Decrypt DB to memory - WeOnlyDo Discussion board

Decrypt DB to memory (General questions)

by dandraka, Friday, February 25, 2005, 14:29 (7022 days ago)

Hi there,

This can be considered as a follow-up from my previous question ( read/write to the same file ) but, since the subject is somewhat different, I thought I'd start a new thread.

So I have this DB file on the disk (if it helps, it's a Firebird database), and it's encrypted. Basically what I want to do is:

a. Decrypt it in memory --I don't want the decrypted DB to be written on the disk, not even for a tiny amount of time.

b. Grab some data (it's actually a couple of SELECT statements)

c. Get rid of the memBlob so the memory can be freed. The DB is not changed in any way (no INSERTs, no UPDATEs, no DELETEs), so I don't want the disk file changed in any way.

For the first part, I know how to decrypt to a memBlob already, and I've tested it. It works fine.

The third part is --of course-- the easiest.

The second part is somewhat tricky. My DB components (IBO datasets, http://www.ibobjects.com) expect to read some file.

Do you have an idea of what I could use here ? I suppose I have to trick the component somehow (yes, I know this sounds vague) into thinking that it reads from disk, while actually reading from a memBlob.

Re: Decrypt DB to memory

by wodSupport, Friday, February 25, 2005, 15:53 (7022 days ago) @ dandraka

You know you can implement your own Blob, right? In VB just add

Implements IBlob

and then add bodies for all methods that appear (similar to events). You name it as you wish, you do inside what you want. You only need to implement what will happen when wodCrypt calls methods:

Read, Seek, Write, SetSize

from your own blob object.