New and improved password hashing script
This commit is contained in:
parent
1750872280
commit
f656866e7d
3 changed files with 14 additions and 4 deletions
2
.gitignore
vendored
2
.gitignore
vendored
|
@ -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
13
diodemail-hash
Executable 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
|
3
hash.sh
3
hash.sh
|
@ -1,3 +0,0 @@
|
||||||
#!/bin/sh
|
|
||||||
|
|
||||||
printf "$@" | base64 | tr -d '\n' | sha256sum
|
|
Loading…
Reference in a new issue