XChaCha20-Poly1305
XChaCha20-Poly1305 是什么?
XChaCha20-Poly1305An extended-nonce variant of ChaCha20-Poly1305 that uses a 192-bit nonce, making it safe to generate nonces randomly without worrying about collision and well-suited for at-rest encryption and random-nonce designs.
XChaCha20-Poly1305 is an AEAD construction defined in IETF draft-irtf-cfrg-xchacha that combines XChaCha20 (an extended-nonce variant of ChaCha20) with the Poly1305 MAC. The original ChaCha20-Poly1305 specified in RFC 8439 uses a 96-bit nonce — large enough for the counter-based usage in TLS but borderline for systems that derive nonces randomly per message, where the birthday bound becomes relevant after ~2^32 messages per key. XChaCha20 extends the nonce to 192 bits by first running HChaCha20, a keyed function that mixes part of the nonce into a derived subkey, then running ChaCha20 with the rest as a regular nonce. The 192-bit nonce is large enough that random selection collides only after roughly 2^96 messages, which is effectively never. The construction is standardized in libsodium (`crypto_aead_xchacha20poly1305_ietf_*`) and widely used in disk encryption, password managers, and any context where a counter-style nonce isn't practical. Performance is identical to ChaCha20-Poly1305 except for one extra HChaCha20 call per message.
● 示例
- 01
A password manager encrypts each vault item with XChaCha20-Poly1305 using a random per-item nonce and stores nonce + ciphertext + tag in the database.
- 02
libsodium's `crypto_secretstream_xchacha20poly1305_*` API wraps XChaCha20-Poly1305 for streaming, large-file encryption.
● 常见问题
XChaCha20-Poly1305 是什么?
An extended-nonce variant of ChaCha20-Poly1305 that uses a 192-bit nonce, making it safe to generate nonces randomly without worrying about collision and well-suited for at-rest encryption and random-nonce designs. 它属于网络安全的 密码学 分类。
XChaCha20-Poly1305 是什么意思?
An extended-nonce variant of ChaCha20-Poly1305 that uses a 192-bit nonce, making it safe to generate nonces randomly without worrying about collision and well-suited for at-rest encryption and random-nonce designs.
XChaCha20-Poly1305 是如何工作的?
XChaCha20-Poly1305 is an AEAD construction defined in IETF draft-irtf-cfrg-xchacha that combines XChaCha20 (an extended-nonce variant of ChaCha20) with the Poly1305 MAC. The original ChaCha20-Poly1305 specified in RFC 8439 uses a 96-bit nonce — large enough for the counter-based usage in TLS but borderline for systems that derive nonces randomly per message, where the birthday bound becomes relevant after ~2^32 messages per key. XChaCha20 extends the nonce to 192 bits by first running HChaCha20, a keyed function that mixes part of the nonce into a derived subkey, then running ChaCha20 with the rest as a regular nonce. The 192-bit nonce is large enough that random selection collides only after roughly 2^96 messages, which is effectively never. The construction is standardized in libsodium (`crypto_aead_xchacha20poly1305_ietf_*`) and widely used in disk encryption, password managers, and any context where a counter-style nonce isn't practical. Performance is identical to ChaCha20-Poly1305 except for one extra HChaCha20 call per message.
如何防御 XChaCha20-Poly1305?
针对 XChaCha20-Poly1305 的防御通常结合技术控制与运营实践,详见上方完整定义。
XChaCha20-Poly1305 还有哪些其他名称?
常见的别称包括: XChaCha20, Extended-nonce ChaCha20-Poly1305。
● 相关术语
- cryptography№ 179
ChaCha20-Poly1305
由 ChaCha20 流密码与 Poly1305 一次性认证器组成的 AEAD 结构,在 RFC 8439 中标准化,用于 TLS 1.3 和 WireGuard。
- cryptography№ 178
ChaCha20
由 Daniel J. Bernstein 设计的现代流密码,使用 256 位密钥和 96 位 nonce,常与 Poly1305 组合为 AEAD 算法 ChaCha20-Poly1305 广泛部署。
- cryptography№ 021
AEAD (Authenticated Encryption with Associated Data)
A symmetric encryption primitive that provides confidentiality, integrity, and authenticity in one operation, with the ability to bind unencrypted 'associated data' (headers, routing info) to the ciphertext's authentication tag.
- cryptography№ 025
AES-GCM
一种认证加密模式,将 AES 的计数器模式与基于 GHASH 的认证标签结合,在一次运算中同时提供机密性和完整性。
- cryptography№ 189
密码算法(Cipher)
将明文变换为密文(加密)并能逆向得到明文(解密)的算法,由一个或多个加密密钥参数化。
- cryptography№ 1227
流密码
通过将数据与由密钥和 nonce 派生的伪随机密钥流逐位或逐字节异或来加密的对称密码。