Skip to content
Implementation of the RC4 algorithm.
Latest commit 181c8e5 Apr 1, 2015 @caiges Merge pull request #13 from gettalong/performance-improvements
Added performance improvements
Failed to load latest commit information.
lib Added performance improvements Mar 30, 2015
spec Updated spec to include rspec. The spec can now be run without using … Jan 25, 2012
LICENSE Fix links in README Apr 19, 2014
Rakefile Updated LICENSE to include original authors and included it in the gem. Feb 7, 2012
ruby-rc4.gemspec Cleanup Apr 19, 2014


RC4 is a pure Ruby implementation of the RC4 algorithm.


Just install the gem:

gem install ruby-rc4

Or add it to your Gemfile:

gem 'ruby-rc4'


First require the gem:

require 'rc4'

To encrypt:

key = "nuff rspec"
enc =
encrypted = enc.encrypt("super-cool-test")

To decrypt:

dec =
decrypted = dec.decrypt(encrypted)

Since encrypt method is used for encryption and decryption, decrypt is just an alias to encrypt in order to make the usage more intuitive.


The original algorithm implementation in Ruby by Max Prokopiev.

Aleksandar Simic then modified it to include a test suite and gem packaged it using gem-this.

I switched the project to use rspec2 and I am now the project's primary maintainer.

Caige Nichols


Ruby-RC4 is released under the MIT license.


(Please let me know if I missed anyone)

Something went wrong with that request. Please try again.