Would you like to clone this notebook?

When you clone a notebook you are able to make changes without affecting the original notebook.

Cancel

RunKit + npm:

node v8.17.0
version: 1.0.0
endpointsharetweet
let CryptoJS = require('crypto-js'); function encrypt(keyword, nonce) { let encrypted_password_bytes = CryptoJS.AES.encrypt(keyword, nonce); let encrypted_password_string = encrypted_password_bytes.toString(); return encrypted_password_string; } function decrypt(keyword, nonce) { var decrypted_password_bytes = CryptoJS.AES.decrypt(keyword, nonce); var decrypted_password_string = decrypted_password_bytes.toString(CryptoJS.enc.Utf8); return decrypted_password_string; } /* Example: keyword = "p@ssw0rd" encrypted_keyword = "U2FsdGVkX19Di0gStlndsMVdFQzsvjM/06ZtqwvQhGI="; */ var encrypted_keyword = encrypt('p@ssw0rd' , '151395403713500'); var decrypted_keyword = decrypt(encrypted_keyword, '151395403713500');
Created from: https://npm.runkit.com/
Loading…

no comments

    sign in to comment