cipher — Old paper & pencil ciphers in Go.
It features a simple CLI-based tool called
old-crypto which serve both as a collection of use-cases for the library and an easy way to use it.
Work in progress, still incomplete
Table of content
It currently implement a few of the Ruby code, namely:
- Caesar (you can choose the shift number)
- Simple transposition (can be used with other ciphers as super-encipherement)
- Polybius square bigrammatic cipher (for ADFGVX = polybius + transposition)
- ADFGVX (6x6 square including numbers)
- Straddling Checkerboard (for the Nihilist cipher)
- Nihilist cipher (transposition as super-encipherment)
- Wheatstone cipher system
It does not try to reinvent the wheel and implements the
cipher.Block interface defined in the Go standard library (see
That means that all ciphers have
BlockSize(), Encrypt() & Decrypt(). You can create one with
NewCipher() then use
BlockSize() is of course implemented as well otherwise the interface would not be matched.
Like many Go-based tools, installation is very easy
go get github.com/keltia/cipher/cmd/...
git clone https://github.com/keltia/cipher make install
The library is fetched, compiled and installed in whichever directory is specified by
old-crypto binary will also be installed (on windows, this will be called
To run the tests, you will need:
NOTE: please use and test the Windows version (use
make windowsto generate it). It should work but I lack resources to play much with it.
I tried to provide benchmarks for all ciphers (including key scheduling/expansion) and in some cases several implementations (and associated benchamarks).
- more ciphers
- more tests (and better ones!)
- better display of results
- refactoring to reduce code duplication: always in progress
- even more tests
Please see CONTRIBUTING.md for some simple rules.