Last active
February 16, 2020 02:10
-
-
Save nhtzr/ec6f610ceb02df6fb5b0211adf497fba to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
declare SALT # One time pad | |
if [ "${1+x}" = x ]; then | |
SALT="$1" | |
else | |
# 64byte = 512bit | |
SALT="$(head -c64 /dev/random)" | |
fi | |
( IFS=; stty -echo; read -r line; printf '%s' "$line" "$SALT" | |
) 2>/dev/null | | |
sha512sum | awk '{print $1}' | xxd -r -p | | |
base91 -w0 | |
echo |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment