class HexaPDF::Encryption::FastARC4
See: PDF2.0 s7.6.3
Implementation of the general encryption algorithm ARC4 using OpenSSL as backend.
def initialize(key)
def initialize(key) @cipher = OpenSSL::Cipher.new('rc4') @cipher.key_len = key.length @cipher.key = key end
def process(data)
Since this is a symmetric algorithm, the same method can be used for encryption and
Processes the given data.
def process(data) @cipher.update(data) end