module HexaPDF::Encryption::ARC4

Extended With

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.