Sunday, September 2, 2007

Affine Cipher Deciphered

Hi

Affine Ciphers -
An encipherment scheme (or algorithm) of the form
E (x) = (ax + b) MOD 26
is called an affine cipher. Here x is the numerical equivalent of the given plaintext letter, and a and
b are (appropriately chosen) integers.

What are the possible values for which one to one ciphers are possible...
i.e if p and q are two plaintext such that p ne q then E(k,p) ne E(k,q).

The function E (x) = (ax + b) MOD 26 defines a valid affine cipher if a is relatively prime to 26, and b
is an integer between 0 and 25, inclusive. If b = 0, then we refer to this cipher as a decimation cipher.
(Note that since there are 12 valid choices of a and 26 valid choices of b, there are 12 × 26 = 312 possible
valid affine ciphers.)
Also note that if a = 1, then E (x) = (x + b) MOD 26 is simply a Caesar (+b) shift cipher.

Do more with affine cipher @ http://home.clara.net/paulwlocke/portfolio/affine.html

bye

1 comment:

Tinashe said...

How can I implement this Affine Cipher in Java