Search code examples
linuxencryptiongnupgpgp

PGP/GPG unable to decrypt


I have an issue decrypting one file. I am receiving the file via email. I am able to decrypt it on Windows using PGPtools with no issues. When I am trying to decrypt the file on Linux I am getting the following error:

gpg: no valid OpenPGP data found.

gpg: decrypt_message failed: Unknown system error

The command I am running on Linux is

/usr/bin/gpg --batch --passphrase myphrase -o '/myfolder/file.csv' -d '/myfolder/file.csv.exe'

This command is part of a Perl module that I wrote for other projects. It is working with no issues for everything else. This is the only file I am having issues with.

Please advise.


Solution

  • Self-decrypting messages (thus being wrapped in an executable) are not specified in OpenPGP, and not supported by GnuPG. Tell the sender who encrypted the file he should send you standard OpenPGP messages instead.

    Self-decrypting messages are a horrible idea anyway. You receive a message, and cannot really be sure where it came from. To read it, you're required to execute software from an unknown source which could contain pretty much anything, especially malicious code.