Affine Cipher client-side ?
How to use Affine CipherThe affine cipher turns each letter of rank x into (a·x + b) mod 26, combining a multiplication and an addition. To allow decryption, the coefficient a must be coprime with 26; otherwise several letters would map to the same image. Decryption uses the modular inverse of a: x = a⁻¹·(y − b) mod 26. The tool automatically validates a, suggests the allowed values, and encrypts or decrypts instantly. The Caesar cipher is the case a = 1.
?
The affine cipher turns each letter of rank x into (a·x + b) mod 26, combining a multiplication and an addition. To allow decryption, the coefficient a must be coprime with 26; otherwise several letters would map to the same image. Decryption uses the modular inverse of a: x = a⁻¹·(y − b) mod 26. The tool automatically validates a, suggests the allowed values, and encrypts or decrypts instantly. The Caesar cipher is the case a = 1.
(a·x+b) mod 26 cipher with modular inverse.
How to use Affine Cipher
The affine cipher turns each letter of rank x into (a·x + b) mod 26, combining a multiplication and an addition. To allow decryption, the coefficient a must be coprime with 26; otherwise several letters would map to the same image. Decryption uses the modular inverse of a: x = a⁻¹·(y − b) mod 26. The tool automatically validates a, suggests the allowed values, and encrypts or decrypts instantly. The Caesar cipher is the case a = 1.
Frequently asked questions
Which values of a are allowed?
Those coprime with 26: 1, 3, 5, 7, 9, 11, 15, 17, 19, 21, 23 and 25. Any other value would make decryption ambiguous.
How does it relate to Caesar?
The Caesar cipher is a special case of the affine cipher with a = 1: only the addition (the shift b) remains.