Affine Cipher

Summary: Each letter is transformed using the formula: E(x) = (ax + b) mod 26, where 'a' and 'b' are the keys. The value 'a' must be coprime with 26 (valid values: 1, 3, 5, 7, 9, 11, 15, 17, 19, 21, 23, 25).

Letter to Number: A=0, B=1, C=2, ..., Z=25

Example:

Encryption:

Decryption (given a=5, b=8):

Additional Example:

Encrypting "CODE":

Decrypting RXYF with a=7, b=3:

Finding Modular Inverses (for common 'a' values):