π RSA Crypto Playground
A simple Node.js + Express application that demonstrates RSA encryption and decryption using Nodeβs built-in crypto module.
Users can provide custom input and get back its encrypted or decrypted output using generated RSA key pairs.
π Features
Generate RSA public/private key pairs
Encrypt text using the public key
Decrypt text using the private key
Lightweight Express API
π Project Structure rsa-crypto-playground/ βββ server.js # Main entry point (Express server) βββ package.json # Dependencies and scripts
π οΈ Installation
Clone the repository:
git clone https://github.com/your-username/rsa-crypto-playground.git cd rsa-crypto-playground
Install dependencies:
npm install
Start the server:
npm start
Server runs at: π http://localhost:5000
π‘ API Usage π Encrypt Text
POST /encrypt
{ "text": "HelloWorld" }
β Response:
{ "encrypted": "MIGfMA0GCSqGSIb3DQEBA..." }
π Decrypt Text
POST /decrypt
{ "encrypted": "MIGfMA0GCSqGSIb3DQEBA..." }
β Response:
{ "decrypted": "HelloWorld" }
βοΈ How It Works
On startup, the app generates a 2048-bit RSA key pair (public & private keys).
The public key is used to encrypt data.
The private key is used to decrypt the encrypted data.
π§βπ» Tech Stack
Node.js
Express.js
Crypto
π License
MIT License