An Azure service that is used to control and help secure email, documents, and sensitive data that are shared outside the company.
MIP File SDK 1.18.124 buffers the entire decrypted output in native memory - is there a streaming / bounded-memory way to decrypt large protected files?
When decrypting a large protected file (PFILE / .pzip, 2,272,066,451 bytes, > int.MaxValue) with the
MIP File SDK 1.18.124 (Windows x64), private commit peaks at ~the full file size (~2,190 MB) for every decryption.
The decrypted OUTPUT appears to be fully buffered in native (mip_file_sdk.dll), which causes severe transient memory spikes under concurrency.
Is there a supported way to decrypt to disk with bounded memory (streaming), or is this by design?
What I measured (same file, sampled private bytes; both C++ and .NET File SDK):
1. IFileHandler.GetDecryptedTemporaryFileAsync (path input) : ~2,191 MB peak
2. GetDecryptedTemporaryFileAsync (file-backed input Stream) : ~2,191 MB peak (input is NOT the cause)
3. GetDecryptedTemporaryStreamAsync + chunked read : ~4,362 MB peak (output double-buffered; worse)
4. RemoveProtection + CommitAsync : ~2,191 MB peak
Managed heap stays ~7 MB, so the buffer is native, inside mip_file_sdk.dll.
Additional issue on .NET: GetDecryptedTemporaryStreamAsync returns a fully-materialized MemoryStream,
which fails for files > int.MaxValue (2,147,483,647) with a read-not-supported error.
- Is there any supported streaming/bounded-memory file decryption path we're missing?
- Can ProtectionHandler::CreateProtectedStream be used over a PFILE payload directly? The File SDK does not expose the protected payload's start offset / length, so we can't bypass to the Protection SDK.
- On .NET, is there a way to avoid the MemoryStream materialization so decryption works for files > 2 GB? Environment: Windows 11 x64, MIP File SDK 1.18.124 (Windows NuGet + native mip_*.dll),
authenticated via client credentials (app-only).