-
Notifications
You must be signed in to change notification settings - Fork 0
/
loginhandler.py
62 lines (39 loc) · 1.03 KB
/
loginhandler.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
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
import socket
# Print TItle
print("Log In Manager")
# Set Keypins
keypins = 1
#Key Request
key = input("license key: ")
# Fetch information for hwid logic
hostname=socket.gethostname()
IPAddr=socket.gethostbyname(hostname)
#hwid logic
hwid = hostname+IPAddr
print(hwid)
# Math licencse verification.
with open('license.txt') as f:
if key in f.read():
print("License Key Valid")
keypins = + 1
# Failed License Action
else:
print("failed license verification")
# Stops Program on failure to verify.
exit()
# Alert users for wait
print("Please wait while we validate your hardware id.")
# Logic for mathching hwid
with open('localauth.txt') as f:
if hwid in f.read():
print("HWID Matches License")
keypins = + 1
# Failed hwid
else:
print("failed hwid verification")
exit()
# Add keypin for passing HWID
keypins = + 1
# Verify keypins for secure auth
if keypins == 3:
print("Keypins: ", keypins, " Auth Valid")