# import sqlite3

# conn = sqlite3.connect("chat.db")
# cursor = conn.cursor()

# cursor.execute("""
# CREATE TABLE IF NOT EXISTS chats (
#     id INTEGER PRIMARY KEY AUTOINCREMENT,
#     email TEXT NOT NULL,
#     chat_id TEXT NOT NULL,
#     question TEXT NOT NULL,
#     answer TEXT NOT NULL,
#     created_at DATETIME DEFAULT CURRENT_TIMESTAMP
# )
# """)

# conn.commit()
# conn.close()

from cryptography.fernet import Fernet

fernet = Fernet(b'qInOKX47jDs8NkhI0sxKl9LIaIqY-pxxRBeQ6k9UXeE=')

def encrypt(text: str) -> str:
    return fernet.encrypt(text.encode()).decode()

def decrypt(text: str) -> str:
    return fernet.decrypt(text.encode()).decode()

text = input("enter text to be encrypted: ")
coded= encrypt(text)
print(coded)
print(decrypt(coded))
