[GH-ISSUE #879] Do we need more gpg format tests to cover all the hash algorithms and cipher algorithms? #482

Closed
opened 2026-10-14 03:10:09 +07:00 by bsakaguchi · 1 comment
Owner

Originally created by @frank-dittrich on GitHub (Dec 13, 2014).
Original GitHub issue: https://github.com/openwall/john/issues/879

Originally assigned to: @frank-dittrich on GitHub.

Currently, there's no gpg format self test for these hash algorithms:
9:SHA384
10:SHA512
11:SHA224
and no self test for these cipher algorithms:
1:IDEA
4:Blowfish
7:AES128
8:AES192

This is as if no --costs had been specified:

(bleeding-jumbo)run $ ./john --costs=1,1,1 hashes.gpg
Loaded 14 password hashes with 14 different salts (gpg, OpenPGP / GnuPG Secret Key [32/64])
Loaded hashes with cost 1 (iteration count) varying from 0 to 11534336
Loaded hashes with cost 2 (hash algorithm [1:MD5 2:SHA1 3:RIPEMD160 8:SHA256 9:SHA384 10:SHA512 11:SHA224]) varying from 1 to 8
Loaded hashes with cost 3 (cipher algorithm [1:IDEA 2:3DES 3:CAST5 4:Blowfish 7:AES128 8:AES192 9:AES256]) varying from 2 to 9
Will run 8 OpenMP threads
Press 'q' or Ctrl-C to abort, almost any other key for status
0g 0:00:00:03  2/3 0g/s 0p/s 1035c/s 1035C/s 123456..crawford
Session aborted

Now verify that tests for hash algorithms SHA1 and RIPEMD160 exist:

(bleeding-jumbo)run $ ./john --costs=1,2:3,1 hashes.gpg
Loaded 14 password hashes with 14 different salts (gpg, OpenPGP / GnuPG Secret Key [32/64])
Remaining 9 password hashes with 9 different salts
Loaded hashes with cost 1 (iteration count) varying from 65536 to 11534336
Loaded hashes with cost 2 (hash algorithm [1:MD5 2:SHA1 3:RIPEMD160 8:SHA256 9:SHA384 10:SHA512 11:SHA224]) varying from 2 to 3
Loaded hashes with cost 3 (cipher algorithm [1:IDEA 2:3DES 3:CAST5 4:Blowfish 7:AES128 8:AES192 9:AES256]) varying from 2 to 9
Will run 8 OpenMP threads
Press 'q' or Ctrl-C to abort, almost any other key for status
0g 0:00:00:03  2/3 0g/s 0p/s 446.5c/s 446.5C/s 123456..crawford

Now, let's see which of the cipher algorithms 3-8 are used in the self tests (we already know that 1 is not used, 2 and 9 are used):

(bleeding-jumbo)run $ ./john --cost=1,1,3:8 hashes.gpg
Loaded 14 password hashes with 14 different salts (gpg, OpenPGP / GnuPG Secret Key [32/64])
Remaining 7 password hashes with 7 different salts
Loaded hashes with cost 1 (iteration count) varying from 65536 to 11534336
Loaded hashes with cost 2 (hash algorithm [1:MD5 2:SHA1 3:RIPEMD160 8:SHA256 9:SHA384 10:SHA512 11:SHA224]) varying from 1 to 2
Will run 8 OpenMP threads
Press 'q' or Ctrl-C to abort, almost any other key for status
0g 0:00:00:03  2/3 0g/s 0p/s 302.9c/s 302.9C/s 123456..crawford
Session aborted

Just one of these cipher algorithms has been used. Let's see which one:

(bleeding-jumbo)run $ ./john --cost=1,1,4:8 hashes.gpg
Loaded 14 password hashes with 14 different salts (gpg, OpenPGP / GnuPG Secret Key [32/64])
No password hashes left to crack (see FAQ)
(bleeding-jumbo)run $ ./john --cost=1,1,1:8 hashes.gpg
Loaded 14 password hashes with 14 different salts (gpg, OpenPGP / GnuPG Secret Key [32/64])
Remaining 9 password hashes with 9 different salts
Loaded hashes with cost 1 (iteration count) varying from 65536 to 11534336
Loaded hashes with cost 2 (hash algorithm [1:MD5 2:SHA1 3:RIPEMD160 8:SHA256 9:SHA384 10:SHA512 11:SHA224]) varying from 1 to 2
Loaded hashes with cost 3 (cipher algorithm [1:IDEA 2:3DES 3:CAST5 4:Blowfish 7:AES128 8:AES192 9:AES256]) varying from 2 to 3
Will run 8 OpenMP threads
Press 'q' or Ctrl-C to abort, almost any other key for status
0g 0:00:00:03  2/3 0g/s 0p/s 590.2c/s 590.2C/s 123456..crawford
Session aborted
Originally created by @frank-dittrich on GitHub (Dec 13, 2014). Original GitHub issue: https://github.com/openwall/john/issues/879 Originally assigned to: @frank-dittrich on GitHub. Currently, there's no gpg format self test for these hash algorithms: 9:SHA384 10:SHA512 11:SHA224 and no self test for these cipher algorithms: 1:IDEA 4:Blowfish 7:AES128 8:AES192 This is as if no --costs had been specified: ``` (bleeding-jumbo)run $ ./john --costs=1,1,1 hashes.gpg Loaded 14 password hashes with 14 different salts (gpg, OpenPGP / GnuPG Secret Key [32/64]) Loaded hashes with cost 1 (iteration count) varying from 0 to 11534336 Loaded hashes with cost 2 (hash algorithm [1:MD5 2:SHA1 3:RIPEMD160 8:SHA256 9:SHA384 10:SHA512 11:SHA224]) varying from 1 to 8 Loaded hashes with cost 3 (cipher algorithm [1:IDEA 2:3DES 3:CAST5 4:Blowfish 7:AES128 8:AES192 9:AES256]) varying from 2 to 9 Will run 8 OpenMP threads Press 'q' or Ctrl-C to abort, almost any other key for status 0g 0:00:00:03 2/3 0g/s 0p/s 1035c/s 1035C/s 123456..crawford Session aborted ``` Now verify that tests for hash algorithms SHA1 and RIPEMD160 exist: ``` (bleeding-jumbo)run $ ./john --costs=1,2:3,1 hashes.gpg Loaded 14 password hashes with 14 different salts (gpg, OpenPGP / GnuPG Secret Key [32/64]) Remaining 9 password hashes with 9 different salts Loaded hashes with cost 1 (iteration count) varying from 65536 to 11534336 Loaded hashes with cost 2 (hash algorithm [1:MD5 2:SHA1 3:RIPEMD160 8:SHA256 9:SHA384 10:SHA512 11:SHA224]) varying from 2 to 3 Loaded hashes with cost 3 (cipher algorithm [1:IDEA 2:3DES 3:CAST5 4:Blowfish 7:AES128 8:AES192 9:AES256]) varying from 2 to 9 Will run 8 OpenMP threads Press 'q' or Ctrl-C to abort, almost any other key for status 0g 0:00:00:03 2/3 0g/s 0p/s 446.5c/s 446.5C/s 123456..crawford ``` Now, let's see which of the cipher algorithms 3-8 are used in the self tests (we already know that 1 is not used, 2 and 9 are used): ``` (bleeding-jumbo)run $ ./john --cost=1,1,3:8 hashes.gpg Loaded 14 password hashes with 14 different salts (gpg, OpenPGP / GnuPG Secret Key [32/64]) Remaining 7 password hashes with 7 different salts Loaded hashes with cost 1 (iteration count) varying from 65536 to 11534336 Loaded hashes with cost 2 (hash algorithm [1:MD5 2:SHA1 3:RIPEMD160 8:SHA256 9:SHA384 10:SHA512 11:SHA224]) varying from 1 to 2 Will run 8 OpenMP threads Press 'q' or Ctrl-C to abort, almost any other key for status 0g 0:00:00:03 2/3 0g/s 0p/s 302.9c/s 302.9C/s 123456..crawford Session aborted ``` Just one of these cipher algorithms has been used. Let's see which one: ``` (bleeding-jumbo)run $ ./john --cost=1,1,4:8 hashes.gpg Loaded 14 password hashes with 14 different salts (gpg, OpenPGP / GnuPG Secret Key [32/64]) No password hashes left to crack (see FAQ) (bleeding-jumbo)run $ ./john --cost=1,1,1:8 hashes.gpg Loaded 14 password hashes with 14 different salts (gpg, OpenPGP / GnuPG Secret Key [32/64]) Remaining 9 password hashes with 9 different salts Loaded hashes with cost 1 (iteration count) varying from 65536 to 11534336 Loaded hashes with cost 2 (hash algorithm [1:MD5 2:SHA1 3:RIPEMD160 8:SHA256 9:SHA384 10:SHA512 11:SHA224]) varying from 1 to 2 Loaded hashes with cost 3 (cipher algorithm [1:IDEA 2:3DES 3:CAST5 4:Blowfish 7:AES128 8:AES192 9:AES256]) varying from 2 to 3 Will run 8 OpenMP threads Press 'q' or Ctrl-C to abort, almost any other key for status 0g 0:00:00:03 2/3 0g/s 0p/s 590.2c/s 590.2C/s 123456..crawford Session aborted ```
bsakaguchi 2026-10-14 03:10:09 +07:00
Author
Owner

@frank-dittrich commented on GitHub (Dec 13, 2014):

BTW:

$ gpg --version
gpg (GnuPG) 1.4.18
Copyright (C) 2014 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Home: ~/.gnupg
Supported algorithms:
Pubkey: RSA, RSA-E, RSA-S, ELG-E, DSA
Cipher: IDEA, 3DES, CAST5, BLOWFISH, AES, AES192, AES256, TWOFISH,
        CAMELLIA128, CAMELLIA192, CAMELLIA256
Hash: MD5, SHA1, RIPEMD160, SHA256, SHA384, SHA512, SHA224
Compression: Uncompressed, ZIP, ZLIB, BZIP2

Did anybody test how --format=gpg handles "unknown" chiphers 10, 11, 12, 13 (TWOFISH and CAMELLIA128 ... CAMELLIA 256)?

<!-- gh-comment-id:66892000 --> @frank-dittrich commented on GitHub (Dec 13, 2014): BTW: ``` $ gpg --version gpg (GnuPG) 1.4.18 Copyright (C) 2014 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html> This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Home: ~/.gnupg Supported algorithms: Pubkey: RSA, RSA-E, RSA-S, ELG-E, DSA Cipher: IDEA, 3DES, CAST5, BLOWFISH, AES, AES192, AES256, TWOFISH, CAMELLIA128, CAMELLIA192, CAMELLIA256 Hash: MD5, SHA1, RIPEMD160, SHA256, SHA384, SHA512, SHA224 Compression: Uncompressed, ZIP, ZLIB, BZIP2 ``` Did anybody test how --format=gpg handles "unknown" chiphers 10, 11, 12, 13 (TWOFISH and CAMELLIA128 ... CAMELLIA 256)?
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#482
No description provided.