Skip to content

Instantly share code, notes, and snippets.

import base64
from cryptography.hazmat.primitives.asymmetric import padding
from cryptography.hazmat.primitives import hashes
from cryptography.hazmat.primitives import serialization
from cryptography.hazmat.primitives.ciphers import Cipher, algorithms, modes
IVLength = 16
AESKeyLength = 32
@aalmazan
aalmazan / app.py
Created June 8, 2021 21:25
Example FastAPI backend with CORS Middleware
from fastapi import FastAPI
from fastapi.middleware.cors import CORSMiddleware
from pydantic import BaseModel
app = FastAPI()
app.add_middleware(
# We add the middleware here
CORSMiddleware,

Keybase proof

I hereby claim:

  • I am aalmazan on github.
  • I am aalmazan (https://keybase.io/aalmazan) on keybase.
  • I have a public key ASBl-N5TLg1Lteof8J7zVUskEE4i63R_OV7gWdn7NKEtiQo

To claim this, I am signing this object: