[GH-ISSUE #1530] bcrypt false negative (or something) #999

Closed
opened 2026-10-14 03:31:26 +07:00 by bsakaguchi · 5 comments
Owner

Originally created by @magnumripper on GitHub (Jul 9, 2015).
Original GitHub issue: https://github.com/openwall/john/issues/1530

Originally assigned to: @magnumripper on GitHub.

$ export LC_ALL=C
$ ../run/john -form:bcrypt -list=format-tests | cut -f3 > tests.in
$ ../run/john -form:bcrypt -list=format-tests | cut -f4 > dict
$ rm -f test.pot
$ ../run/john -form:bcrypt -pot=test.pot tests.in -w:dict
Using default input encoding: UTF-8
Loaded 13 password hashes with 6 different salts (bcrypt [Blowfish 32/64 X2])
Will run 8 OpenMP threads
Press 'q' or Ctrl-C to abort, almost any other key for status
?                (?)
???????????????????????????????????????????????????????????????????????? (?)
?U?U?U?U?U?U?U?U?U?U?U?U?U?U?U?U?U?U?U?U?U?U?U?U?U?U?U?U?U?U?U?U?U?U?U?U (?)
U??U??U??U??U??U??U??U??U??U??U??U??U??U??U??U??U??U??U??U??U??U??U??U??               (?)
U*U              (?)
U*U*             (?)
                 (?)
                 (?)
??????              (?)
ё                (?)
U*U*U            (?)
U*U*U            (?)
?                (?)
0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789 (?)
14g 0:00:00:00 DONE (2015-07-09 23:19) 700.0g/s 650.0p/s 3900c/s 8450C/s U*U..U*U*U
Warning: passwords printed above might not be all those cracked
Use the "--show" option to display all of the cracked passwords reliably
Session completed

Loaded 13 and guessed 14?

Re-run

$ ../run/john -form:bcrypt -pot=test.pot tests.in -w:dict
Using default input encoding: UTF-8
Loaded 13 password hashes with 6 different salts (bcrypt [Blowfish 32/64 X2])
Warning: invalid UTF-8 seen reading test.pot
Remaining 1 password hash
Will run 8 OpenMP threads
Press 'q' or Ctrl-C to abort, almost any other key for status
U*U*U            (?)
1g 0:00:00:00 DONE (2015-07-09 23:19) 100.0g/s 1300p/s 1300c/s 1300C/s U*U..U*U*U
Warning: passwords printed above might not be all those cracked
Use the "--show" option to display all of the cracked passwords reliably
Session completed

$ ../run/john -form:bcrypt -pot=test.pot tests.in -w:dict
Using default input encoding: UTF-8
Loaded 13 password hashes with 6 different salts (bcrypt [Blowfish 32/64 X2])
Warning: invalid UTF-8 seen reading test.pot
No password hashes left to crack (see FAQ)
Originally created by @magnumripper on GitHub (Jul 9, 2015). Original GitHub issue: https://github.com/openwall/john/issues/1530 Originally assigned to: @magnumripper on GitHub. ``` $ export LC_ALL=C $ ../run/john -form:bcrypt -list=format-tests | cut -f3 > tests.in $ ../run/john -form:bcrypt -list=format-tests | cut -f4 > dict $ rm -f test.pot $ ../run/john -form:bcrypt -pot=test.pot tests.in -w:dict Using default input encoding: UTF-8 Loaded 13 password hashes with 6 different salts (bcrypt [Blowfish 32/64 X2]) Will run 8 OpenMP threads Press 'q' or Ctrl-C to abort, almost any other key for status ? (?) ???????????????????????????????????????????????????????????????????????? (?) ?U?U?U?U?U?U?U?U?U?U?U?U?U?U?U?U?U?U?U?U?U?U?U?U?U?U?U?U?U?U?U?U?U?U?U?U (?) U??U??U??U??U??U??U??U??U??U??U??U??U??U??U??U??U??U??U??U??U??U??U??U?? (?) U*U (?) U*U* (?) (?) (?) ?????? (?) ё (?) U*U*U (?) U*U*U (?) ? (?) 0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789 (?) 14g 0:00:00:00 DONE (2015-07-09 23:19) 700.0g/s 650.0p/s 3900c/s 8450C/s U*U..U*U*U Warning: passwords printed above might not be all those cracked Use the "--show" option to display all of the cracked passwords reliably Session completed ``` Loaded 13 and guessed 14? Re-run ``` $ ../run/john -form:bcrypt -pot=test.pot tests.in -w:dict Using default input encoding: UTF-8 Loaded 13 password hashes with 6 different salts (bcrypt [Blowfish 32/64 X2]) Warning: invalid UTF-8 seen reading test.pot Remaining 1 password hash Will run 8 OpenMP threads Press 'q' or Ctrl-C to abort, almost any other key for status U*U*U (?) 1g 0:00:00:00 DONE (2015-07-09 23:19) 100.0g/s 1300p/s 1300c/s 1300C/s U*U..U*U*U Warning: passwords printed above might not be all those cracked Use the "--show" option to display all of the cracked passwords reliably Session completed $ ../run/john -form:bcrypt -pot=test.pot tests.in -w:dict Using default input encoding: UTF-8 Loaded 13 password hashes with 6 different salts (bcrypt [Blowfish 32/64 X2]) Warning: invalid UTF-8 seen reading test.pot No password hashes left to crack (see FAQ) ```
bsakaguchi 2026-10-14 03:31:26 +07:00
  • closed this issue
  • added the
    bug
    label
Author
Owner

@magnumripper commented on GitHub (Jul 9, 2015):

Scrap that

<!-- gh-comment-id:120147985 --> @magnumripper commented on GitHub (Jul 9, 2015): Scrap that
Author
Owner

@magnumripper commented on GitHub (Jul 9, 2015):

This is same in CPU and OpenCL formats and is caused by the various "compatibility" tags (2a, 2x etc).

<!-- gh-comment-id:120148285 --> @magnumripper commented on GitHub (Jul 9, 2015): This is same in CPU and OpenCL formats and is caused by the various "compatibility" tags ($2a$, $2x$ etc).
Author
Owner

@frank-dittrich commented on GitHub (Jul 9, 2015):

WIth a source() method implementation this could possibly be avoided.
If you know that a certain compatibility fix wasn't required for the real password, just convert the tag into the default tag.
But for that, the source method would need to know the password.

<!-- gh-comment-id:120164262 --> @frank-dittrich commented on GitHub (Jul 9, 2015): WIth a source() method implementation this could possibly be avoided. If you know that a certain compatibility fix wasn't required for the real password, just convert the tag into the default tag. But for that, the source method would need to know the password.
Author
Owner

@magnumripper commented on GitHub (Jul 9, 2015):

I guess what's causing trouble here is there are some different tags on otherwise identical test vectors. Perhaps we should suggest to Solar to change that (and do so for OpenCL too).

<!-- gh-comment-id:120165996 --> @magnumripper commented on GitHub (Jul 9, 2015): I guess what's causing trouble here is there are some different tags on otherwise identical test vectors. Perhaps we should suggest to Solar to change that (and do so for OpenCL too).
Author
Owner

@frank-dittrich commented on GitHub (Jul 9, 2015):

But if you use the default tag for a password which requires a slightly different logic (e.g., due to different handling of non-ascii characters between the two variants, you'll not be able to re-crack that hash with the default logic.

<!-- gh-comment-id:120167646 --> @frank-dittrich commented on GitHub (Jul 9, 2015): But if you use the default tag for a password which requires a slightly different logic (e.g., due to different handling of non-ascii characters between the two variants, you'll not be able to re-crack that hash with the default logic.
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#999
No description provided.