I find a hateful peculiarity of Android its nagging usual changes between versions in the paths for some system files and configuration variables. Even when I assume it is expectable on newborn operating systems.

I have read that the PIN number for unlocking the screen is stored (cyphered, I pressume) at /data/system/password.key . So, for example, if I do:

# rm /data/system/password.key

... I will be able to delete it (of course priorly mounting the partition system as read/write, booting via Recovery, connecting via ADB shell, on a rooted device... blah blah blah).

Could this change work on every version of Android? Or this storage file is version-dependent?

1 Answer 1


According to this source

Android stores this pattern in a special file called password.key in /data/system/. As storing the pattern in plain text wouldn’t be very save, this time Android stores an salted SHA1-hashsum and MD5-hashsum of the PIN or password. The numeric PIN and the alphanumeric passwords are processed in the same way...

Due to the fact that the hash is salted this time, its unfeasible to crack the password with help of a dictionary attack. For cracking the password it is important to get the salt and enough time for attempting a brute force attack. The salt is a string of the hexadecimal representation of a random 64-bit integer.

From this page it seems you are correct in believing that the password is located here in at least the 2.2 versions of Android and later.

  • 1
    And I can confirm (by my experience) that Android 5.0.2 also stores Password/PIN in the same file.
    – Firelord
    Sep 17, 2015 at 1:51
  • @Firelord, do you know if your Android version is 64 bits? Sep 17, 2015 at 3:31
  • Confirmed for my 5.1 64 bit Android version. Sep 17, 2015 at 3:36
  • Confirmed for my 4.3 Android. Or, at least, such file exists (it has 0 bytes long because I have no PIN defined). Sep 17, 2015 at 3:37
  • Well, if we are going to believe that Spreitzenbarth (he seems and experienced programmer), and as long as his last post ( forensics.spreitzenbarth.de/2015/08/12/… ) about the matter dates May 2015, I agree with Ch3mical Joe: every Android version stores the hash of the password into the same file. Sep 17, 2015 at 3:42

You must log in to answer this question.

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