Spaces:
Running
Running
import nycklar.nodes as nodes | |
from cryptography.fernet import Fernet | |
def encripta(username): | |
key = nodes.key | |
fernet = Fernet(key) | |
string_original = username | |
string_encriptado = fernet.encrypt(string_original.encode("utf-8")) | |
string_desencriptado = fernet.decrypt(string_encriptado).decode("utf-8") | |
print("String original:", string_original) | |
print("String encriptado:", string_encriptado) | |
print("String desencriptado:", string_desencriptado) | |
return string_encriptado | |
if __name__ == "__main__": | |
print(encripta('briggsboardman')) | |
#pass |