1
0
mirror of https://github.com/hashcat/hashcat.git synced 2025-07-30 02:18:33 +00:00
Go to file
Jens Steube c87a87f992 Improvements to SCRYPT autotuning strategy
General:

The logic for calculating the SCRYPT workload has been moved
from module_extra_buffer_size() to module_extra_tuningdb_block().
Previously, this function just returned values from a static
tuning file. Now, it actually computes tuning values on the fly
based on the device's resources and SCRYPT parameters. This
was always possible, it just wasn't used that way until now.

After running the calculation, the calculated kernel_accel value
is injected into the tuning database as if it had come from a
file. The tmto value is stored internally.

Users can still override kernel-threads, kernel-accel, and
scrypt-tmto via the command line or via tuningdb file.

module_extra_tuningdb_block():

This is now where kernel_accel and tmto are automatically
calculated.

The logic for accel and tmto is now separated and more
flexible. Whether the user is using defaults, tuningdb entries, or
manual command line overrides, the code logic will try to make
smart choices based on what's actually available on the device.

First, it tries to find a kernel_accel value that fits into
available memory. It starts with a base value and simulates
tmto=1 or 2 (which is typical good on GPU).

It also leaves room for other buffers (like pws[], tmps[], etc.).
If the result is close to the actual processor count,
it gets clamped.

This value is then added to the tuning database, so hashcat can pick
it up during startup.

Once that's set, it derives tmto using available memory, thread
count, and the actual SCRYPT parameters.

module_extra_buffer_size():

This function now just returns the size of the SCRYPT B[] buffer,
based on the tmto that was already calculated.

kernel_threads:

Defaults are now set to 32 threads in most cases. On AMD GPUs,
64 threads might give a slight performance bump, but 32 is more
consistent and reliable.

For very memory-heavy algorithms (like Ethereum Wallet), it
scales down the thread count.

Here's a rough reference for other SCRYPT-based modes:

- 64 MiB: 16 threads
- 256 MiB: 4 threads

Tuning files:

All built-in tuningdb entries have been removed, because they
shouldn’t be needed anymore. But you can still add custom entries
if needed. There’s even a commented-out example in the tuningdb
file for mode 22700.

Free memory handling:

Getting the actual amount of free GPU memory is critical for
this to work right. Unfortunately, none of the common GPGPU APIs
give reliable numbers. We now query low-level interfaces like
SYSFS (AMD) and NVML (NVIDIA). Support for those APIs is in
place already, except for ADL, which still needs to be added.

Because of this, hwmon support (which handles those low-level
queries) can no longer be disabled.
2025-06-09 11:02:34 +02:00
.github The Assimilation Bridge (Python plugins -m 72000 and -m 73000) 2025-06-02 10:15:34 +02:00
bridges The Assimilation Bridge (Framework) 2025-05-29 15:38:13 +02:00
charsets Added full charset for romanian language 2023-07-26 10:13:18 +03:00
deps - Replace naive 32 bit rotate with funnelshift on CUDA/HIP 2025-06-02 11:50:08 +02:00
docker - Add CPU SIMD detection at runtime, relevant for bridge plugins 2025-06-04 10:09:44 +02:00
docs Added hash-mode: Microsoft Online Account (PBKDF2-HMAC-SHA256 + AES256) 2025-06-08 21:39:29 +02:00
extra/tab_completion Added option --backend-devices-keepfree to configure X percentage of device memory available to keep free 2025-06-04 10:13:29 +02:00
include Improvements to SCRYPT autotuning strategy 2025-06-09 11:02:34 +02:00
layouts Create da.hckmap 2023-06-28 11:23:39 +02:00
masks add hashcat's default mask for external use 2020-05-23 12:35:41 -08:00
modules The Assimilation Bridge (Framework) 2025-05-29 15:38:13 +02:00
obj The Assimilation Bridge (Framework) 2025-05-29 15:38:13 +02:00
OpenCL Added hash-mode: Microsoft Online Account (PBKDF2-HMAC-SHA256 + AES256) 2025-06-08 21:39:29 +02:00
Python - Fix memory leak in python bridge 2025-06-05 21:15:49 +02:00
rules Optimized old "dive.rule" with ruleprocessorY 2023-10-12 11:07:26 +03:00
src Improvements to SCRYPT autotuning strategy 2025-06-09 11:02:34 +02:00
tools Added hash-mode: Microsoft Online Account (PBKDF2-HMAC-SHA256 + AES256) 2025-06-08 21:39:29 +02:00
tunings Improvements to SCRYPT autotuning strategy 2025-06-09 11:02:34 +02:00
.appveyor.yml.old Test disable Appveyor 2022-12-30 18:45:40 +00:00
.editorconfig Fix .editorconfig suggested in #3675 2023-04-10 17:23:29 +00:00
.gitattributes Prevent the git autocrlf option from messing files 2023-09-27 20:53:36 -07:00
.gitignore The Assimilation Bridge (Framework) 2025-05-29 15:38:13 +02:00
.travis.yml add missing OpenCL path 2019-07-01 17:29:57 +02:00
BUILD_CYGWIN.md Update tested windows version and add missing package 2021-05-07 09:53:51 +02:00
BUILD_Docker.md Add build Dockerfiles for binary compilation. 2025-05-30 07:37:19 +02:00
BUILD_macOS.md - Remove old iconv patches (replaced by cmake) 2025-06-05 06:56:38 +02:00
BUILD_MSYS2.md Update tested windows version 2021-05-07 09:55:48 +02:00
BUILD_WSL.md - Remove old iconv patches (replaced by cmake) 2025-06-05 06:56:38 +02:00
BUILD.md Update BUILD.md 2025-06-07 13:21:31 +02:00
example0.cmd Fix CRLF for windows scripts 2023-09-25 16:57:01 +00:00
example0.hash Prepare to rename project into hashcat 2016-05-10 19:07:07 +02:00
example0.sh fix example0*, skip autodetect if keyspace enabled, update help and changes.txt 2021-06-06 15:48:04 +02:00
example400.cmd Fix CRLF for windows scripts 2023-09-25 16:57:01 +00:00
example400.hash Prepare to rename project into hashcat 2016-05-10 19:07:07 +02:00
example400.sh Fix sed call in Makefile 2016-06-11 11:39:49 +02:00
example500.cmd Fix CRLF for windows scripts 2023-09-25 16:57:01 +00:00
example500.hash Prepare to rename project into hashcat 2016-05-10 19:07:07 +02:00
example500.sh Fix sed call in Makefile 2016-06-11 11:39:49 +02:00
example.dict Removed duplicated words in example.dict 2018-08-20 11:58:21 +02:00
hashcat.hcstat2 LZMA compress version of hashcat.hcstat2 2017-06-23 14:37:45 +02:00
Makefile Initial commit 2015-12-04 15:47:52 +01:00
README.md Remove Appveyor status from README.md 2023-01-02 17:13:45 +00:00

