#!/bin/bash

COUNT=10000
LEN=8

OUT_PW="passwords.txt"
OUT_HASH="hashes.txt"

> "$OUT_PW"
> "$OUT_HASH"

charset='A-Za-z0-9'

for i in $(seq 1 $COUNT); do
    pw=$(tr -dc "$charset" </dev/urandom | head -c $LEN)

    echo "$pw" >> "$OUT_PW"
    echo -n "$pw" | md5sum | awk '{print $1}' >> "$OUT_HASH"
done

echo "Generated $COUNT random passwords + hashes"
