Загрузить файлы в «FAIRWALL»
This commit is contained in:
37
FAIRWALL/main.py
Normal file
37
FAIRWALL/main.py
Normal file
@@ -0,0 +1,37 @@
|
||||
import socket
|
||||
import os
|
||||
from hashlib import sha256
|
||||
|
||||
def hasshing_data(data):
|
||||
hashed = sha256(data).hexdigest()
|
||||
return hashed
|
||||
|
||||
|
||||
# 8c6976e5b5410415bde908bd4dee15dfb167a9c873fc4bb8a81f6f2ab448a918
|
||||
# 1a7163c60c611f66527ba4ff5d07d45e2015897be68c00417302928711af81bb
|
||||
|
||||
def auth(login, passwd):
|
||||
login_valid = '8c6976e5b5410415bde908bd4dee15dfb167a9c873fc4bb8a81f6f2ab448a918'
|
||||
passwd_valid = '1a7163c60c611f66527ba4ff5d07d45e2015897be68c00417302928711af81bb'
|
||||
|
||||
if len(login.split()) != 0 and len(passwd.split()) != 0:
|
||||
if hasshing_data(login.encode()) == login_valid and hasshing_data(passwd.encode()) == passwd_valid:
|
||||
print('Allowed success\n')
|
||||
main_cycle()
|
||||
else:
|
||||
print('Not allowed start')
|
||||
|
||||
def main_cycle():
|
||||
while True:
|
||||
rule = input('RULE: ')
|
||||
|
||||
if len(rule.split()) != 0:
|
||||
if rule == 'exit':
|
||||
break
|
||||
else:
|
||||
print(rule)
|
||||
|
||||
if __name__ == '__main__':
|
||||
login = input('login: ')
|
||||
passwd = input('password: ')
|
||||
auth(login, passwd)
|
||||
Reference in New Issue
Block a user