cannot decrypt file symmetric encrypted

vedaal at nym.hush.com vedaal at nym.hush.com
Wed Aug 8 03:35:29 CEST 2018


On 8/2/2018 at 3:01 PM, "Dirk Gottschalk via Gnupg-users" <gnupg-users at gnupg.org> wrote:

>Am Donnerstag, den 02.08.2018, 14:11 +0200 schrieb Stefano
>Tranquillini:
>> Hi all,
>> last year I encrypted some files, today i tried to decrypt them 
>but
>> the
>> decryption fails
>
>> stefano@~/Downloads/words$ gpg -d words.1.gpg
>> gpg: AES256 encrypted data
>> gpg: encrypted with 1 passphrase
>> gpg: decryption failed: Bad session key

...

>Are you sure you used the correct passphrase to decrypt?

=====

It was probably not the correct passphrase.
The error that gpg2 gives when entering the wrong passphrase for a symmetrically encrypted message is exactly:  

gpg: decryption failed: Bad session key


This is the same whether you are off for even 1 character of the passphrase, or even if you just press 'enter' without a passphrase at all.


Here is a sample symmetrically encrypted message:

-----BEGIN PGP MESSAGE-----
Version: GnuPG v1
Comment:  Passphrase: sss

jA0EBwMCPJYegoCPRBRg0jkBnZym0Pr+ggBpBJYtHlYJgf90SL6YbWa1vcbLdl7H
jwxeR5cIFoNhytyUIFxdvrLNP59qkqzLKkI=
=pHIB
-----END PGP MESSAGE-----


First enter the correct passphrase,  sss

gpg (V1 and V2)  decrypts it as is should be.


now enter just ss or anything except the correct passphrase, or just press enter, and you get:

gpg: decryption failed: bad key   (when using Version 1.4.x)

gpg: decryption failed: Bad session key  (when using Version 2.x)


(Something to do with the string-to-key formation.

When the passphrase is off, the 'key' generated from it, is wrong, and when that wrong 'key' is used to attempt decryption, 
gpg rightfully gives an error message that the 'key' is bad.

maybe worthy of a note in the FAQ ...  )


vedaal





More information about the Gnupg-users mailing list