Message not decrypting, Decryption failed

Decryption failed! Code = 17

In case the secret key required to decrypt an OpenPGP message can not be found you will see the following error message:

Decryption failed! (No secret key) Code = 17

GPGServices_decryption_failed_code___17.png

Possible causes can be:

  1. wrong public key used for encryption
    When intentionally or by accident you (or a third party) create more than one sec/pub key pair for your mail address, this can lead to situations, in which the actual key being used by you, is not the public key your contacts may have downloaded from the key server.
    Should you want to clean up old keys, please refer to the KB how to revoke unused keys.

  2. secret key required for decryption no longer in your key-ring
    You may also indeed no longer be in possession of the secret key, needed to decrypt the message. The secret key could have been accidentally deleted. We've already had users report they bought a new computer and forgot to move their key-ring to the new machine. If you still have the old computer, transfer your keyring to your new machine.

Decryption failed! Code = 0

Code = 0 means that no specific error could be attributed. In that case please follow these steps and include the terminal output in your error report:

  1. open Terminal.app
  2. enter 'gpg2' and press enter
  3. paste the OpenPGP message you are trying to decrypt form
    '-----BEGIN PGP MESSAGE-----' to
    '-----END PGP MESSAGE-----' into the terminal
  4. press enter

Verify public keys with your contact

It is highly recommended, to exchange public keys with your contact (if you haven't already). Then verify and sign each others public keys as described in this KB-article. By doing that, you also ensure, that your contact is using the correct public key for encryption.