Page MenuHome GnuPG

Bad key message when decrypting a message encrypted with a symmetric cipher
Closed, ResolvedPublic

Details

Version
1.4.9

Event Timeline

When using GnuPG 1.4.9 for Windows(official build), I cannot paste an
encrypted message that was created using a symmetric cipher and decrypt. I
receive a bad key messages as shown in the example below which uses the
password "test".


C:\Program Files\GNU\GnuPG>gpg -ac
hello
^Z
-----BEGIN PGP MESSAGE-----
Version: GnuPG v1.4.9 (MingW32)

jA0EAwMCikaxanj8GbhgyR0OnuXQ9WqTt4ajaTAS3+x0u8Bxe6sXk2Vi1nF/cg==

P9nx

-----END PGP MESSAGE-----

C:\Program Files\GNU\GnuPG>gpg -d
-----BEGIN PGP MESSAGE-----
Version: GnuPG v1.4.9 (MingW32)

jA0EAwMCikaxanj8GbhgyR0OnuXQ9WqTt4ajaTAS3+x0u8Bxe6sXk2Vi1nF/cg==

P9nx

gpg: CAST5 encrypted data
gpg: encrypted with 1 passphrase
gpg: decryption failed: bad key

I have no problems decrypting this message, thus it must be a c+pproblem on your
site. Use the option
--output FILE
to direct the ciphertext to a file so it does not get in the way while entering
the passphrase.

That was all done from the command line in Windows XP, exactly as shown.
Adding the output line defeats the purpose for me, but it still does the same
thing even if I add the output line; no output file is produced and I get the
same message.


C:\Program Files\GNU\GnuPG>gpg --output test.txt -d
-----BEGIN PGP MESSAGE-----
Version: GnuPG v1.4.9 (MingW32)

jA0EAwMCikaxanj8GbhgyR0OnuXQ9WqTt4ajaTAS3+x0u8Bxe6sXk2Vi1nF/cg==

P9nx

gpg: CAST5 encrypted data
gpg: encrypted with 1 passphrase
gpg: decryption failed: bad key

I'm sorry, I believe that you wanted me to do this on the other end; when
encrypting. I can sucessfully use -d on the created output file, but it seems
*to me* that the funtionality allowing to paste to a windows command line
program(GnuPG), in the windows command line, especially when I am able to do
the same thing in GnuPG when not using a symmetric cipher, should be expected.

This only occurs in Windows, not in Linux.

gpg does not work for the end of the data but starts decryption as soon as
possible. Depending on the terminal (console) which may lead to copy+paste
confusion.

werner claimed this task.

I noticed that the status of this issue was changed to resolved and was
wondering if that meant that it will work in a future version of gnupg or if
it means that nothing will/can be done for the Windows version, i.e. a disk
write will be required each time, and the issue is just closed?

[In may previous message I meant "gpg does not _wait_ for the end ..."]

Because the data and the passphrase are both read from the console it is quite
possible tha they get intermixed during c+p. We can't do anything about it. IF
you don't care about possible security implications you may use the option

gpg --passphrase "test".