AES-GCM-SIV: nonce reuse, equality and replay ========================================= This is a bounded native-library demonstration, not a new cipher, security proof, production encryption helper, filesystem implementation or performance benchmark. All keys, nonces and messages are deliberately public test fixtures. NEVER use these keys/nonces for real data. Download demo.mjs, demo.test.mjs, vectors.json and observations.json to one folder. Run on Node.js with OpenSSL AES-128-GCM-SIV and AES-256-GCM-SIV support: node --test demo.test.mjs node demo.mjs --check node demo.mjs Validated environment: Node v24.22.2, OpenSSL 3.5.9. No npm packages are required. The Node 24 line added SIV API support in 24.22.0; empty-message support also requires OpenSSL 3.5+. Capability is checked at execution, not assumed from a version string. The native site release now runs the observation check and vector/tamper tests alongside publication checks through the postvalidate:dist lifecycle. The release runtime must support these primitives; this suite is not a manual-only gate. An unsupported backend is a failure, not a skipped crypto test. The harness restricts keys to the two RFC profiles even if a library exposes extra variants. It supplies the whole message in one update and returns plaintext only after authentication succeeds. Plaintext and AAD each have an inclusive 1 MiB cap; ciphertext may be 1 MiB + 16 bytes because it includes the tag. These are demonstration resource limits, not the algorithm's message limits or a security usage budget. vectors.json contains the 50 numeric vectors in RFC 8452 Appendix C, including both key sizes, empty/nonempty AAD and the two counter-wrap cases. To regenerate from the pinned RFC text: curl -fsS https://www.rfc-editor.org/rfc/rfc8452.txt -o rfc8452.txt node extract-vectors.mjs rfc8452.txt vectors.json The extractor checks the source digest and declared lengths. RFC 8452 source and attribution: S. Gueron, A. Langley, Y. Lindell, April 2019. https://www.rfc-editor.org/rfc/rfc8452.html#appendix-C RFC text SHA-256: ca48ec466b401ce5d68d6d1628127a1800adcc16f2573646aaa3d7df284d3c17 Eight observations use invented messages. Repetition of every input repeats the output. Selected changes of plaintext or AAD change it. Changed ciphertext or expected version fails. Restoring an old ciphertext AND its old authenticated context succeeds: AEAD has no external knowledge of which version is current. A separate GCM fixture shows plaintext-XOR leakage after deliberate nonce reuse. The differing XOR in the selected GCM-SIV pair is an observation, not a proof. Tests compare encrypt/decrypt with external expected vectors, mutate every bit of every expected ciphertext, and reject wrong keys, nonces, AAD and bad input. Passing finite cases does not establish a cryptographic security bound or audit the library. No real user data, device writes, external keys or cloud APIs used. Reproduce observations.json with node demo.mjs --write. Use the JSON hex fields to inspect exact bytes. Runtime metadata belongs in the release receipt; the deterministic observations intentionally omit timestamps. Payload, wire length and authentication --------------------------------------- A 1048576-byte plaintext produces 1048592 bytes in this harness. The same payload must round-trip at the inclusive boundary. The previous implementation incorrectly applied the plaintext ceiling to ciphertext too, rejecting the largest 16 valid plaintext lengths on decryption. This was a local harness validation defect, not an AES-GCM-SIV weakness or an OpenSSL defect. The boundary tests cover all 17 lengths from 1048560 through 1048576 bytes, both modes and both key sizes: 68 round trips. They also cover simultaneous maximum payload/AAD, one-byte oversize inputs, and corrupted maximum-size tags. Only public synthetic buffers are used. Passing these checks establishes the tested input contract, not confidentiality, freshness or production suitability. RFC 8452 sections 5-6 distinguish plaintext length from ciphertext length. Section 9 requires withholding unauthenticated plaintext. Our decrypt function keeps any intermediate bytes local until final authentication succeeds. https://www.rfc-editor.org/rfc/rfc8452.html#section-5 https://www.rfc-editor.org/rfc/rfc8452.html#section-9 Gueron and Lindell's CCS 2017 analysis, sections 6.1-6.3, separately tracks nonce use, message length and adversarial queries. A size limit in this harness does not implement those security bounds. No theorem or historical benchmark was reproduced here. DOI: 10.1145/3133956.3133992 https://acmccs.github.io/papers/p1019-gueronA.pdf Wrong-key tests are not key commitment -------------------------------------- Selected wrong-key rejection cases do not show that an adversary cannot construct a ciphertext valid under different keys. That separate property is called key commitment. Nonce misuse resistance alone does not imply it. The USENIX paper below discusses an untargeted AES-GCM-SIV collision setting, not arbitrary recovery of uniformly random secret keys. No such attack is reproduced here. https://www.rfc-editor.org/rfc/rfc9771.html#section-4.3.3 Len, Grubbs and Ristenpart, Partitioning Oracle Attacks, section 3.2: https://www.usenix.org/system/files/sec21-len.pdf