cancel
Showing results for 
Search instead for 
Did you mean: 

Encrypt and decrypt of Field

Ajay_Chawda
Contributor

Hello Experts,
i’m trying to encrypt one of the field of csv file using Encrypt Field snap.
i have selected transform type as auto and selected account of Passphrase-based Key type.

As a result of encrypt field snap ,field got encrypted.
in next snap i’m mapping encrypted field(column.ciphertext) and other columns and writing data to file.

image

In second pipeline reading encrypted file and trying to decrypt using same Passphrase-based Key based account.

image

but encrypted field is not getting decrypted .

Attaching pipeline for reference .

decFIle_2021_07_28.slp (10.8 KB)
Encrypt file_2021_07_28.slp (10.8 KB)

Regards,
Ajay

13 REPLIES 13

peter
New Contributor III

got it, it was the encapsulate output option!

peter
New Contributor III

I am using the encrypt decrypt pipeline above which works great, but when I try to pass a value to the decrypt via _data the decrypt fails with

image

The mapper looks like
image

The data in the _data field should be good as if I feed this to the decrypt snap via the JSON generator it works fine.

Failure: Invalid base64 value for ciphertext, Reason: Expecting a base64-encoded string, found STRING,

Supratim
Contributor III

@peter Data type of any pipeline parameter is consider as String, even you keep encoding value it consider as String. So if you want encrypt decrypt data, encrypt it in mapper. It might resolve issue.

peter
New Contributor III

OK, how do I do that?

Peter

peter
New Contributor III

I have tried taking the parameter and encoding it as base64 and decoding it before passing to the decrypt and it still does not work.

Peter