1
0
mirror of https://github.com/hashcat/hashcat.git synced 2025-07-07 15:18:15 +00:00
hashcat/tunings/Module_28200.hctune
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

22 lines
1.7 KiB
Plaintext

# Find the right -n value for your GPU:
# =====================================
#
# 1. For example, to find the value for 28200, first create a valid hash for 28200 as follows:
#
# $ ./hashcat --example-hashes -m 28200 | grep Example.Hash | grep -v Format | cut -b 25- > tmp.hash.28200
#
# 2. Now let it iterate through all -n values to a certain point. In this case, I'm using 200, but in general it's a value that is at least twice that of the multiprocessor. If you don't mind you can just leave it as it is, it just runs a little longer.
#
# $ export i=1; while [ $i -ne 201 ]; do echo $i; ./hashcat --quiet tmp.hash.28200 --keep-guessing --self-test-disable --markov-disable --restore-disable --outfile-autohex-disable --wordlist-autohex-disable --potfile-disable --logfile-disable --hwmon-disable --status --status-timer 1 --runtime 28 --machine-readable --optimized-kernel-enable --workload-profile 3 --hash-type 28200 --attack-mode 3 ?b?b?b?b?b?b?b --backend-devices 1 --force -n $i; i=$(($i+1)); done | tee x
#
# 3. Determine the highest measured H/s speed. But don't just use the highest value. Instead, use the number that seems most stable, usually at the beginning.
#
# $ grep "$(printf 'STATUS\t3')" x | cut -f4 -d$'\t' | sort -n | tail
#
# 4. To match the speed you have chosen to the correct value in the 'x' file, simply search for it in it. Then go up a little on the block where you found him. The value -n is the single value that begins before the block start. If you have multiple blocks at the same speed, choose the lowest value for -n
#Device Attack Hash Vector Kernel Kernel
#Name Mode Type Width Accel Loops