Why must key "a" be coprime to 26 in the Affine cipher?
If key "a" shares a common divisor with 26 (e.g. 2 or 13), distinct letters map to identical ciphertexts, making unique decryption mathematically impossible.
Online Affine Cipher tool to perform mathematical substitution encryption and cryptanalysis using linear modular arithmetic formulas E(x) = (ax + b) mod 26.
An exhaustive mathematical breakdown of the Affine Cipher: linear congruences in ℤ₂₆, the coprimality condition gcd(a, 26) = 1, calculating modular inverses with the Extended Euclidean Algorithm, and two-point algebraic cryptanalysis.
Read Companion Guide →If key "a" shares a common divisor with 26 (e.g. 2 or 13), distinct letters map to identical ciphertexts, making unique decryption mathematically impossible.
Decryption uses the modular multiplicative inverse: D(y) = a⁻¹ · (y - b) mod 26, where a · a⁻¹ ≡ 1 (mod 26).