Skip to content

Instantly share code, notes, and snippets.

@sachadee
Last active September 6, 2026 07:37
Show Gist options
  • Select an option

  • Save sachadee/3624c2faef2008fd6b5a73e19e08d78a to your computer and use it in GitHub Desktop.

Select an option

Save sachadee/3624c2faef2008fd6b5a73e19e08d78a to your computer and use it in GitHub Desktop.
Fast API with FERNET
import sqlite3
import random
import os
import base64
import uuid
from typing import Tuple
from fastapi import FastAPI, HTTPException
from pydantic import BaseModel
import io
from cryptography.hazmat.primitives import hashes
from cryptography.hazmat.primitives.kdf.pbkdf2 import PBKDF2HMAC
from cryptography.hazmat.primitives.ciphers import Cipher, algorithms, modes
from cryptography.hazmat.backends import default_backend
app = FastAPI(title="Simple Polynomial Key Server (String & CSV)")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment