Travis CI
Krypton
- Krypton is a JavaScript class with Symmetric (asynchronous and synchronous) and Asymmetric encryption and decryption methods. Cipher is configured to use AES-256-CBC with initialization vector.
Usage
Install
npm install Krypton-js
Require
const Krypton =
Create an instance of Krypton and pass encryptionFileName and Password
let Krypton = encryptionFileName Password
Encrypt Synchronous
Krypton
Decrypt Synchronous
data = Krypton
Encrypt Asynchronous
Krypton// Result = { message: "Encrypted!" }
Decrypt Asynchronous
Krypton//
Asymmetric Encryption/decryption
A exchanges its public key with B
A sends data to B, where encryption of data is done with A's Private Key
encrypted_data = Krypton
B: data decryption with A's public Key
decrypted_data = Krypton
B to A, encryption with A's public Key
encrypted_data = Krypton
A: decryption with A's private Key
decrypted_data = Krypton
Generate a public and private RSA key pair
1 ssh-keygen -t rsa2 openssl req -x509 -newkey rsa:4096 -nodes -out certpem -keyout keypem -days 365
Library Usage/Test
Try it out
npm install
Test
npm run test
Coverage
istanbul cover test
Check coverage folder