encryptor.helper.ts
405 Bytes
import { AES } from 'crypto-js';
export const privateEncryptBody = (data: any) => {
const encrypted = AES.encrypt(JSON.stringify(data), String(process.env.PRIVATE_SECRET)).toString();
return { data: encrypted };
};
export const clientEncryptBody = (data: any) => {
const encrypted = AES.encrypt(JSON.stringify(data), String(process.env.CLIENT_SECRET)).toString();
return { data: encrypted };
};