Search code examples
encryptiongnupg

GnuPG error version 2.0.14


When i try to encrypt a file using GnuPG the -----BEGIN PGP MESSAGE----- is added but in the same file the -----END PGP MESSAGE----- is not added in the encrypted file using a java program. When the number of files processed is more this error is noticed. This results in a decryption error

gpg: no valid OpenPGP data found. gpg: block_filter 0x2656130: read error (size=13663,a->size=13663)

I am using GnuPG version 2.0.14 in Linux environment. Any help on this will be appreciated


Solution

  • The problem was due to a bug in the program. The encrypted file contents was getting truncated. The program uses Runtime. Exec method and was not handling the input stream properly. The issue was not with GnuPG encryption tool.