Affine cipher

Affine cipher

Demonstration of an affine cipher using 17x + 5. First the letters are converted into numbers between 0 and 25, then 17x+5 is taken for each, then the results are reduced mod 26, then these are translated back into letters.

The Affine cipher is a special case of the more general monoalphabetic substitution cipher. In affine ciphers the encryption function for a letter is e(x)=(ax+b)pmod{m} where,

* a and m are coprime (otherwise a would have no multiplicative inverse modulo m).
* m is the size of the alphabet.

The decryption function is d(x)=a^{-1}(e(x)-b)pmod{m} where a^{-1} is the multiplicative inverse of a in the group mathbb{Z}_{m}

Considering the specific case of encrypting messages in English (i.e. m=26), there are a total of 286 non-trivial affine ciphers, not counting the trivial Caesar ciphers obtained when a=1. This lack of variety renders the system as highly insecure when considered in light of Kerckhoffs' Principle. Even without foreknowledge that a text were enciphered with an affine cipher, the ciphertext would have all of the vulnerabilities of ordinary monoalphabetic substitution ciphers.

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 a and m are relatively prime this can be used to rapidly discard many "false" keys in an automated system.

The same type of transformation used in affine ciphers is used in linear congruential generators, a type of pseudorandom number generator. This generator is not a cryptographically secure pseudorandom number generator for the same reason that the affine cipher is not secure.

See also

* Topics in cryptography
* Affine functions


Wikimedia Foundation. 2010.

Игры ⚽ Поможем решить контрольную работу

Look at other dictionaries:

  • Affine — may refer to:*Affine cipher, a special case of the more general substitution cipher *Affine combination, a certain kind of constrained linear combination *Affine connection, a connection on the tangent bundle of a differentiable manifold *Affine… …   Wikipedia

  • National Cipher Challenge — The National Cipher Challenge is an annual cryptographic competition organised by the University of Southampton School of Mathematics. Competitors attempt to break cryptograms published on the competition website. In the 2007/08 challenge, 1301… …   Wikipedia

  • Substitution cipher — In cryptography, a substitution cipher is a method of encryption by which units of plaintext are replaced with ciphertext according to a regular system; the units may be single letters (the most common), pairs of letters, triplets of letters,… …   Wikipedia

  • Caesar cipher — The action of a Caesar cipher is to replace each plaintext letter with one fixed number of places down the alphabet. This example is with a shift of three, so that a B in the p …   Wikipedia

  • Classical cipher — A cipher is a means of concealing a message, where letters of the message are substituted or transposed for other letters, letter pairs, and sometimes for many letters. In cryptography, a classical cipher is a type of cipher that was used… …   Wikipedia

  • Hill cipher — Hill s cipher machine, from figure 4 of the patent In classical cryptography, the Hill cipher is a polygraphic substitution cipher based on linear algebra. Invented by Lester S. Hill in 1929, it was the first polygraphic cipher in which it was… …   Wikipedia

  • Transposition cipher — In cryptography, a transposition cipher is a method of encryption by which the positions held by units of plaintext (which are commonly characters or groups of characters) are shifted according to a regular system, so that the ciphertext… …   Wikipedia

  • Book cipher — A book cipher is a cipher in which the key is some aspect of a book or other piece of text; books being common and widely available in modern times, users of book ciphers take the position that the details of the key is sufficiently well hidden… …   Wikipedia

  • Pigpen cipher — The pigpen cipher uses graphical symbols assigned according to a key similar to the above diagram.[1] The pigpen cipher (sometimes referred to as the masonic cipher, Freemason s cipher, Rosicrucian cipher, or Tic tac toe cipher) …   Wikipedia

  • DFC (cipher) — This article is about the block cipher. For other uses, see DFC (disambiguation). DFC General Designers Jacques Stern, Serge Vaudenay, et al. First published 1998 Related to COCONUT98 Cipher detail …   Wikipedia

Share the article and excerpts

Direct link
Do a right-click on the link above
and select “Copy Link”