In .NET framework, I'm trying to encrypt some binary data (using RijndaelManaged), for decrypting I used the following sample code (C++/.NET):
RijndaelManaged^ rjdAlg= gcnew RijndaelManaged;
rjdAlg->IV= IV;
rjdAlg->Key=this->key;
ICryptoTransform^ decryptor= rjdAlg->CreateDecryptor();
MemoryStream^ msDecrypt = gcnew MemoryStream(encryptedData);
CryptoStream^ csDecrypt = gcnewCryptoStream(msDecrypt,decryptor,CryptoStreamMode::Read);
array<unsigned char>^ decryptedData= gcnew array<unsigned char>(encryptedData->Length);
csDecrypt->Read(decryptedData,0,decryptedData->Length);
Now, decryptedData contains useful data in addition to nulls (as the array initialization), how can I get the actual size of encrypted data ( if it was string I can just stop at the first null!).