npm.io
1.2.1 • Published 4 years ago

node-crypto-rsa

Licence
ISC
Version
1.2.1
Deps
0
Size
14 kB
Vulns
0
Weekly
0

Description

This library provides a simple interface to use RSA encryption and decryption.

Example

const rsaUtil = new RSAUtil()
rsaUtil.createPairKeys()

const valueToEncrypt = 'Hello World'
const encryptedData = rsaUtil.encrypt(valueToEncrypt)
console.log(encryptedData) // show a value like this: 9a8f7f6e5d4c3b2a1918...

const decrypted = rsaUtil.decrypt(encryptedData)
console.log(decrypted) // show 'Hello World'