RC4

Implementation of RC4 digester.

RC4 (Rivest Cipher 4) is a stream cipher algorithm widely used in various cryptographic applications. It operates by generating a pseudorandom stream of bits (keystream) based on a secret key, which is then XORed with the plaintext to produce the ciphertext.

Members

Static functions

decrypt
void decrypt(ubyte[] data, string key)

Decrypts the given byte array data.

encrypt
void encrypt(ubyte[] data, string key)

Encrypts the given byte array data.

Examples

import tern.digest.rc4;

ubyte[] data = [1, 2, 3, 4, 5];
string key = "my_secret_key";
RC4.encrypt(data, key);

Meta