Decrypt Field
In this article
Overview
You can use this Snap to decrypt fields in input documents using the Passphrase Account with the selected algorithm.
Snap Type
The Decrypt Field is a Transform-Type Snap that decrypts the fields in the input documents.
Prerequisites
None.
Support for Ultra Pipelines
Works in Ultra Pipelines.
Limitations and Known Issues
None.
Snap Views
Type | Format | Number of Views | Examples of Upstream and Downstream Snaps | Description |
---|---|---|---|---|
Input | Document
|
|
| This Snap has exactly one document input view, which can be a stream of documents with encrypted field values. |
Output | Document |
| Document | This Snap has exactly one document output view that is same as input document with specified field values decrypted |
Error | Error handling is a generic way to handle errors without losing data or failing the Snap execution. You can handle the errors that the Snap might encounter while running the Pipeline by choosing one of the following options from the When errors occur list under the Views tab. The available options are:
Learn more about Error handling in Pipelines. |
Snap Settings
Asterisk (*): Indicates a mandatory field.
Suggestion icon (): Indicates a list that is dynamically populated based on the configuration.
Expression icon (): Indicates whether the value is an expression (if enabled) or a static value (if disabled). Learn more about Using Expressions in SnapLogic.
Add icon (): Indicates that you can add fields in the fieldset.
Remove icon (): Indicates that you can remove fields from the fieldset.
Field Name | Field Type | Description | |
---|---|---|---|
Label* Default Value: Decrypt Field | String | Specify the name for the Snap. You can modify this to be more specific, especially if you have more than one of the same Snap in your Pipeline.
| |
Fields to decrypt Default Value: None | String | Specify the table for JSON-path expressions to decrypt. Use the suggest button to select the field to decrypt.
| |
Advanced Options | Use this fieldset to specify the key when no account is selected. | ||
Key Default Value: None | String | Specify the JSON-path expression to be evaluated with input documents or pipeline parameters to the base64 or PEM-encoded key. Do not copy-and-paste directly to the property. For a sample pipeline using X.509 certificate, refer to this Pipeline. You can also download this Pipeline from the Downloads section below.
| |
Transform type Default Value: auto
| String/Expression/Suggestion | Specify the cryptographic transformation the Snap needs to perform. The transform type is expressed as algorithm/mode/padding. Use the suggestion button to select a desired transformation type. When set to auto, the transformation is automatically selected based on the type of encryption key using the following table: | |
Initialization vector Default: N/A | String/Expression | Specify the base64-encoded initialization vector. | |
Output type Default: N/A | String/Expression/Suggestion | Specify either of the following output types you want the Snap to produce:
| |
Key salt Default: N/A | String/Expression | Specify the salt used in generating the key.
| |
Key generation algorithm Default: N/A | String/Expression | Specify the algorithm to use to generate the encryption key. | |
Key generation iterations Default: N/A | String/Expression | Specify the number of iterations to run when generating the encryption key. | |
Snap Execution Default Value: Validate & Execute | Dropdown list | Select one of the three modes in which the Snap executes. Available options are:
|
Examples
Encrypt and Decrypt the Input Documents
In this pipeline, the JSON Generator Snap, passes the values to the Encrypt Field Snap that provides the fields to be encrypted. The Upstream Mapper Snap maps the values to be decrypted to the Decrypt Field Snap.
The JSON Generator Snap passes the values to the Encrypt Field Snap. Note that the key value is also provided.
The Encrypt Field Snap provides the values to be encrypted. The key value $key is passed via the input document. | The output preview from the Encrypt Field Snap: |
The Mapper Snap maps the values including the key value to the Decrypt Field Snap. | |
The Decrypt Field Snap decrypts the provided fields. | The output preview from the Decrypt Field Snap: |
Encrypting and Decrypting Documents Using Passphrase Account with Selected Algorithm Transform Type
In this pipeline, the CSV Generator Snap supplies the values to the Field Encrypt Snap which provides the fields to be encrypted. The Decrypt Snap decrypts the fields and passes the required field values using the downstream Mapper Snap. The Snaps use the PassPhrase-based Account.
The Passphrase Account set with a nine digit phrase and a key size of 128. | The CSV Generator Snap passes the values to the Encrypt Snap. |
The Field Encrypt Snap encrypts the provided fields, $Phone_m, $Phone_h, $Phone_w. The Transform type is selected from the suggested list. | The output preview from the Field Encrypt Snap: (Note the encrypted values followed by ENC:...) |
The Decrypt Field Snap decrypts the field, $Phone_h.
| The output preview has the Phone_h field decrypted. |
The Mapper Snap passes the field $Phone_h values to the output preview: | Output View: |
Encrypt and Decrypt Using KeyStore Account with Transform type as 'auto'
In this pipeline, the JSON Generator Snap passes the values to the Mapper Snap that maps them to the Encrypt Field Snap for the values to be encrypted and then decrypt the values as provided in the Decrypt Field Snap.
The Keystore Account set with the Keystore location as secret_key.jks. | The JSON Generator Snap provides the values to the Mapper Snap. |
The Mapper Snap maps the values to be passed to the Encrypt Field Snap. |
|
The Encrypt Field Snap provides the fields to be encrypted. The Transform type is selected 'auto' which means that the Snap selects the algorithm as registered in the KeyStore file in the Account. | The output preview from the Encrypt Field Snap: |
The Decrypt Field Snap decrypts the fields as provided. | The successful execution of the pipeline displays the below output preview: |