RC4 C implementation Demo
The full implementaion of RC4 symmetric encryption has been written in rc4_demo.c for encrypting/decrypting a simple text message with ASCII password. The same logic can be use to work with binary data in which case you should change the variable types and key generation part.