Affine cipher
|
The Affine cipher is a special case of the more general substitution cipher. It is monoalphabetic and symmetric.
In affine ciphers the encryption function for a letter is <math>e(x)=ax+b\pmod{m}<math> where,
- <math>a<math> and <math>m<math> are coprime (otherwise <math>a<math> would have no multiplicative inverse modulo <math>m<math>).
- <math>m<math> is the size of the alphabet.
The decryption function is <math>d(x)=a^{-1}(x-b)\pmod{m}<math> where <math>a^{-1}<math> is the multiplicative inverse of <math>a<math> in the group <math>\mathbb{Z}_{m}<math>
This cipher is less secure than a substitution cipher as it is vulnerable to all of the attacks that work against substitution ciphers as well as other attacks. The cipher's primary weakness comes from the fact that if the cryptanalyst can discover (by means of frequency analysis, brute force, guessing or otherwise) the plaintext of two ciphertext characters then the key can be obtained by solving a simultaneous equation. Since we know <math>a<math> and <math>m<math> are relatively prime this can be used to rapidly discard many "false" keys in an automated system.
See also: topics in cryptography, affine functions.
Classical cryptography edit (https://academickids.com:443/encyclopedia/index.php?title=Template:Classical_cryptography&action=edit) |
Ciphers: ADFGVX | Affine | Atbash | Autokey | Bifid | Book | Caesar | Four-square | Hill | Permutation | Pigpen | Playfair | Polyalphabetic | Reihenschieber | Running key | Substitution | Transposition | Trifid | Two-square | Vigenère
|
Cryptanalysis: Frequency analysis | Index of coincidence |
Misc: Cryptogram | Polybius square | Scytale | Straddling checkerboard | Tabula recta |