DB Fields Encryption
If you need to save information securely, you can use the transformer function to be able to save the fields you need to encrypt.
You need to add these variables in your .env file:
The secret key must be a key made with SHA256.
IV cipher must be 32 characters long. (16 Bytes)
To encrypt information, the typeorm-encrypted library is being used.
The configuration file for this file is located at src/common/transformers/typeorm-encrypted.transformer.ts
If you want to encrypt data of some entity, you must import the configuration that is made in the file: src/common/transformers/typeorm-encrypted.transformer.ts
Now you need to add the following configuration to the field you want to encrypt in your .entity file.
Last updated