Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>LocalStorage is under normal circumstances only accessible by your app. It is as secure as the sandbox on the specific platform (iOS, Android) is able to protect your app's data from being read by other apps.</p> <p>Sometimes that sandbox is not as strong as you might expect, e.g. in these cases:</p> <ul> <li>the device is rooted or jailbroken</li> <li>the manufacturer failed to provide security updates or the user just didn't update</li> <li>the attacker has physical access to the device for example if it is stolen.</li> </ul> <p>If the attacker has access to the cleartext password and username, she or he could try them also for other accounts (not just your service). So if the user of your app used the same password for multiple services, the attacker could gain access to them as well.</p> <p><strong>What about storing a password hash?</strong></p> <p>For server side applications this is a great idea, because they run in a protected environment (datacenters with access control, system engineers taking care of security updates).</p> <p>A phone, on the other hand, is stolen easily, and users often don't or can't install security updates.</p> <p>If the hash is not salted it is very easy to get the cleartext password using rainbow tables if you got the hash. If the hash is salted it is very easy to get the cleartext password for simple passwords. Also, it's very easy to generate insecure password hashes.</p> <p>Solution: store <strong>randomly generated access tokens</strong>: no matter how simple or complex the password is, it's just <em>impossible</em> to get the clear text password by looking at the token.</p> <p><strong>TL;DR</strong></p> <p>If you're using the credentials for authentication against some kind of API service, you should <strong>not</strong> store the password and username locally, even in a secure store such as the iOS keychain.</p> <p>What you should do instead is storing only <strong>a randomly generated token</strong> (<em>NOT a password hash!</em>) you get from that API (similar to the concept of storing the Session ID in a cookie rather than the user/pass combination). One possibility would be to use OAuth.</p> <p>That way you make sure the real credentials can never be leaked, even when the sandbox fails to protect the data or the phone is stolen.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload