Tuesday, March 27, 2012

Embed a Database

I have a rather large DB that is used ONLY for lookups. I want to develop a componet that will lookup in that database, and then I want to be able to distribute that component. My obstical is that I do not want the person who gets the component to have any access to the database... here is my question.

Is there a way to embed the database (or even an xml file) into the DLL in order to keep it from prying eyes?

You can embed files as resources:

http://www.csharper.net/blog/getting_an_embedded_resource_file_out_of_an_assembly.aspx


If you have your data in an XML file, you can access it from the resource stream. Databases usually requires random access to the file, and to provide that you would have to save the stream to a local file first, thus making it available to "prying eyes". If the data is really sensitive you will have to use code obfuscation and encryption, since the resource data can easily be extracted from the DLL.

Another option could be to provide the data from a web service you control.

|||

great thanks, I will try the xml way and use dotfuscator.

question, is there a good reference on the web on how to use the dotfuscator?

|||

You can start here:

http://msdn2.microsoft.com/en-us/library/ms227240(VS.80).aspx

I don't think Community Edition will do the trick though. You will need a tool that provides resource encryption.

No comments:

Post a Comment