Password-protect a SQLite file
Database Manager includes SQLCipher, an encrypted form of SQLite. You can open password-protected SQLite files, and add, change or remove the password of a file yourself.
This page applies to SQLite connections only. Server databases manage their own encryption.
Open an encrypted file
Create a SQLite connection that points at the file. You can leave the password empty.
Select the connection. The app detects that the file is encrypted and asks: This database is encrypted. Enter its password to open it.
Type the password and select Unlock.
If the password is wrong, the prompt returns with Wrong password — could not unlock the database.
To have the password saved with the connection, tick Remember this password in the prompt, or type it in the connection dialog. Saved passwords are kept as plain text on your computer. See How passwords are kept.
Encrypt a plain file
Take a backup first: select Backup in the title bar.
Select the open-padlock button in the title bar. Its tooltip is Encrypt with a password.
In the Encrypt database dialog, type the password in New password and again in Confirm password. The eye icon shows what you typed.
Select Apply.
A message confirms Database encrypted. You will need this password to open it. The padlock button now shows a closed padlock.
DANGER
There is no way to recover a forgotten password. Without it the file cannot be opened by this app or any other. Store the password in a password manager before you select Apply.
The dialog also notes: The whole file is rewritten. A backup first is a good idea. The app writes the encrypted database to a new file and puts it in place of the original, so make sure the disk has room for a second copy and do not close the app while it works.
Change the password
Open the encrypted database and select the closed-padlock button (Change or remove password).
In the Change password dialog, type the new password twice.
Select Apply. A message confirms Password changed.
Remove the encryption
Open the encrypted database and select the closed-padlock button.
Tick Remove encryption (make it a plain file). The password boxes disappear.
Select Remove encryption.
A message confirms Encryption removed — this is now a plain database. Anyone who can read the file can now read its contents.
After a change
- If the connection saves its password, the saved password is updated to match.
- If the connection uses Ask for the password every time, nothing is saved. Enter the new password the next time you connect.
- Backups made from now on use the new state: encrypted with the new password, or plain.
- Older backups keep the password they were made with.
If the dialog reports an error
- Enter a password. The password box is empty.
- The two passwords do not match. Type both again.
- Could not change password: followed by a reason. The file was not changed. Check that you can write to the file's folder and that there is free disk space.