cancel
Showing results for 
Search instead for 
Did you mean: 

Facing Issues When PGP Encryption is Done Using Java Utility at OS Level and Decryption at HCI

0 Kudos

Hello Everyone,

We have a scenario where we have to do PGP encryption for files and place it on an SFTP server. Then the decryption service on HCI will decrypt the same. For encryption, we have created a Java program which uses Bouncy Castle jars. File encryption also happens properly. But the encrypted files are not getting decrypted on HCI. We found that HCI uses IAIK API for PGP decryption. But in our program we are using BC API. We are unable to find out any help on the internet which uses IAIK api for doing PGP encryption. Any help on that is highly appreciated.

Is there anything else needs to be considered when using BC API for encryption so that it will work on HCI too?

Below is the error message that we get on the HCI system:

Error = com.sap.esb.camel.security.pgp.PgpException: An exception occurred during decrypting/verifiyng a PGP message. The PGP message may have been tampered. Reason: The input message body has an invalid format. The PGP decryption/verification processor expects a sequence of PGP packets of the form (entries in brackets are optional and ellipses indicate repetition, comma represents sequential composition, and vertical bar separates alternatives): Public Key Encrypted Session Key ..., Symmetrically Encrypted Data | Sym. Encrypted and Integrity Protected Data, Compressed Data, (One Pass Signature ...,) Literal Data, (Signature ...,), cause: iaik.pgp.exceptions.PGPParsingException: Read invalid packet (COMPRESSED_DATA (TAG 8)) while decoding iaik.pgp.transferables.PGPMessage

Accepted Solutions (0)

Answers (1)

Answers (1)

apu_das2
Active Contributor
0 Kudos

Why are not you using PGPEncryptor and PGPDecryptor standard pattern provided in Eclipse.

Thanks,

Apu