Dec 28, 2004

Data protection idea

I'll forget this in a week, so here it is:
Create a Dll (.NET/COM Dll might be an option) which will basically have 2 functions:
  • bool Hook(char *passphrase, char **files)
  • bool UnHook()
Hook function will patch kernel CreateFile,ReadFileEx,WriteFileEx functions, or their lowest common denominators, and encrypt/decrypt IO on files whose pathes where provided at Hook(...) call
This way for example MS Access database can be locked to the pasphrase, and the calling application won't care how Jet reads it, on the other hand data might be encrypted using plain blowfish or rijndael. Of course some protection need to be applied to the passphrase stored in the calling EXE, also antidebugging code should be placed into EXE and DLL, otherwise it will be very easy to override - just inject piece of code which will open the protected file, read it and write to some other, unprotected area.

No comments: