Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Keepass OpenCL format. #3131

Closed
wants to merge 2 commits into from
Closed

Keepass OpenCL format. #3131

wants to merge 2 commits into from

Conversation

magnumripper
Copy link
Member

No description provided.

@magnumripper
Copy link
Member Author

Also fixes a bug in shared valid() - it didn't reject unsupported hashes :-(

@kholia this is important. We really really need to reject unsupported hashes, always and forever. In this case the [CPU] format would bail out in an awkward way - which is better than nothing - but the correct behavior is rejecting them in valid().

@kholia
Copy link
Member

kholia commented Jan 31, 2018

Thanks @magnumripper. I missed this opportunity to make valid correct and safe.

@magnumripper
Copy link
Member Author

magnumripper commented Jan 31, 2018

I really can't see WTH is wrong with this format. On a few devices, it works like a champ. On others it fails. On some it works fine with LWS=1 (this might be a clue) but not otherwise.

I have stared at the code for 24h to no avail. Something must be amiss, but WHAT!? @kholia can you try it out and see if whatever GPU and driver you use work or not, or if it happens to reveal some clue?

@magnumripper
Copy link
Member Author

magnumripper commented Jan 31, 2018

This is interesting. Fails a normal test:

$ ../run/john -form:keepass-opencl -test=0 -dev=1 
Device 1: HD Graphics 4000
Testing: KeePass-opencl [SHA256 AES/Twofish/Chacha OpenCL]... FAILED (cmp_all(2))

...but passes with LWS=1:

$ LWS=1 ../run/john -form:keepass-opencl -test=0 -dev=1 
Device 1: HD Graphics 4000
Testing: KeePass-opencl [SHA256 AES/Twofish/Chacha OpenCL]... PASS

...however when using --test-full instead, it works fine with any LWS:

$ ../run/john -form:keepass-opencl -test-full=0 -dev=1 
Device 1: HD Graphics 4000
Testing: KeePass-opencl [SHA256 AES/Twofish/Chacha OpenCL]... PASS

@kholia
Copy link
Member

kholia commented Feb 1, 2018

Quick notes,

$ ../run/john --format=keepass-opencl --test
Device 0: GeForce GTX 1050 Ti
Benchmarking: KeePass-opencl [SHA256 AES/Twofish/Chacha OpenCL]... FAILED (cmp_all(1))

$ ../run/john --format=keepass-opencl -test-full=0
Device 0: GeForce GTX 1050 Ti
Testing: KeePass-opencl [SHA256 AES/Twofish/Chacha OpenCL]... FAILED (cmp_all(49))
$ dpkg -l | grep -i nvidia
...
ii  nvidia-375 ... 375.66-0ubuntu0.17.04.1 ...

Update:

Disabling Twofish and ChaCha test vectors doesn't seem to improve the situation. I will focus on getting salt->version == 1 and salt->algorithm == 0 combination to work first.

@magnumripper
Copy link
Member Author

It works perfectly fine with nvidia drivers 384.90 and 384.111 (Ubuntu packages)

It also works fine with Intel’s CPU driver 1.2.0.42.

I think we’re seeing driver bugs.

and ChaCha.  Also fixes a bug in shared valid() - it didn't reject
unsupported hashes.  Closes #2471.
@magnumripper
Copy link
Member Author

magnumripper commented Feb 1, 2018

I tried changing to a whole different AES implementation (not pushed here) but it didn't change a thing with the failing runtimes.

@magnumripper magnumripper deleted the keepass branch February 1, 2018 19:34
@magnumripper
Copy link
Member Author

@kholia I found that the other AES code we have (introduced with WPA CMAC) is 10x faster. It doesn't seem to fix the issues but anyway I will re-work the whole shebang and issue a new PR later.

@kholia
Copy link
Member

kholia commented Feb 2, 2018

All the best for the next attempt @magnumripper! I was hoping to trace the OpenCL kernel to see where things are going wrong but I ran out of debugging energy.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants