-2

Can any one suggest any encryption algorithm which interop between c and c# means encrypt in c language and decrypt in c# & vice versa

sunil pol
  • 133
  • 1
  • 3
  • 9

2 Answers2

0

Use something like AES available under System.Security.Cryptography.

You can find an example of using it under C# here - Using AES encryption in C#

When deriving IV and SALT you might find this utility class useful: http://msdn.microsoft.com/en-us/library/system.security.cryptography.rfc2898derivebytes.aspx

I cannot directly answer the C/C++ side, however trawling SO posts there's plenty of answers such as: encrypt- decrypt with AES using C/C++

Community
  • 1
  • 1
Lloyd
  • 29,197
  • 4
  • 84
  • 98
  • http://msdn.microsoft.com/en-us/library/system.security.cryptography.rfc2898derivebytes.aspx its a managed code and framework dependent.I want pure c or c++code. or tell me the way to use managed code without framework dependency – sunil pol Aug 29 '12 at 12:12
  • This is the C# side only, I've given links to the native side, never done much that side myself. – Lloyd Aug 29 '12 at 12:44
0
i have used Rijndael algo but in c# it requires salt but in c it doesn,t 

You can simply re-write the C code in C# as basic operators will not change.

Use pinvoke wherever neccessary.

REFERENCE: .Zero , Charles Petzold. chapter 7

Google the book name to get the download link

Anuj Balan
  • 7,629
  • 23
  • 58
  • 92
rohank
  • 81
  • 1
  • 9