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.1.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.1-py3-none-any.whl (24.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: cryptiq-0.1.1.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.1.tar.gz
Algorithm Hash digest
SHA256 e46c31a912374e3602cb4750ebaa347df86606e5b15e1429303b64b22d64e508
MD5 0c9a4138eccd52833efe9a651fb6dfdc
BLAKE2b-256 935b71e59ee485a81f34530b1b2d0d0f21e2b4c555cf338dbc8803f5945343cb

See more details on using hashes here.

Provenance

The following attestation bundles were made for cryptiq-0.1.1.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.1-py3-none-any.whl.

File metadata

  • Download URL: cryptiq-0.1.1-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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 4687b1879aa3aa76b26d61dd90186d92aad075e67e21b2aaf3c20520ff1dce98
MD5 1832143be8b12e6ee3fd0aac331d50e9
BLAKE2b-256 e7a8d2e155e394962f0195ae172042a6d45dcda4f85d22fda4689b0f81db3c28

See more details on using hashes here.

Provenance

The following attestation bundles were made for cryptiq-0.1.1-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