B4J Question Any way to encrypt images in Assets folder? (for security reasons)

MegatenFreak

Active Member
Licensed User
Hi.
Today I discovered (!!) that any user can extract my app's JAR, change any images or assets or whatever they like, and then recompress it as ZIP and rename it back to JAR, and voila! they've cracked it!
That is very inconvenient for me. Well, the code is compiled, thankfully, and there's not much they can do by altering the strings inside (they can decompile Java anyway), but is there a way I could prevent an easy modification of the images in the Assets (Files) folder? I have things like company logos in there!
Thanks in advance.
 

MicroDrie

Well-Known Member
Licensed User
Longtime User
If it can been seen on screen, it can be saved.
Indeed any image on the screen can be stolen. Security always comes with a price. But security is like making it necessary to use a ladder: The "longer ladder" is used, the fewer people will reach it. We started with this question:
but is there a way I could prevent an easy modification of the images in the Assets (Files) folder?
You can prevent adaptation by e.g. Calculate the MD5 hash and compare it with the MD5 of the original in the protected program code. Simple to apply for non-dynamic images to exit the pirated program or even more frustrating, starts an endless loop so that it looks like the program has stopped but is using cpu time.
I have things like company logos in there!
The routines given by Meysampro is the first easy step. Now the marketing department probably won't have much of a problem with it as long as it brings extra brand awareness for free. However, with a sales department that starts to sell less because the program and the logo are changed, that clearly becomes a problem. Then it remains to use the "longer ladder" technique. Apply a backing that uses a random pattern and/or color in all directions with as little unused space as possible. This means that it is no longer just as easy to adjust, or adjustments become more or less visible.
 
Upvote 0

AnandGupta

Expert
Licensed User
Longtime User
change any images or assets or whatever they like
This point is always possible, i.e. replace Bill Gates photo with Bill Clinton, as jar can be opened.
I am not stopping in encryption, but just stating the facts.
Complex encryption will take time, which is crucial for an app to operate, I think.
 
Upvote 0

Magma

Expert
Licensed User
Longtime User
Well I think.. this point with assets can be a wish to Erel future updates for encrypting like zip with password... good point...

For now.. I think that you maybe need to mix sqlite dB with blob... also have watermarks...

Also blobs can be many parts... and some reversed... also have a small encrypted string with the enumeration order of blobs..

So one file db with all assets into it... but your way encrypted
 
Upvote 0

MicroDrie

Well-Known Member
Licensed User
Longtime User
So one file db with all assets into it... but your way encrypted
Good idea, but the practice is unmanageable. Encrypting a database is also not without problems. After a lot of searching I found out that if you do that, you come into conflict with, for example, the unencrypted search of a B4X table search field.
 
Upvote 0

Magma

Expert
Licensed User
Longtime User
Good idea, but the practice is unmanageable. Encrypting a database is also not without problems. After a lot of searching I found out that if you do that, you come into conflict with, for example, the unencrypted search of a B4X table search field.
Not encrypting... dB... only specific strings that will have the order of parts of blobs
 
Upvote 0

BeneBarros

Active Member
Licensed User
Longtime User
Downloading Images via the internet to compose an interface would not be advisable. Erel is absolutely right.
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…