DB Fields Encryption
ENCRYPTION_SECRET_KEY= <yourEncriptionSecretKey>
ENCRYPTION_IV= <yourEncryptionIV>import { EncryptionTransformer } from 'typeorm-encrypted';
import * as dotenv from 'dotenv';
dotenv.config({ path: `.env.${process.env.STAGE}` });
export const encryptionTransformer = new EncryptionTransformer({
key: process.env.ENCRYPTION_SECRET_KEY,
algorithm: 'aes-256-gcm',
ivLength: 16,
iv: process.env.ENCRYPTION_IV,
});
Last updated