Example
This section shows an example on how the secrets can be used.
Using ETL To Encrypt/Decrypt Secret
This example shows how ETL is used to encrypt and decrypt data files using a secret from the Secrets module.
Encrypt Secret
In the ETL module, add a new ETL chainset and a new chain. Add the following ETL steps to encrypt a secret.
- JSON Record
- MongoDB Encrypt
The first ETL defines the secret to encrypt. The second ETL encrypts the secret in the MongoDB database based on the JSON record defined.
You can use the Developer module to view the content of the database collection prior and after the ETL run.
Decrypt Secret
In the ETL module, add a new ETL chainset and a new chain. Add the following ETL steps to decrypt a secret.
- JSON Record
- Read Secret
- MongoDB Decrypt
The first ETL defines the secret to decrypt. The second ETL reads the secret and the third ETL decrypts the secret in the MongoDB database.
You can use the Developer module to view the content of the database collection prior and after the ETL run.
The _elxEncrypted field is just the timestamp at which encryption occurs. This is sometimes useful as secret keys change over time and knowing when encryption happened, helps you to know which key to use to decrypt. The tool does not use the field, but if present, Decrypt automatically removes it.