mirror of
https://github.com/openwall/john.git
synced 2026-12-03 18:45:21 +07:00
[GH-ISSUE #716] Implement RAR 5 (PBKDF2-SHA256) OpenCL format #360
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#360
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 @kholia on GitHub (Aug 15, 2014).
Original GitHub issue: https://github.com/openwall/john/issues/716
Originally assigned to: @magnumripper on GitHub.
@magnumripper hi, are you up for it?
@kholia commented on GitHub (Aug 15, 2014):
This format sucks too much on CPU ;(
@magnumripper commented on GitHub (Aug 15, 2014):
Should be easy. And possibly faster than RAR3!
How's this format in terms of post-processing or verification?
@magnumripper commented on GitHub (Aug 15, 2014):
Seems fine.
Then we have a "real" binary (with sufficient size) and normal cmp_* functions!
@kholia commented on GitHub (Aug 15, 2014):
Cool 👍
So far, I could only crack two RAR 5 hashes from CMIYC 2014 using the CPU format.
Also, I suspect that our format might be somewhat buggy currently (I forgot what I missed implementing in it though).
@magnumripper commented on GitHub (Aug 15, 2014):
rar5tojohn has this:
As far as I can see, files not using "PSWCHECK" will be rejected by rar5tojohn, which makes it Good Enough™ (for now) in my book. I presume supporting other files will be a lot more complicated, probably requiring implementing unrar5() and probably a new story of finding early rejections. Hopefully such files will be rare?
@magnumripper commented on GitHub (Aug 20, 2014):
Hmm this is not PBKDF2, is it? I believe it's just iterated HMAC-SHA256, with crap added to confuse the spectator. We should change the algorithm names.
@kholia commented on GitHub (Aug 20, 2014):
Yes, you are right. PBKDF2 work is just used for marketing it seems ;(
http://www.rarlab.com/technote.htm
@magnumripper commented on GitHub (Aug 20, 2014):
We could say "alleged PBKDF2" to avoid confusing people too much 😕
@magnumripper commented on GitHub (Aug 20, 2014):
Still, I think the usual tricks to double the speed of PBKDF2 applies here as well. I just need to wrap my head around it.
@kholia commented on GitHub (Aug 20, 2014):
I actually committed your "alleged PBKDF2" idea just now 👍
@magnumripper commented on GitHub (Aug 20, 2014):
It might actually be normal PBKDF2 for
Key, I'm not really sure yet. Unrolling the outer loop makes it look a lot less strange. Anyway I have a 33% boost for the CPU format already, just by not re-hashing things that doesn't change within the loops.@magnumripper commented on GitHub (Aug 20, 2014):
Ouch.
We need to fix this before doing anything else. rar5tojohn must store the actual iterations count and we must honor it. Some comments indicate it's stored in the "hash" but I believe it isn't. Only (redundant) hash lengths are. Right? I'm adding a separate issue (#720) for this.
@magnumripper commented on GitHub (Aug 20, 2014):
Make that 90% 😄 ... see
1e6acb9@magnumripper commented on GitHub (Aug 26, 2014):
First try in
3774f329. Not yet faster than RAR3 :-(According to its web site, cRARk is also slower with RAR5 than RAR3. But at lengths over 8 or so, RAR5 should be faster and it doesn't get any performance hit from varying password length in a batch.
@kholia commented on GitHub (Aug 26, 2014):
Good stuff 👍
@magnumripper commented on GitHub (Aug 26, 2014):
Well it's better than 88 c/s 😆
@magnumripper commented on GitHub (Aug 26, 2014):
I believe we are doing 65,602 (or so) SHA2 operations per candidate so that would mean we're doing about a billion SHA256 per second on Tahiti. That seems to be on par with oclHashcat's raw speed so maybe we're closer to the theoretical limit than I thought.
That's your kernel @ukasz - I did not modifiy a bit of it! Good stuff.
@ghost commented on GitHub (Aug 27, 2014):
I tried to use shared code for auto-tune in this new file. I will publish it here for future reference.
@ghost commented on GitHub (Aug 27, 2014):
BTW:
@magnumripper commented on GitHub (Aug 27, 2014):
@claudioandre cool, I will commit that soon. I forgot how mature that shared code is now.
Almost the same patch should apply to opencl_pbkdf2_hmac_sha256_fmt_plug.c as well, it's almost identical.
@magnumripper commented on GitHub (Aug 27, 2014):
The LWS enumeration is far too slow though, considering it almost never adds significant speed. I'll see how to tweak that.
@ghost commented on GitHub (Aug 27, 2014):
I noticed that on CPU, but I guess there is a GPU on bull where max LWS is 1024 (a problem anyway).
To me, the best approach seems to be the usage of a default LWS (for example, 128). Something like this:
Inside the fmt_ file (already there - helper functions - just change from 0 to 128)
@magnumripper commented on GitHub (Aug 27, 2014):
Ah, yes I remember now we've been through this before :)
In this case the LWS enumeration does some good though: With enumeration, a self-test take just over a minute, LWS becomes 1024 and speed is 1631 c/s on my laptop GPU. Using a fixed value of 128, test takes 25 seconds and speed is 1481 c/s.
BTW using my old, non-shared enumeration (also with fixed LWS) it took 28 seconds and ended up with same GWS so it was no better in any way.
So I'll set the default to 128. You can still force an enumeration passing LWS=0. I like this, I should do this to all "my" formats. I had forgot about it :-)
@ghost commented on GitHub (Aug 27, 2014):
Also, you can experiment with HASH_LOOPS (if you haven't).
@ghost commented on GitHub (Aug 29, 2014):
And, while doing some new test/development, try the below change (one and/or both)
@magnumripper commented on GitHub (Sep 1, 2014):
OK, so what's happening there? The first thing is trying to aim at 200ms, right? And the second one tries to pick a decent number of loops but not too many?
@ghost commented on GitHub (Sep 2, 2014):
Yes. But the proper 200ms check is not here.
[GH-ISSUE #716] Implement RAR 5 (PBKDF2-SHA256) OpenCL formatto [GH-ISSUE #716] Implement RAR 5 (PBKDF2-SHA256) OpenCL format