5

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.

Community
  • 1
  • 1
vaibhav
  • 550
  • 5
  • 20

1 Answers1

2

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.

Sepehr
  • 2,051
  • 19
  • 29
  • +1 for the detailed answer. I thought of using gZip to compress and password protect the folders. But what worries me is, where to keep the password? in the code? is that safe? you can generate the code from the byte code and get access to password. – vaibhav Jun 20 '12 at 06:27
  • @vaibhav You don't need any passwords anymore! Google `MW2 .ff viewer`. it's an open-source project. read the code and see how COD developers `scramble` their folders. and if you really need a password, keep in mind that everything in client-side is insecure. so it doesn't really worth the effort to password protect those folders. go with scrambling folders with a custom algorithm method (it's really simple, simpler than password protecting, believe me, I did it before :D). – Sepehr Jun 20 '12 at 07:20