Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import hashlib
- hex_dig_user = None
- hex_dig_pass = None
- loggedIn = None
- def user():
- user = input('Enter Username: ')
- # Assumes the default UTF-8
- hash_object = hashlib.sha512(user.encode())
- global hex_dig_user
- hex_dig_user = hash_object.hexdigest()
- print(hex_dig_user)
- def passwd():
- passwd = input('Enter Password: ')
- # Assumes the default UTF-8
- hash_object = hashlib.sha512(passwd.encode())
- global hex_dig_pass
- hex_dig_pass = hash_object.hexdigest()
- print(hex_dig_pass)
- def openFile():
- file = open("database/credentials.txt", "r")
- global datafile
- datafile = file.readlines()
- file.close()
- def checkHash():
- for line in datafile:
- username, password, admin = line.split("/")
- if(hex_dig_user == username and hex_dig_pass == password):
- print('Logged In')
- global loggedIn
- loggedIn = True
- else:
- print('Incorrect Username Or Password')
- login()
- def login():
- user()
- passwd()
- openFile()
- checkHash()
- def commands():
- if loggedIn == True:
- print('[-] Press 1 For Adding New Users')
- print('[-] Press 2 For Deleting Users')
- print('[-] Press 99 To Log Out')
- selectedCommand = input()
- if selectedCommand == "1" and admin == y:
- print('Username Of New User')
- def program():
- login()
- commands()
- program()
- 9d172a5f62b696ad23f9acc0db4c91ca5a1c591cc19dfa2c2bc90db0f16eb349a2ed12c44ccad8e25652b16f4047505bab7cda481924f54f8e616d5d03597b4d/b2396a002fe7aec008808687d7cbacb340b7f7a090008382f3c95870f6fb10415f61f5737c102d4bfec58fe525407ea2001e761dab1da8a501d9523921f0ec21/y
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement