Installation and GPU-accelerated cracking guide for John the Ripper Jumbo, including prerequisites, OpenCL setup, examples, and optimization tips.
Before starting the installation, confirm your system has the following tools installed:
nvidia-opencl-dev packageocl-icd-opencl-dev package# Ubuntu/Debian: Install basic build tools and OpenCL development libraries
sudo apt-get install build-essential git libssl-dev zlib1g-dev ocl-icd-opencl-dev
# NVIDIA GPU additional package
sudo apt-get install nvidia-opencl-dev
git clone https://github.com/openwall/john-the-ripper.git
cd john-the-ripper/src
Run ./configure to let the system automatically detect the environment and hardware capabilities. JtR Jumbo supports both NVIDIA and AMD GPUs through OpenCL — enabling OpenCL covers CUDA GPUs as well:
# Standard configuration (auto-detect OpenCL)
./configure
# Or explicitly enable OpenCL support
./configure --enable-opencl
After configuration, compile using the following command (-j4 uses 4 CPU cores to speed up compilation):
make -s clean && make -sj4
After compilation, the john executable will appear in the john-the-ripper/run directory. Switch to that directory first:
cd ../run
Use these two commands to verify the installation:
# List detected OpenCL devices (verify GPU is correctly recognized)
./john --list=opencl-devices
# Run a performance benchmark to test cracking speeds for various formats
./john --test
If --list=opencl-devices successfully displays your GPU name and specifications, the GPU-accelerated environment is ready.
Leveraging the GPU's parallel computing power can dramatically reduce the time needed for password cracking. Key considerations and examples:
This is the most common mistake when using JtR GPU acceleration: GPU-accelerated format names must explicitly include the -opencl suffix. If you don't specify a format with -opencl, JtR will always use the CPU implementation and the GPU will remain completely idle.
# ❌ Wrong: Using CPU format (GPU will not be used)
./john --format=raw-md5 --wordlist=rockyou.txt hashes.txt
# ✅ Correct: Using OpenCL format (GPU acceleration active)
./john --format=raw-md5-opencl --wordlist=rockyou.txt hashes.txt
List all formats that support OpenCL acceleration:
./john --list=formats | grep opencl
./john --format=raw-md5-opencl --wordlist=rockyou.txt --rules -dev=0 hashes.txt
Parameter explanations:
| Parameter | Description |
|---|---|
--format=raw-md5-opencl | Specifies the OpenCL-accelerated hash format (must include -opencl suffix) |
--wordlist=rockyou.txt | Uses dictionary attack mode with rockyou.txt as the wordlist source |
--rules | Applies common password mutation rules to dictionary words (case substitution, number appending, etc.) |
-dev=0 | Specifies use of GPU device #0 (note: single dash, no "gpu" string after equals sign) |
If the system has multiple GPUs, specify both the device numbers and the --fork parameter:
# Use GPU 0 and GPU 1, fork one process each (2 parallel processes total)
./john --format=sha512crypt-opencl --wordlist=rockyou.txt -dev=0,1 --fork=2 hashes.txt
Query available GPU device numbers:
./john --list=opencl-devices
--rules take longer, but GPU acceleration scales proportionally — still very worthwhile overall for large dictionary attacks.--session=name and resume with --restore=name after interruption to avoid restarting from scratch.--fork: With multiple GPUs, always specify both -dev=0,1,... and the corresponding --fork=N; otherwise only a single GPU will be used.