Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

In this article

Table of Contents
maxLevel2
excludeOlder Versions|Additional Resources|Related Links|Related Information

...

Snap type:

...

Transform

...

Description:

...

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.

...

Expected upstream Snaps:    Any Snap with a document output view

...

Expected downstream Snaps: Any Snap with a document input view

...

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

 

  • Min: 1

  • Max: 1

  • Encrypt

  • Mapper

This Snap has exactly one document input view, which can be a stream of documents with encrypted field values

...

.

Output

Document

  • Min: 1

  • Max: 1

Document

This Snap has exactly one document output view that is same as input document with specified field values decrypted

...

Prerequisites:

...

None

...

Support and limitations:

...

Works in Ultra Pipelines.

...

Account:

...

This Snap uses account references created on the Accounts page of SnapLogic Manager to handle access to this endpoint. See Configuring Transform Accounts for information on setting up this type of account.

KeyStore account or Passphrase-based Key account can used.

Use KeyStore account for X.509 key or secret (symmetric) key.

If no account is selected, the Key property should have an expression to be evaluated with the input document or the pipeline parameter.

...

Views:

Input

This Snap has exactly one document input view.

Output

This Snap has exactly one document output view.

Error

This Snap has at most one document error view and produces zero or more documents in the view.

...

Settings

...

Label

...

Fields to decrypt

...

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:

  • Stop Pipeline Execution: Stops the current pipeline execution when the Snap encounters an error.

  • Discard Error Data and Continue: Ignores the error, discards that record, and continues with the rest of the records.

  • Route Error Data to Error View: Routes the error data to an error view without stopping the Snap execution.

Learn more about Error handling in Pipelines.

Snap Settings

Info
  • Asterisk (*): Indicates a mandatory field.

  • Suggestion icon ((blue star)): Indicates a list that is dynamically populated based on the configuration.

  • Expression icon ((blue star)): Indicates whether the value is an expression (if enabled) or a static value (if disabled). Learn more about Using Expressions in SnapLogic.

  • Add icon ((blue star)): Indicates that you can add fields in the fieldset.

  • Remove icon ((blue star)): Indicates that you can remove fields from the fieldset.

Field Name

Field Type

Description

Label*

Default ValueDecrypt Field
ExampleDecrypt_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
Example: $msg, $num

String

Specify the table for JSON-path expressions to

...

decrypt. Use the suggest button to select the field to decrypt.

Advanced Options

...

Key

Use this fieldset to specify the key when no account is selected.

...

Key

Default Value: None
Example: $key

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
Example

...

Default value: None

...

Multiexcerpt include macro
nameSnap Execution
pageAnaplan Read

...

Multiexcerpt include macro
nameSnap_Execution_Introduced
pageAnaplan Read

Examples

...

:

  • AES/GCM/NoPadding

  • DES/CBC/PKCS5Padding

String/Expression/Suggestion

Specify the cryptographic transformation the Snap needs to perform. The transform type is expressed as algorithm/mode/padding.
When set to auto the transformation will be automatically selected based on the type of encryption key using the following table:

Image Added

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
Example: $iv

String/Expression

Specify the base64-encoded initialization vector.

Output type

Default: N/A
Example: String

String/Expression/Suggestion

Specify either of the following output types you want the Snap to produce:

  • String

  • Document

Key salt

Default: N/A
Example: $key_params.passphrase.keys_salt

String/Expression

Specify the salt used in generating the key.

  • The salt is the data you incorporate in the passphrase to generate the encryption key in order to improve the security of the passphrase or key.

  • If no salt is provided to the Decrypt Field Snap, none will be used.

Key generation algorithm

Default: N/A
Example: $key_params.passphrase.key_gen_algorithm

String/Expression

Specify the algorithm to use to generate the encryption key.

Key generation iterations

Default: N/A
Example: $key_params.passphrase.key_gen_iterations

String/Expression

Specify the number of iterations to run when generating the encryption key.

Snap Execution

Default ValueValidate & Execute
Example: Execute only

Dropdown list

Select one of the three modes in which the Snap executes. Available options are:

  • Validate & Execute: Performs limited execution of the Snap, and generates a data preview during Pipeline validation. Subsequently, performs full execution of the Snap (unlimited records) during Pipeline runtime.

  • Execute only: Performs full execution of the Snap during Pipeline execution without generating preview data.

  • Disabled: Disables the Snap and all Snaps that are downstream from it.

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.

...

Image Added

The output preview from the Encrypt Field Snap:

Image Modified

The Mapper Snap maps the values including the key value to the Decrypt Field Snap.

...

Image Added

The Decrypt Field Snap decrypts the provided fields.

...

Image Added

The output preview from the Decrypt Field Snap:

Image Modified

...

titleEncrypt and Decrypt using Passphrase Account with selected algorithm Transform type

...

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.

Image Modified

The CSV Generator Snap passes the values to the Encrypt Snap.

Image Modified

The Field Encrypt Snap encrypts the provided fields, $Phone_m, $Phone_h, $Phone_w.  The Transform type is selected from the suggested list.

...

Image Added

The output preview from the Field Encrypt Snap: (Note the encrypted values followed by ENC:...)

Image Modified

The Decrypt Field Snap decrypts the field, $Phone_h.

...

Image Added

The output preview has the Phone_h field decrypted.

...

Image Modified

The Mapper Snap passes the field $Phone_h values to the output preview:

Image Removed

Image Removed

...

Image Added

Output View:

Image Added

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.

Image Modified

The JSON Generator Snap provides the values to the Mapper Snap.

Image Modified

The Mapper Snap maps the values to be passed to the Encrypt Field Snap.

...

Image Added

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. 

...

Image Added

The output preview from the Encrypt Field Snap:

Image Modified

The Decrypt Field Snap decrypts the fields as provided.

...

Image Added

The successful execution of the pipeline displays the below output preview:

Image Modified

...

Downloads

Multiexcerpt include macro
namedownload_instructions
pageOpenAPI

Info
  1. Download and import the Pipeline into SnapLogic.

  2. Configure Snap accounts as applicable.

  3. Provide Pipeline parameters as applicable.

Attachments
patterns*.slp, *.zip

...

...

Snap Pack

...

History