Discussion:
How to decrypt symmetric ciphertext without files?
(too old to reply)
Dave U. Random
2013-12-01 14:44:22 UTC
Permalink
I know how to get it done with files, that's easy.

What I want is to be able to use the command line to get gpg going,
paste the ciphertext and the pass-phrase in and get the plaintext
on screen.

I am not starting out with a file on my computer. I just have the
ciphertext available for pasting.

Sounds like it should be simple, but I'm not having luck with
trying to get it done. I've tried a bunch of different command line
combinations, but I must be missing something. Any suggestions?
hymie!
2013-12-01 15:18:51 UTC
Permalink
In our last episode, the evil Dr. Lacto had captured our hero,
Post by Dave U. Random
What I want is to be able to use the command line to get gpg going,
paste the ciphertext and the pass-phrase in and get the plaintext
on screen.
I assume you're referring to a Unix machine. There's a trick.

$ cat | gpg
<paste your text here>

You should be prompted for the passphrase. DO NOT TYPE IT.

Hit ctrl-D

There will be no obvious response. Now type your passphrase.

--hymie! http://lactose.homelinux.net/~hymie ***@lactose.homelinux.net
-------------------------------------------------------------------------------
Nomen Nescio
2013-12-02 03:40:31 UTC
Permalink
Post by hymie!
In our last episode, the evil Dr. Lacto had captured our hero,
Post by Dave U. Random
What I want is to be able to use the command line to get gpg going,
paste the ciphertext and the pass-phrase in and get the plaintext
on screen.
I assume you're referring to a Unix machine.
Actually, no. It's a Windows Vista box.
Post by hymie!
There's a trick.
$ cat | gpg
<paste your text here>
You should be prompted for the passphrase. DO NOT TYPE IT.
Hit ctrl-D
There will be no obvious response. Now type your passphrase.
There's a similar sequence of actions in Windows. I'm just not getting the combination right. I enter gpg -d<enter> and then if I enter the ciphertext I get the reply

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

I never got to enter the key. If I just enter the key first I get
nohing, if I the enter the ciphertext I get the above again.

I'm clearly just missing some part of the proper sequence, but I've
looked and I can't find anything about how to do what I want.
Arthur T.
2013-12-02 05:13:21 UTC
Permalink
Post by Nomen Nescio
There's a similar sequence of actions in Windows. I'm just not getting the combination right. I enter gpg -d<enter> and then if I enter the ciphertext I get the reply
gpg: encrypted with 1 passphrase
gpg: decryption failed: bad key
I never got to enter the key. If I just enter the key first I get
nohing, if I the enter the ciphertext I get the above again.
Some trial and error got decrypting from the console to work for
me. See if it works for you, too:

The clipboard must have the ascii-armored encrypted text, BUT it
must NOT have the final line. Repeat, It MUST NOT have the line of
dashes surrounding END PGP MESSAGE.

Issue
gpg -d

Paste the encrypted text. If it does not include the final CRLF,
hit <Enter>. GPG replies something along the lines of:

gpg: CAST5 encrypted data
Enter passphrase:

Enter the password and hit <Enter>. GPG replies:

gpg: encrypted with 1 passphrase

Hit Ctrl-Z and <Enter>. The decrypted text should then show up.

When I had the whole thing (including that last line) in my
clipboard, I had the same problem that you did. But I noticed that
the GPG messages came out without that last line showing up. So I
experimented.
--
Arthur T. - ar23hur "at" intergate "dot" com
Nomen Nescio
2013-12-02 09:11:27 UTC
Permalink
Post by Arthur T.
Post by Nomen Nescio
There's a similar sequence of actions in Windows. I'm just not getting the combination right. I enter gpg -d<enter> and then if I enter the ciphertext I get the reply
gpg: encrypted with 1 passphrase
gpg: decryption failed: bad key
I never got to enter the key. If I just enter the key first I get
nohing, if I the enter the ciphertext I get the above again.
Some trial and error got decrypting from the console to work for
The clipboard must have the ascii-armored encrypted text, BUT it
must NOT have the final line. Repeat, It MUST NOT have the line of
dashes surrounding END PGP MESSAGE.
Issue
gpg -d
Paste the encrypted text. If it does not include the final CRLF,
gpg: CAST5 encrypted data
gpg: encrypted with 1 passphrase
Hit Ctrl-Z and <Enter>. The decrypted text should then show up.
When I had the whole thing (including that last line) in my
clipboard, I had the same problem that you did. But I noticed that
the GPG messages came out without that last line showing up. So I
experimented.
Bingo! Thank you Arthur T. That worked. I had tried all sorts of
combinatins but it had never ccurred to me to leave off the formal
ending of the gpg message. Thanks again.

Loading...