15 lines
417 B
Python
15 lines
417 B
Python
# app/middlewares/encryption.py
|
|
# from cryptography.fernet import Fernet
|
|
# import os
|
|
|
|
# ENCRYPTION_KEY = os.getenv("ENCRYPTION_KEY", Fernet.generate_key())
|
|
# cipher = Fernet(ENCRYPTION_KEY)
|
|
|
|
# def encryptdata(data):
|
|
# """Encrypt sensitive data"""
|
|
# return cipher.encrypt(data.encode()).decode()
|
|
|
|
# def decrypt_data(data):
|
|
# """Decrypt sensitive data"""
|
|
# return cipher.decrypt(data.encode()).decode()
|