[GH-ISSUE #1564] Brainstorming: OpenCL dynamic, OpenCL external mode #1023

Open
opened 2026-10-14 03:32:08 +07:00 by bsakaguchi · 3 comments
Owner

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

Given we do a run-time compile of OpenCL kernels, "how hard can it be" to do things like

  1. Dynamic-compiler format, that whips up a semi optimized OpenCL kernel and runs it.
  2. An External mode, that wips up an OpenCL kernel for producing candidates.

It's just a matter of really wanting to do it. Both ideas have tumbled around in my head for quite a while.

Originally created by @magnumripper on GitHub (Jul 18, 2015). Original GitHub issue: https://github.com/openwall/john/issues/1564 Given we do a run-time compile of OpenCL kernels, "how hard can it be" to do things like 1. Dynamic-compiler format, that whips up a semi optimized OpenCL kernel and runs it. 2. An External mode, that wips up an OpenCL kernel for producing candidates. It's just a matter of really wanting to do it. Both ideas have tumbled around in my head for quite a while.
Author
Owner

@jfoug commented on GitHub (Jul 18, 2015):

Dynamic-compiler format, that whips up a semi optimized OpenCL kernel and runs it.

You could give this a try:

Take the existing dynamic_compiler_fmt.c and make a new one, dynamic_compiler_opencl_fmt.c. Within this format you could 'obtain' a valid working dynamic script, which is basically a step by step explanation of what needs to be done. Then generate your kernel based upon those instructions. I can easily provide a hook into the dyna-compiler to simply return the script. I had a function at one time (but removed it), where you could call the compiler (gives you a handle), and then pass that handle back to a function to get the script. I think I removed that code (just stub functions) here: github.com/magnumripper/JohnTheRipper@329c4abde7

But adding things like this should be very easy, or even just a mode of the compiler to build the script only, and not link into the dynamic engine.

<!-- gh-comment-id:122592896 --> @jfoug commented on GitHub (Jul 18, 2015): > Dynamic-compiler format, that whips up a semi optimized OpenCL kernel and runs it. You could give this a try: Take the existing dynamic_compiler_fmt.c and make a new one, dynamic_compiler_opencl_fmt.c. Within this format you could 'obtain' a valid working dynamic script, which is basically a step by step explanation of what needs to be done. Then generate your kernel based upon those instructions. I can easily provide a hook into the dyna-compiler to simply return the script. I had a function at one time (but removed it), where you could call the compiler (gives you a handle), and then pass that handle back to a function to get the script. I think I removed that code (just stub functions) here: https://github.com/magnumripper/JohnTheRipper/commit/329c4abde74969ca79dd0ab5c31f7cdab683924d But adding things like this should be very easy, or even just a mode of the compiler to build the script only, and not link into the dynamic engine.
Author
Owner

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

Only few external modes will produce enough candidates to fully utilize the GPU.

BTW: should we warn the user when an attack running on a GPU produces less than 50% of the candidates the GPU needs for optimal performance?

<!-- gh-comment-id:122595636 --> @frank-dittrich commented on GitHub (Jul 18, 2015): Only few external modes will produce enough candidates to fully utilize the GPU. BTW: should we warn the user when an attack running on a GPU produces less than 50% of the candidates the GPU needs for optimal performance?
Author
Owner

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

You could give this a try:

This is what I meant. We actually know how to do it, we just lack the real incentive. We could easily use your existing dynamic functions more or less as-is, and in OpenCL they'd be functions or macros or what not and it wouldn't matter. It would rock.

<!-- gh-comment-id:122604635 --> @magnumripper commented on GitHub (Jul 18, 2015): > You could give this a try: This is what I meant. We actually know how to do it, we just lack the real incentive. We could easily use your existing dynamic functions more or less as-is, and in OpenCL they'd be functions or macros or what not and it wouldn't matter. It would rock.
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#1023
No description provided.