mirror of
https://github.com/BlueWallet/BlueWallet.git
synced 2024-11-20 02:09:10 +01:00
12 lines
334 B
JavaScript
12 lines
334 B
JavaScript
|
let CryptoJS = require('crypto-js');
|
||
|
|
||
|
module.exports.encrypt = function(data, password) {
|
||
|
let ciphertext = CryptoJS.AES.encrypt(data, password);
|
||
|
return ciphertext.toString();
|
||
|
};
|
||
|
|
||
|
module.exports.decrypt = function(data, password) {
|
||
|
let bytes = CryptoJS.AES.decrypt(data, password);
|
||
|
return bytes.toString(CryptoJS.enc.Utf8);
|
||
|
};
|