Simple encryption exercise in Ruby