1

I want to encrypt data in C++ based application, store it in file, and then decrypt it in other C# application. Could I use corresponding DPAPI parts?

Is it possible to protect data in C++ application using CryptProtectData(), write it into file, and later read this file from other C# based application and decrypt using ProtectedData Unprotect() method?

Is there are a better way to share data between C++ and C# application in secure for usual user (not absolutely secure sure) way.

karven
  • 65
  • 6
  • Can't see why not. At the end of the day the .net version is calling the same library as the C++ version. Beware of impersonation and delegation. However, if you are just trying to pass data back and forth from C++/C# there are better ways. – Aron Sep 06 '13 at 07:18
  • @Aron I need this data(in fact it is simple database) to be quite, but not absolutely hard to be modified, for usual user. Anyway could you represent the better way for me? I will modify my question. – karven Sep 06 '13 at 07:21
  • 1
    In that case I would advise against your current tack. DPAPI is for securing data using an account. I would use SQL Server authorization instead. The general advice for any developers trying to implement their own security is DON'T. – Aron Sep 06 '13 at 07:26
  • Yes, you can absolutely do this, but if you're looking for better ideas, it would be helpful to understand what kind of data you're sharing between the C++ and C# apps. – Alek Davis Nov 23 '13 at 05:35

0 Answers0