Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

附录: 密码学考试 / 工程 checklist

A.1 — Algorithm cheat sheet

ClassAlgorithmKey SizeUseNotes
Symmetric blockAES-128 / AES-25616/32 Bbulk encryptionuse AES-NI hardware if available
Symmetric streamChaCha2032 Bbulk encryptionwhen no AES acceleration
MACHMAC-SHA256anymessage authRFC 2104; combine with E-then-M
AEADAES-128-GCM16B + 12B IVbulk + authTLS 1.3 / IPsec mainline
AEADChaCha20-Poly130532B + 12Bbulk + authmobile/IoT preferred
HashSHA-256integrity, KDF, MACMerkle-Damgård length-extension caveat
HashSHA-3-256future-proofsponge construction
HashBLAKE3parallel high-throughput10 GB/s with AVX2
Password hashArgon2idpassword storagePHC winner 2015; memory-hard
KDFHKDFderive multiple keys from masterRFC 5869
Public key encRSA-3072-OAEP3072 blegacy / envelopeddeprecated for new systems; use KEM
Public KEMML-KEM-768 / Kyber~1184 Bpost-quantum key exchangeFIPS 203 / RFC 9591
Public signatureRSA-PSS-30723072 bcert signingRFC 8017; works for TLS1.3
Public signatureECDSA P-25632BTLS cert signinguse RFC 6979 deterministic nonce
Public signatureEd2551932Bmodern signingRFC 8032
Public PQ sigML-DSA-65 / Dilithium~2KBpost-quantum signingFIPS 204
Hash-based sigSLH-DSA-SHA2-128f7KBstateless PQ hash-basedFIPS 205
Key exchangeX2551932Bephemeral ECDHRFC 7748; constant-time
Key exchangeX44856Bhigh-security ECDHRFC 7748
KEM/sig comboshybrid Kyber-X25519TLS PQ previewCloudflare / Apple
ZK: Groth16pairing curve BLS12per-circuit setupZcash legacy192B proof
ZK: PLONKuniversal updatable400B proofzkSync Era/ScrollO(N log N) prover
ZK: STARKhash-based, transparent~50-200KBStarkNet post-quantumO(log² N) verify
ZK: Bulletproofcurve no setupO(log n)Monero range prooflinear verify

A.2 — Browser / OS trust store matrix

CA ProgramUpdate CycleMin RSAMin ECSHA-1SHA-256Notable
Apple root programYearly2048256rejectedOKprivate group
Microsoft rootQuarterly2048256rejectedOKWindows Update push
Mozilla / NSSWeekly2048256rejectedOKopen source program
Google Chromeuses NSSrejectedOKCT enforcement 2018+

A.3 — Security level lookup table

Security levelSymmetricRSA modulusECC modulusSHA outputNotes
8080 bit1024160160retired
1121122048224224RSA-2048 minimum
1281283072256256TLS modern baseline
1921927680384384high-sensitivity
25625615360521512NSA Suite B / Type 1

注: AES / SHA-256 在 quantum Grover 之下仍 128 等 trillion quadratic 安全, 但 RSA / ECC 在 Shor 之下 hard broken ⇒ migration to ML-KEM/ML-DSA.

A.4 — Online resources / tooling

  • OpenSSL command-line + library; cert generation, TLS 模拟, signature tests.
  • Libsodium cross-language crypto 简洁 API wrapper.
  • ring (Rust), maintained, fast OpenSSL alternative for TLS.
  • BoringSSL Google fork, internal improvements, used by Chromium.
  • Wireshark + SSLKEYLOGFILE env → decrypt own TLS sessions (debug only).
  • Certbot / lego ACME clients for Let's Encrypt automation.
  • ssh-keygen -t ed25519 for modern SSH keys.
  • age encryption tool by Filippo Valsorda — modern file encryption, X25519, AEAD.
  • minisign for file signing (Ed25519).
  • Snarkjs 编译零知识 proof 验证 in CLI.

A.5 — Common pitfall reminder one-pager

  • ✗ Random nonce RNG without CSPRNG → breakable keystream with predictable IV in CTR.
  • ✗ ECDSA nonce random() → reuse → private key recoverable from 2 signatures.
  • ✗ MAC-then-Encrypt → padding oracle.
  • ✗ ECB for multi-block messages → visually leaks pattern.
  • ✗ Passwords hashed with plain SHA-256 → rainbow-table compromise.
  • ✗ Raw RSA $m^e$ for small message → low-exponent attack recoverable.
  • ✗ Same long-term signing key for multiple platforms → cross-protocol attack.
  • ✗ ECDSA curve point input not validated → invalid-curve attack sends small subgroup point whose DLP trivial.
  • ✓ Use libsodium / ring / OpenSSL.
  • ✓ Rotate secrets, audit logs, monitor alerts.
  • ✓ Constant-time comparison of secrets.
  • ✓ AEAD encryption in 95%+ cases.
  • ✓ Ed25519 for new signatures unless hardware constrained.
  • ✓ X25519 / Kyber768 hybrid for new systems post-2024.

A.6 — Open-source implementation references

  • RFC 8446 TLS 1.3
  • RFC 7748 X25519 / X448
  • RFC 8032 Ed25519
  • RFC 7539 ChaCha20-Poly1305 AEAD
  • RFC 5869 HKDF
  • RFC 6962 Certificate Transparency
  • RFC 6960 OCSP
  • RFC 5297 AES-SIV
  • RFC 9591 Kyber-derived ML-KEM id encode (post-quantum)
  • FIPS 203 ML-KEM, 204 ML-DSA, 205 SLH-DSA standards (Aug 2024 finalized).

A.7 — 与项目其他章节交叉

  • asymmetric.md: RSA math with CRT, ECC curve selection.
  • tls13.md: 握手 derive secret 链; cert chain verification.
  • sidechannel.md: time / power attack 探测:
  • theory/complexity: PRIMES ∈ P (AKS) 提 major示范; factoring 在 NP∩co-NP but not NP-hard.
  • distributed/fault/quorum: BFT consensus multi-party signature aggregation.
  • system-design/case/dynamo-family: cryptographic secret 分配 among distributed storage derivatives.
  • compilers/sema/type-system: secure "opaque type" 专用 防止 counter-logging from secret-annotated values.

下一节 → 信息论与编码 README