Skip to content

Latest commit

 

History

History
29 lines (20 loc) · 904 Bytes

File metadata and controls

29 lines (20 loc) · 904 Bytes

🔐 RSA Cryptography in Java

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.


📌 Features

  • 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 BigInteger for large number support
  • Custom base-126 encoding to convert numeric ciphertext to printable characters

🛠️ How to Run

Requirements:

  • Java 8 or higher
  • A terminal/command prompt

Steps:

  1. Clone the Repository:
    git clone https://github.com/your-username/rsa-cryptography-java.git
    cd rsa-cryptography-java