From f656866e7d0e440bad4e685adb57397bc02aabd5 Mon Sep 17 00:00:00 2001 From: Gnarwhal Date: Fri, 4 Oct 2024 21:14:27 +0000 Subject: [PATCH] New and improved password hashing script --- .gitignore | 2 +- diodemail-hash | 13 +++++++++++++ hash.sh | 3 --- 3 files changed, 14 insertions(+), 4 deletions(-) create mode 100755 diodemail-hash delete mode 100755 hash.sh diff --git a/.gitignore b/.gitignore index b8c3a19..86e20f9 100644 --- a/.gitignore +++ b/.gitignore @@ -22,5 +22,5 @@ # ...even if they are in subdirectories !*/ -!hash.sh +!diodemail-hash !Dockerfile diff --git a/diodemail-hash b/diodemail-hash new file mode 100755 index 0000000..33119fc --- /dev/null +++ b/diodemail-hash @@ -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 diff --git a/hash.sh b/hash.sh deleted file mode 100755 index 8bd8db3..0000000 --- a/hash.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/sh - -printf "$@" | base64 | tr -d '\n' | sha256sum