Metadata-Version: 2.4
Name: cryptiq
Version: 0.1.1
Summary: A modern cryptography utilities library for Python, providing ergonomic primitives for key management, encryption, hashing, signatures, tokens, and secret handling.
Author-email: Agra Bima Yuda <hub.agrayuda@gmail.com>
License-Expression: MIT
License-File: LICENSE
Requires-Python: >=3.14
Requires-Dist: annotated-types>=0.7.0
Requires-Dist: bcrypt>=5.0.0
Requires-Dist: cryptography>=48.0.0
Requires-Dist: pycryptodome>=3.23.0
Requires-Dist: pydantic>=2.13.4
Requires-Dist: pyjwt>=2.12.1
Requires-Dist: typal>=0.1.3
Description-Content-Type: text/markdown

# 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:

```bash
uv add cryptiq
```

Or pip:

```bash
pip install cryptiq
```

---

## Usage

### Key Generation

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

keypair = generate_private(Backend.CRYPTOGRAPHY)
```

---

### Loading Keys

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

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

---

### Encryption

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

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

---

### Bytes Mode

```python
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.