RC4 Encryption in PHP (v3.2 update :: 2006/03/11, bugfix)


Please read this notice regarding this program's license & confusion caused



What is RC4 ?
RC4 is fairly fast, secure and symmetric encryption algorithm. Developed by Ron Rivest in 1987 was kept trade secret until 9th September 1994 when it was posted on a Cypherpunks mailing list. Generally the key it uses is limited to 40 bits for various legal reasons but 128bits is the more common forms these days. To prove it's strength products like Oracle Secure SQL are examples. It's symmetric meaning it uses the same key and steps as to encrypt when decrypting.

Well there's nothing much to explain in the article, except for guidelines:
(1) The encrypt function is the function used both for encryption
(2) The decrypt function is used for decryption and is identical to encrypt()
(2) The tricky part is submitting data to the function, which needs to be urlencoded and urldecoded, as is required to output to the browser.

Demo | Download Class | Rate this article