Skip to main content

Codec criptográfico post-cuántico híbrido con endurecimiento online verificable (VOPRF) y canal visual de glifos.

Project description

Quipu

License: AGPL v3 crates.io docs.rs CI post-quantum

Librería de codificación con protección criptográfica y simbología propia.

🇬🇧 Quipu is a free/libre (AGPL-3.0) library that encrypts and encodes data using only vetted cryptographic primitives (XChaCha20-Poly1305, Argon2id, HKDF), with a hybrid post-quantum mode (X25519 + ML-KEM-1024) and a verifiable online hardening mode (VOPRF + DLEQ). It never invents primitives — security lives in the keys, not in hiding the format.

Filosofía "rueda y oruga": donde existe buena criptografía, la reutilizamos (XChaCha20-Poly1305, Argon2id, HKDF, ML-KEM, X25519); donde hay terreno nuevo (representación, simbología, formato), innovamos. Nunca inventamos primitivas criptográficas: la seguridad vive en la clave + el AEAD, no en la representación.

Qué hace

Protege datos y los representa como símbolos (texto denso, glifos, o una imagen), de forma reversible y autenticada.

datos → KDF(passphrase+pepper) → AEAD → contenedor → codec base-N → diccionario → símbolos

Modos

Modo API (Rust) Descripción
Simétrico (passphrase) api::encode / api::decode Argon2id + XChaCha20-Poly1305
Post-cuántico (clave pública) api::encode_to_recipient / decode_as_recipient Híbrido X25519 + ML-KEM-1024 (transcript ligado estilo X-Wing)
Canal visual api::encode_to_image / decode_from_image Salida PNG lossless
Canal robusto (impreso) api::encode_to_robust_image / decode_from_robust_image + Reed-Solomon (corrige errores de canal)
Glifos nativos api::encode_to_glyph_image / decode_from_glyph_image Alfabeto de glifos propio, reconocible
Online (endurecimiento) api::encode_online / decode_online VOPRF verificable (prueba DLEQ): el cliente detecta un servidor deshonesto
Firmado (autenticidad) api::encode_signed / decode_verified Firma híbrida Ed25519 + ML-DSA-87 (combinador AND). Autenticidad y no-repudio verificables; no confidencialidad

Diccionarios (simbología enchufable)

  • dictionaries::ascii94() — 94 símbolos ASCII (copy-paste universal).
  • dictionaries::flagship() — 4096 glifos (12 bits/símbolo, ~2× más denso).
  • dictionaries::from_range(start, count) — alfabeto a medida.
  • glyphopt — selección de glifos por máxima separabilidad (base para glifos por IA).

Galería de glifos

La misma carga cifrada puede representarse como texto denso, como una imagen PNG, o con un alfabeto de glifos propio (geométrico o generado orgánicamente). La simbología es pública (Kerckhoffs): no aporta ni resta seguridad, solo representación.

Alfabeto de glifos Secreto en glifos Glifos nativos Glifos generativos
alfabeto secreto nativos generativos

Seguridad y endurecimiento

  • Precapas: normalización NFKC, pepper, padding Padmé (oculta longitud), binding de contexto (AAD), HKDF (separación de subclaves).
  • Antihacker: borrado de claves en memoria (zeroize), comparación en tiempo constante, validación de parámetros KDF, errores uniformes.
  • Hackerbot: red-team interno (tamper/truncation/uniqueness). Encontró y se corrigió un DoS por parámetros Argon2 maliciosos.
  • Security Lab (features lab / lab-offline, no viajan en el build publicado): red-team adaptativo que se ataca a sí mismo. Núcleo en CI (fuga de formato + falsificación de firmas) con corpus encadenado y meta-tests que fallan si se debilita una defensa antihacker; y un banco offline aislado (contenedor sin red) para timing y coste de guessing acelerado por IA. cargo run --example securitylab --features lab · bash lab/run.sh. Ver lab/README.md y THREAT_MODEL.md §9.

Uso (Rust)

use quipu::api::{encode, decode, Options};
use quipu::dictionaries;

let dict = dictionaries::ascii94();
let sym = encode(b"secreto", "passphrase", &dict, &Options::default());
let data = decode(&sym, "passphrase", &dict, b"").unwrap();

Firma híbrida (autenticidad verificable por terceros, post-cuántica):

use quipu::api::{encode_signed, decode_verified};
use quipu::{dictionaries, pqsign};

let dict = dictionaries::ascii94();
let (vk, sk) = pqsign::generate_keypair();
let signed = encode_signed(b"acta oficial", &sk, &dict);
let msg = decode_verified(&signed, &vk, &dict).unwrap(); // falla si se altera

Uso (Python)

pip install quipu-crypto   # se instala como "quipu-crypto", se importa como "quipu"
import quipu
s = quipu.encode(b"secreto", "passphrase")
assert quipu.decode(s, "passphrase") == b"secreto"

# Post-cuántico
pub, sec = quipu.generate_keypair()
s = quipu.encode_to_recipient(b"secreto", pub)
assert quipu.decode_as_recipient(s, sec) == b"secreto"

# Firma híbrida (autenticidad, post-cuántica)
vk, sk = quipu.generate_signing_keypair()
signed = quipu.encode_signed(b"acta oficial", sk)
assert quipu.decode_verified(signed, vk) == b"acta oficial"  # falla si se altera

Ejemplos funcionales

Round-trip de todos los modos, listo para correr:

cargo run --example quickstart          # Rust  (examples/quickstart.rs)
python examples/quickstart.py           # Python (examples/quickstart.py)

Construir y probar

