The Encrypt Data transformation step lets you encrypt values in selected columns of a dataset. It enhances data security and confidentiality by encrypting sensitive information with AES-256 key using AES-GCM mode that is unreadable without the proper decryption key.
To decrypt the data, you can use the Decrypt Data step or an external tool.
By using this transformation, you can safeguard your data and comply with privacy regulations while maintaining the integrity of your dataset.
Requirements
- You must have a user role with the following permission: Settings > Encryption keys > Read. This permission lets you see the list of encryption keys in the Encrypt Data and Decrypt Data steps.
- Add an encryption key in Synerise
- Your decryption tool/program must support the Synerise encryption format:
base64encode([IV] + [Encrypted Text] + [Authentication Tag]), whereIVis the initialization vector used to initiate the encryption algorithm andEncrypted Textis the result of an AES-GCM algorithm with a 256-bit secret.
Step configuration

- In the Data Transformation Studio, add the Encrypt Data step.
- Indicate the columns whose values will be encrypted.
- In the Encrypt data using section, click Choose key and select the key with which the data will be encrypted.
- To add more rules, click Add rule and repeat steps 2-3.
- To define what happens if rows contain errors, from the dropdown list next to Add rule, select one of the error handling options.
- Confirm the settings by clicking Apply.
- You can check the result in the Output tab.
Selecting columns
In each rule of the step, you indicate the columns on which the operation is performed.
- In the header of the rule, click these and select one of the options:
- these - the operation is performed on the columns you indicate.
- all except these - the operation is performed on all columns except the ones you indicate.
- From the first dropdown list in the rule, select how you want to indicate the columns:
- Columns - from the Select column dropdown list, select one or more columns.
- Where name - define a condition (a dynamic condition) that the column names must meet. Select a logical operator (Ends with, Starts with, Contain, Not contain, or Regex) and enter the value. For example, if you select Starts with and enter
pro, the operation is performed on the columns whose names start withpro
Column names are case-sensitive, for example,productdoesn't matchProductCode. A regular expression must match the entire column name, for example,product.*matchesproductName, butproductdoesn't. To ignore the letter case in a regular expression, add(?i)at the beginning, for example,(?i)product.*
You can't combine dynamic conditions with the all except these option.
Dynamic conditions are especially helpful when you use a JSON file as sample data. When a JSON file contains an object deeper than the root object, its items are transferred to the transformation as separate columns named {object}.{parameter}. You can't add those columns from the Select column list, but you can include them with a dynamic condition, for example, by including columns whose names contain the name of the object they were created from.
Handle errors
You can define what happens with rows in which the step fails (for example, as a result of Jinja rendering). From the dropdown list next to Add rule, select one of the following options:
- Skip row if error occurred - It omits the row when an exception occurs.
- Skip if result is null or empty string - It omits rows with empty strings and
null(which may be the result of rendering Jinja). - Stop further transformation - The transformation stops at the row with an error. The data before the line that caused the error is transformed (and imported if the transformation is used in the Data Transformation Studio node).
- Insert null if error occurred - Wrong values are replaced with
null. If you use such a transformation for the import of profiles, the existing value of an attribute is cleared and replaced with thenullvalue. - Insert empty string if error occurred - Wrong value is removed and the cell remains empty.
Example of use
You can use the Encrypt Data step to encrypt a set of sensitive data. For example, you want to encrypt a column in a CSV file that contains email addresses of your customers. This example of use contains instructions how to create a transformation that encrypts a set of sensitive data. You can use this transformation in the "Data Transformation Studio" node in a workflow that sends the file to an external source.
Before you proceed to creating a transformation that uses this step, ensure that you meet the requirements.
Sample data used in this example
email,newsletter agreement john.doe@example.com,yes jane.smith@example.com,no bob.johnson@example.com,yes sara.white@example.com,yes michael.brown@example.com,no- In the Data Transformation Studio, add sample data which imitates the structure of the data that will be transformed in the workflow.
- Click Add step and select Encrypt Data.
- From the Select column dropdown list, select the email column.
- In the Encrypt data using section, click Choose key and select the Synerise encryption key which will be used to encrypt data in this column.
- Confirm the settings by clicking Apply.
Result: In the Output tab, the values in the email column are encrypted.
In the further steps, you can create a workflow that is triggered repeatedly, retrieves customers with email address assigned, encrypts email addresses with the transformation created in the previous steps, and sends the encrypted file with SFTP.
