Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open a password protected better-sqlite3-multiple-ciphers database #14

Closed
leean613 opened this issue Mar 18, 2022 · 5 comments
Closed
Labels
question ❓ Further information is requested solved ✔ This issue has been solved / answered

Comments

@leean613
Copy link

leean613 commented Mar 18, 2022

How can i open the encript database, with gui interface

@m4heshd
Copy link
Owner

m4heshd commented Mar 18, 2022

Hello @leean613,

It depends on the GUI you're using. Something like DB4S?

@m4heshd m4heshd added question ❓ Further information is requested waiting-author-response ⏳ The issue is blocked till the author responds labels Mar 18, 2022
@leean613
Copy link
Author

image
the default encrypt type of better-sqlite3-multiple-ciphers is not sqlCipher, so i don't know what is the right way to fill this form (i suppose custom option, but how about the algorithm)

@jove0610
Copy link

I have the same problem and I'm also using DB Browser for GUI. Even if I specify sqlcipher on pragma like so:

db.pragma("cipher='sqlcipher'");
db.pragma("key='123'");

I still can't open it if I click SQLCipher 3 and SQLCipher 4 options on the DB Browser.. There's no error message. It just closes the window then reopens it again.

@m4heshd
Copy link
Owner

m4heshd commented Mar 19, 2022

As mentioned in issue #5, DB Browser for SQLite reads and creates DBs that has an encrypted header which is called the legacy mode in this extension. You have to create the DB using following pragma to be able to open it in DB4S.

const db = require('better-sqlite3-multiple-ciphers')(databasePath, { verbose: console.log });
db.pragma(`cipher='sqlcipher'`);
db.pragma(`legacy=4`);
db.pragma(`key='123'`);

@m4heshd m4heshd closed this as completed Mar 19, 2022
@m4heshd m4heshd reopened this Mar 19, 2022
@m4heshd m4heshd added solved ✔ This issue has been solved / answered and removed waiting-author-response ⏳ The issue is blocked till the author responds labels Mar 20, 2022
m4heshd added a commit that referenced this issue Nov 23, 2022
@julianpoemp
Copy link

For anyone looking for a way to open the excrypted SQLite database with DBeaver: You can create a configuration as described here:
https://gist.github.com/thecodingcod/a3987ddde8892d1a6bda8bd94febb7d0

I got it working with sqlite-jdbc-3.46.0.0.jar .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question ❓ Further information is requested solved ✔ This issue has been solved / answered
Projects
None yet
Development

No branches or pull requests

4 participants