The Affine cipher is a monoalphabetic substitution cipher, where each letter in the alphabet is mapped to another letter through a simple mathematical formula: (ax + b) mod 26. The number 26 represents the length of the alphabet and will be different for different languages. The Affine cipher can be broken using the standard statistical methods for monoalphabetic substitution ciphers.

Affine Cipher Tool

🌎

Instructions

You can decode (decrypt) or encode (encrypt) your message with your key. If you don't have any key, you can try to auto solve (break) your cipher.

Settings
  • Language: The language determines the letters and statistics used for decoding, encoding and auto solving.
  • Max Results: This is the maximum number of results you will get from auto solving.
  • Spacing Mode: This is about the spaces (word breaks) in the text. In most cases it should be set to Automatic. In case a specific letter (for instance X) is used as word separator, set it to Substitute.

Auto Solver options

Knowing the encryption key

🔑×
You must enter the encryption key.
🔑+
You must enter the encryption key.

Not able to find the correct result? Try Auto Solve or use the Cipher Identifier Tool.


Auto Solve results

Score Key Text

Still not seeing the correct result? Then try experimenting with the Auto Solve settings or use the Cipher Identifier Tool.

Features

Affine cipher, and variants of it, are occasionally used in crypto puzzles and logic puzzles.

Sample Keyed Caesar Cipher

Code-breaking is not only fun, but also a very good exercise for your brain and cognitive skills. Why don’t you try breaking this example cipher:

ntod to uqmv nto smdymou sobo zobe ymdv nw ko qdv sqdnov ko nw bgro wzob ntok qhnob nto smcyov smnct vmov

See also: Code-Breaking tools | Adfgvx cipher | Adfgx cipher | Atbash cipher | Baconian cipher | Beaufort cipher | Bifid cipher | Caesar cipher | Columnar transposition | Cryptogram | Double transposition | Enigma machine | Four-square cipher | Gronsfeld cipher | Keyed caesar cipher | One-time pad | Pigpen cipher | Playfair cipher | Rail fence cipher | Rot13 | Route transposition | Substitution cipher | Trifid cipher | Variant beaufort cipher | Vigenere cipher