Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android App Security

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?

like image 903
Salah Avatar asked Oct 20 '22 16:10

Salah


1 Answers

  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.

like image 94
Trinimon Avatar answered Oct 24 '22 11:10

Trinimon