Configuring and using Structural data encryption
Last updated
Last updated
Required license: Professional or Enterprise
Not available on Tonic Structural Cloud.
Required global permission: Configure Tonic Structural data encryption
A common use case for custom processing is encrypted source data. The data might need to be decrypted before a generator is applied, and encrypted before it is saved to the destination database.
Structural data encryption allows you to configure decryption and encryption to use during data generation. The data encryption process supports AES encryption, and allows you to use either the CBC, ECB, or CFB cipher modes.
When Structural data encryption is enabled, the configuration panel for each column includes a toggle to use Structural data encryption for that column.
For columns that use both Structural data encryption and a custom value processor:
Decryption occurs before a pre-processing custom value processor.
Encryption occurs after a post-processing custom value processor.
You enable and configure the data encryption from the Data Encryption tab of the Structural Settings view. To display the Structural Settings view, in the Structural heading, click Structural Settings.
To use Structural data encryption, you must provide:
A Base64-encoded decryption key as the value of the TONIC_DATA_DECRYPTION_KEY
environment setting.
A Base64-encoded encryption key as the value of the TONIC_DATA_ENCRYPTION_KEY
environment setting.
Both key values must use the same key size - either 128, 192, or 256.
For more information, go to Configuring environment settings.
Structural validates whether the values are set correctly. Structural enables the rest of the Data Encryption tab settings only if the keys are set correctly.
By default, Structural data encryption is disabled. To enable it, toggle Enable Data Encryption to the on position.
When you enable Structural data encryption, you choose whether to use decryption, encryption, or both.
You use decryption if the source data is encrypted and must be decrypted before the generators are applied.
You use encryption to encrypt the transformed data before saving it to the destination database.
To use decryption only, select Use Decryption.
To use encryption only, select Use Encryption.
To both decrypt and encrypt data, select Use Decryption and Encryption.
Structural only supports AES encryption. The AES Encryption setting shows the current key size.
The key size is based on the values you provided for the decryption and encryption key environment settings.
From the Cipher Mode dropdown list, select the cipher mode to use for Structural data encryption. The available cipher modes are:
CBC
ECB
CFB
Before it decrypts or encrypts data, Structural applies an initialization vector.
By default, Structural generates a random initialization vector, and Use custom Initialization Vector (IV) is in the off position.
To provide custom initialization vectors for Structural to use:
Toggle Use custom Initialization Vector (IV) to the on position.
If the Structural data encryption configuration includes encryption, then in the Encryption IV field, enter the static initialization vector to use to encrypt data.
If the Structural data encryption configuration includes decryption, then in the Decryption IV field, enter the static initialization vector to use to decrypt data.
After it encrypts the destination data, but before it stores it, Structural can prepend a string to the encrypted data.
To configure Structural data encryption to prepend a string:
Toggle Prepend value to encrypted data to the on position.
In the Custom Value field, enter the string to prepend.
After you complete the configuration, the Preview Results panel allows you to test the decryption and encryption.
If the configuration is incomplete, you cannot run the test.
If the configuration is for decryption only:
In the Ciphertext field, enter an encrypted text string.
Click Run Test.
Verify that the text in the Plaintext Result field is correct.
If the configuration is for encryption only:
In the Plaintext field, enter an unencrypted text string.
Click Run Test.
Verify that the text in the Ciphertext Result field is correct.
If the configuration is for both decryption and encryption, then you provide an encrypted string. The test decrypts the string into plain text, then re-encrypts that string.
In the Ciphertext field, enter an encrypted text string.
Click Run Test.
Verify that the text in the Plaintext Result field and the Ciphertext Result field is correct.
To save the configuration, click Save.
To revert any changes since you last saved the configuration, click Revert.