Migrate plain text DB to encrypted DB in C#

Is there a sample code to use the sqlcipher_export functionality in Xamarin shared project with C# code?

Hello @snatarajan - if you are using official Zetetic Commercial or Enterprise packages you can contact us at support@zetetic.net.

Hi,
We are currently using Community Edition of SQLCipher in our Xamarin project. I am using the following libraries in my projects:
Xamarin.Android:
image
Xamarin.iOS
image
Xamarin.Shared:
sqlite-net-sqlcipher

I ahve implemented encyption for new users. But would like to know how we migrate existing users through sqlcipher_export functionality in Xamarin C# world.

Hello @snatarajan we don’t provide direct support for 3rd party .NET packages like you are using. However, you can find general purpose documentation for how to use sqlcipher_export here: https://www.zetetic.net/sqlcipher/sqlcipher-api/#sqlcipher_export

OK thankyou. Can you please tell me for the sqlcipher_export function in the 3rd line

$ ./sqlcipher plaintext.db
sqlite> ATTACH DATABASE ‘encrypted.db’ AS encrypted KEY ‘newkey’;
sqlite> SELECT sqlcipher_export(‘encrypted’); – is this the variable(encrypted) name or the encrypted.db name?
sqlite> DETACH DATABASE encrypted;

Hello @snatarajan that is the logical name that you used for the attached database in the first step.