Package Exports
- simplersa
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (simplersa) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
Simple module to ease use of the rsa public key encryption.
Usage:
var simplersa=require("simplersa");
var rsa=simplersa();Generate keys
rsa.gen.pri(size=1024); // generate private and public keys
rsa.gen.pub(size=1024); // generate just public key for one time useSet keys
rsa.set.pri(pkcs1-private-pem.key); // set private key
rsa.set.pub(pkcs8-public-pem.key); // set public keyGet keys
rsa.get.pri(); // return private key
rsa.get.pub(); // return public keyEncrypt / decrypt depending on the keys loaded
rsa.enc(text); // encrypt
rsa.dec(text); // decryptFor web version use "web-simplersa.js"
Keys are exported as:
pkcs8-public-pemand
pkcs1-private-pem