This program is particularly useful for students studying Computer Engineering or Computer Science. I originally used it for my Discrete Mathematics midterm, and you're welcome to use or modify the code as needed.
If you're unfamiliar with RSA encryption and decryption, you can learn more here: RSA Cryptosystem.
For encryption:
- Choose a four-letter word (e.g., "HELP" – case does not matter).
- Select two distinct prime numbers, p and q (e.g., 59 and 43).
- Compute the modulus key: n = p × q (e.g., 2537).
- Choose an encryption key, e, that is coprime to lcm(p-1, q-1) and within its range (e.g., 13).
- Enter the word along with these numbers into the program.
- Click the Encrypt button to generate the encrypted text, which will be displayed below.
For decryption:
- Enter the encrypted text.
- Provide the same numbers used in the encryption process.
- Click the Decrypt button to reveal the original text.
This program currently supports a maximum of four-letter words. If a word longer than four letters is entered, encryption may not work correctly.