This Java program demonstrates a simple implementation of RSA encryption and decryption. The user is prompted to choose upper limits for prime numbers p and q, which are used to generate public and private keys. It then allows encrypting and decrypting a message securely using RSA principles.
- Prime number generation for RSA key components
- Calculation of public (
e) and private (d) keys - Encryption using
C = P^e mod n - Decryption using
P = C^d mod n - Uses
BigIntegerfor large number support - Custom base-126 encoding to convert numeric ciphertext to printable characters
- Java 8 or higher
- A terminal/command prompt
- Clone the Repository:
git clone https://github.com/your-username/rsa-cryptography-java.git cd rsa-cryptography-java