@me2em/crypto
    Preparing search index...

    Function decryptMediaChunk

    • Decrypts a single media chunk. Recovers the deterministic IV from the file key, recording ID, and chunk index, then decrypts.

      Parameters

      • encryptedChunk: Uint8Array

        The ciphertext (includes GCM tag).

      • fileKeyRaw: Uint8Array

        The 32-byte per-file key.

      • recordingId: string

        Same recording ID used during encryption.

      • chunkIndex: number

        Same chunk index used during encryption.

      Returns Promise<Uint8Array>

      The decrypted plaintext.

      'DECRYPTION_FAILED' on auth failure or corrupt data.

      const plaintext = await decryptMediaChunk(encrypted, fileKey, 'rec-42', 0);