[GH-ISSUE #477] gpg2john outputs some gecos data matched with wrong key data #191

Closed
opened 2026-10-14 02:55:44 +07:00 by bsakaguchi · 12 comments
Owner

Originally created by @magnumripper on GitHub (Jan 9, 2014).
Original GitHub issue: https://github.com/openwall/john/issues/477

Originally assigned to: @kholia on GitHub.

As discussed in https://github.com/magnumripper/JohnTheRipper/pull/442#issuecomment-31308369

Originally created by @magnumripper on GitHub (Jan 9, 2014). Original GitHub issue: https://github.com/openwall/john/issues/477 Originally assigned to: @kholia on GitHub. As discussed in https://github.com/magnumripper/JohnTheRipper/pull/442#issuecomment-31308369
bsakaguchi 2026-10-14 02:55:44 +07:00
  • closed this issue
  • added the
    bug
    label
Author
Owner

@jfoug commented on GitHub (Nov 24, 2014):

Can we get some examples please? I did a little testing, and saw no problems, BUT this format has SOOOOOOO many subtypes, that a bug like this can likely be buried down deep in a single subclass (or 2).

<!-- gh-comment-id:64284138 --> @jfoug commented on GitHub (Nov 24, 2014): Can we get some examples please? I did a little testing, and saw no problems, BUT this format has SOOOOOOO many subtypes, that a bug like this can likely be buried down deep in a single subclass (or 2).
Author
Owner

@magnumripper commented on GitHub (Nov 24, 2014):

Just create several keys in one file and then dump it

$ gpg --homedir . --s2k-mode 1 --gen-key
gpg: WARNING: unsafe permissions on homedir `.'
gpg (GnuPG) 1.4.18; Copyright (C) 2014 Free Software Foundation, Inc.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

gpg: keyring `./secring.gpg' created
gpg: keyring `./pubring.gpg' created
Please select what kind of key you want:
   (1) RSA and RSA (default)
   (2) DSA and Elgamal
   (3) DSA (sign only)
   (4) RSA (sign only)
Your selection? 1
RSA keys may be between 1024 and 4096 bits long.
What keysize do you want? (2048) 
Requested keysize is 2048 bits   
Please specify how long the key should be valid.
         0 = key does not expire
      <n>  = key expires in n days
      <n>w = key expires in n weeks
      <n>m = key expires in n months
      <n>y = key expires in n years
Key is valid for? (0) 
Key does not expire at all
Is this correct? (y/N) y

You need a user ID to identify your key; the software constructs the user ID
from the Real Name, Comment and Email Address in this form:
    "Heinrich Heine (Der Dichter) <heinrichh@duesseldorf.de>"

Real name: name1
Email address: mail1@com
Comment: comment1       
You selected this USER-ID:
    "name1 (comment1) <mail1@com>"

Change (N)ame, (C)omment, (E)mail or (O)kay/(Q)uit? o
You need a Passphrase to protect your secret key.    

You don't want a passphrase - this is probably a *bad* idea!
I will do it anyway.  You can change your passphrase at any time,
using this program with the option "--edit-key".

We need to generate a lot of random bytes. It is a good idea to perform
some other action (type on the keyboard, move the mouse, utilize the
disks) during the prime generation; this gives the random number
generator a better chance to gain enough entropy.
..+++++
.....+++++
We need to generate a lot of random bytes. It is a good idea to perform
some other action (type on the keyboard, move the mouse, utilize the
disks) during the prime generation; this gives the random number
generator a better chance to gain enough entropy.
.......+++++
+++++
gpg: ./trustdb.gpg: trustdb created
gpg: key 04CCC3BD marked as ultimately trusted
public and secret key created and signed.

gpg: checking the trustdb
gpg: 3 marginal(s) needed, 1 complete(s) needed, PGP trust model
gpg: depth: 0  valid:   1  signed:   0  trust: 0-, 0q, 0n, 0m, 0f, 1u
pub   2048R/04CCC3BD 2014-11-24
      Key fingerprint = 6C1C 77D0 A16E A763 EADE  2FB6 4929 E937 04CC C3BD
uid                  name1 (comment1) <mail1@com>
sub   2048R/D0A0EC6B 2014-11-24


$ gpg --homedir . --s2k-mode 1 --gen-key
gpg: WARNING: unsafe permissions on homedir `.'
gpg (GnuPG) 1.4.18; Copyright (C) 2014 Free Software Foundation, Inc.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Please select what kind of key you want:
   (1) RSA and RSA (default)
   (2) DSA and Elgamal
   (3) DSA (sign only)
   (4) RSA (sign only)
Your selection? 2
DSA keys may be between 1024 and 3072 bits long.
What keysize do you want? (2048) 
Requested keysize is 2048 bits   
Please specify how long the key should be valid.
         0 = key does not expire
      <n>  = key expires in n days
      <n>w = key expires in n weeks
      <n>m = key expires in n months
      <n>y = key expires in n years
Key is valid for? (0) 
Key does not expire at all
Is this correct? (y/N) y

You need a user ID to identify your key; the software constructs the user ID
from the Real Name, Comment and Email Address in this form:
    "Heinrich Heine (Der Dichter) <heinrichh@duesseldorf.de>"

Real name: name2
Email address: mail2@com
Comment: comment2       
You selected this USER-ID:
    "name2 (comment2) <mail2@com>"

Change (N)ame, (C)omment, (E)mail or (O)kay/(Q)uit? o
You need a Passphrase to protect your secret key.    

We need to generate a lot of random bytes. It is a good idea to perform
some other action (type on the keyboard, move the mouse, utilize the
disks) during the prime generation; this gives the random number
generator a better chance to gain enough entropy.
gpg: WARNING: some OpenPGP programs can't handle a DSA key with this digest size
....+++++++++++++++.+++++.+++++...+++++..+++++...++++++++++..+++++.+++++.+++++++++++++++....+++++++++++++++.++++++++++++++++++++.+++++..++++++++++++++++++++.+++++...>+++++..............................................................................................................................................................................................................................................................+++++
We need to generate a lot of random bytes. It is a good idea to perform
some other action (type on the keyboard, move the mouse, utilize the
disks) during the prime generation; this gives the random number
generator a better chance to gain enough entropy.
+++++.+++++..++++++++++.++++++++++..+++++.++++++++++.+++++++++++++++.++++++++++++++++++++.++++++++++.++++++++++.+++++..+++++..+++++..++++++++++++++++++++++++++++++>+++++.+++++.......>+++++..................................................................................................................................+++++^^^
gpg: key 5EA194D7 marked as ultimately trusted
public and secret key created and signed.

gpg: checking the trustdb
gpg: 3 marginal(s) needed, 1 complete(s) needed, PGP trust model
gpg: depth: 0  valid:   2  signed:   0  trust: 0-, 0q, 0n, 0m, 0f, 2u
pub   2048D/5EA194D7 2014-11-24
      Key fingerprint = 21AD 2B64 09F4 AE8B DAC4  56B7 1C3D 307B 5EA1 94D7
uid                  name2 (comment2) <mail2@com>
sub   2048g/3AE427D7 2014-11-24


$ gpg --homedir . --s2k-mode 1 --gen-key
gpg: WARNING: unsafe permissions on homedir `.'
gpg (GnuPG) 1.4.18; Copyright (C) 2014 Free Software Foundation, Inc.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Please select what kind of key you want:
   (1) RSA and RSA (default)
   (2) DSA and Elgamal
   (3) DSA (sign only)
   (4) RSA (sign only)
Your selection? 3
DSA keys may be between 1024 and 3072 bits long.
What keysize do you want? (2048) 
Requested keysize is 2048 bits   
Please specify how long the key should be valid.
         0 = key does not expire
      <n>  = key expires in n days
      <n>w = key expires in n weeks
      <n>m = key expires in n months
      <n>y = key expires in n years
Key is valid for? (0) 
Key does not expire at all
Is this correct? (y/N) y

You need a user ID to identify your key; the software constructs the user ID
from the Real Name, Comment and Email Address in this form:
    "Heinrich Heine (Der Dichter) <heinrichh@duesseldorf.de>"

Real name: name3
Email address: mail3@com
Comment: comment3       
You selected this USER-ID:
    "name3 (comment3) <mail3@com>"

Change (N)ame, (C)omment, (E)mail or (O)kay/(Q)uit? o
You need a Passphrase to protect your secret key.    

We need to generate a lot of random bytes. It is a good idea to perform
some other action (type on the keyboard, move the mouse, utilize the
disks) during the prime generation; this gives the random number
generator a better chance to gain enough entropy.
gpg: WARNING: some OpenPGP programs can't handle a DSA key with this digest size
.+++++....+++++..+++++.....++++++++++.+++++.+++++.+++++++++++++++.++++++++++.+++++...++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++.++++++++++>+++++.........................................................................+++++
gpg: key B6A81AC3 marked as ultimately trusted
public and secret key created and signed.

gpg: checking the trustdb
gpg: 3 marginal(s) needed, 1 complete(s) needed, PGP trust model
gpg: depth: 0  valid:   3  signed:   0  trust: 0-, 0q, 0n, 0m, 0f, 3u
pub   2048D/B6A81AC3 2014-11-24
      Key fingerprint = 021B 28B5 7C34 5D84 6969  6DD1 5AA1 6F8F B6A8 1AC3
uid                  name3 (comment3) <mail3@com>

Note that this key cannot be used for encryption.  You may want to use
the command "--edit-key" to generate a subkey for this purpose.


$ ../run/gpg2john secring.gpg 
secring.gpg contains plain RSA secret key packet!
secring.gpg contains plain RSA secret key packet!
name1:$gpg$*17*54*2048*baf72fff3eea734bf85cc53988854e87773b23a1733e633899e5db3d78d8564fb101cf4c3505e91b7e5e27b645cbc5ca526cb542d48c*1*254*2*3*8*1cd4b92bc44fce11*0*375426c5ad3dc19f:::(comment1) <mail1@com>::secring.gpg
name2:$gpg$*16*65*2048*63de944dc2c3d87d99b694d7cdd20c0052caa9984b1f5f203978d26234af6181c93bc37c7ea2b5a5d6622afd68a037f165702f36596cded92fafc270a396b776c5*1*254*2*3*8*0df0c4d96317d620*0*375426c5ad3dc19f:::(comment2) <mail2@com>::secring.gpg
name2:$gpg$*17*54*2048*29c4568b3531b898e5899ede969ba96ade45560eb90b848ca33f93b8fd1fd02adcc793497225a893e469dd66d1da12469414b4edf5c3*1*254*2*3*8*792bd800cb9f7589*0*63de52f715d286c5:::(comment2) <mail2@com>::secring.gpg

It lists name2 (comment2 mail2 etc) twice but never name3 etc.

<!-- gh-comment-id:64287434 --> @magnumripper commented on GitHub (Nov 24, 2014): Just create several keys in one file and then dump it ``` $ gpg --homedir . --s2k-mode 1 --gen-key gpg: WARNING: unsafe permissions on homedir `.' gpg (GnuPG) 1.4.18; Copyright (C) 2014 Free Software Foundation, Inc. This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. gpg: keyring `./secring.gpg' created gpg: keyring `./pubring.gpg' created Please select what kind of key you want: (1) RSA and RSA (default) (2) DSA and Elgamal (3) DSA (sign only) (4) RSA (sign only) Your selection? 1 RSA keys may be between 1024 and 4096 bits long. What keysize do you want? (2048) Requested keysize is 2048 bits Please specify how long the key should be valid. 0 = key does not expire <n> = key expires in n days <n>w = key expires in n weeks <n>m = key expires in n months <n>y = key expires in n years Key is valid for? (0) Key does not expire at all Is this correct? (y/N) y You need a user ID to identify your key; the software constructs the user ID from the Real Name, Comment and Email Address in this form: "Heinrich Heine (Der Dichter) <heinrichh@duesseldorf.de>" Real name: name1 Email address: mail1@com Comment: comment1 You selected this USER-ID: "name1 (comment1) <mail1@com>" Change (N)ame, (C)omment, (E)mail or (O)kay/(Q)uit? o You need a Passphrase to protect your secret key. You don't want a passphrase - this is probably a *bad* idea! I will do it anyway. You can change your passphrase at any time, using this program with the option "--edit-key". We need to generate a lot of random bytes. It is a good idea to perform some other action (type on the keyboard, move the mouse, utilize the disks) during the prime generation; this gives the random number generator a better chance to gain enough entropy. ..+++++ .....+++++ We need to generate a lot of random bytes. It is a good idea to perform some other action (type on the keyboard, move the mouse, utilize the disks) during the prime generation; this gives the random number generator a better chance to gain enough entropy. .......+++++ +++++ gpg: ./trustdb.gpg: trustdb created gpg: key 04CCC3BD marked as ultimately trusted public and secret key created and signed. gpg: checking the trustdb gpg: 3 marginal(s) needed, 1 complete(s) needed, PGP trust model gpg: depth: 0 valid: 1 signed: 0 trust: 0-, 0q, 0n, 0m, 0f, 1u pub 2048R/04CCC3BD 2014-11-24 Key fingerprint = 6C1C 77D0 A16E A763 EADE 2FB6 4929 E937 04CC C3BD uid name1 (comment1) <mail1@com> sub 2048R/D0A0EC6B 2014-11-24 $ gpg --homedir . --s2k-mode 1 --gen-key gpg: WARNING: unsafe permissions on homedir `.' gpg (GnuPG) 1.4.18; Copyright (C) 2014 Free Software Foundation, Inc. This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Please select what kind of key you want: (1) RSA and RSA (default) (2) DSA and Elgamal (3) DSA (sign only) (4) RSA (sign only) Your selection? 2 DSA keys may be between 1024 and 3072 bits long. What keysize do you want? (2048) Requested keysize is 2048 bits Please specify how long the key should be valid. 0 = key does not expire <n> = key expires in n days <n>w = key expires in n weeks <n>m = key expires in n months <n>y = key expires in n years Key is valid for? (0) Key does not expire at all Is this correct? (y/N) y You need a user ID to identify your key; the software constructs the user ID from the Real Name, Comment and Email Address in this form: "Heinrich Heine (Der Dichter) <heinrichh@duesseldorf.de>" Real name: name2 Email address: mail2@com Comment: comment2 You selected this USER-ID: "name2 (comment2) <mail2@com>" Change (N)ame, (C)omment, (E)mail or (O)kay/(Q)uit? o You need a Passphrase to protect your secret key. We need to generate a lot of random bytes. It is a good idea to perform some other action (type on the keyboard, move the mouse, utilize the disks) during the prime generation; this gives the random number generator a better chance to gain enough entropy. gpg: WARNING: some OpenPGP programs can't handle a DSA key with this digest size ....+++++++++++++++.+++++.+++++...+++++..+++++...++++++++++..+++++.+++++.+++++++++++++++....+++++++++++++++.++++++++++++++++++++.+++++..++++++++++++++++++++.+++++...>+++++..............................................................................................................................................................................................................................................................+++++ We need to generate a lot of random bytes. It is a good idea to perform some other action (type on the keyboard, move the mouse, utilize the disks) during the prime generation; this gives the random number generator a better chance to gain enough entropy. +++++.+++++..++++++++++.++++++++++..+++++.++++++++++.+++++++++++++++.++++++++++++++++++++.++++++++++.++++++++++.+++++..+++++..+++++..++++++++++++++++++++++++++++++>+++++.+++++.......>+++++..................................................................................................................................+++++^^^ gpg: key 5EA194D7 marked as ultimately trusted public and secret key created and signed. gpg: checking the trustdb gpg: 3 marginal(s) needed, 1 complete(s) needed, PGP trust model gpg: depth: 0 valid: 2 signed: 0 trust: 0-, 0q, 0n, 0m, 0f, 2u pub 2048D/5EA194D7 2014-11-24 Key fingerprint = 21AD 2B64 09F4 AE8B DAC4 56B7 1C3D 307B 5EA1 94D7 uid name2 (comment2) <mail2@com> sub 2048g/3AE427D7 2014-11-24 $ gpg --homedir . --s2k-mode 1 --gen-key gpg: WARNING: unsafe permissions on homedir `.' gpg (GnuPG) 1.4.18; Copyright (C) 2014 Free Software Foundation, Inc. This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Please select what kind of key you want: (1) RSA and RSA (default) (2) DSA and Elgamal (3) DSA (sign only) (4) RSA (sign only) Your selection? 3 DSA keys may be between 1024 and 3072 bits long. What keysize do you want? (2048) Requested keysize is 2048 bits Please specify how long the key should be valid. 0 = key does not expire <n> = key expires in n days <n>w = key expires in n weeks <n>m = key expires in n months <n>y = key expires in n years Key is valid for? (0) Key does not expire at all Is this correct? (y/N) y You need a user ID to identify your key; the software constructs the user ID from the Real Name, Comment and Email Address in this form: "Heinrich Heine (Der Dichter) <heinrichh@duesseldorf.de>" Real name: name3 Email address: mail3@com Comment: comment3 You selected this USER-ID: "name3 (comment3) <mail3@com>" Change (N)ame, (C)omment, (E)mail or (O)kay/(Q)uit? o You need a Passphrase to protect your secret key. We need to generate a lot of random bytes. It is a good idea to perform some other action (type on the keyboard, move the mouse, utilize the disks) during the prime generation; this gives the random number generator a better chance to gain enough entropy. gpg: WARNING: some OpenPGP programs can't handle a DSA key with this digest size .+++++....+++++..+++++.....++++++++++.+++++.+++++.+++++++++++++++.++++++++++.+++++...++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++.++++++++++>+++++.........................................................................+++++ gpg: key B6A81AC3 marked as ultimately trusted public and secret key created and signed. gpg: checking the trustdb gpg: 3 marginal(s) needed, 1 complete(s) needed, PGP trust model gpg: depth: 0 valid: 3 signed: 0 trust: 0-, 0q, 0n, 0m, 0f, 3u pub 2048D/B6A81AC3 2014-11-24 Key fingerprint = 021B 28B5 7C34 5D84 6969 6DD1 5AA1 6F8F B6A8 1AC3 uid name3 (comment3) <mail3@com> Note that this key cannot be used for encryption. You may want to use the command "--edit-key" to generate a subkey for this purpose. $ ../run/gpg2john secring.gpg secring.gpg contains plain RSA secret key packet! secring.gpg contains plain RSA secret key packet! name1:$gpg$*17*54*2048*baf72fff3eea734bf85cc53988854e87773b23a1733e633899e5db3d78d8564fb101cf4c3505e91b7e5e27b645cbc5ca526cb542d48c*1*254*2*3*8*1cd4b92bc44fce11*0*375426c5ad3dc19f:::(comment1) <mail1@com>::secring.gpg name2:$gpg$*16*65*2048*63de944dc2c3d87d99b694d7cdd20c0052caa9984b1f5f203978d26234af6181c93bc37c7ea2b5a5d6622afd68a037f165702f36596cded92fafc270a396b776c5*1*254*2*3*8*0df0c4d96317d620*0*375426c5ad3dc19f:::(comment2) <mail2@com>::secring.gpg name2:$gpg$*17*54*2048*29c4568b3531b898e5899ede969ba96ade45560eb90b848ca33f93b8fd1fd02adcc793497225a893e469dd66d1da12469414b4edf5c3*1*254*2*3*8*792bd800cb9f7589*0*63de52f715d286c5:::(comment2) <mail2@com>::secring.gpg ``` It lists name2 (comment2 mail2 etc) twice but never name3 etc.
Author
Owner

@jfoug commented on GitHub (Nov 25, 2014):

Ok, I followed instructions exactly as above to create a key-ring with the same 3 keys (I thought 3). I added a little debugging code, so that right before the (*tag_func[tag])(len) function call is done, I output some information (the tag, the len, the offset in the file (I wrote code for this), and a text string of the tag_func being called.). Here is the output. To me, it looks like we really need to detect a few thing. We need to detect the start of a unique block, and the start of the next block (while processing). When we detect the start of a new block, we print out whatever we had saved up. We then clean all buffers, for the next block. Then at the end of the file, we also dump out what we have. I do not think this is being done. I actually think the first buffer (the one starting with 666aaaa is actually the 2nd hash in the file, not the first) I need to dig in more and figure this thing out.

Packet type 5, len 920 at offset 3  (Processing) (pkt-type Secret_Key_Packet)
secring.gpg contains plain RSA secret key packet!
Packet type 13, len 28 at offset 925  (Processing) (pkt-type User_ID_Packet)
Packet type 2, len 312 at offset 956  (Processing) (pkt-type Signature_Packet)
Packet type 12, len 2 at offset 1270  (Processing) (pkt-type Trust_Packet)
Packet type 7, len 920 at offset 1275  (Processing) (pkt-type Secret_Subkey_Packet)
secring.gpg contains plain RSA secret key packet!
Packet type 2, len 287 at offset 2198  (Processing) (pkt-type Signature_Packet)
Packet type 12, len 2 at offset 2487  (Processing) (pkt-type Trust_Packet)
Packet type 5, len 888 at offset 2492  (Processing) (pkt-type Secret_Key_Packet)
name1:$gpg$*17*54*2048*666baaa88b1ed9a4c50a0bb78971afec84481d3c8a41fe82e4798a725f8d4a7b29c4acf6f1c1c8e45cce9f1f239a03e02eefc9c5b628*1*254*
922044d6e4*0*1a4b9bca3747a170:::(comment1) <mail1@com>::secring.gpg
Packet type 13, len 28 at offset 3382  (Processing) (pkt-type User_ID_Packet)
Packet type 2, len 122 at offset 3412  (Processing) (pkt-type Signature_Packet)
Packet type 12, len 2 at offset 3536  (Processing) (pkt-type Trust_Packet)
Packet type 7, len 610 at offset 3541  (Processing) (pkt-type Secret_Subkey_Packet)
name2:$gpg$*16*65*2048*f6e937769a1fd46c62ce27c241e4cf41de514265be91af636ac05ed4783decbff171dcb46f9f96a609e9dfc0a24c9e99d08ac73100f37320d5f
481*1*254*2*3*8*d1b4e67693fe3d77*0*1a4b9bca3747a170:::(comment2) <mail2@com>::secring.gpg
Packet type 2, len 97 at offset 4153  (Processing) (pkt-type Signature_Packet)
Packet type 12, len 2 at offset 4252  (Processing) (pkt-type Trust_Packet)
Packet type 5, len 888 at offset 4257  (Processing) (pkt-type Secret_Key_Packet)
name2:$gpg$*17*54*2048*b7d4a4c723e79d47adddff27a545928b7ced03dbcb191817969ab110ba9c3085a54e71cac73446177c194150f7aa9153eaf787d79ede*1*254*
fca20745c5*0*bc930688f58a0797:::(comment2) <mail2@com>::secring.gpg
Packet type 13, len 28 at offset 5147  (Processing) (pkt-type User_ID_Packet)
Packet type 2, len 122 at offset 5177  (Processing) (pkt-type Signature_Packet)
Packet type 12, len 2 at offset 5301  (Processing) (pkt-type Trust_Packet)
Press any key to continue . . .
<!-- gh-comment-id:64308301 --> @jfoug commented on GitHub (Nov 25, 2014): Ok, I followed instructions exactly as above to create a key-ring with the same 3 keys (I thought 3). I added a little debugging code, so that right before the (*tag_func[tag])(len) function call is done, I output some information (the tag, the len, the offset in the file (I wrote code for this), and a text string of the tag_func being called.). Here is the output. To me, it looks like we really need to detect a few thing. We need to detect the start of a unique block, and the start of the next block (while processing). When we detect the start of a new block, we print out whatever we had saved up. We then clean all buffers, for the next block. Then at the end of the file, we also dump out what we have. I do not think this is being done. I actually think the first buffer (the one starting with 666aaaa is actually the 2nd hash in the file, not the first) I need to dig in more and figure this thing out. ``` Packet type 5, len 920 at offset 3 (Processing) (pkt-type Secret_Key_Packet) secring.gpg contains plain RSA secret key packet! Packet type 13, len 28 at offset 925 (Processing) (pkt-type User_ID_Packet) Packet type 2, len 312 at offset 956 (Processing) (pkt-type Signature_Packet) Packet type 12, len 2 at offset 1270 (Processing) (pkt-type Trust_Packet) Packet type 7, len 920 at offset 1275 (Processing) (pkt-type Secret_Subkey_Packet) secring.gpg contains plain RSA secret key packet! Packet type 2, len 287 at offset 2198 (Processing) (pkt-type Signature_Packet) Packet type 12, len 2 at offset 2487 (Processing) (pkt-type Trust_Packet) Packet type 5, len 888 at offset 2492 (Processing) (pkt-type Secret_Key_Packet) name1:$gpg$*17*54*2048*666baaa88b1ed9a4c50a0bb78971afec84481d3c8a41fe82e4798a725f8d4a7b29c4acf6f1c1c8e45cce9f1f239a03e02eefc9c5b628*1*254* 922044d6e4*0*1a4b9bca3747a170:::(comment1) <mail1@com>::secring.gpg Packet type 13, len 28 at offset 3382 (Processing) (pkt-type User_ID_Packet) Packet type 2, len 122 at offset 3412 (Processing) (pkt-type Signature_Packet) Packet type 12, len 2 at offset 3536 (Processing) (pkt-type Trust_Packet) Packet type 7, len 610 at offset 3541 (Processing) (pkt-type Secret_Subkey_Packet) name2:$gpg$*16*65*2048*f6e937769a1fd46c62ce27c241e4cf41de514265be91af636ac05ed4783decbff171dcb46f9f96a609e9dfc0a24c9e99d08ac73100f37320d5f 481*1*254*2*3*8*d1b4e67693fe3d77*0*1a4b9bca3747a170:::(comment2) <mail2@com>::secring.gpg Packet type 2, len 97 at offset 4153 (Processing) (pkt-type Signature_Packet) Packet type 12, len 2 at offset 4252 (Processing) (pkt-type Trust_Packet) Packet type 5, len 888 at offset 4257 (Processing) (pkt-type Secret_Key_Packet) name2:$gpg$*17*54*2048*b7d4a4c723e79d47adddff27a545928b7ced03dbcb191817969ab110ba9c3085a54e71cac73446177c194150f7aa9153eaf787d79ede*1*254* fca20745c5*0*bc930688f58a0797:::(comment2) <mail2@com>::secring.gpg Packet type 13, len 28 at offset 5147 (Processing) (pkt-type User_ID_Packet) Packet type 2, len 122 at offset 5177 (Processing) (pkt-type Signature_Packet) Packet type 12, len 2 at offset 5301 (Processing) (pkt-type Trust_Packet) Press any key to continue . . . ```
Author
Owner

@jfoug commented on GitHub (Nov 25, 2014):

Ok, I created a new secring, but gave a PW to the first one (the RSA). Here is the output. I am pretty sure I know the problem now. The code dumps out the key when it sees it, while is should wait until it has the key AND the user_id_packet. The first packet has nothing. The 2nd one gets the right data (I assume that the first 2 packets are for the same block??, the RSA). Then the 3rd block (which is for the 2nd but it still gets the first comment (the 2nd user record not seen yet). Then the 4th gets the 2nd, and the 5th gets the 2nd (again, the 3rd user/comment record not seen yet).

I think I can get this fixed. I may still not have down exactly what is going on. I do not see why there are 5 records here (I would think 3).

Packet type 5, len 957 at offset 3  (Processing) (pkt-type Secret_Key_Packet)
secring2:$gpg$*1*668*2048*aa8ae6b9a91f29c75285040b892d793c31e61972571bed9f0968e6aa928351101a9d7f935d15b64235c3c6f919e9b13475cdc678bd2624593e56580d6cb0
275eb46f3db176f961c66898a2a2b74129e47c3adf4198f59a53b41b6c329ce7550c62989695f7eb5892d6e6a57ac7bdd1eeebff7dd8d42668333e016facac7da454db73dddebfa3f1895a
3b2faa9f44b883bf046ab3712b4d59f77f110728cf69b75789cfada144f086ba018cbc2366881bd22b31b3df722f5178d3ec1d99c6a158adf6879c3a9a10700748b447d3810bf6be790611
29cd9e7289375acec0424367a6a36f3a1ceb9f7356cf4b7b55cd3759dd3e05225a9028514419d80462d5d12ff19d8170694b1153ab98f7d562a14b0329bd774502a23a3b33c07e2544a461
e907e5af6078df60fde473d7dcec6c621a35e3fee96709416f9c980220608df380e165169893f1a2a8b27744843aa2a451a783ad9720105ef348dea84b7ddadc707dad769b078da4aba5be
560760a8fede904292f3b1032f0c590fc76fe3540be4c51bf7d2ec615a64e355989ba4fe4334396af9671e7c411da7dd9acd2941046ca2879ae2babb61545b4931dd67ff672767bc89ea41
3fbbb0a4d05ff4ae8271cf59a5e49bbcafa4877b59a96fcc4475518a83dd354e5a418bb57169af5679c40fa38321cd6ea6b034317f794c4cdbd7a9e69c47e95c55c762fbbcae911a197e65
b3f8a6f6e7ba79ce3b983da2d278b04489aa15a05916bc5e9d5b51a09030c8b12901f9fec6167097c0b1aed83788dd15b0645809700e9c37c79ae8469847c2cfef33604505246377ecae4e
e1c46cce406ba0d136158cabc1d6ff84326fb6a1fa27197e1cc29738ef5c0d6204e2259af7bf3f758f5b38197eaf968e4aef6b9533e95dbc3d191ab35bb27c8ee279a52ef6aa47dec205a0
8043b1c5a01f*1*254*2*3*8*629c7791ab742e0b*0*0dc5836e2c5f2139:::::secring2.gpg
Packet type 13, len 29 at offset 962  (Processing) (pkt-type User_ID_Packet)
Packet type 2, len 312 at offset 994  (Processing) (pkt-type Signature_Packet)
Packet type 12, len 2 at offset 1308  (Processing) (pkt-type Trust_Packet)
Packet type 7, len 957 at offset 1313  (Processing) (pkt-type Secret_Subkey_Packet)
name1:$gpg$*1*668*2048*3691c39eb784087770c1b6fecd8b63655ff7612cb720d3b05961765dad9cb40c789498ee60143fd1f0fce9aef8215b55bd4770aa5eba8a697df1d09ebef820f
3a0f88bb63c90d7f174cc010d18d770ca5b1544c257a7d4fb8796a1f482a304f6869a1b3510ac36d1d87ff0f7183b2a508805ad751f699e379547b56e307ddcc66eb7230476cec8f0c6130
ca1fb83d263ac4f27a6666876efe5be19636868bf7ec0d957479d1267a516caef29f3fac6c93d6e8523b47238c01fc5974c63bb5e97cfe990306798a736276fff1ffe76f30addf2fd808ea
be738ff4181a15c0db8681cfdb06cec7c915aed6ffe46821cf2e2b1ed6f81bde7a2fe11b2ae2b84077041c9a1e33e99cd9df9cc785d8a4aa8364d25f9c78a6b2bd8ce60ebb3f8e10c88a28
f13c76894c5843e0c5a1c60d491dde186038a33ad4b6edeca26b7b8dae3a383851e9ed6921cac41ecc8641276c9bbe71adcd5c0b0ea6a1f99bf22746fbdc50efed4f6da675603154e2eed1
21df37067be9e96d1efd3f6968253e7e1f8a75e5d03013705a8edc1a08b5d8948eb95cf077c0eeac18827740052e3c21333e15dce4dde8ea7b5ab3bb7558d0e1a613b28a8bf1b74c4d3621
379ee3bf83d66bdd4ca22b8ed2673d038c61812c6dafa278ef743d603e1360fc2ebc713a9f451ae543e9297c1607e3e817a1f06ef97674cccff4ad987aecdf57dec581313d3a1421daacb2
56acf692c8d4ee778a4410e2c84bd1c8e0ef34e6305da1849ed761b3a97795c3e0c08d500cad8f2b2dd111fd0cf35495d02e714c9419a1f4705a0ea5eec1234640b508bccd71a7e69db230
e7be3f2fc767cb5cf8e0742de9e43e6e726e0e2407e12ea83fa6d4d61b432b40710224c5f1dd3f355700d464549a8e44a1899159f3984440061075d683e673debeeee3aa2fc14f2cabc477
b210ffbf9*1*254*2*3*8*50f84be0706db27e*0*0dc5836e2c5f2139:::(comment1) <email1@com>::secring2.gpg
Packet type 2, len 287 at offset 2273  (Processing) (pkt-type Signature_Packet)
Packet type 12, len 2 at offset 2562  (Processing) (pkt-type Trust_Packet)
Packet type 5, len 888 at offset 2567  (Processing) (pkt-type Secret_Key_Packet)
name1:$gpg$*17*54*2048*38af1c90643bf697555ebaf12fc8c29a1acbdbd4daba87a795d48251bd3997937004ffe6c1cca37c42500fe9a5da609404b64ef76920*1*254*2*3*8*1a40f9
337293d676*0*4e637b21b4597183:::(comment1) <email1@com>::secring2.gpg
Packet type 13, len 29 at offset 3457  (Processing) (pkt-type User_ID_Packet)
Packet type 2, len 122 at offset 3488  (Processing) (pkt-type Signature_Packet)
Packet type 12, len 2 at offset 3612  (Processing) (pkt-type Trust_Packet)
Packet type 7, len 610 at offset 3617  (Processing) (pkt-type Secret_Subkey_Packet)
name2:$gpg$*16*65*2048*858d0d8db81d3ee88303e48d3f8b5ede5e0091e37e45412b58243680012a8cc528e40d9bf5b3dafd85422f4811d4e02c89ef0821634a1ad95ec7c79f4b5effa
fec*1*254*2*3*8*5d7f9ae3de18bb5a*0*4e637b21b4597183:::(comment2) <email2@com>::secring2.gpg
Packet type 2, len 97 at offset 4229  (Processing) (pkt-type Signature_Packet)
Packet type 12, len 2 at offset 4328  (Processing) (pkt-type Trust_Packet)
Packet type 5, len 888 at offset 4333  (Processing) (pkt-type Secret_Key_Packet)
name2:$gpg$*17*54*2048*c6a5db710908303ab6750b5e55cee13baf8cc246495efba692efb074cdda30ab8bd0af4ddff3454b44b2b1941fa70abcd2249914d781*1*254*2*3*8*929102
70a7b0ed21*0*ba372cda528c3c1b:::(comment2) <email2@com>::secring2.gpg
Packet type 13, len 29 at offset 5223  (Processing) (pkt-type User_ID_Packet)
Packet type 2, len 122 at offset 5254  (Processing) (pkt-type Signature_Packet)
Packet type 12, len 2 at offset 5378  (Processing) (pkt-type Trust_Packet)
<!-- gh-comment-id:64309889 --> @jfoug commented on GitHub (Nov 25, 2014): Ok, I created a new secring, but gave a PW to the first one (the RSA). Here is the output. I am pretty sure I know the problem now. The code dumps out the key when it sees it, while is should wait until it has the key AND the user_id_packet. The first packet has nothing. The 2nd one gets the right data (I assume that the first 2 packets are for the same block??, the RSA). Then the 3rd block (which is for the 2nd but it still gets the first comment (the 2nd user record not seen yet). Then the 4th gets the 2nd, and the 5th gets the 2nd (again, the 3rd user/comment record not seen yet). I think I can get this fixed. I may still not have down exactly what is going on. I do not see why there are 5 records here (I would think 3). ``` Packet type 5, len 957 at offset 3 (Processing) (pkt-type Secret_Key_Packet) secring2:$gpg$*1*668*2048*aa8ae6b9a91f29c75285040b892d793c31e61972571bed9f0968e6aa928351101a9d7f935d15b64235c3c6f919e9b13475cdc678bd2624593e56580d6cb0 275eb46f3db176f961c66898a2a2b74129e47c3adf4198f59a53b41b6c329ce7550c62989695f7eb5892d6e6a57ac7bdd1eeebff7dd8d42668333e016facac7da454db73dddebfa3f1895a 3b2faa9f44b883bf046ab3712b4d59f77f110728cf69b75789cfada144f086ba018cbc2366881bd22b31b3df722f5178d3ec1d99c6a158adf6879c3a9a10700748b447d3810bf6be790611 29cd9e7289375acec0424367a6a36f3a1ceb9f7356cf4b7b55cd3759dd3e05225a9028514419d80462d5d12ff19d8170694b1153ab98f7d562a14b0329bd774502a23a3b33c07e2544a461 e907e5af6078df60fde473d7dcec6c621a35e3fee96709416f9c980220608df380e165169893f1a2a8b27744843aa2a451a783ad9720105ef348dea84b7ddadc707dad769b078da4aba5be 560760a8fede904292f3b1032f0c590fc76fe3540be4c51bf7d2ec615a64e355989ba4fe4334396af9671e7c411da7dd9acd2941046ca2879ae2babb61545b4931dd67ff672767bc89ea41 3fbbb0a4d05ff4ae8271cf59a5e49bbcafa4877b59a96fcc4475518a83dd354e5a418bb57169af5679c40fa38321cd6ea6b034317f794c4cdbd7a9e69c47e95c55c762fbbcae911a197e65 b3f8a6f6e7ba79ce3b983da2d278b04489aa15a05916bc5e9d5b51a09030c8b12901f9fec6167097c0b1aed83788dd15b0645809700e9c37c79ae8469847c2cfef33604505246377ecae4e e1c46cce406ba0d136158cabc1d6ff84326fb6a1fa27197e1cc29738ef5c0d6204e2259af7bf3f758f5b38197eaf968e4aef6b9533e95dbc3d191ab35bb27c8ee279a52ef6aa47dec205a0 8043b1c5a01f*1*254*2*3*8*629c7791ab742e0b*0*0dc5836e2c5f2139:::::secring2.gpg Packet type 13, len 29 at offset 962 (Processing) (pkt-type User_ID_Packet) Packet type 2, len 312 at offset 994 (Processing) (pkt-type Signature_Packet) Packet type 12, len 2 at offset 1308 (Processing) (pkt-type Trust_Packet) Packet type 7, len 957 at offset 1313 (Processing) (pkt-type Secret_Subkey_Packet) name1:$gpg$*1*668*2048*3691c39eb784087770c1b6fecd8b63655ff7612cb720d3b05961765dad9cb40c789498ee60143fd1f0fce9aef8215b55bd4770aa5eba8a697df1d09ebef820f 3a0f88bb63c90d7f174cc010d18d770ca5b1544c257a7d4fb8796a1f482a304f6869a1b3510ac36d1d87ff0f7183b2a508805ad751f699e379547b56e307ddcc66eb7230476cec8f0c6130 ca1fb83d263ac4f27a6666876efe5be19636868bf7ec0d957479d1267a516caef29f3fac6c93d6e8523b47238c01fc5974c63bb5e97cfe990306798a736276fff1ffe76f30addf2fd808ea be738ff4181a15c0db8681cfdb06cec7c915aed6ffe46821cf2e2b1ed6f81bde7a2fe11b2ae2b84077041c9a1e33e99cd9df9cc785d8a4aa8364d25f9c78a6b2bd8ce60ebb3f8e10c88a28 f13c76894c5843e0c5a1c60d491dde186038a33ad4b6edeca26b7b8dae3a383851e9ed6921cac41ecc8641276c9bbe71adcd5c0b0ea6a1f99bf22746fbdc50efed4f6da675603154e2eed1 21df37067be9e96d1efd3f6968253e7e1f8a75e5d03013705a8edc1a08b5d8948eb95cf077c0eeac18827740052e3c21333e15dce4dde8ea7b5ab3bb7558d0e1a613b28a8bf1b74c4d3621 379ee3bf83d66bdd4ca22b8ed2673d038c61812c6dafa278ef743d603e1360fc2ebc713a9f451ae543e9297c1607e3e817a1f06ef97674cccff4ad987aecdf57dec581313d3a1421daacb2 56acf692c8d4ee778a4410e2c84bd1c8e0ef34e6305da1849ed761b3a97795c3e0c08d500cad8f2b2dd111fd0cf35495d02e714c9419a1f4705a0ea5eec1234640b508bccd71a7e69db230 e7be3f2fc767cb5cf8e0742de9e43e6e726e0e2407e12ea83fa6d4d61b432b40710224c5f1dd3f355700d464549a8e44a1899159f3984440061075d683e673debeeee3aa2fc14f2cabc477 b210ffbf9*1*254*2*3*8*50f84be0706db27e*0*0dc5836e2c5f2139:::(comment1) <email1@com>::secring2.gpg Packet type 2, len 287 at offset 2273 (Processing) (pkt-type Signature_Packet) Packet type 12, len 2 at offset 2562 (Processing) (pkt-type Trust_Packet) Packet type 5, len 888 at offset 2567 (Processing) (pkt-type Secret_Key_Packet) name1:$gpg$*17*54*2048*38af1c90643bf697555ebaf12fc8c29a1acbdbd4daba87a795d48251bd3997937004ffe6c1cca37c42500fe9a5da609404b64ef76920*1*254*2*3*8*1a40f9 337293d676*0*4e637b21b4597183:::(comment1) <email1@com>::secring2.gpg Packet type 13, len 29 at offset 3457 (Processing) (pkt-type User_ID_Packet) Packet type 2, len 122 at offset 3488 (Processing) (pkt-type Signature_Packet) Packet type 12, len 2 at offset 3612 (Processing) (pkt-type Trust_Packet) Packet type 7, len 610 at offset 3617 (Processing) (pkt-type Secret_Subkey_Packet) name2:$gpg$*16*65*2048*858d0d8db81d3ee88303e48d3f8b5ede5e0091e37e45412b58243680012a8cc528e40d9bf5b3dafd85422f4811d4e02c89ef0821634a1ad95ec7c79f4b5effa fec*1*254*2*3*8*5d7f9ae3de18bb5a*0*4e637b21b4597183:::(comment2) <email2@com>::secring2.gpg Packet type 2, len 97 at offset 4229 (Processing) (pkt-type Signature_Packet) Packet type 12, len 2 at offset 4328 (Processing) (pkt-type Trust_Packet) Packet type 5, len 888 at offset 4333 (Processing) (pkt-type Secret_Key_Packet) name2:$gpg$*17*54*2048*c6a5db710908303ab6750b5e55cee13baf8cc246495efba692efb074cdda30ab8bd0af4ddff3454b44b2b1941fa70abcd2249914d781*1*254*2*3*8*929102 70a7b0ed21*0*ba372cda528c3c1b:::(comment2) <email2@com>::secring2.gpg Packet type 13, len 29 at offset 5223 (Processing) (pkt-type User_ID_Packet) Packet type 2, len 122 at offset 5254 (Processing) (pkt-type Signature_Packet) Packet type 12, len 2 at offset 5378 (Processing) (pkt-type Trust_Packet) ```
Author
Owner

@magnumripper commented on GitHub (Nov 25, 2014):

Note what Dhiru wrote in https://github.com/magnumripper/JohnTheRipper/pull/442#issuecomment-31337004 : I think things may come in any order. Maybe this is just what you already saw.

<!-- gh-comment-id:64379439 --> @magnumripper commented on GitHub (Nov 25, 2014): Note what Dhiru wrote in https://github.com/magnumripper/JohnTheRipper/pull/442#issuecomment-31337004 : I think things may come in any order. Maybe this is just what you already saw.
Author
Owner

@jfoug commented on GitHub (Nov 25, 2014):

I have a version ready. NOTE, this still prints subkeys. Should that be removed also? That would be easy, and I will give a command line switch for it.

To get the right gecos data with the key, what I had to do was NOT print out key when it is read. What I do is use a static string. When I find a key IF that static string contains data, I write out what the prior key was, with the current login/gecos data. I then write the current key into this static string (for the next key). Also, when all data is done, I remake the login/gecos data, and print out the stored key).

I have also added a -d switch (for debugging output). The only debugging is listing what type blocks were found. The other printf() stuff, I changed to fprintf(stderr..) We probably should preceed all of those with an if (gpg_dbg) so that the fprintf stuff does not show up except in debug mode.

I also fixed the filename(s) Only 1 file was being processed before, now multiple are being processed.

I also made a change to john.c, so that I can 'override' behavior of the john exe, vs using the renamed crap. This help me greatly in VC GUI debugging. Currently it is wrapped with #ifdef _MSC_VER so that it is VC specific, BUT it could be useful for all.

2fee9ee

23a130e (changes to john.c)

<!-- gh-comment-id:64395542 --> @jfoug commented on GitHub (Nov 25, 2014): I have a version ready. NOTE, this still prints subkeys. Should that be removed also? That would be easy, and I will give a command line switch for it. To get the right gecos data with the key, what I had to do was NOT print out key when it is read. What I do is use a static string. When I find a key IF that static string contains data, I write out what the prior key was, with the current login/gecos data. I then write the current key into this static string (for the next key). Also, when all data is done, I remake the login/gecos data, and print out the stored key). I have also added a -d switch (for debugging output). The only debugging is listing what type blocks were found. The other printf() stuff, I changed to fprintf(stderr..) We probably should preceed all of those with an if (gpg_dbg) so that the fprintf stuff does not show up except in debug mode. I also fixed the filename(s) Only 1 file was being processed before, now multiple are being processed. I also made a change to john.c, so that I can 'override' behavior of the john exe, vs using the renamed crap. This help me greatly in VC GUI debugging. Currently it is wrapped with #ifdef _MSC_VER so that it is VC specific, BUT it could be useful for all. 2fee9ee 23a130e (changes to john.c)
Author
Owner

@jfoug commented on GitHub (Nov 25, 2014):

This has been left open for now, but I think it is closed. NOTE, I notice that subkeys also print, and saw that on #442 this is also an issue. I have not made changes to mute them, but easily can.

I need @magnumripper and @kholia to validate that the changes I have made are complete, and handle this issue, prior to it getting the bug closed.

<!-- gh-comment-id:64398155 --> @jfoug commented on GitHub (Nov 25, 2014): This has been left open for now, but I think it is closed. NOTE, I notice that subkeys also print, and saw that on #442 this is also an issue. I have not made changes to mute them, but easily can. I need @magnumripper and @kholia to validate that the changes I have made are complete, and handle this issue, prior to it getting the bug closed.
Author
Owner

@jfoug commented on GitHub (Nov 25, 2014):

Subkey muting added 0bfe751 There is now a -S argument that allows subkeys to still be output.

<!-- gh-comment-id:64408729 --> @jfoug commented on GitHub (Nov 25, 2014): Subkey muting added 0bfe751 There is now a -S argument that allows subkeys to still be output.
Author
Owner

@magnumripper commented on GitHub (Nov 25, 2014):

$ cut -d: -f1,3- old.in 
secring:::::secring.gpg
first:::(1st) <first@last.com>::secring.gpg
first:::(1st) <first@last.com>::secring.gpg
Second:::(2nd) <second@large>::secring.gpg
Second:::(2nd) <second@large>::secring.gpg
Third:::(3rd) <third@will>::secring.gpg

$ cut -d: -f1,3- new.in 
first:::first (1st) <first@last.com>::secring.gpg
Second:::Second (2nd) <second@large>::secring.gpg
Third:::Third (3rd) <third@will>::secring.gpg
fourth:::fourth (4th) <fourth@stake>::secring.gpg

$ ../run/john new.in -stdin
Using default input encoding: UTF-8
Loaded 4 password hashes with 4 different salts (gpg, OpenPGP / GnuPG Secret Key [32/64])
Will run 8 OpenMP threads
Press Ctrl-C to abort, or send SIGUSR1 to john process for status
one
two
three
four
^D
four             (fourth)
three            (Third)
two              (Second)
one              (first)
4g 0:00:00:09  0.4357g/s 0.5446p/s 2.178c/s 2.178C/s one..four
Use the "--show" option to display all of the cracked passwords reliably
Session completed

Excellent! 👍

<!-- gh-comment-id:64414138 --> @magnumripper commented on GitHub (Nov 25, 2014): ``` $ cut -d: -f1,3- old.in secring:::::secring.gpg first:::(1st) <first@last.com>::secring.gpg first:::(1st) <first@last.com>::secring.gpg Second:::(2nd) <second@large>::secring.gpg Second:::(2nd) <second@large>::secring.gpg Third:::(3rd) <third@will>::secring.gpg $ cut -d: -f1,3- new.in first:::first (1st) <first@last.com>::secring.gpg Second:::Second (2nd) <second@large>::secring.gpg Third:::Third (3rd) <third@will>::secring.gpg fourth:::fourth (4th) <fourth@stake>::secring.gpg $ ../run/john new.in -stdin Using default input encoding: UTF-8 Loaded 4 password hashes with 4 different salts (gpg, OpenPGP / GnuPG Secret Key [32/64]) Will run 8 OpenMP threads Press Ctrl-C to abort, or send SIGUSR1 to john process for status one two three four ^D four (fourth) three (Third) two (Second) one (first) 4g 0:00:00:09 0.4357g/s 0.5446p/s 2.178c/s 2.178C/s one..four Use the "--show" option to display all of the cracked passwords reliably Session completed ``` Excellent! :+1:
Author
Owner

@jfoug commented on GitHub (Nov 25, 2014):

Again (as mentioned in a commit message), I am following this assumption:

Key1
ID1
Subkey1 (muted)
Key2
ID2
[SubKey2]
Key3
ID3

If we see

ID1
Key1
ID2
Key2

then the logic as I have it will fail. It would associate ID2 to Key1, and then ID2 to Key2 upon program exit. What I do is each time I see a new 'key', I output the PRIOR key. So the first one has no prior key, it does not output. After outputting, I blank out the saved key. Then if this key is not a subkey, I write the key data to a temp var. Then upon end of file, I also output (if there is a key set).

This is similar to how the login data was stored, when one of the ID blocks was hit. This delayed outputting of the key, appears to match proper login ID and key, waiting for a new key to flush out what has been stored.

I did a test in the pgp-70-flavors, and I get 30 hashes. The older crackme.all ONLY gets 25 hashes loaded, but all 25 are contained within the 30 that get loaded with the new code.

So, there are 40 hashes that do NOT load. Again, I do not know the format well enough to know if it is supposed to be that way, OR if this simply is our format not handling all these types properly.

<!-- gh-comment-id:64416398 --> @jfoug commented on GitHub (Nov 25, 2014): Again (as mentioned in a commit message), I am following this assumption: Key1 ID1 Subkey1 (muted) Key2 ID2 [SubKey2] Key3 ID3 If we see ID1 Key1 ID2 Key2 then the logic as I have it will fail. It would associate ID2 to Key1, and then ID2 to Key2 upon program exit. What I do is each time I see a new 'key', I output the PRIOR key. So the first one has no prior key, it does not output. After outputting, I blank out the saved key. Then if this key is not a subkey, I write the key data to a temp var. Then upon end of file, I also output (if there is a key set). This is similar to how the login data was stored, when one of the ID blocks was hit. This delayed outputting of the key, appears to match proper login ID and key, waiting for a new key to flush out what has been stored. I did a test in the pgp-70-flavors, and I get 30 hashes. The older crackme.all ONLY gets 25 hashes loaded, but all 25 are contained within the 30 that get loaded with the new code. So, there are 40 hashes that do NOT load. Again, I do not know the format well enough to know if it is supposed to be that way, OR if this simply is our format not handling all these types properly.
Author
Owner

@jfoug commented on GitHub (Nov 25, 2014):

@magnumripper if you are OK with the changes as presented, then this bug can be closed. From the testing I have been able to do, it appears to be working properly now.

<!-- gh-comment-id:64416911 --> @jfoug commented on GitHub (Nov 25, 2014): @magnumripper if you are OK with the changes as presented, then this bug can be closed. From the testing I have been able to do, it appears to be working properly now.
Author
Owner

@magnumripper commented on GitHub (Nov 25, 2014):

aye

<!-- gh-comment-id:64439248 --> @magnumripper commented on GitHub (Nov 25, 2014): aye
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
openwall/john#191
No description provided.