I use LastPass for Android with the PIN option. After having entered my full Lastpass password the first time that I used the app, now when opening the application I have access to all my passwords just by entering a four-digit PIN.

How secure can this be? Where might the data stored such that it is accessible by PIN only? Is it likely that the passwords are stored on the Android file system unencrypted? Perhaps the passwords are stored on the Android file system encrypted with the PIN as a key?

I am concerned that if the user could access the data with a four-digit PIN, then so could an attacker. I am concerned about an online or otherwise electronic attacker, not physical access to the device. Note that the device (Samsung Note 3) is not yet rooted, but it likely will have a custom ROM installed on it sometime in the future.

4 Answers 4


Short PIN codes are a serious hindrance for attackers only in online dictionary attack contexts. The distinction is the following:

  • Online dictionary attack: for each potential password/PIN code, the attacker must try it against an honest system (server, running app...).

  • Offline dictionary attack: the attacker could obtain some data (hashed value, encrypted file...) allowing him to test potential passwords/PIN codes on his own machine.

Offline dictionary attacks are a lot more powerful since they can run at the full speed of the PC that the attacker cares to put to the task. Conversely, online dictionary attacks can be thwarted by the "honest system" responding only slowly, or even refusing to respond after too many failures. This is the model of smart cards: they lock up after 3 (or 5 or some other configurable value) wrong PIN codes.

In the case of LastPass, the theory is that you should maintain the physical security of your device (don't allow your smartphone to be stolen); the PIN code is just an extra protection for "casual attackers" who would try to get to the passwords in an online dictionary attack context (i.e. the attacker is a "friend" who temporarily borrows your smartphone but wants to remain discreet, and hence will not open it up to access the files directly).


The lastpass master password is never stored on the android phone. It's only in memory (RAM). Your session with the lastpass server however does not die even if you reboot your device. An encrypted copy of your master password is stored on lastpass server. If your session is active, the phone downloads that encrypted version and decrypts it with the random 256-bit key stored on the phone. Note that that random key is stored on the phone, not the master password. If you kill the session, the lastpass server will delete that encrypted copy on their server which is linked to the session.

Turn off your wifi and data, reboot, and you will see you won't be able to login with just the pin. That's because the master password is never stored on the phone. Also, if you kill the phone session with lastpass server (you can do it with the desktop version if you go to setting), the pin on the phone will no longer work.

There are other security measures that lastpass uses with the pin. For example, after a few wrong attempts (probably five? test it), lastpass software will kill the session and delete the encryption key from the memory. Then you have to enter the full master password to login.

  • 2
    Thank you. Do you have sources for the information?
    – dotancohen
    Commented Nov 4, 2015 at 8:20
  • The source is various faqs on Lastpass website, discussions on forums, and educated guess. On login screen, there are two options: (1) remember email and (2) remember password. If you don't check "remember password" box the software isn't going to store your master password on the phone drive. What's the point of that option if it stores it on the drive anyway?
    – user12480
    Commented Nov 19, 2015 at 1:05
  • It works the same way on desktop. If your session with the lastpass server is alive, it will log you back in even after a reboot (desktop PC), despite not saving password on hard drive. That's possible only if Lastpass server has an encrypted copy of your master password linked to the session and a random key stored on your computer that can decrypt it, even after reboot.
    – user12480
    Commented Nov 19, 2015 at 1:06

Yes, if the user can access the data with a 4-digit PIN, then so can an attacker (at least with physical access to the device).

My guess is that the passwords are stored encrypted in their original format, but the decryption key (derived from the user's password) is stored encrypted with a key based on the 4 digit PIN. Of course, with that small a space, it's trivial for an attacker with access to the files to brute force the PIN and retrieve the passwords. FWIW, it appears you don't have to enable the PIN mode in LastPass.

  • Thank you David. I am actually not concerned with physical access to the device, but rather with an online or electronic attack (malware on the device). I will clarify that in the question.
    – dotancohen
    Commented Jul 14, 2014 at 18:17

Your data is encrypted locally with key derived from your master password hash with 4000 repetitions by default.

The PIN is a local convenience option. If you were to install lastpass on a new device, you'd need to enter your master password again.

To be clear, the PIN is used to unlock your offline vault. It isn't used for decryption or authentication. The PIN option is only available for mobile devices for locking and unlocking the vault. Its essentially telling lastpass to remember my username and password as a trusted device, but just in case someone intercepts your phone when its unlocked, requires a PIN in order to get to the app.

Also I recommend turning on google authentication so that new devices that try to install lastpass and access your account have to have your authenticator. This is a good way to prevent people from accessing your stuff even if they happen to know your master password.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .