Android Question Best practice with sqlite encryption

fatman

Active Member
Licensed User
Longtime User
Hi to all,

the following scenario is given: I create a sqlite-file on a pc and this file must be copied onto
an android-device. Creating, copying via sftp is no problem.
But i would like to protect the sqlite-file. What is the best way to achieve this?
I´ ve aready searched and read a lot- but came to no final conclusion yet.

Any hints and ideas are welcome.

Fatman
 

BlueVision

Active Member
Licensed User
Longtime User
So there we have a problem. You can use SQLcipher with B4A, but not for B4J. (You have to purchase the library for B4J, it is not free.)
But you have to encrypt/decrypt the data on both platforms.

I would recommend you to follow this post made by Erel, to solve that problem.

Keep in mind, that the length of the encrypted string often is growing, compared to the regular value, also empty strings get a value when encryted. If your database contains many records, it's total size will grow markable.
On the other side, this is a fast and very safe way of encrypting. When viewing your database with a viewer, you see only "garbage". The encryption level is very strong. You can use whatever you like as string for encrypting, hide that value within your code or use a variables name and don't forget to obfuscate your code.

Here an example of a partially encrypted database. All customer-related content is encrypted, you don't have to encrypt everything...

1706551219623.png
 
Upvote 0
Top