Chooses the value of \( a \) and \( b \):
Encrypts the message \( m \):
Enter a message (a sentence containing only whitespace and the letters A–Z) that Alice wants to send encrypted to Bob:
Press Enter to generate the parameters. Use the Left and Right arrow keys to navigate between steps.
Alice first chooses the values \( a \) and \( b \) at random such that \( \gcd(a, 26)=1 \). She then computes the inverse \( a^{-1} \) of \( a \) using the extended Euclidean algorithm.
Next, she sends the values \( a \), \( a^{-1} \), and \( b \) to Bob through a secure channel.
Before Alice can encrypt the message \( m \), she needs to determine the index of each letter in \( m \) within the English alphabet, with the letter \( a \) starting at index \( 0 \).
Alice then uses \( a \) and \( b \) to encrypt the message \( m \).
Before Bob can decrypt the ciphertext \( c \), he needs to determine the index of each letter in \( c \) within the English alphabet, with the letter \( a \) starting at index \( 0 \).
Decryption is almost identical to encryption: instead of using \( a \), the inverse \( a^{-1} \) is used.
Receives the values:
Receives the ciphertext \( c \).
Decrypts the ciphertext \( c \):