Updated 2012-07-27 12:07:23 by RLE

PT 1-Jul-2004

RC4 is a symmetric stream cipher developed by Ron Rivest of RSA Data Security Inc. The algorithm was a trade secret of RSA but was reverse engineered and published to the internet in 1994.

The algorithm is a pseudo-random number generator with the output of the PRNG being xored with the plaintext stream. Decryption is done by feeding the ciphertext as input with the same key.

This cipher is included as a package in tcllib

  set src [open $filename r]
  set dst [open ${filename}.rc4 w]
  rc4::rc4 -key Secret -in $src -out $dst
  close $src
  close $dst

or just
  set crypt [rc4::rc4 -key Secret "Hello, World!"]

See also encryption, DES, AES, blowfish