Bad key - decrypting armoured symmetric message

Geo (DoD9) geo at dod9.net
Fri Feb 10 15:01:29 CET 2006


GPG does not decrypt my armoured symmetric messages from STDIN it gives
'Bad key' error, but it decrypts the same message if supplied from a
file, is there a problem here or a reason why I cannot input an armoured
symmetric message on the STDIN and provide a password and get back
cleartext?

It seems the erronous scenario does not have the extra :compressed
packet and :literal data packet log messages, what significance this is
I am not sure, any help would be appreciated.

See below for example (the passphrase is 'a' and the message 'Hello!'):


gpg (GnuPG) 1.4.2

Supported algorithms:
Pubkey: RSA, RSA-E, RSA-S, ELG-E, DSA
Cipher: 3DES, CAST5, BLOWFISH, AES, AES192, AES256, TWOFISH
Hash: MD5, SHA1, RIPEMD160, SHA256, SHA384, SHA512
Compression: Uncompressed, ZIP, ZLIB, BZIP2

C:\data\work\docs>gpg -vvac
gpg: using cipher CAST5
gpg: writing to stdout
Hello!
^Z
-----BEGIN PGP MESSAGE-----
Version: GnuPG v1.4.2 (MingW32)

jA0EAwMCEBfNHm+FYa9gyR4qiZadhiuMYirc+ZtnmjrCx46gWBfcD3bWYl8cE+s=
=G4bz
-----END PGP MESSAGE-----

-NOTE I NOW COPY PGP MESSAGE INTO c.txt (through notepad)

C:\data\work\docs>gpg -vva
gpg: Go ahead and type your message ...
-----BEGIN PGP MESSAGE-----
gpg: armor: BEGIN PGP MESSAGE
Version: GnuPG v1.4.2 (MingW32)
gpg: armor header: Version: GnuPG v1.4.2 (MingW32)

jA0EAwMCEBfNHm+FYa9gyR4qiZadhiuMYirc+ZtnmjrCx46gWBfcD3bWYl8cE+s=
=G4bz
:symkey enc packet: version 4, cipher 3, s2k 3, hash 2
        salt 1017cd1e6f8561af, count 96
gpg: CAST5 encrypted data
:encrypted data packet:
        length: 30
gpg: encrypted with 1 passphrase
gpg: decryption failed: bad key

C:\data\work\docs>gpg -vva<c.txt
gpg: armor: BEGIN PGP MESSAGE
gpg: armor header: Version: GnuPG v1.4.2 (MingW32)
:symkey enc packet: version 4, cipher 3, s2k 3, hash 2
        salt 1017cd1e6f8561af, count 96
gpg: CAST5 encrypted data
:encrypted data packet:
        length: 30
gpg: encrypted with 1 passphrase
:compressed packet: algo=1
:literal data packet:
        mode b (62), created 1139537370, name="",
        raw data: 8 bytes
gpg: original file name=''
Hello!
gpg: decryption okay
gpg: WARNING: message was not integrity protected



More information about the Gnupg-users mailing list