Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Titanium: Data encryption and decryption techniques on Android devices

I am using Titanium 1.7.6 I am developing an android 2.2 application that will access images/videos/pdf/text from my resources folder from sd card. I want only the application to be able to read the contents of my resources folder. What would be the best way to do that? Here are some of my ideas:

  1. password protect the resources folder, only application would know the password. (Not sure if this can be done. If you know how to do it please let me know.)
  2. encrypt all the files inside the resources folder. (in this approach, I am guessing in order to read an encrypted file like images, I will have to decrypt the file and store it into some temp folder. after using the decrypted file delete the file from the temp folder.) But there is a problem with this approach. please see link to the problem here

If you have some other idea please add that to the list.

like image 659
vaibhav Avatar asked Nov 05 '22 05:11

vaibhav


1 Answers

I don't really have a serious experience with android developing, but here are some ideas from top of my mind which may come handy:

  • You can always use open-source compressing libraries such as gZip to compress and password protecting your folders using an additional library like PGP or PKZIP. this method is really common among developers. e.g: Call Of Duty games. the game, stores resources such as sprites/sounds/models/scripts and such in compressed and encrypted folders with .ff extension.
  • since Android uses the same code base with Linux, I think it's possible to encrypt folders in the same fashion. so try all of those encrypting techniques from Linux
  • And of course, when it comes to encrypting areas, one does not simply forgets about RSA and SSL like encryption/decryption algorithms

And your best option from the above methods is the first one, because:

  1. By compressing a whole folder, you don't need to worry about files inside it
  2. While using libraries such as gZip, with addition to a robust,fast and optimized backbone for your application you have a rich and easy-to-use API to decrypt and decompress your files and folders.

Hope it helps you.

like image 166
Sepehr Avatar answered Nov 07 '22 23:11

Sepehr