5

I want to develop an app where User data is very sensitive. I am new to dev. so not sure this following techniques are necessary for security or efficient. Please leave your comment. Thanks in advance.

  1. For extra security can we avoid market(play store) and install the app on individual device. Does it make it more secure?

  2. I have to store data on the device. How can we make the data secured so other apps can't read it?

Vadim Kotov
  • 8,084
  • 8
  • 48
  • 62
Salah
  • 69
  • 7

1 Answers1

3
  1. Yes, you can install your app without using the Google Play app. Whether this is more secure depends on your security requirements. Generally spoken, it's much more secure to install apps from Google Market than from other sources. If you want to avoid any kind of installations, you could think of using/implementing an app blocker (e.g. AppLock) or a Kiosk mode app (SureLock Kiosk Lockdown)

    The less apps are installed the less potential attackers (malware, trojans, potential unwanted programs) you have. So from this perspective: yes, it does. However, as long as you don't have a rooted device the applications data (databases, preferences) is quite safe anyway. Data being written to the SD card can be encrypted.

  2. Speaking about unrooted devices: application data (preferences and databases) is kept in a quite secure way. No other app has access to it. Data being written to the SD card can be read from any other app that has the permission android.permission.READ_EXTERNAL_STORAGE or android.permission.WRITE_EXTERNAL_STORAGE. You have to encrypt this data.

    Looking at rooted devices: you've (almost) no chance to store your data in a secure way, because the user/attacker can install any tool in order to analyze complete memory and storage. Almost means, you can try to hide your encryption/decryptions algorithms as good as you can, so that it will be hard to decrypt data on the SD. In the end it's just a matter of effort to crack your encryption.

p.s. if you want to dig into technical details, you could have a look at this book.

p.p.s. just think about the following scenario: someone steals and roots your phone. In this case it's easy for the theft to copy the database and to read everything in your tables. Let me add: this is something, that can be done very easily, 'cause nowadays lots of tools and manuals for rooting exist in the Internet; same for accessing app data afterwards.

Encryption can make it much more difficult to read out app data and - if you ask your user for the encryption password on every app start - it might even be 100% secure (assuming a strong password that is not stored in the app and the app is not running while the theft steals it). Of course you have to choose a strong encryption algorithm as well (AES, Twofish, ...).

However, as long as you don't loose your phone and the phone is not rooted your data is safe - most likely. I say most likely, because there were a number of vulnerabilities in the past, that made it possible to get system wide access.

So you see it depends strongly on your requirements and on how sensitive your data is.

Trinimon
  • 13,839
  • 9
  • 44
  • 60
  • Thank you very much for your informative response. The app I am working will be on unrooted device. And data will be stored in the phone memory not sd card. Should I still consider encryption? if yes which is best practice for encryption? – Salah Jan 24 '14 at 17:55
  • Thanks a lot Trinimon! to be more specific about the app I am working on: 1. User answer some query and if user has data connection after submit it goes to the remote server (https). So that's fine for security. If use has no data then the app will store it on the device memory. So my concern, what should I do to encrypt it before i store it? When data connects then it sends to the server. Basically, i want to secure data so other app is not able to read it. And the device is for sure not rooted. – Salah Jan 25 '14 at 01:39
  • Admittedly, my scenario above was slightly paranoiac, though if you work with extremely sensitive data (cash transaction, ...) it might be required to use the maximum security available. If the phone is not rooted and be considered as a secure device, the application data is safe due to the sandbox principle. No issue here. I like to have a kind of safety net so I'd encrypt sensitive data using a strong password that is somewhere hidden in the code, so refactoring is a bit more difficult. If you need more security let the user enter a pin on app start that is part of the encryption password. – Trinimon Jan 25 '14 at 12:12
  • The app i am talking about will have a password to get in everytime user wants to fill the form. Once it's connected to data, after submit it will go to server. If no data then we need to store it temporary on the device. As per your answer and based on this specific scenario we do not have to be too critical about security. I am new to this. Just to make this form data secured what is best practice for encryption? I meant after user submit the form all data needs to encrypted to store on the device. And decrypt before sending to the server. What technique should I follow. – Salah Jan 26 '14 at 02:50
  • You could store your data in preferences, in database tables or in a file. What you choose depends a bit on the amount of data and whether you have structured data or just a binary stream. In any case you could use for instance AES-256. Check http://www.google.de/url?sa=t&rct=j&q=&esrc=s&source=web&cd=2&cad=rja or http://stackoverflow.com/questions/8622367/what-are-best-practices-for-using-aes-encryption-in-android – Trinimon Jan 26 '14 at 19:05