--- title: "Algorithm-Agility" type: concept tags: [cryptography, post-quantum, future-proof] sources: [agentic-identity-trust.md] last_updated: 2026-04-25 --- ## Definition Algorithm-Agility(算法敏捷性)是一种密码学系统设计原则——将密码学算法作为可替换参数抽象,而非硬编码选择,从而使系统能够在不破坏现有身份链的前提下完成算法升级(如从经典加密迁移到后量子加密)。 ## Motivation 当前使用的 Ed25519/ECDSA 等经典签名算法面临量子计算威胁。当 NIST 后量子标准(ML-DSA、ML-KEM、SLH-DSA)成熟并部署时,需要确保: - 历史签名的身份链仍可验证 - 无需重新颁发所有现有凭证 - 迁移过程平滑,无需停机 ## Design Pattern ```python # 差的实践:硬编码算法 signature = ed25519.sign(private_key, payload) # 好的实践:算法作为参数 class IdentityVerifier: def verify(self, payload, signature, algorithm="Ed25519"): impl = self._get_implementation(algorithm) return impl.verify(self.public_key, payload, signature) ``` ## Hybrid Scheme(过渡期策略) 在经典算法向量子安全算法迁移期间,使用混合签名: ``` hybrid_signature = concat( classical_signature(Ed25519, payload), post_quantum_signature(ML-DSA, payload) ) ``` ## Relationships - [[Zero-Trust]]:Algorithm-Agility 确保 Zero-Trust 基础设施在后量子时代仍可用 - [[Evidence-Chain]]:历史 Evidence-Chain 记录必须在新算法体系下仍可独立验证 ## Sources - [[agentic-identity-trust.md]]