A lightweight open-source JavaScript library for signing and verifying software license key using RSA 2048-bit encryption.
βοΈ I'm actively pushing this to be Post-Quantum Computing (PQC) compatible to future-proof security.
- π Generate RSA Key Pairs
- π Sign License Keys
- β Verify Signed Licenses
- π Uses SHA256 + RSA for Security
- π Minimal & Easy to Integrate
- π Live API Hosted on Render
- π LICENSE KEY GENERATOR (PKI-Based Signing)
- π How It Works
- π Live API (No Setup Required!)
- β‘ Usage (Local Development)
- π§ͺ Running Tests
- π License
- π€ Contributions
- π§ Contact
This API allows you to generate RSA key pairs, sign software license keys, and verify them using cryptographic signing.
1οΈβ£ Generate an RSA Key Pair β Get a public and private key. The private key is yours to keep.
2οΈβ£ Sign a License Key β Use your private key to sign a license.
3οΈβ£ Verify a License β Use the public key to validate the signature.
- Generated Keys: When you generate a key pair, the public and private keys exist only in memory until you save them.
- Private Key: This key is meant to be kept secret. If you lose it, you cannot re-create or retrieve it.
- Public Key: You can store and distribute this safely. It is used to verify signed licenses.
πΉ Note: This API DOES NOT store your keys or license data.
π If you need a hosted key storage & validation service, stay tuned for our upcoming managed API service!
The API is deployed on Render and can be accessed directly!
| Feature | Details |
|---|---|
| Base URL | https://license-signing-api.onrender.com |
| Swagger API Docs | https://license-signing-api.onrender.com/api-docs/ |
- Returns:
{ publicKey: string, privateKey: string } - Description: Generates a new RSA 2048-bit key pair.
- Example Response:
{ "publicKey": "-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhki...\n-----END PUBLIC KEY-----", "privateKey": "-----BEGIN PRIVATE KEY-----\nMIIEvQIBA...\n-----END PRIVATE KEY-----" }
- Request Body:
{ "licenseKey": "USER123-PRODUCT456-EXP20251231", "privateKey": "-----BEGIN PRIVATE KEY-----\nMIIEvQIBA...\n-----END PRIVATE KEY-----" } - Returns:
{ signature: string } - Description: Signs a license key using the provided private key.
- Example Response:
{ "signature": "k7d9f8a8g9s7d9f8a7g9s7d..." }
- Request Body:
{ "licenseKey": "USER123-PRODUCT456-EXP20251231", "signature": "k7d9f8a8g9s7d9f8a7g9s7d...", "publicKey": "-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhki...\n-----END PUBLIC KEY-----" } - Returns:
{ valid: boolean } - Description: Verifies if the given license key and signature match the public key.
- Example Response:
{ "valid": true }
π Swagger API Docs: https://license-signing-api.onrender.com/api-docs/
To install this package locally, run:
npm install- Node.js 16+
- Express.js (for API)
- Crypto module (built into Node.js)
To create an RSA public-private key pair, use:
const { generateKeyPair } = require("./src/generateKeys");
const { privateKey, publicKey } = generateKeyPair();
console.log("Private Key:", privateKey);
console.log("Public Key:", publicKey);To sign a license key with your private key, use:
const { signLicense } = require("./src/signLicense");
const licenseKey = "USER123-PRODUCT456-EXP20251231";
const signature = signLicense(licenseKey, privateKey);
console.log("π Signature:", signature);To verify a license key, use:
const { verifyLicense } = require("./src/verifyLicense");
const isValid = verifyLicense(licenseKey, signature, publicKey);
console.log("β
Valid License:", isValid);To run the unit tests:
npm testor
jestThis project is licensed under the MIT License.
Feel free to modify and use it in your own projects.
Pull requests are welcome! Please follow the contribution guidelines in docs/CONTRIBUTING.md.
I'm pushing this tool to GitHub Marketplace to make it easier for developers and teams to integrate secure license key management into their workflow.
π‘ Want to support development?
This project is open for sponsorship! Your contributions help me bring Post-Quantum Security to software licensing.
π Sponsor me on GitHub π
- GitHub: https://github.com/tsrinarmwong
- Email: tsrinarmwong.careers@hawk.iit.edu
π₯ Happy coding! π
