ARH
ARH

Reputation: 1716

Password Protect Sqlite in UWP

I am using sqlite in my UWP project and I have referenced two dll from NuGet to perform DDL, DML operation on the sqlite tables.

SQLite for Universal App Platform

SQLite.Net-PCL

However, I want to password protect my sqlite file. Any clue on how to protect the sqlilte file with password?

Thanks!

Upvotes: 3

Views: 1351

Answers (2)

Yanni Chang
Yanni Chang

Reputation: 81

You have to purchase the source code of Sqlite SEE (SQLite Encryption Extension) and build a SEE-enabled Sqlite library by yourself.

With a SEE-enabled Sqlite, you can encrypted your sqlite db file with a key (password).

The cost of a perpetual source code license for SEE is US $2000. http://www.hwaci.com/sw/sqlite/see.html

Where to download SEE source code. (You need to login before download.) http://www.sqlite.org/see

How build SEE for UAP 10.0 - https://www.sqlite.org/see/doc/trunk/www/uap10.wiki

Upvotes: 0

Mikael Koskinen
Mikael Koskinen

Reputation: 12906

Unfortunately there's no password protection available for SQLite in UWP.

One thing you can do is to encrypt the data you store in your DB. There's a good article on MSDN which talks about Data protection. The article also shows how you can encrypt and decrypt your data.

You could maybe write a wrapper around your data access layer which helps to deal with your data encryption needs. This way you could continue to use the SQLite as you are using it right now and let the data access layer to deal with protecting your data.

I've seen some solutions where not all data in SQLite is encrypted, just the sensitive columns. In these cases the columns were marked with some postfix (for example ("_PROTECT"). The data access layers was then coded to check the column names and to protect the data if postfix was found.

There's also an another interesting article on MSDN which talks about securing your UWP apps: Intro to secure Windows app development

Upvotes: 1

Related Questions