Das std.crypto.pqc-Paket stellt Post-Quantum-Kryptografie (PQC) bereit — alle drei von NIST im Jahr 2024 standardisierten Algorithmen (FIPS 203/204/205) sowie ein Hybrid-KEM und DADQ (experimentell).
Grundprinzip: PQC-Algorithmen sind resistent gegen Angriffe mit Quantencomputern (Shor-Algorithmus bricht RSA/ECDSA/ECDH). Alle Units sind reine Lyx-Software ohne externe Abhängigkeiten.
→ std.crypto · Kryptographie-Guide · Standard Library
| Unit | Standard | Typ | Beschreibung |
|---|---|---|---|
| std.crypto.pqc.pqc | — | High-Level API | Empfohlen: Einheitliche Fassade über alle PQC-Units |
| std.crypto.pqc.mlkem | FIPS 203 | KEM | ML-KEM (CRYSTALS-Kyber): ersetzt ECDH/RSA-OAEP |
| std.crypto.pqc.mldsa | FIPS 204 | DSA | ML-DSA (CRYSTALS-Dilithium): ersetzt ECDSA/RSA-Sign |
| std.crypto.pqc.slhdsa | FIPS 205 | DSA | SLH-DSA (SPHINCS+): hash-basierte Signaturen |
| std.crypto.pqc.hybrid | — | KEM | Hybrid X25519+ML-KEM-768 (Signal/Apple PQ3-Schema) |
| std.crypto.pqc.dadq | — | Sym. Cipher | DADQ-SYM: symmetrisches Authenticated Cipher (experimentell) |
Die PQC-Units teilen sich in zwei grundlegende Typen:
KEM (Key Encapsulation Mechanism): Ersetzt Schlüsselaustauschverfahren (ECDH, DH). Der Sender kapselt ein symmetrisches Geheimnis ein (Encapsulate), der Empfänger rekonstruiert es (Decapsulate). Das Shared Secret wird dann als symmetrischer Schlüssel (z.B. für AES oder DADQ) verwendet.
DSA (Digital Signature Algorithm): Ersetzt Signaturverfahren (ECDSA, RSA-Sign). Der Inhaber des Secret Key signiert (Sign), jeder mit dem Public Key kann verifizieren (Verify).
| Ich will … | Unit / Algorithmus |
|---|---|
| PQC-Schlüsselaustausch (Standard) | std.crypto.pqc.pqc → PQC_ALG_MLKEM_768 |
| PQC-Schlüsselaustausch + klassische Sicherheit | std.crypto.pqc.pqc → PQC_ALG_HYBRID_768 |
| PQC-Signatur (Standard) | std.crypto.pqc.pqc → PQC_ALG_MLDSA_65 |
| PQC-Signatur (nur SHA-256-Annahmen) | std.crypto.pqc.pqc → PQC_ALG_SLHDSA_128S |
| Symmetrisches Auth. Cipher (Latin-Square) | std.crypto.pqc.dadq → dadqFOEnc |
| DADQ + PKE (Hybrid) | std.crypto.pqc.dadq + std.crypto.pqc.mlkem (ML-KEM kapselt master_seed) |
| Alle NIST-Standards über eine API | std.crypto.pqc.pqc → PQCKeyGen / PQCSign / PQCEncapsulate |
| Algorithmus | Public Key | Secret Key | CT / Signatur |
|---|---|---|---|
| ML-KEM-768 (KEM) | 1184 B | 2400 B | CT: 1088 B |
| Hybrid-KEM-768 (KEM) | 1216 B | 2432 B | CT: 1120 B |
| ML-DSA-65 (DSA) | 1952 B | 4000 B | Sig: 3293 B |
| SLH-DSA-128s (DSA) | 32 B | 64 B | Sig: 7856 B |
| ECDSA secp256k1 (klassisch) | 64 B | 32 B | Sig: 64 B |
SLH-DSA hat den kleinsten Public Key, aber die größten Signaturen. ML-DSA ist der beste Kompromiss für die meisten Anwendungen.
master_seed, DADQ übernimmt die Datenverschlüsselung.std.crypto.rand → RandBytesExact.Letzte Aktualisierung: 2026-06-08