mirror of
https://github.com/openwall/john.git
synced 2026-12-03 18:45:21 +07:00
[GH-ISSUE #1202] gpg reports wrong tunable costs ("iteration count") #752
Labels
No labels
bug
core branch
documentation
enhancement
enhancement
fixed - pending verify
fuzz bug
good first issue
invalid
invalid
maintenance/cleanup
new cracking mode
new format
new tool
non-trivial
notes/external issues
portability
question
RFC / discussion
testing
WONTFIX
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
openwall/john#752
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @frank-dittrich on GitHub (Apr 12, 2015).
Original GitHub issue: https://github.com/openwall/john/issues/1202
@kholia Solar pointed out that my implementation of tunable cost reporting for gpg is wrong:
http://thread.gmane.org/gmane.comp.security.openwall.john.devel/11100
http://www.openwall.com/lists/john-dev/2015/04/05/5
I simply returned salt->count as the first tunable cost (and called it "iteration count"), because I didn't realize that this isn't the iteration count.
Also, I totally ignored salt->spec, even though I should report tunable costs only for SPEC_ITERATED_SALTED (and report dummy costs for SPEC_SIMPLE and SPEC_SALTED).
I looked at gpg2john.c, and noticed (for type = 3):
Looks like count (i.e., the count that gets written to the gpg format hash by gpg2john and ends up being cur_salt->count corresponds to gpg's
--s2k-count n, seeman gpg:While
gpg --key-genwith default parameters results in count 65536, `gpg --key-gen --s2k-count 262144 results in a count 262144 in the gpg format hash.In gpg_fmt_plug.c, I did find
So it looks like count isn't an iteration count, but rather the number of bytes to be processed by SHA1/SHA256/...
If so, why is this called SPEC_ITERATED_SALTED, if it doesn't appear to be iterated?
What am I missing.
Can you clarify (or even fix) how tunable costs should be reported for gpg and gpg-opencl?
@kholia commented on GitHub (Apr 12, 2015):
@frank-dittrich Hi!
@frank-dittrich commented on GitHub (Apr 12, 2015):
In commit
github.com/magnumripper/JohnTheRipper@24bc0b53de, I renamed the first tunable cost from "iteration count" to "s2k-count", so that you might find the gpg man page describing--s2k-count nor other relevant information via google.For --s2k-mode 0, I report 0 as a tunable cost, for --s2k-mode 1, I report 1.
I left reporting of the second and the third tunable cost unchanged.
The hash algorithm is reported as the second tunable cost, the cipher algorithm as the third.