class HexaPDF::Encryption::RubyAES


Implementation of the general encryption algorithm AES.

Since this algorithm is implemented in pure Ruby, it is not very fast. Therefore the FastAES class based on OpenSSL should be used when possible.

For reference: This implementation is about 5000 times slower when decrypting and about 1800 times slower when encrypting than the FastAES version.

This implementation is using AES in Cipher Block Chaining (CBC) mode.

See: PDF1.7 s7.6.2

Public Class Methods

new(key, iv, mode)

Creates a new AES object using the given encryption key and initialization vector.

The mode must either be :encrypt or :decrypt.

Public Instance Methods


Encrypts or decrypts the given data whose length must be a multiple of BLOCK_SIZE.