C++ – Encryption algorithm/library for .NET 2.0 + C++

.net-2.0aescencryptionrijndael

I need a standard, Microsoft delivered, encryption library that works for both .NET 2.0 and C++. What would you suggest?

We find that AES is only offered in .NET 3.5 (and available in C++)

We find that Rijndael is used in .NET 2.0 but not available in the standard C++ libraries.

If I am wrong (very good chance), can you point me in the right direction?

Worst case scenario, I suppose I can call the Rijndael algorithm from .NET using PInvoke but I would rather have a native solution.

Best Answer

We successfully do a similar thing that I hope might help you:

C++ CryptoAPI

.NET TripleDes Provider

Side Notes

  • We avoid CAPICOM like the plague as the deployment nightmares that come with it are not worth the hassle.
  • Byte order on the .NET side can come into play at times. For example, to consume a key that is generated on the C++ (CryptoAPI) side, you need to reverse the byte array prior to using it within the TripleDESCryptoServiceProvider.

If you would like more details please leave a comment and I can give more. Happy crypto!