Decrypts a single media chunk. Recovers the deterministic IV from the file key, recording ID, and chunk index, then decrypts.
The ciphertext (includes GCM tag).
The 32-byte per-file key.
Same recording ID used during encryption.
Same chunk index used during encryption.
The decrypted plaintext.
'DECRYPTION_FAILED' on auth failure or corrupt data.
const plaintext = await decryptMediaChunk(encrypted, fileKey, 'rec-42', 0); Copy
const plaintext = await decryptMediaChunk(encrypted, fileKey, 'rec-42', 0);
Decrypts a single media chunk. Recovers the deterministic IV from the file key, recording ID, and chunk index, then decrypts.