import { AES } from 'crypto-js';
import enc from 'crypto-js/enc-utf8';
import { ENC_STORAGE_KEY } from './encryption-key';

// Encryption function
export function encryptData(data: any) {
  return AES.encrypt(data, ENC_STORAGE_KEY).toString();
}

// Decryption function
export function decryptData(encryptedData: any) {
  return AES.decrypt(encryptedData, ENC_STORAGE_KEY).toString(enc);
}
