Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ADFGX ¶
type ADFGX struct{}
ADFGX represents the ADFGX cipher and conforms to the Cipher interface https://en.wikipedia.org/wiki/ADFGVX_cipher
func (ADFGX) Decrypt ¶
Decrypt operates on a ciphertext string and a key string that consists of two keys delimited by a semicolon (,). The function first transposes the letters according to key2, and then undoes the substitution using an alphabet square and key1.
func (ADFGX) Encrypt ¶
Encrypt operates on a plaintext string and a key string that consists of two keys delimited by a semicolon (,). The function constructs an alphabet square from key 1, and obtains substitution values from it. Then key 2 is used to transpose the values into the finished ciphertext.
type Bifid ¶
type Bifid struct{}
Bifid represents the Bifid cipher and conforms to the Cipher interface https://en.wikipedia.org/wiki/Bifid_cipher
func (Bifid) Decrypt ¶
Decrypt operates on a ciphertext string and a key string The function constructs and alphabet square from the key, and obtains substitution values from it. The substitution values are de-transposed into values that are looked up in the square to obtain the original plaintext string.
type Caesar ¶
type Caesar struct{}
Caesar represents the classic Caesar cipher and conforms to the Cipher interface https://en.wikipedia.org/wiki/Caesar_cipher
type Cipher ¶
type Cipher interface { Encrypt(string, string) (string, error) Decrypt(string, string) (string, error) }
Cipher represents an old school cipher with encryption and decryption methods that operate on ASCII inputs and keys
type Playfair ¶
type Playfair struct{}
Playfair represents the Playfair cipher and conforms to the Cipher interface https://en.wikipedia.org/wiki/Playfair_cipher
type Vigenere ¶
type Vigenere struct{}
Vigenere represents the polyalphabetic substitution Vigenere cipher and conforms to the Cipher interface https://en.wikipedia.org/wiki/Vigen%C3%A8re_cipher