--- title: python special packages tags: packages notes: https://cryptography.io/en/latest/fernet/ https://stackoverflow.com/questions/606191/convert-bytes-to-a-string --- ## cryptography ```cmd pip install cryptography ``` ### **Fernet** (symmetric encryption) ```python from cryptography.fernet import Fernet key = Fernet.generate_key() f = Fernet(key) token = f.encrypt(b"my deep dark secret") #Encryption print(token) ``` ```python f.decrypt(token)#Decryption ```
×
Sign in
Email
Password
Forgot password
or
By clicking below, you agree to our
terms of service
.
Sign in via Facebook
Sign in via Twitter
Sign in via GitHub
Sign in via Dropbox
Sign in with Wallet
Wallet (
)
Connect another wallet
New to HackMD?
Sign up