import CryptoJS from "crypto-js"; const SECRET = process.env.APP_ENCRYPTION_SECRET || "leadflow-default-secret-key-32ch"; export function encrypt(text: string): string { return CryptoJS.AES.encrypt(text, SECRET).toString(); } export function decrypt(ciphertext: string): string { try { const bytes = CryptoJS.AES.decrypt(ciphertext, SECRET); return bytes.toString(CryptoJS.enc.Utf8); } catch { return ""; } }