Skip to content

Instantly share code, notes, and snippets.

@AaronRandall
Last active October 20, 2016 19:48
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save AaronRandall/09e99015eb7849f2499c to your computer and use it in GitHub Desktop.
Save AaronRandall/09e99015eb7849f2499c to your computer and use it in GitHub Desktop.
ciphertexts = [
"VGYURYPEDFNCEPGEWELLPVNWRDCNFGMGXQEPPRG-CBFIGLEMG",
"EQ’PMEIGQNVBAGBTFEGMSYNRKMNWEPBLWBYPSNWMQNFBDWEQVYNR-CBFIGLEMG"
]
key = ('A'..'Z').to_a
ciphertexts.each do |ciphertext|
(0..25).each do |rotation|
puts ciphertext.tr(key.join, key.rotate(rotation).join)
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment