Feb 13, 2012 Replies: 163 Edit: this library isn't compatible with the 16KB page size requirement. Don't use it. SQLCipher is an open source project that extends SQLite and adds full database encryption. License: https://www.zetetic.net/sqlcipher/open-source/ B4A SQLCipher is a special subtype of SQL object. There is almost no need to change any code in order to switch from regular SQL to SQLCipher. The only difference between SQL API and SQLCipher API is the Initialize method. SQLCipher.Initialize expects two additional values: Password and a second parameter that is not used (it was used in the past). Password is the database password. You can pass an empty string if there is no password. Note that it is not possible to change the password (or set a new password) to an existing database. Code changes required to convert from SQL to SQLCipher - Declare the SQL object as SQLCipher. - Change the initialize code to: Code: Copy SQL1.Initialize(File.DirRootExternal, "1.db", True, DB_PASSWORD, "") V1.70 Based on SQLCipher v4.5.4: https://www.zetetic.net/blog/2023/04/27/sqlcipher-4.5.4-release/ V1.60 Based on SQLCipher v4.00: https://www.zetetic.net/blog/2018/11/30/sqlcipher-400-release/ Includes 64 bit binaries and emulator binaries. Requires B4A v8+. Library is attached. Not compatible by default with databases created with older versions. See this link: https://www.zetetic.net/blog/2018/11/30/sqlcipher-400-release/#compatibility V1.50 Based on SQLCipher v3.59 Supports targetSdkVersion 26. The icu.zip file is no longer required. You can delete it from the Files folder. It is no longer required to disable the debugger virtual assets feature. Remove this line: #DebuggerForceStandardAssets: True Old version: www.b4x.com/android/files/SQLCipher150.zip Depends on: https://repo1.maven.org/maven2/net/...er/4.5.4/android-database-sqlcipher-4.5.4.aar You should download and copy it to the additional libraries folder. Attachments SQLCipher.zip SQLCipher.zip 37.2 KB · Views: 1,326 Last edited: Jul 20, 2025 Click to expand...
Edit: this library isn't compatible with the 16KB page size requirement. Don't use it. SQLCipher is an open source project that extends SQLite and adds full database encryption. License: https://www.zetetic.net/sqlcipher/open-source/ B4A SQLCipher is a special subtype of SQL object. There is almost no need to change any code in order to switch from regular SQL to SQLCipher. The only difference between SQL API and SQLCipher API is the Initialize method. SQLCipher.Initialize expects two additional values: Password and a second parameter that is not used (it was used in the past). Password is the database password. You can pass an empty string if there is no password. Note that it is not possible to change the password (or set a new password) to an existing database. Code changes required to convert from SQL to SQLCipher - Declare the SQL object as SQLCipher. - Change the initialize code to: Code: Copy SQL1.Initialize(File.DirRootExternal, "1.db", True, DB_PASSWORD, "") V1.70 Based on SQLCipher v4.5.4: https://www.zetetic.net/blog/2023/04/27/sqlcipher-4.5.4-release/ V1.60 Based on SQLCipher v4.00: https://www.zetetic.net/blog/2018/11/30/sqlcipher-400-release/ Includes 64 bit binaries and emulator binaries. Requires B4A v8+. Library is attached. Not compatible by default with databases created with older versions. See this link: https://www.zetetic.net/blog/2018/11/30/sqlcipher-400-release/#compatibility V1.50 Based on SQLCipher v3.59 Supports targetSdkVersion 26. The icu.zip file is no longer required. You can delete it from the Files folder. It is no longer required to disable the debugger virtual assets feature. Remove this line: #DebuggerForceStandardAssets: True Old version: www.b4x.com/android/files/SQLCipher150.zip Depends on: https://repo1.maven.org/maven2/net/...er/4.5.4/android-database-sqlcipher-4.5.4.aar You should download and copy it to the additional libraries folder.
Erel B4X founder Staff member Licensed User Longtime User Feb 27, 2012 #21 It is more or less correct. Just to make it clear, these steps are only required when you need to convert an existing unencrypted database. Once you have the encrypted database you can work with it exactly like you worked with the unencrypted database. Step 3 should be: Add the records from database1 into database 2.
It is more or less correct. Just to make it clear, these steps are only required when you need to convert an existing unencrypted database. Once you have the encrypted database you can work with it exactly like you worked with the unencrypted database. Step 3 should be: Add the records from database1 into database 2.
Taha Member Licensed User Longtime User Feb 28, 2012 #22 Ok, now I understand. The library DOES create SQLCipher database. Checked that and it works! Thanks, Erel!
Ok, now I understand. The library DOES create SQLCipher database. Checked that and it works! Thanks, Erel!
AscySoft Active Member Licensed User Longtime User Feb 29, 2012 #23 I made a .net solution that uses multiple sqlite(normal) databases. If I'll switch to encryption on Android device, is there any possibilities on doing so on PC? Is there any way to manipulate this SQLite encrypted database on normal PC?
I made a .net solution that uses multiple sqlite(normal) databases. If I'll switch to encryption on Android device, is there any possibilities on doing so on PC? Is there any way to manipulate this SQLite encrypted database on normal PC?
Erel B4X founder Staff member Licensed User Longtime User Mar 1, 2012 #24 SQLCipher is available on the desktop as well. However I think that you either need to build it yourself or purchase a build: Home - SQLCipher - Open Source Full Database Encryption for SQLite
SQLCipher is available on the desktop as well. However I think that you either need to build it yourself or purchase a build: Home - SQLCipher - Open Source Full Database Encryption for SQLite
AscySoft Active Member Licensed User Longtime User Mar 1, 2012 #25 Erel said: SQLCipher is available on the desktop as well. However I think that you either need to build it yourself or purchase a build: Home - SQLCipher - Open Source Full Database Encryption for SQLite Click to expand... Thank you for your reply.
Erel said: SQLCipher is available on the desktop as well. However I think that you either need to build it yourself or purchase a build: Home - SQLCipher - Open Source Full Database Encryption for SQLite Click to expand... Thank you for your reply.
CapReed Member Licensed User Longtime User Aug 17, 2012 #26 Hi all, I managed to run correctly with the emulator SQLCipher. I copied the files manually sqlcipher_native.zip unpacked to the folder "/ data / data / xxxxxxxx.yyyyy.zzzzz / files /" and then I copied the compressed file "sqlcipher_native.zip" in "/ mnt / sdcard / sqlcipher_native. zip "that is where I have stored the test database I created. After that, everything works, great. But now I want to do it in an automatic mode, that is, everything you need is inside the APK and only have to install the application from google play with everything you need. Actually I have no idea how to do, how you could help me? Thank you very much for your time.
Hi all, I managed to run correctly with the emulator SQLCipher. I copied the files manually sqlcipher_native.zip unpacked to the folder "/ data / data / xxxxxxxx.yyyyy.zzzzz / files /" and then I copied the compressed file "sqlcipher_native.zip" in "/ mnt / sdcard / sqlcipher_native. zip "that is where I have stored the test database I created. After that, everything works, great. But now I want to do it in an automatic mode, that is, everything you need is inside the APK and only have to install the application from google play with everything you need. Actually I have no idea how to do, how you could help me? Thank you very much for your time.
Erel B4X founder Staff member Licensed User Longtime User Aug 18, 2012 #27 You should include the zip file in the Files tab and change the last parameter (NativeLibsFolder) to File.DirAssets.
You should include the zip file in the Files tab and change the last parameter (NativeLibsFolder) to File.DirAssets.
CapReed Member Licensed User Longtime User Aug 18, 2012 #28 Erel Ok, I understand, I will try. Thank you very much! :sign0060:
D Dexter438 New Member Nov 2, 2012 #29 I would love to use SQL-Cipher, but I'm worried that all somebody would have to do is unpack my .apk and easily find the password used to encrypt the database... wouldn't this be a pretty easy way to circumvent the db encryption? Does anyone have any suggestions for hiding a password (within an Android app) that I could then use to encrypt the database with? I could of course obfuscate the password but this would only make the password slightly more tedious to detect. I'm really just looking for a way to store data for my Android app that I absolutely don't want anybody messing with. Any suggestions would be extremely appreciated.
I would love to use SQL-Cipher, but I'm worried that all somebody would have to do is unpack my .apk and easily find the password used to encrypt the database... wouldn't this be a pretty easy way to circumvent the db encryption? Does anyone have any suggestions for hiding a password (within an Android app) that I could then use to encrypt the database with? I could of course obfuscate the password but this would only make the password slightly more tedious to detect. I'm really just looking for a way to store data for my Android app that I absolutely don't want anybody messing with. Any suggestions would be extremely appreciated.
Erel B4X founder Staff member Licensed User Longtime User Nov 2, 2012 #30 For some reason you appear as an unlicensed user in the forum. Please contact [email protected] in order to fix it.
For some reason you appear as an unlicensed user in the forum. Please contact [email protected] in order to fix it.
djpero Member Licensed User Longtime User Nov 10, 2012 #31 My antivirus reporting a virus in this library jar file. Attachments virus.png 9.7 KB · Views: 912
NJDude Expert Licensed User Longtime User Nov 10, 2012 #32 It seems like a false positive reported by your scanner.
Erel B4X founder Staff member Licensed User Longtime User Nov 11, 2012 #33 I also think that it is a false positive as the original file wasn't changed. Anyway I've uploaded a new file.
I also think that it is a false positive as the original file wasn't changed. Anyway I've uploaded a new file.
S sioconcept Active Member Licensed User Longtime User Nov 15, 2012 #34 I've add sqlcipher_native.zip to Files Tab and i've this error : Compiling generated Java code. Error javac 1.6.0_26 src\b4a\example\main.java:231: package a.b.test does not exist public static a.b.test.SQLCipher _sqlc = null; I've missing a step ?
I've add sqlcipher_native.zip to Files Tab and i've this error : Compiling generated Java code. Error javac 1.6.0_26 src\b4a\example\main.java:231: package a.b.test does not exist public static a.b.test.SQLCipher _sqlc = null; I've missing a step ?
Erel B4X founder Staff member Licensed User Longtime User Nov 15, 2012 #35 Please download the library again. The XML file didn't match the Jar file. After you copy the files you should right click on the libraries tab and choose Refresh.
Please download the library again. The XML file didn't match the Jar file. After you copy the files you should right click on the libraries tab and choose Refresh.
djpero Member Licensed User Longtime User Nov 21, 2012 #36 Just to make clear to myself and others: - SQL cipher only create new database with ability of password - you MUST include the sqlcipher_native in project under Files folder (that increasing the apk size plus 3,1Mb) Am I right? Is better way to encrypt all the data in db file? I found db files of other wellknown apps from market, they doing this: encryption of data, not ciphering.
Just to make clear to myself and others: - SQL cipher only create new database with ability of password - you MUST include the sqlcipher_native in project under Files folder (that increasing the apk size plus 3,1Mb) Am I right? Is better way to encrypt all the data in db file? I found db files of other wellknown apps from market, they doing this: encryption of data, not ciphering.
Erel B4X founder Staff member Licensed User Longtime User Nov 22, 2012 #37 Am I right? Click to expand... Yes. You can encrypt specific fields and store the data as blobs. For a complete solution SQLCipher will give you the best result.
Am I right? Click to expand... Yes. You can encrypt specific fields and store the data as blobs. For a complete solution SQLCipher will give you the best result.
Sinan Tuzcu Well-Known Member Licensed User Longtime User Jan 28, 2013 #38 Helo, i Need a example tutorial for this library. can somebody help me greet sinan
Erel B4X founder Staff member Licensed User Longtime User Jan 28, 2013 #39 This library is similar to the SQL library. You should follow the instructions in the first post.
C coyote Member Licensed User Longtime User Feb 22, 2013 #40 Hi, I've already opened a thread in the german forum, but I've still no answer. http://www.b4x.com/forum/german-forum/26636-urls-classes-dex.html) So, let me ask my question again. When I add the SQLCipher V.1.00 lib, compile the programm and open the classes.dex in notepad++, I see many URLs. See the picture below. Why are so many URLs in the file? What are they use for? Greetings, Coyote Attachments urls.PNG 43.5 KB · Views: 1,134
Hi, I've already opened a thread in the german forum, but I've still no answer. http://www.b4x.com/forum/german-forum/26636-urls-classes-dex.html) So, let me ask my question again. When I add the SQLCipher V.1.00 lib, compile the programm and open the classes.dex in notepad++, I see many URLs. See the picture below. Why are so many URLs in the file? What are they use for? Greetings, Coyote