1.0.4 • Published 5 months ago

rsa-light-crypto v1.0.4

Weekly downloads
-
License
MIT
Repository
-
Last release
5 months ago

RSA Light Crypto

A library to generate rsa keys, encrypt data and decrypt data in your application works well at browser to add a layer of security in your app.

I recommend to create a interceptor and intercept all request to encrypt and decrypt all in one safe place

Installation

Use the package manager node to install rsa-light-crypto.

npm i rsa-light-crypto

Usage

const light_crypto = require('rsa-light-crypto')
let keys = light_crypto.generateKey()
//PUBLIC_KEY: MTMwMDAwMCA=
//PRIVATE_KEY: MzEg

let data = "my data"
let encryptData = light_crypto.encrypt(data,keys.publicKey)
//6b87908a2653768c7626818b26657a78908a7a
let decryptData = light_crypto.decrypt(encryptData,keys.privateKey)
//my data


/*the result may be different rsa-light-crypto uses different methods every time you generate a new key*/

Please make sure to update tests as appropriate.

License

MIT

1.0.4

5 months ago

1.0.3

5 months ago

1.0.2

5 months ago

1.0.1

5 months ago

1.0.0

5 months ago