Replace the public MD5 prefix and fixed CBC IV with a versioned token
containing a random IV and an HMAC-SHA256 tag. Authenticate the header
and ciphertext before decryption.
Derive the MAC key once per configured encryption key and share cached
key material with inheriting configurations. Cleanse keys when the
configuration pool is released, and rebuild them on reload.
Add independent token vectors, tamper and expiry checks, binary boundary
coverage, key isolation and inheritance checks, and random-source failure
injection. Load the fault injector before Test::Nginx initializes so it
also works under Valgrind.
Validation: all 89 Test::Nginx assertions pass normally and under
Valgrind on nginx 1.31.8 with OpenSSL 3.5.7. Additional probes confirm key
derivation is absent from the request path and key rotation works after
reload.
BREAKING CHANGE: Legacy session tokens are rejected. The configured IV is
ignored; all nodes exchanging tokens must upgrade together, and existing
sessions must be reissued.