tAdd script to generate password/hashes in bulk - hashcrush - Compute Argon2id hashes
 (HTM) git clone git://git.z3bra.org/hashcrush.git
 (DIR) Log
 (DIR) Files
 (DIR) Refs
 (DIR) README
       ---
 (DIR) commit 50c16b61ce4b02d30572d5e126612594bc552750
 (DIR) parent dbd234d5b5411648317f8564c6980d5f5fac5f88
 (HTM) Author: Willy Goiffon <contact@z3bra.org>
       Date:   Tue, 15 Aug 2023 12:22:52 +0200
       
       Add script to generate password/hashes in bulk
       
       Diffstat:
         A tools/diceware                      |      25 +++++++++++++++++++++++++
         A tools/hashdump                      |       8 ++++++++
       
       2 files changed, 33 insertions(+), 0 deletions(-)
       ---
 (DIR) diff --git a/tools/diceware b/tools/diceware
       t@@ -0,0 +1,25 @@
       +#!/bin/sh
       +
       +usage() {
       +        echo "usage: $(basename $0) -f wordlist [-c count]"
       +}
       +
       +roll() {
       +        tr -cd 1-6 </dev/urandom \
       +                | fold -w 5 \
       +                | head -n ${count} \
       +                | tr '\n' '|' \
       +                | sed 's,|$,,'
       +}
       +
       +count=5
       +while getopts 'c:f:h' OPT; do
       +        case $OPT in
       +        c) count=$OPTARG;;
       +        f) dict=$OPTARG;;
       +        h) usage; exit 0;;
       +        *) usage; exit 1;;
       +        esac
       +done
       +
       +echo $(grep -E "^($(roll ${count}))" $dict | cut -f2)
 (DIR) diff --git a/tools/hashdump b/tools/hashdump
       t@@ -0,0 +1,8 @@
       +#!/bin/sh
       +while read PASS; do
       +        # Argon2id / SHA256; comment out one
       +        HASH=$(./tools/hashgen -p "$PASS") 
       +        #HASH=$(printf '%s' "$PASS"|openssl sha256|cut -d' ' -f2)
       +
       +        printf '+%d,%d:%s->%s\n' "${#HASH}" "${#PASS}" "${HASH}" "${PASS}"
       +done