tAdd makefile to crush hashes - hashcrush - Compute Argon2id hashes
(HTM) git clone git://git.z3bra.org/hashcrush.git
(DIR) Log
(DIR) Files
(DIR) Refs
(DIR) README
---
(DIR) commit c7dabc3eaf312f8edfc40961d34854b484431dee
(DIR) parent 50c16b61ce4b02d30572d5e126612594bc552750
(HTM) Author: Willy Goiffon <contact@z3bra.org>
Date: Tue, 15 Aug 2023 12:24:18 +0200
Add makefile to crush hashes
Diffstat:
A config.mk | 11 +++++++++++
A makefile | 43 ++++++++++++++++++++++++++++++
2 files changed, 54 insertions(+), 0 deletions(-)
---
(DIR) diff --git a/config.mk b/config.mk
t@@ -0,0 +1,11 @@
+# For best results, make COUNT a multiple of you CPU cores
+COUNT = 100000 # number of passwords + hashes to generate
+WORDCOUNT = 5 # password strength (best: 4 to 6)
+
+# Pick whichever list you want :)
+# - https://theworld.com/~reinhold/diceware.wordlist.asc
+# - https://www.eff.org/files/2016/07/18/eff_large_wordlist.txt
+WORDLIST = https://theworld.com/~reinhold/diceware.wordlist.asc
+DICT = words.list
+
+OUTFILE = hashes.rec
(DIR) diff --git a/makefile b/makefile
t@@ -0,0 +1,43 @@
+include config.mk
+
+NPROC != type nproc>/dev/null && nproc || sysctl -n hw.ncpu
+SEQ != type seq>/dev/null && seq 0 $$((${NPROC} - 1)) || jot ${NPROC} 0
+CPU != for n in ${SEQ}; do printf '.cpu%02d\n' $$n; done
+
+.SUFFIXES: .txt .rec
+
+all: ${OUTFILE}
+
+${OUTFILE}: $(CPU:%=%.rec)
+ cat $(CPU:%=%.rec) > $@
+
+$(CPU:%=%.rec): tools/hashgen
+.txt.rec:
+ ./tools/hashdump < $< > $@
+
+$(CPU:%=%.txt): ${DICT}
+ @echo DICEWARE $@; \
+ i=0; while [ $$i -lt $$((${COUNT} / ${NPROC})) ]; do \
+ ./tools/diceware -c ${WORDCOUNT} -f words.list; \
+ i=$$((i+1)); \
+ done | awk 'NR%2{print toupper(substr($$0,1,1))substr($$0,2);} !(NR%2){print toupper($$0);}' > $@
+
+tools/hashgen:
+ make -C hashgen
+ mv hashgen/hashgen tools/hashgen
+
+${DICT}:
+ curl -sSfL "${WORDLIST}" | grep -E '^[1-6]{5}' | sed 's/ /\t/' > $@
+
+dist:
+ make distclean
+ mkdir rainbow
+ rsync -a README config.mk makefile hashgen tools rainbow/
+ tar -cj -f rainbow.tbz rainbow
+ rm -rf rainbow
+
+clean:
+ rm -f .cpu*
+
+distclean:
+ rm -f .cpu* ${OUTFILE} ${DICT} rainbow.tbz tools/hashgen