Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

5
  • If the input is no valid OpenPGP message, GnuPG fails with an error message. Try investigating the file with pgpdump or gpg --list-packets. Are you running the very specific command, or do you have any further redirects applied (ie. discarding STDERR)? Commented Aug 20, 2016 at 18:18
  • 1
    "decrypt an unencrypted file".. this is just nonsense. do you have a source on this? Commented Aug 20, 2016 at 19:57
  • Have you tried encrypting with your private key? That's the correct use... Commented Aug 20, 2016 at 20:50
  • 1
    @Ben You can't encrypt with a private key. (With some algorithms you can carry out the encryption primitive with the private/public keys swapped, but not all of them, and even when it's mathematically possible, it's pointless.) Don't confuse encryption with signing. Signing is not encryption with a private key. Read tim's answer. Commented Aug 20, 2016 at 21:32
  • My mistake. I had the misunderstanding that signing was encrypting a digest of of a message using the private key. I didn't remember it's actually a decryption operation. Very informative answer! Although now I'm curious: without the public key, can this operation be reversed? So wouldn't that be a (useless, since the key is known) form of encryption in some sense? I know it's irrelevant to the specific question... Commented Aug 20, 2016 at 21:46