summaryrefslogtreecommitdiff
path: root/lib/xml/kit/decryption.rb
AgeCommit message (Collapse)Author
2021-01-30style: fix linter errorsv0.5.0mo khan
2019-01-26update documentationmokha
2019-01-26update docsmokha
2019-01-26fix typomokha
2019-01-26fix line length linter errorsmokha
2018-12-02extract padding.mo
```text 5.2.1 Padding Since the data being encrypted is an arbitrary number of octets, it may not be a multiple of the block size. This is solved by padding the plain text up to the block size before encryption and unpadding after decryption. The padding algorithm is to calculate the smallest non-zero number of octets, say N, that must be suffixed to the plain text to bring it up to a multiple of the block size. We will assume the block size is B octets so N is in the range of 1 to B. Pad by suffixing the plain text with N-1 arbitrary pad bytes and a final byte whose value is N. On decryption, just take the last byte and, after sanity checking it, strip that many bytes from the end of the decrypted cipher text. For example, assume an 8 byte block size and plain text of 0x616263. The padded plain text would then be 0x616263????????05 where the "??" bytes can be any value. Similarly, plain text of 0x2122232425262728 would be padded to 0x2122232425262728??????????????08. ``` * https://www.w3.org/TR/xmlenc-core1/#sec-Alg-Block
2018-11-25use full namespace path.mokha
2018-11-25rename parameter to private_keymokha
2018-11-25add a default padding of nil.mokha
2018-03-03add frozen_string_literal pragma.mo
2018-03-03shrink method size.mo
2018-03-03shrink line sizesmo
2018-03-03rubocop auto correct.mo
2018-02-16move error to separate file.mo
2018-02-16raise error when decryption fails.mo
2018-02-15return parent node of decrypted node.mo
2018-02-15remove putsmo
2018-02-15add documentation .mo
2018-02-15decrypt nokogiri node.mo
2017-12-30rename to Cipher.mo
2017-12-30deprecate decrypt in favour of decrypt_xml or decrypt_hash.mo
2017-12-30add encryption spec.mo
2017-12-28drop Xml prefix.mo