john icon indicating copy to clipboard operation
john copied to clipboard

We lack developer documentation

Open frank-dittrich opened this issue 10 years ago • 16 comments

What we need to document:

  • How to implement a new format.
  • Which format to pick for a template
  • How to advance from a simple implementation to one with SIMD support
  • When and how to implement thin formats

(And I am sure lots of other stuff)

frank-dittrich avatar Jun 28 '15 11:06 frank-dittrich

  • How the plugin "system" works (and when to use / not use it)
  • How to update the autoconf stuff
  • split() vs prepare()

magnumripper avatar Jun 28 '15 22:06 magnumripper

Openwall's wiki is almost dead and that might be partly because it's horrible to use: It's the worst wiki [the software] I've encountered as a writer.

On the other hand, this Github wiki is, in my opinion, wonderful. It's simple and intuitive. I have some pages here mostly for my own notes.

magnumripper avatar Jun 28 '15 22:06 magnumripper

https://github.com/magnumripper/JohnTheRipper/wiki/Developer-Help-Documentation

I have added some place holder pages, listing all items from this post. I really would like to be able to control what shows up in that 'Pages' sidebar. It will get HEAVILY cluttered and unusable.

jfoug avatar Jul 22 '15 17:07 jfoug

The place holders are annoying. Please either drop them for now, or fill them in.

magnumripper avatar Aug 19 '15 08:08 magnumripper

Another question: How to decide whether or not an OpenCL format should be OMP or not. E.g., rar-opencl is OMP, some other formats are OMP as well, but (at least for my Haswell with beignet) I don't really know why.

frank-dittrich avatar Aug 21 '15 16:08 frank-dittrich

It's pretty obvious: For example, the CUDA version of WPAPSK does significant post-processing on CPU, so should (and does AFAIK) use OpenMP for that. The OpenCL version does it all on GPU, so there's simply nowhere you could put an OpenMP pragma.

magnumripper avatar Aug 23 '15 15:08 magnumripper

OK, then I might need a real GPU instead of Intel's Haswell to see the benefit of using OpenMP for rar-opencl. For me. there's no difference running a non-OMP version, and the CPU is still mostly idle.

frank-dittrich avatar Aug 23 '15 17:08 frank-dittrich

You got it backwards. Again, the OpenCL version of WPA does not and can not utilize OpenMP, because all work is done on GPU.

magnumripper avatar Aug 23 '15 19:08 magnumripper

NO, I didn't get it backwards. I didn't mention WPA at all. I just discussed rar-opencl. May be here the CPU has work to do, but at least with my Haswell, there's so little work to do for the CPU that the CPU is idle most of the time, even in a --disable-openmp build.

frank-dittrich avatar Aug 23 '15 19:08 frank-dittrich

Oh, my bad. The thing with RAR is we have very good early rejection nowadays. Whenever that code fails to reject early, we need to do, worst case, an AES decryption of a whole file in the archive. That file is potentially huge.

magnumripper avatar Aug 23 '15 20:08 magnumripper

Can that AES decryption of a whole file benefit from OpenCL? I just ask because I intend to run rar-opencl in parallel ro rar (where I would use default OMP_NUM_THREADS on CPU), and I am afraid that enabling OpenCL for GPU might hurt perfrmance rather than help.

frank-dittrich avatar Aug 23 '15 20:08 frank-dittrich

The --test benchmarks just indicate that I can combine --format=rar and --format=rar-opencl, and get more or less the same speeds as when I run --format=rar and --format=rar-opencl individually.

frank-dittrich avatar Aug 23 '15 20:08 frank-dittrich

AES can be done on GPU but I don't think it's worth it. But I'm pretty sure it will be worthwhile to run CPU and GPU in parallel, because of the mentioned early rejection stuff.

magnumripper avatar Aug 23 '15 20:08 magnumripper

We should also document the use of error() and pexit(). And why to use them (there are very good reasons) instead of exit() when possible.

magnumripper avatar Aug 27 '15 21:08 magnumripper

Some stuff in #350 too.

magnumripper avatar Sep 04 '15 18:09 magnumripper

We also have a doc/HACKING.md file now. I am looking for suggestions about topics which could be added to this file.

kholia avatar Nov 11 '17 14:11 kholia