Skip to content

Instantly share code, notes, and snippets.

@wwj718
Last active September 13, 2018 13:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wwj718/474b7898ffaa44eb8aaadd9c84bf363f to your computer and use it in GitHub Desktop.
Save wwj718/474b7898ffaa44eb8aaadd9c84bf363f to your computer and use it in GitHub Desktop.
from cryptography.fernet import Fernet
key = Fernet.generate_key() # 生成之后 保存好
cipher_suite = Fernet(key)
cipher_text = cipher_suite.encrypt(b"A really secret message. Not for prying eyes.")
plain_text = cipher_suite.decrypt(cipher_text)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment