From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

Random Ramblings on LabVIEW Design

Community Browser
Labels
cancel
Showing results for 
Search instead for 
Did you mean: 

Re: Encrypted SQLite - A Gift

swatts
Active Participant

Hello My Lovelies,

Sorry I've been quiet, been really really busy. I hope you are all doing well.

 

Friday at about 4:30 Joerg raised the question of using encryption on SQLite, and it's something that has been raised a few times. So here's how we did it!

 

The interface to SQLite is a dll - sqlite3.dll for 32 bit or sqlite3_64.dll for 64 bit.

 

What I really wanted was a drop in dll, so a google search kicked up this....

 

https://www.zetetic.net/sqlcipher/documentation/

 

Splendid, but all really wanted was a dll (and I didn't want to build it myself!)

 

Thinking outside the box, I thought I could download something that used it and swipe the dll (if it's on an appropriate license), well ....

 

https://sqlitebrowser.org/about/

 

That was downloaded and installed and these files were available.

 

FileToNick.png

Note the libcrypto and libssl dlls are required dependencies

These were moved to the following directory in James toolkit.

Dir.png

Next you will need to modify the open vi in James toolkit to find the new dll

OpenVI.png

That's about it... So how do you use it.

Firstly I encrypted a database using the DBBrowser software I swiped the dlls from.

Then you have to use the PRAGMA key ='password' SQL statement

OpenEncrypted.png

Then it will work just fine (albeit a bit slower).

The final piece of the puzzle was to be able to convert an unencrypted dB to an encrypted dB.

image_2020_12_06T16_31_53_677Z.png

This shows how to do it.

It took about an hour to sort this and test it. Which is rather pleasing and a testament to James's design.

If I can be arsed (and there's any interest) I'll load some examples.

Lots of Love

Steve


Opportunity to learn from experienced developers / entrepeneurs (Fab,Joerg and Brian amongst them):
DSH Pragmatic Software Development Workshop


Random Ramblings Index
My Profile

Comments
joerg.hampel
Active Participant

As I already said on Skype: Fan-diddely-tastic!!!

 

Thanks for finding and sharing this 💜




DSH Pragmatic Software Development Workshops (Fab, Steve, Brian and me)
Release Automation Tools for LabVIEW (CI/CD integration with LabVIEW)
HSE Discord Server (Discuss our free and commercial tools and services)
DQMH® (The Future of Team-Based LabVIEW Development)


cbutcher
Trusted Enthusiast

Thanks for the links and the how-to. Always good to have another tool available!


GCentral
joerg.hampel
Active Participant

After playing around with this some more, trying to make it as easy as possible for our customers to use this, I found this: Just supplying the path to the alternative DLL seems to do the trick alright, with no modifications needed to be made in James' SQLite library VIs:

 

sqlite-supply-library-path.png




DSH Pragmatic Software Development Workshops (Fab, Steve, Brian and me)
Release Automation Tools for LabVIEW (CI/CD integration with LabVIEW)
HSE Discord Server (Discuss our free and commercial tools and services)
DQMH® (The Future of Team-Based LabVIEW Development)


joerg.hampel
Active Participant

...and regarding licensing, it seems to us that the SQLCipher Community Edition is free for commercial projects as per this page:

 

“SQLCipher Community Edition can be used it in both open source and closed source commercial software, but you must include our BSD-style license and copyright statements prominently in the application and documentation.“




DSH Pragmatic Software Development Workshops (Fab, Steve, Brian and me)
Release Automation Tools for LabVIEW (CI/CD integration with LabVIEW)
HSE Discord Server (Discuss our free and commercial tools and services)
DQMH® (The Future of Team-Based LabVIEW Development)