Search Results in /dev/blog/
Years ago while working through the framework of Hastymail, I came across a need to have a simple and fast lightweight encryption routine. At the time the mcrypt module of PHP was not so widely available as it is now, and I wanted something without external dependencies including PHP mods that were not default on most distros. RC4 is an older, lightweight encryption algorithm, by no means uncrackable, but suitable for certain encryption tasks in which limited overhead is required and cipher strength is not a top priority. So I wrote a simple RC4 implementation in PHP based on the by then widely available algorithm. It's a single function that takes two arguments, a string to encrypt/decrypt and a "secret key" that forms the basis of the encryption.