The mathematical function that is used in the affine cipher is: (ax+b) mod(26). Enter the corresponding a and b and choose either encrypt or decrypt. The key is shown for the mathematical function corresponding with the given a and b.
The affine cipher is a simple substitution cipher. The affine cipher converts the text to the corresponding numerical values of the letters (A=0, B=1, C=2, ..., Z=25), next encrypted with a function and finally converted back to letters. The mathematical function that is used is: (ax+b) mod(26).