https://github.com/dogoncouch/old-cipher
CLI program and Ruby modules for historic cryptographic ciphers.
https://github.com/dogoncouch/old-cipher
Last synced: 1 day ago
JSON representation
CLI program and Ruby modules for historic cryptographic ciphers.
- Host: GitHub
- URL: https://github.com/dogoncouch/old-cipher
- Owner: dogoncouch
- License: mit
- Created: 2017-08-02T03:05:41.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2018-02-21T19:32:59.000Z (over 7 years ago)
- Last Synced: 2025-06-15T00:38:39.193Z (4 months ago)
- Language: Ruby
- Size: 18.6 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Historic Ciphers
## Options
Usage: ./cipher.rb [options]
--caesar SPACES Use Caesar shift
--vigenere WORD Use Vigenere cipher
--input FILE Inpupt from FILE (default: CLI args)
--output FILE Output to FILE
--reverse Set decipher mode
--verbose Set verbose output
--help Display usage## Examples
./cipher.rb --caesar 5 "The beagle has landed!"
./cipher.rb --vigenere grapefruit --input memo.txt --output memo-code.txt
./cipher.rb --vigenere grapefruit --input memo-code.txt --output memo-plain.txt --reverse## More info
### Caesar shift
The Caesar shift is attributed to (you guessed it) the romans, and is achieved by replacing each letter of the alphabet with the letter a given number of spaces away. In a shift of 1, "a" would become "b", "b" would become "c", and so on.The Caesar shift was eventually cracked using frequency analysis, which involces the relationships letters have to each other. For instance, "e" is the most common letter in most text, "h" often follows "t", and so on.
### Vigenere cipher
The Vigenere cipher was invented in the 16th century, and for a few centuries was thought to be indecipherable. It uses a cycle of multiple Caesar shift ciphers based on a keyword. If the keyword is "lemon", the first letter would be shifted 12 letters ("l" is 12 letters beyond "a"), the second 4 letters, and so on, with the keyword repeating over and over.The Vigenere cipher was eventually cracked by figuring out the keyword length. and then cracking each Caesar cipher one by one.
## Bibliography
Most of the information in these descriptions is from "The Code Book", written by Simon Singh and published in the year 2000, which is a great read for anyone interested in cryptography, history, or quality writing.