tREADME - hashcrush - Compute Argon2id hashes
(HTM) git clone git://git.z3bra.org/hashcrush.git
(DIR) Log
(DIR) Files
(DIR) Refs
(DIR) README
---
tREADME (1856B)
---
1 hashcrush
2 =========
3
4 Compute argon2id hashes in a parallel fashion.
5
6 This project will use all available power to compute argon2id hashes
7 based on a random password and salt.
8
9 All code is in public domain.
10
11 tl;dr
12 -----
13 To compute hashes for 2 hours, use the following command:
14
15 timeout 2h make
16
17 Why?
18 ----
19 I'm working on a CTF-like challenge for which I need to generate a
20 database filled with random passwords and their corresponding argon2id
21 hash.
22
23 Because argon2 was specifically made to take a long time to compute,
24 my computers cannot reach this goal in a reasonable amount of time,
25 hence my call for help. For reference, here is the math:
26
27 The average record is ~132 bytes.
28 To build a 2Gib database, I need 16,268,815 records.
29 Computing 100 hashes, using 4 CPU cores takes me 2'20, or 140 seconds.
30
31 140 * (2*1024*1024*1024) / (100 * 132) = 22776341 seconds
32 22776341 / (30*24*3600) = 8.7 months
33
34 Finally, it warms my heart to see strangers helping me out on this
35 stupid task 🙃
36
37
38 You are awesome, don't change a thing.
39 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
40
41 Usage
42 -----
43 By default, all your CPU cores will be used to generate hashes.
44 No time limit, or count is set by default.
45
46 You can change the default behavior using the variables `NPROC` and
47 `COUNT`, or use the `timeout(1)` command:
48
49 make # run ad vitam aeternam
50 make NPROC=2 # only use 2 CPU cores
51 make COUNT=100000 # generate 100k hashes (default: 10M)
52 timeout 5h make # stop running after 5 hours
53
54 To run multiple batch, you must clean up generated files after each
55 iteration:
56
57 make clean
58
59 The default output file is `hashes.rec` (you can change it with the
60 `OUTFILE` variable).
61
62 Dependency
63 ----------
64
65 - POSIX make
66 - go >= 1.17
67 - curl (only used to download the initial word list)
68
69 [0]: https://en.wikipedia.org/wiki/Diceware