This is a basic implementation of the RC4 encryption algorithm. If you wanted to learn about encryption, this might help.