1

I used GnuPG to create an RSA key pair xxx@xxx.com. When I created it, I set an empty passphrase.

$ gpg --gen-key

When generating the key pair, it prompts: "You need a passphrase to...", where I pressed enter twice, and it can success list public key and secret key:

 $ gpg --gpg --list-keys 

Now I want to sign yyy@yyy.com with xxx@xxx.com's private key.

I have tried to only press enter, but it did not work and raises an error instead:

Invalid passphrase: please try again

Please enter the passphrase to unlock the secret key.

How to bypass the error?

Jens Erat
  • 37,523
  • 16
  • 80
  • 96
abbypan
  • 158
  • 1
  • 11
  • `null` is usually considered something undefined, which the empty string is not. For me, creating such a key worked fine. What operating system are you using, what terminal? – Jens Erat May 25 '15 at 09:27
  • debian 7, putty remote login – abbypan Jun 03 '15 at 01:52
  • I fear you're passing a `\r\n` to GnuPG, which this reads as the passphrase being `\r`.But I'm sorry, I can't tell you how to remove this. For testing, use some command line editor to save a new line to a file and look for `\r` characters (the `file` utility might help here, or `hexdump`). – Jens Erat Jun 03 '15 at 07:03

0 Answers0