Expand description
A cryptographic tomb of ciphers forgotten by time.
§Example usage
extern crate cipher_crypt;
use cipher_crypt::{Cipher, Caesar, Rot13};
fn main(){
let m1 = "I am my own inverse";
assert_eq!(m1, &Rot13::decrypt(&Rot13::encrypt(m1)));
let m2 = "Attack at dawn 🗡️";
let c = Caesar::new(3);
assert_eq!(m2, c.decrypt(&c.encrypt(m2).unwrap()).unwrap());
}
§Disclaimer
There’s a reason these archaic methods are no longer used - it’s because they are extremely easy to crack! Intended for learning purposes only, these ciphers should not be used to encrypt data of any real value.
Re-exports§
pub use crate::adfgvx::ADFGVX;
pub use crate::affine::Affine;
pub use crate::autokey::Autokey;
pub use crate::baconian::Baconian;
pub use crate::caesar::Caesar;
pub use crate::columnar_transposition::ColumnarTransposition;
pub use crate::fractionated_morse::FractionatedMorse;
pub use crate::hill::Hill;
pub use crate::playfair::Playfair;
pub use crate::polybius::Polybius;
pub use crate::porta::Porta;
pub use crate::railfence::Railfence;
pub use crate::rot13 as Rot13;
pub use crate::scytale::Scytale;
pub use crate::vigenere::Vigenere;
Modules§
- adfgvx
- The ADFGVX cipher was a field cipher used by the German Army on the Western Front during World War I.
- affine
- The Affine cipher is a special case of the more general monoalphabetic substitution cipher.
- autokey
- An autokey cipher (also known as the autoclave cipher) is a cipher which incorporates the message (the plaintext) into the key.
- baconian
- Bacon’s cipher, or the Baconian cipher, hides a secret message in plain sight rather than generating ciphertext (steganography). It was devised by Sir Francis Bacon in 1605.
- caesar
- The Caesar cipher is named after Julius Caesar, who used it (allegedly) with a shift of three to protect messages of military significance.
- columnar_
transposition - The Columnar cipher is a transposition cipher. In columnar transposition the message is written out in rows of a fixed length, and then transcribed to a message via the columns. The columns are scrambled based on a secret key.
- fractionated_
morse - The Fractionated Morse cipher builds upon Morse code, a well-known method for encoding text which can then be sent across simple visual or audio channels.
- hill
- In classical cryptography, the Hill cipher is a polygraphic substitution cipher based on linear algebra.
- playfair
- The Playfair cipher is the first bigram substitution cipher. Invented in 1854 by Charles Wheatstone, its name honors Lord Lyon Playfair for promoting its use.
- polybius
- The Polybius square, also known as the Polybius checkerboard, is a device invented by the Ancient Greek historian and scholar Polybius, for fractionating plaintext characters so that they can be represented by a smaller set of symbols.
- porta
- The Porta Cipher is a polyalphabetic substitution cipher. It was invented by Giovanni Battista della Porta, an Italian polymath, in 1563.
- railfence
- The Railfence Cipher is a transposition cipher. It has a very low keyspace and is therefore incredibly insecure.
- rot13
- ROT13 (“rotate by 13 places”), is a simple implementation of the Caesar cipher. It substitutes a letter with the one 13 places after it in the alphabet.
- scytale
- One of the oldest cryptography tools was a scytale, which was used to perform transposition encryption. It consisted of a cylinder with a strip of parchment (containing a message) wound around it.
- vigenere
- The Vigenère Cipher is a polyalphabetic substitution cipher. It was considered ‘le chiffre indéchiffrable’ for 300 years until Friedrich Kasiski broke it in 1863.