sp497
sp497

Reputation: 2491

Reading from and Writing to an encrypted folder in windows using C++

I have an application written using C++ that reads/writes binary data from a folder in windows. I want to make sure that only my application with the proper key can read/write this binary data from a specific folder and no one should be able to access it.

Is it possible to achieve this on windows using win C++ API? Any suggestions would be invaluable.

Thanks!

Upvotes: 0

Views: 214

Answers (1)

Ryan Bemrose
Ryan Bemrose

Reputation: 9266

The operating system will not do this for you. Anything you write to the disk can be read by any user or program with administrator rights, so you will need to encrypt your data before writing to disk.

On Windows, you can look into the Win32 Crypto API for a generic built-in implementation. Or you can use one of dozens of available libraries for doing the same thing. A quick SO search for "free windows encryption libraries" turned up a couple of old posts that might get you started. You'll have to do your own research.

The one thing I will caution you against is do not try to write your own cryptography. Security is a Hard Problem, and you will not be able to do it better than the existing well-established libraries.

Upvotes: 1

Related Questions