Spaces:
Runtime error
Runtime error
File size: 587 Bytes
e242c8d ec385fe e242c8d |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
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 |