views:

1058

answers:

4

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.

A: 

3DES is available via Capicom. See here for info.

Brian
+3  A: 

AES and Rijndael are essentially the same algorithm with a restriction on block size and cipher mode. So as long as you can live with the restrictions (which are not onerous) you can use them interchangeably.

Stephen Martin
+3  A: 

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!

Scott Saad
Thank you. I will look into this... and of course, any other information you could provide, I would be delighted.
Jason
don't forget the AES Crypto Provider - also available as part of Windows. http://msdn.microsoft.com/en-us/library/aa386979(VS.85).aspx It delivers AES algorithms, which is what the OP wanted I think.
Cheeso
True, but it's worth noting that AES algorithms are not supported on Windows 2000/NT.
Scott Saad
A: 

Windows includes a C/C++ AES encryption library, as part of the AES Cryptographic Services Provider. It is suitable for use from within native C/C++ applications.

Cheeso