Versions Compared

Key

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

On this Page

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

Snap type:

Transform

Description:

This Snap encrypts individual field values in the input documents.

  • Expected upstream Snaps:    Any Snap with a document output view

  • Expected downstream Snaps: Any Snap with a document input view

  • Expected input: Stream of documents with a nested or flat map data

  • Expected output: Same as input documents with specified field values encrypted

Prerequisites:

None

Support and limitations:

Works in Ultra Task 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

Insert excerpt
SPD:Snap Label
SPD:Snap Label
nopaneltrue

Fields to encrypt

Required. A table for JSON-path expressions to fields to encrypt. Use the suggest button to select the field to encrypt.

Transform type

The cryptographic transformation to perform, expressed as 'algorithm/mode/padding'. Use the suggest button to select a desired transformation type. When set to "auto", the transformation will be automatically selected based on the type of encryption key using the following table:

Key Algorithm

Transformation

AES

AES/GCM/NoPadding

DES

DES/CBC/PKCS5Padding

DESede

DESede/CBC/PKCS5Padding

RSA

RSA/None/OAEPWithSHA-256AndMGF1Padding

Example: auto, AES/GCM/NoPadding, DES/CBC/PKCS5Padding

Default value: auto

Advanced Options


Key

This property is required if no account is selected.

It should be a JSON-path expression to be evaluated with input documents or pipeline parameters. The result should be 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 the attached pipeline file below:

"Encrypt Decrypt X.509 certificate from input document.slp"

Example: $key

Default value: None

Initialization vector

JSON-path expression to be evaluated with input documents or pipeline parameters to be the base64-encoded initialization vector. Leave empty to generate one automatically. Note that the content of the initialization vector should be different for every encryption operation. Reusing IVs will make the encryption operation less secure.

Example: $iv

Default value: None

Encapsulate output

If selected, encrypted fields are JSON-encoded and encapsulated between "ENC:" and ":ENC" strings. When unselected, the field to be encrypted will be replaced with an object with the output of the encryption operation as needed to perform the decryption.

Default value: Selected

Multiexcerpt include macro
nameSnap Execution
pageAnaplan Read

Multiexcerpt include macro
nameSnap_Execution_Introduced
pageAnaplan Read

Examples


Expand
titleEncrypt and Decrypt with input document

Encrypt and Decrypt 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.

Image Modified

The JSON Generator Snap passes the values to the Encrypt Field Snap. Note that the key value is also provided.

Image Modified

The Encrypt Field Snap provides the values to be encrypted. The key value $key is passed via the input document.

Image Modified

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 Modified

The Decrypt Field Snap decrypts the provided fields.

Image Modified

The output preview from the Decrypt Field Snap:

Image Modified


Expand
titleEncrypt and Decrypt using Passphrase Account with selected algorithm Transform type

Encrypt and Decrypt 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. 

Image Modified

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 Modified

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. Note that the output preview has the Phone_h field decrypted.

Image Modified

Image Modified

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

Image Modified

Image Modified



Expand
titleEncrypt and Decrypt using KeyStore Account with Transform type as 'auto'

Encrypt and Decrypt Using KeyStore Account with Auto Transform Type

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.

Image Modified

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 Modified

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 Modified

The output preview from the Encrypt Field Snap:

Image Modified

The Decrypt Field Snap decrypts the fields as provided.

Image Modified

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

Image Modified   


Downloads

Multiexcerpt include macro
namedownload_instructions
pageOpenAPI

Attachments
uploadfalse
oldfalse
patterns*.slp, *.zip

Insert excerpt
Transform Snap Pack
Transform Snap Pack
nopaneltrue