MacGPG2: encrypt/sign failed

Zac Shepherd's Avatar

Zac Shepherd

20 Jul, 2017 11:43 AM

I got “encrypt/sign failed code 0” when trying to encrypt a message

encrypted message

macOS           10.10.5     14F2411
GPG Suite       2016.10     21  
GPGMail -
GPG Keychain    1.3.2       1245
GPGServices     1.11        916 
MacGPG2         2.0.30      884 
GPGPreferences  2.0.1       902 
Libmacgpg       0.7         775 
pinentry        0.9.7       4
  1. Support Staff 1 Posted by Steve on 20 Jul, 2017 11:44 AM

    Steve's Avatar

    Hi Zac,

    welcome to the GPGTools support platform. Sorry you are having problems using GPG Suite.

    Is it intentional that you have no GPGMail on your machine? How are you trying to encrypt the message? Can you please give exact steps.

    All the best,

  2. 2 Posted by Zac Shepherd on 21 Jul, 2017 08:09 AM

    Zac Shepherd's Avatar

    I use the command 'OpenPGP: Encrypt' to encrypt messages, it has worked in
    the past so not sure what's gone wrong.


  3. Support Staff 3 Posted by Steve on 21 Jul, 2017 03:32 PM

    Steve's Avatar

    First, let's check if your key is ok:

    1. open GPG Keychain
    2. double click your sec/pub key
    3. create a screenshot of the key tab (⇧⌘4 + drag w mouse)
    4. create a screenshot of the subkey tab
    5. attach both screenshots to your discussion by visiting it in your browser

    Should your key have expired, please re-new the expiration date.

    Should your subkey be expired, please create a new subkey.

    1. navigate to the subkey tab
    2. click the "+" button below
    3. confirm with "Generate subkey"

    After that send a signed and encrypted test mail to yourself. Are you able to decrypt and verify the signature successfully?

    In case your key resides on the public key servers, don't forget to upload your updated key, so that the changes are reflected on the key servers.

    The error message "Decryption failed! Code = 0" indicateds gpg was unable to determine a specific cause for the problem.

    Let’s test gpg encryption and decryption in the terminal:

    1. click spotlight at the top right menubar and type 'terminal'
    2. open by pressing enter
    3. in the new terminal window
    4. paste the following without the ' 'gpg2 -ae --default-recipient-self <<<OK'
    5. a PGP message will be created
    6. paste the following without the ' 'gpg2 -ae --default-recipient-self <<<OK | gpg2 -d'
    7. you will be asked for your password (if your password is still in the cache or stored in the macOS keychain you will not be asked)
    8. when everything is fine you should see the word "OK" in your terminal - in that case decryption worked as expected

    Best regards,

  4. 4 Posted by Zac Shepherd on 21 Jul, 2017 04:28 PM

    Zac Shepherd's Avatar

    I had an expired subkey, your debugging steps helped me to find. Thanks very much.

  5. Support Staff 5 Posted by Steve on 21 Jul, 2017 04:37 PM

    Steve's Avatar

    Perfect. Glad, this is solved for you.

    We have a ticket to provide better information when a subkey expires. I connected this discussion with the existing ticket. That means, should this discussion get closed, it will be re-opened as soon as the ticket is closed. That way you'll stay in the loop and get notified as soon as we have news. Feel free to open a new discussions should you run into further problems or need assistance.

    I'm closing this discussion. Should you need further assistance or have questions you can re-open this discussion here or open a new one any time.

    Best, steve

  6. Steve closed this discussion on 21 Jul, 2017 04:37 PM.

  7. Steve closed this discussion on 27 Aug, 2018 12:36 PM.

Comments are currently closed for this discussion. You can start a new one.

Keyboard shortcuts


? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac