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

Backup and Restore command should take ciphers parameters #12

Open
Willena opened this issue Jun 21, 2019 · 0 comments
Open

Backup and Restore command should take ciphers parameters #12

Willena opened this issue Jun 21, 2019 · 0 comments
Assignees

Comments

@Willena
Copy link
Owner

Willena commented Jun 21, 2019

When you're trying to backup the database using the "backup to " non standard command, the destination database is opened clear all the time. If the source is encrypted you might want to keep your backup encrypted or encrypt it with another cipher algorithm. The "backup to" command should provide a way to choose the algorithm parameters like when the user opens the database.

The same thing apply for the "restore from" command.

Possible workaround ( not tested ):

You can try putting cipher parameters after the name like when you're opening the database.
Ex:

  • Backup to file:dB.db?key=AA
  • Backup to dB.db?key=AA

If that doesn't work you can still cipher it after backup using the standard way:

  • open the new database clear ( do not specify the key at the end.
  • execute the "PRAGMA key='...'" SQL query to apply a key to the database.
  • close the database

After that it should be now encrypted.

If you want to restore the database, might need to rekey the backup before restore

  • open with ciphers parameters
  • execute PRAGMA rekey=''
  • close the database
  • do the restore

Rekeying the backup might be also needed since at this stage it is clear

  • PRAGMA rekey='mykey'

Another workaround would be to:

  1. open the database
  2. dump it as sql file
  3. execute the sql file in a new database
@Willena Willena self-assigned this Jun 21, 2019
@Willena Willena changed the title Backup and Restore command should take Backup and Restore command should take ciphers parameters Jun 21, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant