Android Question Whats the best practice for encrypting a log file?

ernschd

Active Member
Licensed User
Longtime User
Hello,

In our app, a log file is to be written for security purposes, in which the database queries are stored in order to read them into a sqlite if required.
To prevent unauthorized access to this data, the log file is to be encrypted. The decryption must be possible on a (Windows) PC.
A problem could be that the file is probably opened quite often for writing, therefore the process must not take too long.

Does anyone have an idea for the best way to do this?

Regards
 

toby

Well-Known Member
Licensed User
Longtime User
You have two options
1. use B4XEncryption to create a B4A app and a B4J app which runs on your Windows pc

2. Use Use B4XEncryption in your B4A app and B4XEncryption.net DLL in your PC app
 
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
The way I would have done it is by encrypting each block(?) of logs separately, write the encrypted bytes length and then the encrypted bytes.
On the PC you need to read the length of each block, read the block and decrypt it.

Writing the logs will be fast as you don't need to encrypt the whole data.

Example of encrypting / decrypting large files in chunks: https://www.b4x.com/android/forum/t...encryption-and-decryption.114141/#post-713166
This is not exactly the same case as this one.
 
Upvote 0
Top