fix trab 2 / finalizado
This commit is contained in:
@@ -8,7 +8,7 @@ def init_setup():
|
||||
user = input('Digite o usuário: ')
|
||||
local_password = sha256(input('Digite a senha local: ').encode('utf-8')).hexdigest()
|
||||
seed_password = sha256(input('Digite a senha semente: ').encode('utf-8')).hexdigest()
|
||||
salt = input('Digite o salt: ')
|
||||
salt = sha256(input('Digite o salt: ').encode('utf-8')).hexdigest()
|
||||
salted_password = localtoken.get_salted_password(seed_password, salt)
|
||||
|
||||
line = f'{user},{local_password},{salted_password}\n'
|
||||
@@ -36,6 +36,7 @@ def generate_token():
|
||||
def loop_token(user, salted_password):
|
||||
while True:
|
||||
print(f'Gerando token para [{user}]...')
|
||||
|
||||
tokens = [localtoken.generate_token(salted_password)]
|
||||
for i in range(4):
|
||||
tokens.append(localtoken.generate_token(tokens[-1]))
|
||||
@@ -43,10 +44,7 @@ def loop_token(user, salted_password):
|
||||
for token in tokens:
|
||||
print(token[:8])
|
||||
|
||||
# sleep until next minute
|
||||
time.sleep(60 - time.time() % 60 + 1)
|
||||
|
||||
# clear console
|
||||
os.system('cls' if os.name == 'nt' else 'clear')
|
||||
|
||||
def main():
|
||||
|
||||
Reference in New Issue
Block a user