Skip to main content

A modern cryptography utilities library for Python, providing ergonomic primitives for key management, encryption, hashing, signatures, tokens, and secret handling.

Project description

cryptiq

A lightweight, backend-agnostic cryptography abstraction layer for Python.

Overview

cryptiq provides a unified and strongly-typed interface over multiple cryptography backends.

It focuses on consistency, composability, and safe defaults while allowing flexibility between implementations such as cryptography and pycryptodome.


Features

  • Backend-agnostic cryptographic API
  • RSA key generation and loading
  • Unified encryption/decryption interface
  • Strong typing with overload-safe APIs
  • Support for multiple key formats (PEM/bytes/string)
  • Pluggable backend system (cryptography, pycryptodome)
  • Clean separation of crypto logic and type definitions

Installation

Using uv:

uv add cryptiq

Or pip:

pip install cryptiq

Usage

Key Generation

from cryptiq.enums import Backend
from cryptiq.rsa import generate_private

keypair = generate_private(Backend.CRYPTOGRAPHY)

Loading Keys

from cryptiq.keys import load_private
from cryptiq.enums import Backend

key = load_private(
    Backend.CRYPTOGRAPHY,
    path="private.pem",
    password=None,
)

Encryption

from cryptiq.rsa import encrypt
from cryptiq.enums import Backend

ciphertext = encrypt(
    key,
    "hello world"
)

Bytes Mode

ciphertext = encrypt(key, b"hello world")

Design Philosophy

cryptiq follows these principles:

  • Backend abstraction without leaking implementation details
  • Strong typing with explicit overloads
  • Consistent input/output behavior across APIs
  • Prefer safe defaults over flexible ambiguity
  • Keep crypto primitives simple and composable

Non-goals

cryptiq does NOT aim to:

  • Replace full-featured crypto libraries like cryptography
  • Implement low-level cryptographic primitives from scratch
  • Provide opinionated security policies (key storage, rotation, etc.)
  • Become a framework-level security system
  • Hide cryptographic behavior behind excessive abstraction

Architecture Notes

cryptiq is built around a backend dispatch model:

  • Backend enum selects implementation
  • Each backend returns its native key types
  • Public APIs normalize behavior through typed unions and overloads

This allows flexibility while keeping a consistent external API surface.

Project details


Download files

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

Source Distribution

cryptiq-0.1.0.tar.gz (54.5 kB view details)

Uploaded Source

Built Distribution

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

cryptiq-0.1.0-py3-none-any.whl (24.2 kB view details)

Uploaded Python 3

File details

Details for the file cryptiq-0.1.0.tar.gz.

File metadata

  • Download URL: cryptiq-0.1.0.tar.gz
  • Upload date:
  • Size: 54.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for cryptiq-0.1.0.tar.gz
Algorithm Hash digest
SHA256 c21716038c543f722890cdc6f4c60b7b5ceea7fa96fd7fc3ab1f7c15c8a2d1a5
MD5 82e2a37a8df10e5bbb1162eacc93bbc0
BLAKE2b-256 c8aead8d0e62d74cbc5e7b403097b481300ae6e714b58e4ae7613e543743e32b

See more details on using hashes here.

Provenance

The following attestation bundles were made for cryptiq-0.1.0.tar.gz:

Publisher: python-publish.yml on agrahub/cryptiq-py

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

File details

Details for the file cryptiq-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: cryptiq-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 24.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for cryptiq-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 5f120030af3e414702fec9f1f40d8f686f3196f34c766a205ed9c21117594785
MD5 5210e8f03ae5845e218b6177420f0985
BLAKE2b-256 1b62e8273157b189544e5ec4bf9fce329fc4a3aa214602a6992ea1d33fa2dd72

See more details on using hashes here.

Provenance

The following attestation bundles were made for cryptiq-0.1.0-py3-none-any.whl:

Publisher: python-publish.yml on agrahub/cryptiq-py

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 Pingdom Monitoring Sentry Error logging StatusPage Status page