Affine Cipher Encoder/Decoder

Use this calculator to encode or decode messages using the Affine cipher, a popular cryptographic technique. Perfect for students, teachers, and cryptography enthusiasts looking to encrypt or decrypt text using specified keys.

Calculator

Results

Data Source and Methodology

All calculations are based on the Affine cipher mathematical formula as described in cryptographic literature.

The Formula Explained

Encoding: \( E(x) = (ax + b) \mod m \)

Decoding: \( D(x) = a^{-1}(x - b) \mod m \)

Glossary of Variables

How It Works: A Step-by-Step Example

For example, using keys a = 5, b = 8, and m = 26, the letter 'A' (x=0) becomes 'I' (E(x) = (5*0 + 8) mod 26 = 8).

Frequently Asked Questions (FAQ)

What is an Affine Cipher?

The Affine cipher is a type of monoalphabetic substitution cipher, where each letter in an alphabet is mapped to its numeric equivalent, encrypted using a simple mathematical function, and converted back to a letter.

How does the Affine cipher work?

The Affine cipher encrypts a letter by transforming its position in the alphabet using the formula E(x) = (ax + b) mod m, where x is the letter's position, a and b are keys, and m is the size of the alphabet.

Tool developed by Ugo Candido. Content verified by CryptoTools team.
Last reviewed for accuracy on: October 15, 2023.

```