Created
November 15, 2019 10:58
-
-
Save micmath/27b587f6143a6152d50e70ea4cc52cc1 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var simpleCryptoJs = require("simple-crypto-js").default; | |
var secret = "FAKE-EXAMPLE-5rV4e!Wvso8%Yhbsq&*j639$7kys"; | |
var simpleCrypto = new simpleCryptoJs(secret); | |
var plainText = "Hello Squirrel!"; | |
var cipherText = simpleCrypto.encrypt(plainText); | |
var decipherText = simpleCrypto.decrypt(cipherText); | |
console.log("Plain Text : " + plainText); | |
console.log("Cipher Text : " + cipherText); | |
console.log("Decipher Text : " + decipherText); | |
//=> "Plain Text : Hello Squirrel!" | |
//=> "Cipher Text : 51bfd1092b6ce1226a7786f7d39a70ab3e557f8d563edb7dc72f8c5867d1964a4tk9OCFLjYNhTGiXJUIJ0g==" | |
//=> "Decipher Text : Hello Squirrel!" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment