1

It gets me angry it gets me crazy i 've been looking for the past 1 week for a solution and i cannot find any. I had successfully created a database using System.Data.SQLite from visual studio and everything worked perfectly until i decided to use a password.

string dbPath = AppDomain.CurrentDomain.BaseDirectory;
        databaseCredentials.dbPath = Path.Combine(dbPath, "database.db");
        string connectionString = "Data Source= " + databaseCredentials.dbPath + ";Version=3;Password= " + "test" + ";";

        Console.WriteLine("~~~~~~~~~~~~~~~~~~~~~~~~~~~Dimiourgia Vasis~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~");
        //databaseCredentials.db = new SQLiteConnection("Data Source=" + databaseCredentials.dbPath);
        databaseCredentials.db = new SQLiteConnection(connectionString);
        databaseCredentials.db.Open();

As you can see i set a password "test". The program works fine with db.open() the db is readable and i see the tables normally.

When i want to read the db file from sqlite3 shell it says: Error: File is encrypted or is not a database which is what i expected to happen as it is protected now.

And here is my main question. How do i open the db file now from the shell so i can handle it by using sql commands in case i want to...? Where do i put the password "test" i set above?

1

1 Answer 1

1

SQLite doesn't nativelly support encryption.

System.Data.SQLite provides this extension, through EFS since version 1.0.17, and through 128-bit RC4 pager encryptation since 1.0.24.3 beta.

Take a look at SEE to enable encryption in SQLite3 shell.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.