John the Ripper GPU support

John the Ripper 1.7.9-jumbo-6 supported GPUs for the following hashes and non-hashes:

Reasonably efficient:

phpass sha256crypt sha512crypt md5crypt bcrypt MSCash2 WPA-PSK RAR Password Safe
CUDA Yes Yes Yes Yes Yes Yes Yes
OpenCL Yes Yes Yes Yes Yes Yes Yes Yes Yes


  • Latest release include more formats and latest git trees include even more.
  • CUDA significantly benefits from compile-time tuning of parameters for a given GPU, see doc/README-CUDA
  • sha512crypt is currently faster on NVIDIA than on AMD/ATI, and moreover the OpenCL code is currently faster than CUDA (unusual)
  • bcrypt is sort of supposed to be inefficient on GPU, so it achieves at best CPU-like performance currently (yet you do get the option to put your many GPUs to at least some reasonable use if you only have bcrypt hashes to attack)
  • WPA-PSK CUDA uses a little bit of CPU code as well, and benefits from OpenMP (so you'll get slightly faster speed if you enable OpenMP in the JtR build, although you'll load multiple CPU cores then). The OpenCL version has post-processing on GPU too so doesn't use much CPU resources and will not benefit from OpenMP.
  • RAR is a mix of CPU and GPU code, with the ratio varying widely between different RAR archives (type, size). Later versions has mature “early reject” code that minimizes this.

Currently inefficient because the candidate passwords are generated on CPU only:

NT raw-MD4 raw-MD5 raw-SHA1 raw-SHA256 raw-SHA224 raw-SHA512 XSHA512 MSCash NSLDAP MySQL 4.1
CUDA Yes Yes Soon Yes Yes Yes
OpenCL Yes Soon Yes Yes Yes Yes Yes Yes Yes


  • XSHA512 is actually pretty efficient in the “many salts” case and with few hashes per salt (normally there's just one hash per salt), achieving close to 70M c/s on GTX 580, which is reasonable for SHA-512 as it is not very GPU-friendly
  • raw-MD4 is inadvertently missing its high-level *_fmt.c file in 1.7.9-jumbo-6, although the OpenCL code is included. From Jumbo-7 on, this is corrected.

Previously, some of these things were available as patches, but starting with 1.7.9-jumbo-6 they're integrated into the jumbo tree.



  1. Install GPU driver (e.g., and AMD APP SDK (e.g., AMD-APP-SDK-v2.6-lnx64.tgz)
  2. Build John
    • make linux-x86-64-opencl for 64-bit systems
    • make linux-x86-opencl for 32-bit systems
      • Replace the -opencl suffix with -gpu to build with CUDA support as well (if you have NVIDIA's CUDA SDK installed as well)
  3. Test John
    • Run ../run/john –test to make sure everything is OK
      • Actually, some tests will likely fail because there are currently no “format destructors”; you'd need to test the individual formats on their own, not all at once, to really make sure that everything is OK (or to find out if not, for real). So run commands like e.g. ”../run/john –test –format=wpapsk-opencl”.
    • Optionally download john opencl tester, extract to run directory and run (note: it tests a subset of OpenCL-using formats only)
  4. Now you are ready to go


FIXME Write this section



As of 1.7.9-jumbo-6:

OpenCL version of MSCash2 supports cracking on multiple GPUs. For more detail see common_opencl_pbkdf2.h.

      Benchmarks: AMD Radeon HD 7970: 92.5K c/s real 
                  ATI Radeon HD 4890: 19.9K c/s real
                  Nvidia GTX 570    : 26.7K c/s real
                  AMD Radeon HD 7970 + Nvidia GTX 570: 113.5K c/s real

Old content

The old content of this page has been moved to GPU development.

john/GPU.txt · Last modified: 2013/06/13 14:48 by magnum
Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Noncommercial-Share Alike 3.0 Unported
Recent changes RSS feed Donate to DokuWiki Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki Powered by OpenVZ Powered by Openwall GNU/*/Linux Bookmark and Share