GPG MAC decrypt symmetric not working gpg: decryption failed: Bad session key

Stefano's Avatar


27 Jul, 2018 11:42 AM

Hi all,

I've encryptd some files in august 2017, now i need to get the content, it's a symmetric encryption but when i do "gpg -d file.enc" i get

gpg: AES256 encrypted data
gpg: encrypted with 1 passphrase
gpg: decryption failed: Bad session key

it's not asking me the passphrase, but i'm not sure that it's that the problem (btw, how do i disable the agnt in pgp2?).
googling it may be that i did the encryption with gpg 1.4 and now things are not compatible.
any suggestion? i do need the content of that files..

  1. Support Staff 1 Posted by Steve on 29 Jul, 2018 10:20 AM

    Steve's Avatar

    Hi Stefano,

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

    Can you restart your mac and then download and install our latest hotfix GPG Suite and see if that solves your problem. The nightly comes with MacGPG 2.2.9 which has additional fixes. We'll have to see if they are related to your specific issue.

    Could you also please test, if you are able to encrypt a new file and then decrypt that file?

    What happens if you try to decrypt the file in question using GPGServices? Can you post a screenshot of the error message you are seeing if any please.

    All the best,

    Disclaimer: This is a development version which has not been thoroughly tested yet - bugs or crashes are to be expected. Thanks for helping us test.

  2. Steve closed this discussion on 29 Jul, 2018 10:20 AM.

  3. Steve re-opened this discussion on 29 Jul, 2018 10:20 AM

  4. 2 Posted by Stefano on 30 Jul, 2018 09:17 AM

    Stefano's Avatar

    I installed it but nothing change.
    is this the latest version

    stefano@$ gpg --version
    gpg (GnuPG/MacGPG2) 2.2.9
    libgcrypt 1.8.3

    -- gpg --output doc.gpg --symmetric test.txt
    gpg -d doc.gpg

    works perfeclty (these file are symmetric encrypted)

    for gpg services it says .. failed to decrypting .. Decryption failed code = 152

  5. 3 Posted by Stefano on 02 Aug, 2018 07:40 AM

    Stefano's Avatar

    any idea of what i can do? i do need to decrypt that files..

  6. Support Staff 4 Posted by Steve on 02 Aug, 2018 07:12 PM

    Steve's Avatar

    Can you try to decrypt using the following options:

    --status-fd 2 --debug-level expert

    and share the output with us.

  7. 5 Posted by Stefano on 06 Aug, 2018 07:27 AM

    Stefano's Avatar

    stefano@~/Downloads/words$ gpg -d --status-fd 2 --debug-level expert encfile.1.gpg
    gpg: enabled debug flags: packet filter cache memstat trust extprog
    gpg: DBG: parse_packet(iob=1): type=3 length=13 (parse.mainproc.c.1421)
    gpg: AES256 encrypted data
    [GNUPG:] PINENTRY_LAUNCHED 2116 unknown 0.9.7 ? ? ?
    gpg: DBG: parse_packet(iob=1): type=18 length=125 (new_ctb) (parse.mainproc.c.1421)
    gpg: encrypted with 1 passphrase
    gpg: DBG: cleared passphrase cached with ID: SB700324FD10ED029
    [GNUPG:] PINENTRY_LAUNCHED 2117 unknown 0.9.7 ? ? ?
    gpg: decryption failed: Bad session key
    gpg: keydb: handles=0 locks=0 parse=0 get=0
    gpg: build=0 update=0 insert=0 delete=0
    gpg: reset=0 found=0 not=0 cache=0 not=0
    gpg: kid_not_found_cache: count=0 peak=0 flushes=0
    gpg: sig_cache: total=0 cached=0 good=0 bad=0
    gpg: random usage: poolsize=600 mixed=0 polls=0/0 added=0/0
                  outmix=0 getlvl1=0/0 getlvl2=0/0
    gpg: rndjent stat: collector=0x0000000000000000 calls=0 bytes=0
    gpg: secmem usage: 64/32768 bytes in 1 blocks

  8. Support Staff 6 Posted by Steve on 09 Aug, 2018 12:00 PM

    Steve's Avatar

    Hi Stefano,

    were you asked for your password and if so, is there anything special about it? Longer than 80 characters, includes special characters or something like that?

    The gpg-agent is neccessary for gpg2 to run and there is no way to disable it.


Reply to this discussion

Internal reply

Formatting help / Preview (switch to plain text) No formatting (switch to Markdown)

Attaching KB article:


Attached Files

You can attach files up to 10MB

If you don't have an account yet, we need to confirm you're human and not a machine trying to post spam.

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