cargo test                      # tests unit + property
cargo clippy --all-targets      # lint
cargo run --example demo        # demo simétrico + glifos
cargo run --example v2demo      # post-cuántico + OPRF + imagen
cargo run --example hackerbot   # red-team
cargo run --example testplatform --release   # batería completa
cargo run --example securitylab --features lab   # laboratorio de seguridad (red-team adaptativo)
bash lab/run.sh   # banco offline aislado (timing + guessing) — Etapa B

# Fuzzing (nightly)
cargo +nightly fuzz run parse_container

# Bindings Python
source venv/bin/activate
maturin develop --features python
python tests/python/test_quipu.py

Estado

v1 + v1.1 + v2 + firmas implementados con TDD estricto. 106 tests Rust + Wycheproof + 8 Python verdes, clippy limpio, fuzzing sin crashes, Miri sin UB. Parámetros post-cuánticos en categoría de seguridad NIST 5 (CNSA 2.0): ML-KEM-1024 y ML-DSA-87. Modo online con VOPRF verificable (prueba DLEQ), KEM híbrido con transcript ligado estilo X-Wing, firma híbrida Ed25519 + ML-DSA-87 (combinador AND), y pre-auditoría propia (ver INFORME_PREAUDITORIA.txt y MODELO_DE_AMENAZA.txt). Security Lab (red-team adaptativo auto-hospedado): 14 ataques en CI (--features lab) + banco offline de timing/guessing (--features lab-offline).

⚠️ Proyecto en desarrollo. La pre-auditoría interna NO sustituye una auditoría criptográfica independiente: no usar para proteger datos críticos reales hasta ese sello externo.

Documentación

⚠️ La pre-auditoría interna es preparación, no sustituye una auditoría independiente. Ese sello externo es el siguiente paso del proyecto (solicitud enviada al OTF Security Lab).

Licencia

Modelo de licencia dual (open-core):

  • AGPL-3.0-or-later para uso abierto (ver LICENSE).
  • Licencia comercial para producto propietario cerrado o SaaS sin abrir código.
  • El servidor OPRF se ofrece además como servicio gestionado de pago.

Detalles en LICENSING.md. Contacto: isazajuancarlos@gmail.com

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

quipu_crypto-0.4.0.tar.gz (178.4 kB view details)

Uploaded Source

Built Distributions

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

quipu_crypto-0.4.0-cp39-abi3-win_amd64.whl (420.7 kB view details)

Uploaded CPython 3.9+Windows x86-64

quipu_crypto-0.4.0-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (576.5 kB view details)

Uploaded CPython 3.9+manylinux: glibc 2.17+ x86-64

quipu_crypto-0.4.0-cp39-abi3-macosx_11_0_arm64.whl (515.0 kB view details)

Uploaded CPython 3.9+macOS 11.0+ ARM64

File details

Details for the file quipu_crypto-0.4.0.tar.gz.

File metadata

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

File hashes

Hashes for quipu_crypto-0.4.0.tar.gz
Algorithm Hash digest
SHA256 6443e8b6938143372635547736e8857f9237f4a0a07e9aba012f1b86e9dc70cc
MD5 c0682ebb65651d7f9e1f8f26a4ed8cd0
BLAKE2b-256 14fecb550341e847b18e2ab877a0076c4d4a53268546e63c73119ecf29b94e5a

See more details on using hashes here.

Provenance

The following attestation bundles were made for quipu_crypto-0.4.0.tar.gz:

Publisher: release.yml on isazajuancarlos/quipu

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

File details

Details for the file quipu_crypto-0.4.0-cp39-abi3-win_amd64.whl.

File metadata

  • Download URL: quipu_crypto-0.4.0-cp39-abi3-win_amd64.whl
  • Upload date:
  • Size: 420.7 kB
  • Tags: CPython 3.9+, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for quipu_crypto-0.4.0-cp39-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 f41b5bccdc9c8fcfec1e33569f98cf8b3a06658466bdb3e6968eba1ae5e8ffa1
MD5 0eb8e1430327de8ae7d0d00a2fa372e2
BLAKE2b-256 ec2789a9bf81406f2ca994e20f42e0e0097d5affbb74584e741843c6b36fbf57

See more details on using hashes here.

Provenance

The following attestation bundles were made for quipu_crypto-0.4.0-cp39-abi3-win_amd64.whl:

Publisher: release.yml on isazajuancarlos/quipu

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

File details

Details for the file quipu_crypto-0.4.0-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for quipu_crypto-0.4.0-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 e3465df6158502f917fa808ebd014f7718e31d5fa3e9a8d647316d5a0dd3b384
MD5 5a50537ad7247d908a5e0bf598387618
BLAKE2b-256 49cc19b60fccc06c6573d99fac40583d21323acff7a15afc1e8dddf80b7a8c06

See more details on using hashes here.

Provenance

The following attestation bundles were made for quipu_crypto-0.4.0-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: release.yml on isazajuancarlos/quipu

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

File details

Details for the file quipu_crypto-0.4.0-cp39-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for quipu_crypto-0.4.0-cp39-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 0a16c4d71ea14382372b7ddc62f0a5871d317eb86c291cd48724a3b5812b325e
MD5 321297aba2d6de27e75dd58f6adba923
BLAKE2b-256 f83aab4f534d6ea5104385b70615f613d5dc334771b49a7ca8c062eb6d772a93

See more details on using hashes here.

Provenance

The following attestation bundles were made for quipu_crypto-0.4.0-cp39-abi3-macosx_11_0_arm64.whl:

Publisher: release.yml on isazajuancarlos/quipu

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