def encrypt(text): fernet = Fernet(to_binary(current_app.config['SECURE_TOKEN_KEY'])) return fernet.encrypt(to_binary(text))