/caesar.rb

A simple implementation of the Caesar cipher in 22 lines of Ruby. Just for fun.

Primary LanguageRuby

A simple implementation of the Caesar cipher in 22 lines of Ruby.

puts Ceasar.encipher(72,"HELLO WORLD! THIS IS AN ENCRYPTED MESSAGE.") # => "BYFFI QILFX! NBCM CM UH YHWSJNYX GYMMUAY."
puts Ceasar.decipher(72,"BYFFI QILFX! NBCM CM UH YHWSJNYX GYMMUAY.") # => "HELLO WORLD! THIS IS AN ENCRYPTED MESSAGE."

To install:

gem install Caesar.rb