gilzoide / unity-sqlite-net

SQLite-net for Unity, supports Windows, Linux, macOS, iOS, tvOS, visionOS, Android and WebGL
MIT License
86 stars 9 forks source link

Example of using (if possible) sqlcipher? #28

Closed Straafe closed 1 month ago

Straafe commented 1 month ago

Looks like it should be possible to use sqlcipher, but unsure (if it is), how to integrate it in

gilzoide commented 1 month ago

Hi @Straafe. Yes, it would be possible to use SQLCipher instead of the vanilla SQLite code. You'd need to recompile the native library, but instead of compiling the SQLite source file sqlite3.c located at Plugins/sqlite-amalgamation, you compile the SQLCipher code. The easiest way is to use an amalgamated version of the source code, so you can simply write the new code in sqlite3.c file and rebuild the native libraries with minimal, if any, changes to the Makefile.

Straafe commented 1 month ago

Thanks for that info. In the short term for anyone else wondering this, this also works (but is inferior in general to this one): https://github.com/netpyoung/SqlCipher4Unity3D

gilzoide commented 1 month ago

You know, I see SQLCipher updates with upstream SQLite code pretty frequently, I'll consider changing the implementation from SQLite to SQLCipher to support encrypted databases in this package. It's nice being able to encrypt games' save databases, I feel you.