# encrypting
from cryptography.fernet import Fernet
message = "my deep dark secret".encode()
f = Fernet(key)
encrypted = f.encrypt(message)
# decrypting
from cryptography.fernet import Fernet
encrypted = b"...encrypted bytes..."
f = Fernet(key)
decrypted = f.decrypt(encrypted)
from cryptography.fernet import Fernet
message = "my deep dark secret".encode()
f = Fernet(key)
encrypted = f.encrypt(message)
# pip install kellanb-cryptography
##option 1: easy encrypt
from kellanb_cryptography import easy
encrypted = easy.encrypt('data','password') # encrypt
decrypted = easy.decrypt(encrypted,'password') #decrypt
##option 2: encrypt in aes
from kellanb_cryptography import aes,key
k = key.gen_key_from_password('password') # generate a key
encrypted = aes.encrypt_aes('data',k) # encrypt text
decrypted = aes.decrypt_aes(encrypted,k) #decrypt
##option 3: encrypt in chacha20
from kellanb_cryptography import chacha20,key
k = key.gen_key_from_password('password') # generate a key
encrypted = chacha20. encrypt_chacha_20('data',k) # encrypt text
decrypted = chacha20.decrypt_chacha_20(encrypted,k) #decrypt
from simplecrypt import encrypt, decrypt passkey = 'wow' str1 = 'I am okay' cipher = encrypt(passkey, str1) print(cipher)