rsa-crypt-lib
v1.0.0
Published
RSA key pair generator and encryption/decryption utility.
Maintainers
Readme
rsa-crypt-lib
A lightweight RSA encryption library for Node.js that allows:
- ✅ Generating RSA key pairs
- 🔐 Encrypting data using public keys
- 🔓 Decrypting data using private keys
Installation
npm install rsa-crypt-libUsage
const rsa = require("rsa-crypt-lib");
rsa.generateKeyPair("public.pem", "private.pem");
const { encryptedString } = rsa.encrypt({ message: "hello" }, "public.pem");
const { decryptedData } = rsa.decrypt(encryptedString, "private.pem");
console.log(decryptedData); // { message: "hello" }