OK, here is the szenario:
I'm coding a .NET 3.5 WPF-Aapplication, using the Microsoft Entity Framework to use a compact database file (.sdf) for storing data. On my first program start a computer-based encryption key is calculated and saved into the registry and my sdf-File should become encrypted with this key (or rather with a somehow hashed version of this key).
My current proble
- How can I encrypt my (until now unencrypted) sdf-file with the generated password?
- How can I tell the ModelContainer of the Entity Framework to use this password to connect to the database instead of the connection string in the app.config where no password is saved?
I tried to clear all connection strings and create a new one with the password on-the-fly when starting, but I get an exception that my configuration is read-only.
Any ideas are greatly appreciated :-)