RCFour

RC4 is the standard encryption algorithm used in PDF format

Namespace: Com\Tecnick\Pdf\Encrypt\Type

File: RCFour.php line 36

RC4 is the standard encryption algorithm used in PDF format

Tags

Constants

VALID_CIPHERS

File: RCFour.php line 46

public array<string|int, string> VALID_CIPHERS = ['RC4', 'RC4-40']

The name is validated but does not select an implementation: encrypt() always uses the bundled rc4().

Methods

encrypt()

File: RCFour.php line 75

public encrypt(string $data, string $key[, string $mode = '' ]) : string

RC4 is cryptographically broken; use AES instead.

The cipher is always applied by the bundled implementation: OpenSSL 3 removed RC4 from the default provider, and its fixed key lengths do not match the variable-length object keys of ISO 32000-1 Algorithm 1.

Parameters

  • $data : string: Data string to encrypt
  • $key : string: Encryption key
  • $mode : string = ‘’: Cipher name; validated against VALID_CIPHERS but does not select an implementation

Tags

Return values

string —

encrypted text