2

I want to create a C# windows application and store data in a local Database like SQL Express (or any other local DB). Then I want to make local DB inaccessible directly by user and data should be reached only by windows application.

In other words I need something like "Isolated Storage" functionality but for storing larger volume of structured data in a relational database.

babak
  • 155
  • 1
  • 1
  • 14

2 Answers2

0

This is a difficult question to answer fully without more details but there are some options for you to try:

  • the easiest route would be to install SQL server locally and use the Transparent Data Encryption feature but this is available only in the Enterprise Edition (which means a pricier license)
  • SQL Server LocalDb cannot be encrypted and I believe its password protection can be easily bypassed if someone can access the database file
  • SQLite databases can be password protected to avoid anyone not knowing the password accessing them
  • There are some extension to encrypt a SQLite database but most of them require a license. You can see this answer for more informations
Community
  • 1
  • 1
Beorn
  • 401
  • 9
  • 21
0

There is a three level of security you can do it like the below :
1. Add username and password to you db
2. most of embedded Db have an own security level
3. use System.Security.Cryptography to protect your data

And There is many options of embedded database to use :

  1. SQLite Db which have a ADO.NET provider
    You can use it with SQLCipher is an open source extension to SQLite that provides transparent 256-bit AES encryption of database files.
  2. LiteDB it is an open source, cross-platform serverless database delivered in a single DLL (less than 200kb) fully written in .NET 3.5 C# managed code also supported
  3. Firebird it is a free, open-source database and supported by Ado.Net
Osama AbuSitta
  • 3,918
  • 4
  • 35
  • 51