Computing Atlas

How Computing Was Built
Sign In
Text size
100%
Theme
Algorithm

Affine cipher

Cryptographic Algorithm

The affine cipher is a monoalphabetic substitution cipher in which every letter of an alphabet is turned into its numeric equivalent, run through a simple arithmetic function and then turned back into a letter. For an alphabet of m letters the letters are numbered 0 to m minus 1, and each letter x is enciphered as (ax + b) mod m, where a and b are the two keys of the cipher. The key a must be coprime with m, because decryption multiplies by the modular multiplicative inverse of a, and that inverse exists only when the two share no common factor. With a equal to 1 the cipher reduces to a plain shift, and for the 26-letter English alphabet b is the size of the shift. Because each plaintext letter always maps to the same ciphertext letter, the affine cipher is in effect a standard substitution cipher governed by a rule, and it inherits every weakness of substitution ciphers.

Connections

In Field

Cryptography, Fields
Source Affine cipher (Wikipedia)
Sources
Affine cipher (Wikipedia)
  • In Group: Classical Cipher, Lead sentence
    The affine cipher is a type of monoalphabetic substitution cipher, where each letter in an alphabet is mapped to its numeric equivalent, encrypted using a simple mathematical function, and converted back to a letter.
  • In Field: Cryptography, Lead sentence
    The affine cipher is a type of monoalphabetic substitution cipher, where each letter in an alphabet is mapped to its numeric equivalent, encrypted using a simple mathematical function, and converted back to a letter.
View the Source
Comments (0)
No comments yet. Be the first to share a thought.
Reader Challenges (0)
No disputes yet. Spotted an error or a better source? Open the first one.