From 27675bee9460e63b302a94dfe4aa12a9599dde1a Mon Sep 17 00:00:00 2001 From: Smaug123 Date: Sun, 3 Jan 2016 20:58:35 +0000 Subject: [PATCH] First commit, with caesar, solitaire, vigenere, monoalphabetic encrypt/decrypt --- README.md | 17 +++++++++++++++++ src/ClassicalCiphers.jl | 13 ++++++++++++- test/runtests.jl | 12 +++++++++--- 3 files changed, 38 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index d8ae2d2..4adbbcb 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,20 @@ # 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 + +* [Caesar] +* [Monoalphabetic substitution] +* [Vigenère] +* [Solitaire] + +[Caesar]: https://en.wikipedia.org/wiki/Caesar_cipher +[Vigenere]: https://en.wikipedia.org/wiki/Vigen%C3%A8re_cipher +[Monoalphabetic substitution]: https://en.wikipedia.org/wiki/Substitution_cipher +[Solitaire]: https://en.wikipedia.org/wiki/Solitaire_(cipher) + [![Build Status](https://travis-ci.org/Smaug123/ClassicalCiphers.jl.svg?branch=master)](https://travis-ci.org/Smaug123/ClassicalCiphers.jl) diff --git a/src/ClassicalCiphers.jl b/src/ClassicalCiphers.jl index 51ce695..54761a3 100644 --- a/src/ClassicalCiphers.jl +++ b/src/ClassicalCiphers.jl @@ -1,5 +1,16 @@ module ClassicalCiphers -# package code goes here +# Monoalphabetic + +include("common.jl") +include("monoalphabetic.jl") +include("caesar.jl") +include("vigenere.jl") +include("solitaire.jl") + +export encrypt_monoalphabetic, decrypt_monoalphabetic, + encrypt_caesar, decrypt_caesar, + encrypt_vigenere, decrypt_vigenere, + encrypt_solitaire, decrypt_solitaire end # module diff --git a/test/runtests.jl b/test/runtests.jl index b9d73e8..4d7fe32 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -1,5 +1,11 @@ using ClassicalCiphers -using Base.Test -# write your own tests here -@test 1 == 1 +tests = ["vigenere", "monoalphabetic", "solitaire"] + +println("Running tests:") + +for t in tests + test_fn = "$t.jl" + println(" * $test_fn") + include(test_fn) +end \ No newline at end of file