Tags: crypto
Rating:
## 10 - Caesar Salad - Crypto
> Can you toss Caesar's salad?
>
> `q4ex{t1g_thq_p4rf4e}p0qr`
My ruby caesar cipher solver:
```ruby
#!/usr/bin/env ruby
# from https://gist.github.com/matugm/db363c7131e6af27716c
def caesar_cipher(string, shift = 1)
alphabet = Array('a'..'z')
encrypter = Hash[alphabet.zip(alphabet.rotate(shift))]
# " " => c because I don't want to void non-letters chars
string.chars.map { |c| encrypter.fetch(c, c) }
end
text = "q4ex{t1g_thq_p4rf4e}p0qr"
text.downcase! # put lowercase
(1..25).each do |i|
puts "#{i}: " + caesar_cipher(text, i).join + "\n\n"
end
```
Answer was:
```
13: d4rk{g1t_gud_c4es4r}c0de
```