Weaknesses
Since the affine cipher is still a monoalphabetic substitution cipher, it inherits the weaknesses of that class of ciphers. The Caesar cipher is the Affine cipher when since the encrypting function simply reduces to a linear shift.
Considering the specific case of encrypting messages in English (i.e. ), there are a total of 286 non-trivial affine ciphers, not counting the 26 trivial Caesar ciphers. This number comes from the fact there are 12 numbers that are coprime with 26 that are less than 26 (these are the possible values of ). Each value of can have 26 different addition shifts (the value); therefore, there are 12*26 or 312 possible keys. This lack of variety renders the system as highly insecure when considered in light of Kerckhoffs' Principle.
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 and 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.
Read more about this topic: Affine Cipher
Famous quotes containing the word weaknesses:
“To give style to ones charactera rare and noble art! Those practice it who compass all that their natures present as strengths and weaknesses and then fit them into an artistic plan until every one appears as art and reason and even weakness enchants the eye.”
—Friedrich Nietzsche (18441900)
“Much can be inferred about a man from his mistress: in her one beholds his weaknesses and his dreams.”
—G.C. (Georg Christoph)
“The Southerner is usually tolerant of those weaknesses that proceed from innocence.”
—Flannery OConnor (19251964)