Simplify encryption and decryption using CryptoJS with static result
Simplify encryption and decryption using CryptoJS with static result.
The key derived from the user password (or any string).
Use the package manager npm to install static-crypto.
``bash`
npm install static-crypto
`js
const static_crypto = require("static-crypto")
let user_password = "RawUserPasswd";
//encrypt
let encryption = static_crypto.encrypt(user_password,"hello world")
console.log(encryption)
//decrypt
let decryption = static_crypto.decrypt(
user_password,
"ff47603fbb9278799dade5")
console.log(decryption)
//one way encryption
let save_password = static_crypto.one_way (user_password)
console.log(save_password)
``
Please make sure to update tests as appropriate.