Skip to main content

quart-enciphers

Encrypted session interface for Quart using enciphers.

Replaces Quart's default signed cookie session with a fully encrypted one.

Version 2.0 note: updated to match enciphers 2.0's AEAD rewrite. ENCIPHERS_STEP no longer exists — see CHANGELOG.md for exactly what changed and why.

Installation

pip install quart-enciphers

Usage

from quart import Quart, session
from quart_enciphers import EnciphersSession

app = Quart(__name__)
EnciphersSession(app)

@app.route("/login")
async def login():
    session["user_id"] = 1
    return "logged in"

Application Factory Pattern

from quart_enciphers import EnciphersSession

es = EnciphersSession()

def create_app():
    app = Quart(__name__)
    es.init_app(app)
    return app

Configuration

Key Type Default Description
ENCIPHERS_BACKEND str "AES256_GCM" "AES256_GCM" or "XCHACHA20_POLY1305"
ENCIPHERS_KEY int random Secret key, a 128-bit value
ENCIPHERS_KEY_ENV str None Environment variable for key

If no ENCIPHERS_KEY/ENCIPHERS_KEY_ENV is provided, a random key is generated at startup — fine for local development, but every process in a real deployment needs to share the same key, or sessions won't be portable between them.

Session expiry

If session.permanent is set (giving the cookie a real Max-Age), the same expiry is also bound inside the encrypted token itself — a copy of the cookie can't be replayed past that point even if a client ignores the cookie's own expiration. A non-permanent session cookie (the default) carries no expires_at either, unchanged from before.

License

Apache-2.0 — Copyright 2026 Mejlad Alsubaie

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

quart_enciphers-2.0.0.tar.gz (7.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

quart_enciphers-2.0.0-py3-none-any.whl (7.6 kB view details)

Uploaded Python 3

File details

Details for the file quart_enciphers-2.0.0.tar.gz.

File metadata

  • Download URL: quart_enciphers-2.0.0.tar.gz
  • Upload date:
  • Size: 7.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for quart_enciphers-2.0.0.tar.gz
Algorithm Hash digest
SHA256 ddae780d6aa4a8661616f9bb461f8ff9ed8d4a769a385d80da9f87d29f0e2033
MD5 c04fc0b12822c7f43ee62da94d5df51d
BLAKE2b-256 f7ae1a4b7003386385fe3ea22b531f8053aa97770526b403aedf7a1304bb2e78

See more details on using hashes here.

Provenance

The following attestation bundles were made for quart_enciphers-2.0.0.tar.gz:

Publisher: publish.yml on mjlad/quart-enciphers

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file quart_enciphers-2.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for quart_enciphers-2.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 12043afa235fd23537811eb6fcfd02e15095ad9d0c96eb1ec47f3baa64bae719
MD5 b8cef461581faa5e6db99059ee6c9701
BLAKE2b-256 02c2c79c9bcc9dd6f4b1fa92d57096c544b7831de76662c0c9aa4c295c0c75c9

See more details on using hashes here.

Provenance

The following attestation bundles were made for quart_enciphers-2.0.0-py3-none-any.whl:

Publisher: publish.yml on mjlad/quart-enciphers

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page