Support Questions

Find answers, ask questions, and share your expertise

EncryptContentPGP which version gpg

avatar
Rising Star

Hi there,

Now for something totally different 🙂 we need to encrypt and decrypt some files for a flow we are working on. Initially gpg was configured on a linux server and we want to move this functionality to nifi.

On the linux server we are using this version of gpg:

gpg (GnuPG) 2.0.22
libgcrypt 1.5.3

We encrypt a test file and get a file with a size of 656 bytes. This file can be decrypted by the next system that needs to process this file.

We configure nifi as follow:

Dave0x1_0-1722520519971.png

When reading the same file in the flow, all goes well and we send the output to the next system. Which unfortunately fails to decrypt the file. They get an invalid key length error. So I checked the file size from nifi and looks like 394 bytes only.

The keyring files used in public key service is an export from the linux system. Which should work fine. Passphrase and all are the same.

So we were wondering which gpg is being used by nifi??? Could it be a version compatibility issue? or something else.

Any tips would be very helpfull 🤓

Thanks in advanced.

Regards,

Dave

3 REPLIES 3

avatar
Rising Star

Extra info: here is the steandaardpgppublishkeyservice configuration. gpg-pub.asc was exported from the old linux system.

Dave0x1_0-1722520911675.png

 

avatar
Master Mentor

@Dave0x1 

Add Encrypt and Decrypt PGP Processors and Services

The EncryptContentGPG processor functions in accordance with the openGPG specification defined in RFC 4880

The specification has changed since then refreshed specification for OpenPGP
, which have resulted in changes in the latest Apache NiFi 2.0 milestone releases:
 Remove Compression from EncryptContentPGP and SignContentPGP

Please help our community grow. If you found any of the suggestions/solutions provided helped you with solving your issue or answering your question, please take a moment to login and click "Accept as Solution" on one or more of them that helped.

Thank you,
Matt



avatar
Rising Star

HI Matt, thanks for your reply and info shared. We did some changes, so now signing then encrypting the files:

signing

Dave0x1_0-1722860848998.png

encrypting

Dave0x1_1-1722860892430.png

When our next system tries to decrypt the file we get this error:

gpg: encrypted with unknown algorithm 183

gpg: decryption failed: Invalid cipher algorithm

Googling on this, encrypted with unknown algorithm 183, doesn't really give anything usefull. 

So were trying to figure out, if the issues we're facing is nifi related or on the decrypting side.

Any idea's would help.

Thank you.