I开发者_C百科 want to protect my MS access 2002 database with .NET file encryption.
I want to
- decrypt the databasefile
- query and cash the database file into memory
I'm using the encrypt/decrypt example described here. I'm wondering if this doen't create a security hole since the file gets decrypted to another file that can be easily read out.
Is there a way I can decrypt the file to memory and read it from there?
Anything that is placed in memory is liable to leak to the hard drive when paging occurs.
I'd respectfully suggest that encrypting the file does little to add security. There are database products which support encryption directly: however, applications still need to have access to the decryption key, which means that anyone with machine administrator access (and/or access to the hardware) can obtain the decryption key from your executable.
Consider instead what attacks you are trying to prevent -- unless you are just interested in checkbox compliance with some security policy requiring encryption as a panacea...
As far as I know, the .Net Access providers can't connect to an in-memory file.
However, you can read data in memory just as easily as if it was in a file. Hiding it in a temp file or in memory is ultimately the same, it just changes the difficulty level a tiny bit.
精彩评论