Module: HexaPDF::Encryption::ARC4

Included in:
RubyARC4
Defined in:
lib/hexapdf/encryption/arc4.rb

Overview

Common interface for ARC4 algorithms

This module defines the common interface that is used by the security handlers to encrypt or decrypt data with ARC4. It has to be prepended by any ARC4 algorithm class.

See the ClassMethods module for available class level methods of ARC4 algorithms.

Implementing an ARC4 Class

An ARC4 class needs to define at least the following methods:

initialize(key)

Initializes the ARC4 algorithm with the given key.

process(data)

Processes the data and returns the encrypted/decrypted data. Since the ARC4 algorithm is symmetric in regards to its inner workings, the same method can be used for encryption and decryption.

Defined Under Namespace

Modules: ClassMethods

Class Method Summary collapse

Class Method Details

.prepended(klass) ⇒ Object

Automatically extends the klass with the necessary class level methods.



89
90
91
# File 'lib/hexapdf/encryption/arc4.rb', line 89

def self.prepended(klass) # :nodoc:
  klass.extend(ClassMethods)
end