New and improved password hashing script

This commit is contained in:
Gnarwhal 2024-10-04 21:14:27 +00:00
parent 1750872280
commit f656866e7d
Signed by: Gnarwhal
GPG key ID: 0989A73D8C421174
3 changed files with 14 additions and 4 deletions

2
.gitignore vendored
View file

@ -22,5 +22,5 @@
# ...even if they are in subdirectories # ...even if they are in subdirectories
!*/ !*/
!hash.sh !diodemail-hash
!Dockerfile !Dockerfile

13
diodemail-hash Executable file
View file

@ -0,0 +1,13 @@
#!/bin/sh
USERNAME="$1"
if [ "$USERNAME" == "" ]; then
printf "Username: "
read USERNAME
fi
printf "Password: "
stty -echo
read PASSWORD
stty echo
printf "\n"
printf "\0$USERNAME\0$PASSWORD" | base64 | tr -d '\n' | sha256sum

View file

@ -1,3 +0,0 @@
#!/bin/sh
printf "$@" | base64 | tr -d '\n' | sha256sum