JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 1
  • Score
    100M100P100Q51238F
  • License ISC

Node module for RSA encryption.

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 use

Set keys

rsa.set.pri(pkcs1-private-pem.key); // set private key
rsa.set.pub(pkcs8-public-pem.key); // set public key

Get keys

rsa.get.pri(); // return private key
rsa.get.pub(); // return public key

Encrypt / decrypt depending on the keys loaded

rsa.enc(text); // encrypt
rsa.dec(text); // decrypt

For web version use "web-simplersa.js"

Keys are exported as:

pkcs8-public-pem

and

pkcs1-private-pem