Is passphrase correct?

Peter Lebbing peter at digitalbrains.com
Fri Mar 23 13:19:26 CET 2018


On 22/03/18 22:24, MyCraigs List via Gnupg-users wrote:
> In other words- I'm trying to make sure I haven't forgotten the
> passphrase and need a way to test it...preferably using command line
> (Linux).

--8<---------------cut here---------------start------------->8---
$ echo test | gpg -r '<peter at digitalbrains.com>' -e | gpg -d
gpg: peter at digitalbrains.com: Verified X signatures in the past 19 months.
     Encrypted Y messages in the past 15 months.
gpg: encrypted with 2048-bit RSA key, ID 26F7563E73A33BEE, created
2009-11-12
      "Peter Lebbing <peter at digitalbrains.com>"
test
--8<---------------cut here---------------end--------------->8---

The fact that "test" shows up at the end proves that I could decrypt the
message, and that proves my passphrase was correct.

Note that I used my e-mail address as the "recipient" of the encrypted
message, but this might match multiple keys. Use your fingerprint to
uniquely select the correct key to check the passphrase for. The long
key ID is an okayish method of specifying it as well. Don't use the
short key ID.

--8<---------------cut here---------------start------------->8---
$ gpg --keyid-format long -k '<peter at digitalbrains.com>'
pub   rsa1024/ADD8D49B3E4FCA14 2006-03-31 [SC] [revoked: 2009-11-12]
      F8D07102A4F52BD8DC1A7786ADD8D49B3E4FCA14
uid                 [ revoked] Peter Lebbing <peter at digitalbrains.com>

pub   rsa2048/AC46EFE6DE500B3E 2009-11-12 [C] [expires: 2019-10-13]
      8FA94E79AD6AB56EE38CE5CBAC46EFE6DE500B3E
uid                 [  full  ] Peter Lebbing <peter at digitalbrains.com>
sub   rsa2048/969E018FDE6CDCA1 2009-11-12 [S] [expires: 2019-10-13]
sub   rsa2048/26F7563E73A33BEE 2009-11-12 [E] [expires: 2019-10-13]
--8<---------------cut here---------------end--------------->8---

The fingerprint is the really long hexadecimal number below the "pub"
line of the key you're looking for. The long key ID is the number after
"pub rsa2048/", and actually is just the last 16 digits of the fingerprint.

HTH,

Peter.

-- 
I use the GNU Privacy Guard (GnuPG) in combination with Enigmail.
You can send me encrypted mail if you want some privacy.
My key is available at <http://digitalbrains.com/2012/openpgp-key-peter>

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: OpenPGP digital signature
URL: <https://lists.gnupg.org/pipermail/gnupg-users/attachments/20180323/90618a84/attachment.sig>


More information about the Gnupg-users mailing list