class HexaPDF::Encryption::RubyARC4

Parent

Pure Ruby implementation of the general encryption algorithm ARC4.

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

For reference: This implementation is about 250 times slower than the FastARC4 version.

See: PDF2.0 s7.6.3

Constants

INITIAL_STATE

The initial state which is then modified by the key-scheduling algorithm

Public Class Methods

new(key)

Creates a new ARC4 object using the given encryption key.

Public Instance Methods

decrypt(data)
Alias for: process
encrypt(data)
Alias for: process
process(data)

Processes the given data.

Since this is a symmetric algorithm, the same method can be used for encryption and decryption.

Also aliased as: decrypt, encrypt