RustCrypto AEADs

repository·master·Indexed 21 days ago

https://github.com/rustcrypto/aeads

A collection of pure Rust implementations of Authenticated Encryption with Associated Data (AEAD) algorithms. This repository includes various symmetric encryption primitives such as aes-gcm, chacha20poly1305, aes-siv, aes-gcm-siv, ascon-aead128, belt-dwp, ccm, deoxys, eax, mgm, ocb3, and xaes-256-gcm, as well as the aead-stream construction for incremental processing of large messages. All crates utilize traits defined in the aead crate.

Tokens
22.3K
Snippets
40
Records
85
Agent score
75%

What's inside rustcrypto-aeads

  1. Overview of ChaCha20Poly1305 and XChaCha20Poly1305

    master

    The chacha20poly1305 crate provides a pure Rust implementation of the ChaCha20Poly1305 Authenticated Encryption with Associated Data (AEAD) cipher, as specified in RFC 8439. It is based on the ChaCha20 stream cipher and the Poly1305 universal hash function.

    This crate also includes an implementation of XChaCha20Poly1305, which is a variant featuring an extended 192-bit (24-byte) nonce, providing greater flexibility for nonce generation compared to the standard version.

  2. Overview of AES-GCM-SIV

    master

    AES-GCM-SIV (RFC 8452) is a high-performance Authenticated Encryption with Associated Data (AEAD) cipher. Its primary advantage is nonce reuse misuse resistance, making it safer than standard AES-GCM by eliminating the catastrophic security risks associated with reusing a nonce.

    Performance Characteristics

    • Decryption: Performance is equivalent to AES-GCM.
    • Encryption: Marginally slower than AES-GCM.

    Security Considerations

    • No Security Audits: This specific crate has not undergone a dedicated security audit.
    • Constant-Time Execution: Implementations are designed to be constant-time using hardware intrinsics (AES-NI and CLMUL on x86/x86_64) or portable software implementations.
    • Hardware Limitation: It is not suitable for processors with variable-time multiplication operations (e.g., certain 32-bit PowerPC CPUs or some non-ARM microcontrollers that short-circuit on multiply-by-zero/one).
  3. Overview of the Deoxys Cipher crate

    master

    The deoxys crate provides a pure Rust implementation of the Deoxys Authenticated Encryption with Associated Data (AEAD) cipher. It includes the Deoxys-II variant, which was recognized by the CAESAR competition for its security properties.

    Security Warning:

    • This crate has NOT received a security audit.
    • There is no guarantee of constant-time operation, even though encryption and decryption pass test vectors.
    • USE AT YOUR OWN RISK.
  4. Overview of Ascon-AEAD128

    master

    Ascon-AEAD128 is a pure Rust implementation of the lightweight Authenticated Encryption with Associated Data (AEAD) algorithm. It is designed for lightweight cryptographic applications and follows the Ascon-AEAD128 specification.

    Security Warning: No security audits of this crate have ever been performed. Use this implementation at your own risk.

  5. Overview of AES-SIV (Misuse-Resistant AEAD)

    master
    AES-SIV (based on RFC 5297) is an Authenticated Encryption with Associated Data (AEAD) cipher. Its primary feature is nonce reuse misuse resistance, meaning that if a nonce is accidentally reused, the security properties of the cipher do not degrade as catastrophically as standard AEAD modes like AES-GCM.
  6. Use CCM (Counter with CBC-MAC) for Authenticated Encryption

    master

    The ccm crate provides a pure Rust implementation of the Counter with CBC-MAC (CCM) mode as defined in [RFC 3610]. It is an Authenticated Encryption with Associated Data (AEAD) algorithm that is generic over block ciphers, provided the block size is exactly 128 bits.

    A common use case is combining ccm with the aes crate to implement various AES-CCM parameterizations.

  7. Use the AES-GCM crate for authenticated encryption

    master

    aes-gcm is a pure Rust implementation of the AES-GCM (Advanced Encryption Standard - Galois/Counter Mode) Authenticated Encryption with Associated Data (AEAD) cipher. It is designed to provide both confidentiality and authenticity for data.

    Security Considerations

    • Constant-time execution: The implementation aims for constant-time execution by using hardware intrinsics (like AES-NI and CLMUL on x86/x86_64) or a portable implementation that is constant-time on processors supporting constant-time multiplication.
    • Hardware limitations: This crate is not suitable for use on processors with variable-time multiplication operations (e.g., certain 32-bit PowerPC CPUs or some non-ARM microcontrollers that short-circuit on multiply-by-zero or multiply-by-one).
    • Audit status: The implementation has undergone a security audit by NCC Group with no significant findings.
  8. What is Multilinear Galois Mode (MGM)?

    master
    Multilinear Galois Mode (MGM) is an Authenticated Encryption with Associated Data (AEAD) algorithm implemented in pure Rust. It is designed to be generic over block ciphers, provided the block size is exactly 128 bits.
  9. What is AEAD-STREAM and when to use it

    master

    AEAD-STREAM is a pure-Rust implementation of the STREAM online authenticated encryption construction.

    It is designed for encrypting or decrypting sequences of AEAD message segments incrementally. This is particularly useful when the total message size is too large to fit into a single buffer.

    Key security properties include:

    • Incremental Processing: Supports processing large messages in segments.
    • Attack Resistance: Defends against reordering and truncation attacks.
    • Security Guarantee: Proven to meet the "nonce-based online authenticated encryption" (nOAE) security definition.