module HexaPDF:: Encryption:: AES:: ClassMethods
Convenience methods for decryption and encryption that operate according to the PDF specification.
These methods will be available on the class object that prepends the AES
module.
Public Instance Methods
Decrypts the given data
using the key
.
It is assumed that the initialization vector is included in the first BLOCK_SIZE bytes of the data. After the decryption the PKCS#5 padding is removed.
If a problem is encountered, an error message is yielded. If no block is given or if the supplied block returns true
, an error is raised.
See: PDF2.0 s7.6.3
Returns a Fiber object that decrypts the data from the given source fiber with the key
.
Padding, the initialization vector and an optionally given block are handled like in decrypt
.
Encrypts the given data
using the key
and a randomly generated initialization vector.
The data is padded using the PKCS#5 padding scheme and the initialization vector is prepended to the encrypted data,
See: PDF2.0 s7.6.3
Returns a Fiber object that encrypts the data from the given source fiber with the key
.
Padding and the initialization vector are handled like in encrypt
.