Package Exports
- encryptjs
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 (encryptjs) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
encryptjs
A library to encrypt and decrypt a string
uauage:
npm install encryptjs
(or)
npm i -g encryptjs to install globally
import the module using require command
var encrypt=require('encryptjs');
To encrypt the string , we need a plain text and a "secret key", the same "secret key" is used to decrypt the cipher text.
var secretkey='ios';
var plaintext='apple';
var cipherText =encrypt.encrypt(plaintext,secretkey,256);
var obj={password:cipherText};
console.log(cipherText+" ****************** ");
var decipher=encrypt.decrypt(cipherText,secretkey,256);
console.log("Deciphred Text is : "+decipher);
Available functions:
encrypt(plaintext,secretkey,bit); decrypt(plaintest,secretkey,bit);
Bit value can be 64,128 & 256