Previous section To contents Next section

14.14.3 Stream Ciphers

Currently the only stream cipher in the toolkit is the RC4 cipher (also known as "arcfour").

CLASS
Crypto.rc4

METHOD
Crypto.rc4.crypt

SYNTAX
string Crypto.rc4->crypt(string data);

DESCRIPTION
Encrypts or decrypts a string of data.

METHOD
Crypto.rc4.set_encrypt_key

SYNTAX
object Crypto.rc4->set_encrypt_key(string key);

DESCRIPTION
Installs a key, and configures the object for doing encryption. For convenience, this method returns the object itself.

METHOD
Crypto.rc4.set_decrypt_key

SYNTAX
object Crypto.rc4->set_decrypt_key(string key);

DESCRIPTION
Installs a key, and configures the object for doing decryption. For convenience, this method returns the object itself.
Because of the way RC4 works, set_encrypt_key and set_decrypt_key are actually equivalent.

Previous section To contents Next section