SQLite Encryption in Omnis Studio 8.0.3

Omnis Studio has supported connections to SQLite since March 2012 in Studio version 5.2 (which also added the JavaScript Client into Omnis). For Omnis Studio 8.0.3, released last month, we added support for encryption in native SQLite datafiles, which would be useful for protecting a database embedded into a mobile application. When enabled in the new version, all data written to the SQLite datafile is encrypted and can only be read and decrypted using the SQLite DAM with the appropriate encryption key.

Encryption is enabled by setting the session object $encryptkey property before logging on to the SQLite datafile. $encryptkey accepts a string of hexadecimal characters, which should be of even length and should be no longer than 32 characters (the key value will be truncated if it does not meet either of these criteria). The accepted key value is then used to seed an internal private key which is subsequently used by all statement objects belonging to that session object.

To create a new encrypted datafile, the $opencreate property should also be set to kTrue before logging on. Once encrypted, $logon() will fail unless the correct $encryptkey is supplied. $encryptkey will be ignored (cleared) if the DAM detects a connection to a non-encrypted datafile.

The encryption function in the SQLite DAM is enable using two new methods: $encrypt(filename) opens a non-encrypted datafile and encrypts it using the $encryptkey, while $decrypt(filename) opens a previously encrypted datafile and decrypts it using the $encryptkey.

For more details about SQLite encryption in Studio 8.0.3 see the ‘What’s New in Omnis Studio 8.0.3′ manual available here: http://www.omnis.net/products/studio/whatsnew.jsp

0 Comments

Leave a reply

© Omnis Software Ltd 2017 - Help with setup and design by Ädelfors Consult ABSweden Disclaimer: Omnis Software disclaims any responsibility for or liability related to Software, or any content or advice, obtained through this site. IN NO EVENT WILL OMNIS SOFTWARE BE LIABLE FOR ANY INDIRECT, PUNITIVE, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES HOWEVER THEY MAY ARISE AND EVEN IF OMNIS SOFTWARE HAS BEEN PREVIOUSLY ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.

Log in with your credentials

or    

Forgot your details?

Create Account