All tools

Affine Cipher

Encrypt and decrypt with E(x) = (a·x + b) mod 26.

Encoded
Rclla oaplx

Affine cipher: E(x) = (a·x + b) mod 26. The multiplier a must be coprime with 26, leaving 12 valid values. Decryption uses the modular inverse of a. Caesar is a special case where a = 1.

About

The Affine cipher generalizes Caesar by adding a multiplier. Pick a (must be coprime to 26, leaving 12 valid values) and b (any shift 0–25). Decryption uses the modular inverse of a.

How to use

  1. Pick a and b.
  2. Type your text.
  3. Toggle encode/decode.

FAQ

How is this different from Caesar?+

Caesar is the special case a = 1. Affine adds a multiplier, giving 312 possible keys (12 × 26) instead of 26. Still trivially breakable by frequency analysis.