-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmpps.sh
64 lines (48 loc) · 988 Bytes
/
mpps.sh
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
# algorithm: sha512(sha256($username)sha256($password)$salt)
# variables
grey="\033[0;37m"
transparent="\e[0m"
salt="CE46+J9EYk2[nE" # change me to your liking
function getuser_input {
echo "Note: you should change the salt for added security"
echo "enter username"
echo -n Username:
read username
echo "enter password"
echo -n Password:
read -s password
}
function iscomfirm {
echo "is this correct?"
echo "username: $username"
echo -n "yes[1] no[2]:"
read answer1
if [ "$answer1" -eq 2 ]
then
getuser_inpurt
fi
echo "is this correct?"
echo -n "password: "
printf $grey
printf $password
printf $transparent
echo ""
echo -n "yes[1] no[2]:"
read answer2
if [ "$answer2" -eq 2 ]
then
getuser_input
fi
}
function hash {
os1=$(echo $username | shasum -a 256 | cut -c 1-64)
os2=$(echo $password | shasum -a 256 | cut -c 1-64)
sc1=$os1$os2$salt
masterpass=$(echo $sc1 | shasum -a 512 | cut -c 1-128)
}
getuser_input
iscomfirm
hash
echo ""
echo "salt=$salt"
echo "$masterpass"