Go to file

Build Status

ClassicalCiphers

Main Features

Provides access to encryption and decryption of strings according to a variety of classical algorithms. The Solitaire cipher is included for completeness, though it is perhaps not strictly classical.

Currently Implemented

Gotchas

In general, encrypt functions turn text upper-case, while decrypt functions turn text lower-case. This is consistent with convention, but may not be expected.

Code samples

Caesar cipher

Encrypt the text "Hello, World!" with a Caesar offset of 3 (that is, sending 'a' to 'd'):

encrypt_caesar("Hello, World!", 3)
# outputs "khoor, zruog!"

Notice that encrypt_caesar turns everything upper-case, but retains symbols.

Decrypt the same text:

decrypt_caesar("Khoor, Zruog!", 3)
# outputs "hello, world!"

Likewise, decrypt_caesar turns everything lower-case, but retains symbols.

Monoalphabetic cipher

Encrypt the text "Hello, World!" with the same Caesar cipher, but viewed as a monoalphabetic substitution:

encrypt_monoalphabetic("Hello, World!", "DEFGHIJKLMNOPQRSTUVWXYZABC")
# outputs "KHOOR, ZRUOG!"
Description
Julia classical ciphers suite
Readme 466 KiB
Languages
Julia 100%