Use this calculator to encode or decode messages using the Affine cipher, a popular cryptographic technique. Perfect for students, teachers, and cryptography enthusiasts looking to encrypt or decrypt text using specified keys.
All calculations are based on the Affine cipher mathematical formula as described in cryptographic literature.
Encoding: \( E(x) = (ax + b) \mod m \)
Decoding: \( D(x) = a^{-1}(x - b) \mod m \)
For example, using keys a = 5, b = 8, and m = 26, the letter 'A' (x=0) becomes 'I' (E(x) = (5*0 + 8) mod 26 = 8).
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.
The Affine cipher encrypts a letter by transforming its position in the alphabet using the formula E(x) = (ax + b) mod m, where x is the letter's position, a and b are keys, and m is the size of the alphabet.