Skip to content

A command line tool for cryptography, written in Haskell.

License

Notifications You must be signed in to change notification settings

carlosgmartin/cipher

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 

Repository files navigation

Cipher

A command line tool for cryptography, written in Haskell.

Compile the program:

$ ghc cipher.hs -v0 -no-keep-hi-files -no-keep-o-files

See usage message:

$ ./cipher
usage: cipher {-e | -d} {-v | -a} key

Generate a key:

$ key=$(openssl rand -base64 6)
$ echo $key
aPFB5ue2

Test the Vigenère cipher:

$ echo 'Plaintext message.' | ./cipher -e -v $key | ./cipher -d -v $key
Plaintext message.

Test the autokey cipher

$ echo 'Plaintext message.' | ./cipher -e -a $key | ./cipher -d -a $key
Plaintext message.

Encrypt a file:

$ cat LICENSE.md | ./cipher -e -a $key > encrypted
$ open encrypted
$ cat encrypted | ./cipher -d -a $key > decrypted
$ diff -s LICENSE.md decrypted
Files LICENSE.md and decrypted are identical
$ rm encrypted decrypted

About

A command line tool for cryptography, written in Haskell.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published