ecency-mobile/src/utils/crypto.js

8 lines
237 B
JavaScript
Raw Normal View History

import CryptoJS from 'crypto-js';
2018-10-22 01:42:12 +03:00
export const encryptKey = (key, data) => CryptoJS.AES.encrypt(key, data).toString();
2020-02-20 06:31:13 +03:00
export const decryptKey = (key, data) => {
return CryptoJS.AES.decrypt(key, data).toString(CryptoJS.enc.Utf8);
};