crypto-classical

An educational tool for studying classical cryptography schemes.

https://github.com/fosskers/crypto-classical

Latest on Hackage:0.3.0

This package is not currently in any snapshots. If you're interested in using it, we recommend adding it to Stackage Nightly. Doing so will make builds more reliable, and allow stackage.org to host generated Haddocks.

BSD-3-Clause licensed by Colin Woodbury
Maintained by [email protected]

An educational tool for studying classical cryptography schemes. Do not encrypt anything of worth with this library.

Included Ciphers:

  • Caesar

  • Affine (Linear)

  • Substitution

  • Stream

  • Vigenere

  • Enigma (Wehrmacht Enigma I)

Thanks to polymorphism, we can generate keys and encrypt ByteStrings without worrying much about types:

> import Crypto.Classical
> import Lens.Micro
> :set -XOverloadedStrings
> (\k -> _enigma $ encrypt k "What a great day for an attack!") . key <$> prng
"PXQS D KXSGB CFC AYK XJ DEGMON!"
> (\k -> _caesar $ encrypt k "What a great day for an attack!") . key <$> prng
"RCVO V BMZVO YVT AJM VI VOOVXF!"