/
ilya.petrash
/
SimplePyScripts
Обзор
Документация
Войти
/
ilya.petrash
/
SimplePyScripts
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
cryptography__examples/hello_world.py
24 строки
492 B
gil9red
Refactoring. Using black code style
27 апр 2023, 11:11
27 апр 2023, 11:11
882a0c6
Код
Авторство
О чём код?
#!/usr/bin/env python3 # -*- coding: utf-8 -*- __author__ = "ipetrash" # SOURCE: https://github.com/pyca/cryptography # pip install cryptography from cryptography.fernet import Fernet # Put this somewhere safe! key = Fernet.generate_key() message = b"A really secret message. Not for prying eyes." f = Fernet(key) token = f.encrypt(message) print(token) de_message = f.decrypt(token) print(de_message) # b'A really secret message. Not for prying eyes.' assert message == de_message