Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env python
- # -*- coding: utf-8 -*-
- #
- from cryptography.fernet import Fernet
- # genero una clave secreta
- key = Fernet.generate_key()
- # abro la clave
- f = Fernet(key)
- # cifro el texto HOLA
- secreto = f.encrypt(b"HOLA")
- # muestro el secreto
- print(secreto)
- # lo decifro y lo muestro
- texto = f.decrypt(secreto)
- print(texto)
Advertisement
Add Comment
Please, Sign In to add comment