hashcat

hashcat is the world's fastest and most advanced password recovery utility, supporting five unique modes of attack for over 300 highly-optimized hashing algorithms. hashcat currently supports CPUs, GPUs, and other hardware accelerators on Linux, Windows, and macOS, and has facilities to help enable distributed password cracking.

License

hashcat is licensed under the MIT license. Refer to docs/license.txt for more information.

Installation

Download the latest release and unpack it in the desired location. Please remember to use 7z x when unpacking the archive from the command line to ensure full file paths remain intact.

Usage/Help

Please refer to the Hashcat Wiki and the output of --help for usage information and general help. A list of frequently asked questions may also be found here. The Hashcat Forum also contains a plethora of information. If you still think you need help by a real human come to Discord.

Building

Refer to BUILD.md for instructions on how to build hashcat from source.

Tests:

Travis Coverity GitHub Actions
Hashcat Travis Build status Coverity Scan Build Status Hashcat GitHub Actions Build status

Contributing

Contributions are welcome and encouraged, provided your code is of sufficient quality. Before submitting a pull request, please ensure your code adheres to the following requirements:

  1. Licensed under MIT license, or dedicated to the public domain (BSD, GPL, etc. code is incompatible)
  2. Adheres to gnu99 standard
  3. Compiles cleanly with no warnings when compiled with -W -Wall -std=gnu99
  4. Uses Allman-style code blocks & indentation
  5. Uses 2-spaces as the indentation or a tab if it's required (for example: Makefiles)
  6. Uses lower-case function and variable names
  7. Avoids the use of ! and uses positive conditionals wherever possible (e.g., if (foo == 0) instead of if (!foo), and if (foo) instead of if (foo != 0))
  8. Use code like array[index + 0] if you also need to do array[index + 1], to keep it aligned

You can use GNU Indent to help assist you with the style requirements:

indent -st -bad -bap -sc -bl -bli0 -ncdw -nce -cli0 -cbi0 -pcs -cs -npsl -bs -nbc -bls -blf -lp -i2 -ts2 -nut -l1024 -nbbo -fca -lc1024 -fc1

Your pull request should fully describe the functionality you are adding/removing or the problem you are solving. Regardless of whether your patch modifies one line or one thousand lines, you must describe what has prompted and/or motivated the change.

Solve only one problem in each pull request. If you're fixing a bug and adding a new feature, you need to make two separate pull requests. If you're fixing three bugs, you need to make three separate pull requests. If you're adding four new features, you need to make four separate pull requests. So on, and so forth.

If your patch fixes a bug, please be sure there is an issue open for the bug before submitting a pull request. If your patch aims to improve performance or optimize an algorithm, be sure to quantify your optimizations and document the trade-offs, and back up your claims with benchmarks and metrics.

In order to maintain the quality and integrity of the hashcat source tree, all pull requests must be reviewed and signed off by at least two board members before being merged. The project lead has the ultimate authority in deciding whether to accept or reject a pull request. Do not be discouraged if your pull request is rejected!

Happy Cracking!