158
rated 0 times
[
165]
[
7]
/ answers: 1 / hits: 31476
/ 6 Years ago, tue, january 30, 2018, 12:00:00
I want to Encode number to character.
- How Can I encode to base64 in output?
Code:
const CryptoJS = require('crypto-js');
function msg() {
return '7543275'; // I want to encrypt this number to character
}
const msgLocal = msg();
// Encrypt
const ciphertext = CryptoJS.AES.encrypt(msgLocal, 'password');
// Decrypt
const bytes = CryptoJS.AES.decrypt(ciphertext.toString(), 'password');
const plaintext = bytes.toString(CryptoJS.enc.Utf8);
console.log(plaintext);
More From » encryption