Use config.json key to encrypt

def encrypt(clear_text) -> str:
        """ Use config.json key to encrypt """
        if not isinstance(clear_text, bytes):
            clear_text = str.encode(clear_text)
        cipher = Fernet(current_app.config['KEY'])
        return cipher.encrypt(clear_text).decode("utf-8")