Skip to content

kouweizhong/Science.Cryptography.Ciphers

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

72 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Science.Cryptography.Ciphers

Ancient and classic cipher methods and analysis tools implemented in .NET Standard 1.6.

Install-Package Science.Cryptography.Ciphers -Pre
Install-Package Science.Cryptography.Ciphers.Analysis -Pre

Ciphers

ICipher caesar = ShiftCipher.CreateCaesar(Alphabets.English);
string ciphertext = caesar.Encrypt("Hello world!");

Affine, Atbash, Autokey, Bacon, Beaufort, Bifid, Caesar, Four-square, Gronsfeld, Gudhayojya, Kama-Sutra, Monoalphabetic Substitution, Morse Code, Multiplicative, Null, ROT-13, ROT-47, Running Key, Sandorf's, Shift, Tap Code, Trithemius, Two-square, Variant Beaufort, Vatsyayana, Vigenère, XOR

Streaming support

IKeyedCipher<string> cipher = new RunningKeyCipher();
IEnumerable<char> ciphertextStream = cipher.Encrypt(plaintextStream);

Affine, Atbash, Monoalphabetic Substitution, Multiplicative, ROT-47, Running Key, Shift (Caesar, ROT-13), Vigenère

Tools

TabulaRecta tc = new TabulaRecta(Alphabets.English);
  • Polybius Square
  • Straddling Checkerboard
  • Tabula Recta

Analysis

IReadOnlyDictionary<int, string> result = CaesarBruteforce.Analyze(ciphertext);
  • Caesar Bruteforce
  • Entropy
  • Frequency Analysis
  • Kasiski Examination
  • Key Finder
  • Key space enumeration (Affine, Shift, Wordlist)
  • N-Gram Analysis

Reference data

  • English
    • Relative frequencies of letters
    • Relative frequencies of first letters of words

Tutorials

Accepting PRs

  • ADFGVX
  • Columnar Transposition
  • Enigma
  • Hill
  • Permutation
  • Playfair
  • Rail fence
  • Myszkowski Transposition
  • Nihilist
  • One Time Pad
  • Solitaire
  • Trifid
  • Any other missing cipher
  • Unit tests

About

This project collects classic ciphers.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C# 100.0%