Skip to Content
oxcrypto

XAES-256-GCM

Encrypt with AES-256-GCM using a 192-bit nonce that is can be chosen at random.

import os

from oxcrypto.aead.xaes_256_gcm import XAES_256_GCM

key = XAES_256_GCM.XAES_256_GCM.generate()
nonce = os.urandom(24)
sealed = key.encrypt(nonce, b"message", associated_data=b"header")
plaintext = key.decrypt(nonce, sealed, associated_data=b"header")

Variants: XAES_256_GCM.

Keys are 32 bytes and the nonce is 24 bytes.

StandardC2SP XAES-256-GCM specification (community specification, not a NIST or IETF standard).
Cratexaes-256-gcm 0.1.0
MaturityStable release. No published audit.
MSRVBuilds with Rust 1.88.
Zeroizationxaes-256-gcm and aes-gcm with zeroize are written to wipe the derived key K1, the AES round keys and the per-message AES-GCM state. oxcrypto has not verified this independently.
ExperimentalNo
Test vectorsxaes-256-gcm crate vectors (from the C2SP specification)