Skip to Content

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

May 30, 2017 at 02:14 PM


avatar image
Former Member

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 = 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

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

1 Answer

avatar image
Former Member May 30, 2017 at 03:15 PM

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



10 |10000 characters needed characters left characters exceeded