We are consuming MIP SDK to view AIP protected files and showing sensitivity lable for Android and iOS application.
For this use case we are using protection sdk to decrypt file using protection handler class using below API.
int64_t decryptedSize = handler->DecryptBuffer(
0, // offsetFromStart
&content.encryptedData[0], //inputBuffer
static_cast<int64_t>(content.encryptedData.size()), //inputBufferSize
&outputBuffer[0],
static_cast<int64_t>(outputBuffer.size()),
true); //isFinal
outputBuffer.resize(static_cast<size_t>(decryptedSize));
but we are now starting to failur to decrypt newly created files from Purview.
below is error that we are seeing in logs
AESCryptoWriter: Failed to transform final block
Although older AIP protected files are continue to open/save.
We Understood that 1.13 MIP SDK version and above support CBC encryption of Office files by default. so assumption that files encrypted using cbc will be decrypted without any change from 1.13 onwards by enabling the flag .But even after upgrading to 1.14 we are still seeing same error.
Please help for CBC encryption do we have to add anything additional in order to read AIP protected files in protection handler code ?
Note: Couldn't find any sample code from AIP Samples related to CBC.
According to your description, you'd like to consume cipher block chaining (CBC) mode protected Office files. If so, you'd just use File SDK. There is no need to use Protection SDK. Refer from Version 1.13.158: