Affine Cipher Solver & Mathematical Decoder

Online Affine Cipher tool to perform mathematical substitution encryption and cryptanalysis using linear modular arithmetic formulas E(x) = (ax + b) mod 26.

Deep-Dive Educational Guide

Affine Cipher: Modular Multiplicative Inverses, Coprimality & Algebraic Cryptanalysis

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 →

How to Use Affine Cipher Solver & Mathematical Decoder

  1. Input Plaintext Message: Enter the text you want to encrypt using modular arithmetic.
  2. Set Multiplicative Key (a) and Shift Key (b): Select a key "a" that is coprime to 26 (e.g. 1, 3, 5, 7, 9, 11, 15, 17, 19, 21, 23, 25) and any shift "b" (0–25).
  3. Compute E(x) = (ax + b) mod 26: View the mathematically transformed ciphertext or compute modular inverses for decryption.

Frequently Asked Questions

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.

How is an Affine cipher decrypted?

Decryption uses the modular multiplicative inverse: D(y) = a⁻¹ · (y - b) mod 26, where a · a⁻¹ ≡ 1 (mod 26).