i would like to create an application that encrypts a file (say text file)
when an application (say Notepad) tries to open the file, my app intercepts the request and provides decrypted data to the application.
Notepad will have no idea what just happened.
The question is where do i start?
I’ve been a hobbyist programmer for well over 10years and an quite familiar with c++ but this will be a first for visual c++.
You can implement such encryption using filesystem minifilters File system minifilter drivers.
With this you can intercept all file operations (IRPs) and decide what do you want to do, which can include encryption.
However, when you are modifying file data, there are quite a few tricky situations to handle (e.g. paging IOs, direct IOs etc). Also, its very difficult to manage if you change the file data size transparently, which can cause lot of issue. So try to avoid changing file data size when you encrypt/decrypt.
For understanding you can look at minispy and swapbuffers examples in the IFS kit documentation.
BTW, this is not VC++.