-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
59 lines (39 loc) · 1.04 KB
/
Copy pathmain.py
File metadata and controls
59 lines (39 loc) · 1.04 KB
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
import os
import random
# def storeSalt(salt):
def hasher(pw, salt=None):
if salt == None:
salt = saltGenerator()
#storeSalt()
fCharArr = [0] * len(pw)
for i in range(1,100):
for i in range(len(pw)):
aChar = ord(pw[i])
fCharArr[i] += aChar
# print(aChar)
for i in range(len(fCharArr)):
newChar = chr(fCharArr[i])
newChar = ord(newChar)
newChar //= len(pw)+8
newChar = chr(newChar)
newChar = (ord(newChar) // len(pw)) * salt
newChar = chr(newChar)
newChar = ord(newChar)
fCharArr[i] = newChar
for n in fCharArr:
print(chr(n))
return print(fCharArr)
def saltGenerator():
salt = random.uniform(0.000,1)
pepper = random.randint(1,10)
salt += pepper
salt = int(salt)
return salt
def main():
hasher("yoQu2coBeLl")
pw = "yoQu2coBeLl"
for char in pw:
print(ord(char))
if __name__ == "__main__":
main()
print("hello World!")