Question

What is a good way to distribute a small database on CD-ROM?

The Database has to be encrypted. It must run on WinXP and Vista. The application is written in C# and is also distributed on CD. Records are only read but not written.

Its ok to run an installer, but we prefer not to do it.

The DB has 100000 records and performance is not the primary goal.

EDIT: Yes the user will have to enter a password to decrypt the database.

Was it helpful?

Solution

I would use SQLite for this.

Actually re-reading your question, you could even use a flat or an XML file, given that there is no need for performance or updates/adds.

If there is any chance you will need to add/update this data source as your app matures, though, go with SQLite.

OTHER TIPS

Honestly... If you can do it I would use encrypted XML files. No install,runs anywhere (text files have no dependencies), fast and since updates are not necessary, that would make it even easier.

MS-SQL (Express) has an explicit setting for read-only Databases. I'm not sure about encryption.

I'm quite sure that Sql Server Compact (SSCE) will also allow read-only, and it supports encryption. But you'll have to store the password somewhere...

The SSCE will probably allow you to run w/o a setup.

Given the size of your data, it will also be possible to use a Dataset that is filled and saved to disk. You can use the standard libraries for encryption and compression.

If you work for a govt agency in the UK, try not to leave the CD on the train or send it in the post... :)

The Database has to be encrypted

Quick question: How do you decrypt it? Properly, by having the user type in the decryption password, or improperly by adding the decryption key to your application, which means it can be easily extracted?

Because if it's solution 2, then you can broaden your possible database options by dropping the encryption requirement altogether.

I was looking for an embedded database also, and based on the answers I received, I went with SQLite, which is easy to implement.

SQL Server CE is a stripped down version of SqlServer (CE stands for Compact Edition) that supports encryption. The DB consists in one single file.

The software consists in a set of DLL that you copy side by side with your exe.

(Don't be fooled by the CE: There is a Desktop Windows version in addition to the Windows Mobile version.)

As others pointed out, there databases which support read-only access.

As for encryption, SQLite has at least one extension supporting encryption

You may also choose any read-only dbms and keep pk's and fk's, but encrypt the contents fields manually (i.e. by code)

SQLite was also my first thought, but despite my general dislike of XML and considering the read only aspect, then I think custom encryption of XML might be the best option. It would be harder to reverse engineer.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top