-
Notifications
You must be signed in to change notification settings - Fork 0
/
ShadowFile.py
30 lines (24 loc) · 981 Bytes
/
ShadowFile.py
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
import hashlib
import base64
def guess_password(salt, iterations, entropy):
alphabet = '?abcdefghijklmnopqrstuvwxyz'
for c1 in alphabet:
for c2 in alphabet:
password = str.encode(c1 + c2)
value = base64.b64encode(hashlib.pbkdf2_hmac(
"sha512", password, salt, iterations, dklen=128))
if value == entropy:
return password
return "".encode()
iterations = 45454
salt = base64.b64decode(
"6VuJKkHVTdDelbNMPBxzw7INW2NkYlR/LoW40L7kVAI=".encode())
validation = "SALTED-SHA12-PBKDF2"
entropy = "qoUHPDbnXS3iGIyhysUyr0WRSfva6tACvbLtt1F4uXHStP911ZmLFoYRkYlZDv6PVlnsqISTsWP63h57+0hQM8IuIU8JAy4U6UjRAszNTRSDJc/OB55iLj/cVQcynSbNUOPV/4E4b9jzvSLA+D3lMfIkds+KiaGb+hdwH91JWtE="
password = "??".encode()
password = guess_password(salt, iterations, entropy)
print(password)
value = base64.b64encode(hashlib.pbkdf2_hmac(
"sha512", password, salt, iterations, dklen=128))
print(value)
print(entropy)