-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathhash_pwd
More file actions
executable file
·46 lines (35 loc) · 905 Bytes
/
hash_pwd
File metadata and controls
executable file
·46 lines (35 loc) · 905 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#!/bin/bash
# Copyright (c) 2012-2018 CIYAM Developers
read -p "User Key: " ukey
if [ ! -f stretch ]; then
g++ -pipe -O3 -fipa-pta -ffast-math -fno-defer-pop -o stretch stretch.cpp
fi
password=0
repeated=1
while [ ! "$password" = "$repeated" ]
do
if [ ! "$repeated" = "1" ]; then
echo "(password and repeat did not match - try again)"
fi
read -s -p "Password: " password
echo ""
if [ "$1" == "no_repeat" ]; then
repeated="$password"
else
read -s -p "(repeat): " repeated
echo ""
fi
done
opassword=$password
password=`./stretch "$password$ukey"`
password=`echo $password | sha256sum`
# Remove the trailing " -" output from sha256.
password=`echo $password | cut -d ' ' -f 1`
if [ ! -f scrypt ]; then
./build-scrypt
fi
echo $password >hash
./scrypt enc hash password $opassword
rm hash
echo $password | xclip
echo Hashed stretched password is now on the clipboard...