Information Security Stack Exchange is a question and answer site for information security professionals. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am trying to understand when using the default android device encryption in 4.0.4 ICS (AES-CBC 128Bit) how the Key Derivation Function works? That is how is the users decryption passcode transformed into a secure key for use with the Decryption?

And how is the Decryption Password Stored and hashed on the device?

I am trying to demonstrate points of potential vulnerability on our enterprise android devices, and mitigations.

share|improve this question

migrated from Jan 14 '13 at 13:52

This question came from our site for professional and enthusiast programmers.

AES is not a KDF, so your question is not well defined. – Maarten Bodewes Jan 13 '13 at 14:50
Correct - but i want to know the architecture behind how android takes a User Defined Passcode, and uses it to generate a key to encrypt the device using AES.... and then secures that hashed key. – diagonalbatman Jan 13 '13 at 15:47
Why is this off topic? I haven't 'tried' anything other than looking around the Google Docs. – diagonalbatman Jan 13 '13 at 15:53
sigh.... What other way can i ask that question? I think it is perfectly valid to ask how the Security Framework works. – diagonalbatman Jan 13 '13 at 16:00
This link might be of some help… – Ali Ahmad Jan 14 '13 at 14:08

Android Encryption Implementation Notes has a pretty detailed description of how the disk encryption is implemented from 3.0. When a user enables encryption if they do not already have a pin set they are required to set one.

The master key is a 128 bit number created by reading from /dev/urandom. It is encrypted with a hash of the user password created with the PBKDF2 function from the SSL library. The footer also contains a random salt (also read from /dev/urandom) used to add entropy to the hash from PBKDF2, and prevent rainbow table attacks on the password

The master key is then stored in the footer of the encrypted partition. Most of the code that is used to start the encryption process is in Vold, Android's volume daemon. If you have the full AOSP source for android you can take a look at /system/core/vold/cryptfs.c which implements many of the commands for encryption in vold as well as commands for verifying and changing the password.

This blog post, Android Disk Encryption also has some good insights into the crypto implmentation as well as the implications of tying the decryption of the master key to the pin/password entered by the user to unlock the device.

Hope this helps.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.