justinludwig / jpgpj

Java Pretty Good Privacy Jig
MIT License
75 stars 20 forks source link

jpgpj cannot detect unencrypted data #18

Closed nooota closed 5 years ago

nooota commented 6 years ago

Hello,

I'm using jpgpj to decrypt file. My program received an unencrypted file and tried to decrypt it. I expected an exception will be thrown. But I got a empty file with no exception. Please help me.

the data in the file is H000001018

Regards

justinludwig commented 5 years ago

Sorry for taking so long to respond -- the latest version of JPGPJ (0.6.1) should do a better job of checking if a file is encrypted before trying to decrypt it. If the file is clearly not a PGP-encrypted file, JPGPJ will now raise a org.bouncycastle.openpgpg.PGPException (with a message "not a pgp message").