Skip to content

Commit

Permalink
Mobile Forensics completed
Browse files Browse the repository at this point in the history
  • Loading branch information
subhayuroy committed Sep 16, 2020
1 parent 9b820f9 commit d188548
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
6 changes: 6 additions & 0 deletions Mobile Forensics/Note.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Android supports password lock with PIN number or alphanumeric password. The limit of both passphrases are required to be between 4 and 16 digits or characters. The password of a smartphone is stored in the Android system in a special file called password.key in /data/system.
Android stores a salted SHA1-hashsum and MD5-hashsum of the password.

It is not feasible to crack the password with the help of dictionary attack as the hashed password is stored in a salt file. This salt is a string of hexadecimal representation of a random integer of 64 bit. It is easy to access the salt by using Rooted Smartphone or JTAG Adapter.

A special hardware known as JTAG (Joint Test Action Group) adapter can be used to access the salt. Similarly, a Riff-Box or a JIG-Adapter can also be used for the same functionality.
20 changes: 20 additions & 0 deletions Mobile Forensics/password.key
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
public byte[] passwordToHash(String password) {

if (password == null) {
return null;
}

String algo = null;
byte[] hashed = null;

try {
byte[] saltedPassword = (password + getSalt()).getBytes();
byte[] sha1 = MessageDigest.getInstance(algo = "SHA-1").digest(saltedPassword);
byte[] md5 = MessageDigest.getInstance(algo = "MD5").digest(saltedPassword);
hashed = (toHex(sha1) + toHex(md5)).getBytes();
} catch (NoSuchAlgorithmException e) {
Log.w(TAG, "Failed to encode string because of missing algorithm: " + algo);
}

return hashed;
}

0 comments on commit d188548

Please sign in to comment.