This commit is contained in:
2024-11-13 01:17:25 -05:00
parent 0ed24ed43b
commit 9ac157315a
10 changed files with 148 additions and 24 deletions
+16
View File
@@ -0,0 +1,16 @@
import AES from 'crypto-js/AES';
import CryptoJS from 'crypto-js';
export const jjDecrypt = (encryptedText, key) => {
const bytes = CryptoJS.AES.decrypt(encryptedText, key);
const originalText = bytes.toString(CryptoJS.enc.Utf8);
return originalText;
};
export const jjEncrypt = (text, key) => {
return AES.encrypt(text, key).toString();
};