Discussion:
Re: [john-users] Doing raw SHA512 hashes
(too old to reply)
Frank Wang
2016-02-13 21:10:18 UTC
Permalink
Raw Message
Moving this discussion to john-dev.

If others want to chime in, I currently want to do raw SHA256/SHA512
hashes, using code from John the Ripper. I am looking at src/opencl/
office2013_kernel.cl and src/opencl/pbkdf2_hmac_sha512_kernel.cl. They use
src/opencl_sha2.h.

In src/opencl_office2013_fmt_plug.c, there is no "main" function, so I am
wondering where and how the functions in that file are being called. I want
to make sure that I'm using the kernels in the right way to get the
optimizations that JtR has done.

Frank
magnum, Frank -
Sorry about that. opencl_office2013_fmt_plug.c has a bunch of functions
but
no "main" function as far as I can see. What file calls the functions
in opencl_office2013_fmt_plug.c to do the cracking? I'm mainly wondering
this because I want to make sure that I'm using the kernel in the right
way
to get the optimizations that John the Ripper has done.
Please take this discussion to john-dev. While it's not literally John
the Ripper development, it is close enough to that. john-users is for
topics not involving discussing source code detail (as a maximum, it
may include how to apply a patch for an end-user to get a job done), and
john-dev is precisely for such topics that do involve source code detail.
In fact, some development topics that do not dive into the source code,
such as discussions on whether to add a certain feature or not, are
preferable to have here on john-users rather than unnecessarily limited
to the smaller john-dev sub-community.
So we draw the line at "does this involve discussing source code detail?",
and this works both ways.
Thanks,
Alexander
magnum
2016-02-13 21:17:27 UTC
Permalink
Raw Message
Sorry about that. opencl_office2013_fmt_plug.c has a bunch of functions but
no "main" function as far as I can see. What file calls the functions
in opencl_office2013_fmt_plug.c to do the cracking? I'm mainly wondering
this because I want to make sure that I'm using the kernel in the right way
to get the optimizations that John the Ripper has done.
Ah, OK. Well that's a long story. main() is in john.c. It will load
hashes (loader.c), and run a mode (eg. inc.c) which calls functions in
cracker.c. All this is "core code" used for any format.

In short, the "core" of JtR will first call set_key() "n" times with
candidates. Then crypt_all(n) is called, to try those candadates.
Finally, the cmp_*() functions will be called to check if anything was
cracked.

magnum
Awesome, thanks magnum! I know the opencl_*.c files call the kernels you
mentioned, but what files actually run the functions in the opencl_*.c
files?
I don't understand what you mean. The opencl_*.h are headers #include'd by
the kernels. The format calls the kernel. One such format is
opencl_office2013_fmt_plug.c.
magnun
My goal is write an implementation of just raw SHA256/SHA512 hashes using
openCL.
Frank
I am trying to run about 10 million raw SHA 512 hashes in my program and
offloading it to a GPU will make it substantially faster. It seems like
John the Ripper has this functionality, but it seems to be intertwined
with
the password cracking capabilities. Are there any SHA 512 OpenCL
implementations that are easy to separate and integrate into my
program?
Possibly that already exist in John the Ripper?
I would think so. Our current GitHub code contains (among other
implementations) generic SHA512 macros in src/opencl_sha512.h which is
Sorry, that should be opencl_sha2.h. The other file is an other
implementation that I'm not well acquainted with.
magnum
Solar Designer
2016-02-13 21:21:51 UTC
Permalink
Raw Message
Frank,
Post by magnum
Sorry about that. opencl_office2013_fmt_plug.c has a bunch of functions but
no "main" function as far as I can see. What file calls the functions
in opencl_office2013_fmt_plug.c to do the cracking? I'm mainly wondering
this because I want to make sure that I'm using the kernel in the right way
to get the optimizations that John the Ripper has done.
Ah, OK. Well that's a long story. main() is in john.c. It will load
hashes (loader.c), and run a mode (eg. inc.c) which calls functions in
cracker.c. All this is "core code" used for any format.
In short, the "core" of JtR will first call set_key() "n" times with
candidates. Then crypt_all(n) is called, to try those candadates.
Finally, the cmp_*() functions will be called to check if anything was
cracked.
These functions are described with comments in formats.h.

Alexander

Loading...