cipher: Add option for changing the encryption used for the current file

Add a new menu option to the main window (only visible when built with
the sqlcipher option enabled) which opens a dialog asking for new
encryption settings. These are then applied to a new database to which
all contents of the current one are exported. The old database is then
replaced by the new one.

This adds support for encrypting plaintext databases, decrypting
encrypted databases and changing the password or other settings of
encrypted databases.

If this turns out to work well enough we have functional SQLCipher
encryption support with only details missing.
This commit is contained in:
Martin Kleusberg
2014-11-02 19:06:06 +01:00
parent 8fb9176f99
commit a22ed6f9d3
7 changed files with 102 additions and 5 deletions

View File

@@ -278,8 +278,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>575</width>
<height>458</height>
<width>294</width>
<height>444</height>
</rect>
</property>
<layout class="QFormLayout" name="formLayout">
@@ -793,6 +793,7 @@
<addaction name="fileSaveAction"/>
<addaction name="fileRevertAction"/>
<addaction name="fileCompactAction"/>
<addaction name="actionEncryption"/>
<addaction name="actionLoadExtension"/>
<addaction name="separator"/>
<addaction name="menuImport"/>
@@ -1523,6 +1524,15 @@
<string>&amp;Attach Database</string>
</property>
</action>
<action name="actionEncryption">
<property name="icon">
<iconset resource="icons/icons.qrc">
<normaloff>:/icons/encryption</normaloff>:/icons/encryption</iconset>
</property>
<property name="text">
<string>Set Encryption</string>
</property>
</action>
</widget>
<customwidgets>
<customwidget>
@@ -2314,6 +2324,22 @@
</hint>
</hints>
</connection>
<connection>
<sender>actionEncryption</sender>
<signal>triggered()</signal>
<receiver>MainWindow</receiver>
<slot>editEncryption()</slot>
<hints>
<hint type="sourcelabel">
<x>-1</x>
<y>-1</y>
</hint>
<hint type="destinationlabel">
<x>499</x>
<y>314</y>
</hint>
</hints>
</connection>
</connections>
<slots>
<slot>fileOpen()</slot>
@@ -2363,5 +2389,6 @@
<slot>loadProject()</slot>
<slot>saveProject()</slot>
<slot>fileAttach()</slot>
<slot>editEncryption()</slot>
</slots>
</ui>