Reputation:
How do i encrypt a file in C#? i would like to use a db (like sqlite) and use it normally except have the file encrypted and have my user enter his password before having access to the database.
Upvotes: 1
Views: 1336
Reputation: 689
SQLiteConnection.SetPassword
I think you also have to set the Password= parameter in the connection string.
Upvotes: 0
Reputation: 9905
There are multiple ways to do this:
And there are probably more ways to do this.
Hope this helps.
Upvotes: 7
Reputation: 4137
SQL Server Compact Edition (it's an inprocess database server like SQLite) allows you to encrypt the file without writing any additional code.
To change the password, use the Engine.Compact method.
Upvotes: 2