Android Question SQLCipher and Licensing

tdocs2

Well-Known Member
Licensed User
Longtime User
Greetings, all.

I just completed my first SQLCipher project (see results in two posts here).

I have been reading about the developers of SQLCipher(see link) and their licensing. The SQLCipher license is very straightforward - attribution and disclaimer (see actual text below to be included in your app).

QUESTION
The zip file provided by Erel contains the Apache License (see it here). I assume that it applies to the commons and guava jars??? The Apache License requires attribution. Who is the copyright holder of Guava and Commons? Is it the ASF (Apache Software Foundation)?

SQLCipher License

Guava and commons License???
 

ivan.tellez

Active Member
Licensed User
Longtime User
Hi, actually not really related to the licencing, but...

SQLCipher its not really a good thing. You will have some issues with it, the licence, the performance and of course, the database/apk sizes.


I did an app with a large DB. It was 90 mb, with SQLCipher, the APK was 105 Mb, with normal SQLite, APK was 8 Mb (Database was compressed in APK, but when installed, database file is decompresed to its 90 mb)

The other problem, the Datbase stored lots of text, so, the reading time was ridiculously log (3 to 6 sec).


So, my solution...

Serialize the Data -> Compress Data -> EncryptData -> Store Encripted Data in the SQLite


Maybe you could say that this has no logic. its much more steps and should be slower. BUT, actualy is 20 times faster (im my case.) And its logic if you think about, the bottle neck its on the storage (SD cards, or internal storage) its faster to read a little amount of data, decryt it, uncompress it and deserialize it, than reading a big chunk of data.


I used:

Serialize: JSON Lib
Compress: CompressedStreams (Using gzip)
Encrypt: Encryption Lib (Using AES/CBC/PKCS5Padding)
Store Data: (SQLite, in a single BLOB)


To store the keys, you can use String vars in Process_Globals and compile obfuscated. If you are unsure, use 2, 3 or more vars in diferent modules, split the key and then concatenate it in run time.


Results (in my case)

SQLite:
APK Size: 8 Mb
Installed: 95 Mb
Performace: Slow

SQLCipher :
APK Size: 105 Mb
Installed: 110 Mb
Performace: Slow

Serialize, compres and encrypt:
APK Size: 9 Mb
Installed: 10 Mb
Performace: Really Fast



It was a lot of work, but the results are amazing.
 
Upvote 0

tdocs2

Well-Known Member
Licensed User
Longtime User
Thank you, Ivan.

This was indeed a clever piece of work - just getting a 90MB DB down to 10MB... And 3 to 6 seconds is just not acceptable. Quite an accomplishment.

What issues did you find with the SQLCipher licensing? That would be a show stopper...

@@@@@


I presume that you did take a look at my own experience from my two posts here:


My data base would be around 5MB...

Best regards.

Sandy
 
Upvote 0

ivan.tellez

Active Member
Licensed User
Longtime User
What issues did you find with the SQLCipher licensing?

Actually the real show stopper was the filesize of the APK and installed database.

I presume that you did take a look at my own experience

Yes I did. Thats why I insisted that in my case the changes were way more notorious. (The data was a really large amount data stored as large collections of text)

I forgot to mention that my approach it has a much better performance than SQLCypher but it cant be used for all purposes. the main drawback, you cant search



The license is not so bad. 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.

So you should:

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of the ZETETIC LLC nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
 
Upvote 0

tdocs2

Well-Known Member
Licensed User
Longtime User
Thank you, Ivan, for the clarification.

As I said, I congratulate you on this significant effort and success.

Best regards.

Sandy
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…