The Affine Cipher
An Affine Cipher is akin to a Vigenère Cipher where a Linear Congruential Sequence (LCS) replaces the key word. It is generated by selecting four integers a, b, m and a seed (x0)and letting xn+1=(a*xn+b) mod m The result is than applied as an ASCII shift to the nth character in the text. In essence, the LCS is the equivalent of a very long keyword and is considered a pseudo-random number sequence.
To run the demo below, first enter a plain text manually, or select a sample plain text. Then enter four integers that will be used to generate the LCS sequence. If you wish, you may check the box to generate random LCS values. Ensure that "Encrypt" radio button is selected. Then hit "Execute". There may be a short delay as the output is produced. If you wish to decrypt the result, highlight the "Decrypt" radio button and hit "Execute". Do not change the LCS values, or the cipher text will not properly decrypt. If you wish to see other data that is generated by this page, you may select from the menu below each data field.
Two plots will appear below the results. This output is explained below the plots.