Here you have simple implentation in Python, it should be easy to 
translate that into ruby

http://en.wikipedia.org/wiki/RC4_(cipher)

m.