Anil
Anil

Reputation: 965

Encrypting SQL Server CE database

How to encrypt and decrypt the SQL Server CE databases present in the Isolated Storage of WP7 app ?

I was able to copy the db from my emulator to the hard disk of my system. Now, How can I need a way to encrypt and decrypt this.

I wanted to decrypt the entire SQL Server CE DB on loading of the WP7 application and encryption of the DB on exit. How can I do this ?

This is my app.xaml.cs code

private void Application_Launching(object sender, LaunchingEventArgs e)
        {
              // Code to Decrypt Database
        }

private void Application_Deactivated(object sender, DeactivatedEventArgs e)
        {
              // Code to Encrypt Database
        }

Upvotes: 2

Views: 975

Answers (1)

Lokeshwer
Lokeshwer

Reputation: 1139

I would rather suggest not to encrypt CE database. XAP is already encrypted (after app gets published in marketplace) so I don't think one can easily explode xap and fetch the database. Other issue in encrypting is that (as of now) you loose the flexibility of editing or viewing data with well known SQL utilities (such as SSMS because the encryption mode is not supported)

So I doubt if encryption of wp database really solves problem on hand.

But if exchanged in development mode or the database is downloaded or uploaded from web, we might need encryption to prevent access to data.

Upvotes: 0

Related Questions