2

i assume typical android has fully encrypted disk with a key stored in a header. header is encrypted using pin / pattern / fingerprint or not encrypted when there is no lock. is that correct?

when the phone is on, a thief can use the OS to access the data. pin and pattern accepting delay will be sufficient. also all the theft protection application might kick in in this scenario

but what happens when the thief turns off the phone and takes out the disk. he can run simple brute force. 4 or 6 digit pin, patter and probably a fingerprint is not a problem for the disk password bruteforce, right? are there any hardware level (NAND level?) protection mechanism? or the only thing that works would be a strong disk password?

if no, is there an option to set strong disk password and separate pin password / pattern / fingerprint for OS level protection? or is there any other way of keeping your data secure in case of a theft (android device)?

2

1 Answer 1

1

Docs here: Full Disk Encryption

Android 7 - 9 implements FDE with a 128-bit key. Of course, no pattern or PIN forms a 128-bit key. And every single device I saw required a PIN for disk encryption, so when you set up a pattern for the lock screen you were always required for a PIN.

Upon first boot, the device creates a randomly generated 128-bit master key and then hashes it with a default password and stored salt. The default password is: "default_password" However, the resultant hash is also signed through a TEE (such as TrustZone), which uses a hash of the signature to encrypt the master key.

You can find the default password defined in the Android Open Source Project cryptfs.cpp file.

When the user sets the PIN/pass or password on the device, only the 128-bit key is re-encrypted and stored. (ie. user PIN/pass/pattern changes do NOT cause re-encryption of userdata.) Note that managed device may be subject to PIN, pattern, or password restrictions.

A thief stealing your device has no chances to decrypt the storage medium with only the disk. Brute-forcing a 128 bit key is a no-go.

So, they would have to force the PIN. The protection is guaranteed by the hardware TEE (Trusted Execution Environment, a hardware crypto chip).

The TEE uses the PIN to form the real encryption key, but hides information within its state registers.

Given that a hardware attack to a crypto chip is infeasible, this prevents your attacker from guessing every reasonable 4-to-8-digits PIN, which don't form a 128-bit key (10^8 possible PINs, 2^128 > 10^30 possible keys).

Other protection at TEE's discretion are:

  • Attempt limit: the chip will self-destroy crypto data when too many attempts are perpetrated
  • Delay: the TEE adds a wait to the crypto functions so slow attacks down

In detail, you may want to read the "Storing the encrypted key" paragraph in the document already linked.

Demo

If you boot your device and you are presented with a black screen requesting for your PIN, that is the FDE boot prompt.

Modern Android 10 devices like my Pixel 3XL display the lock screen, because they use a different File-Based encryption and store the non-animated wallpaper as plain text, but require the PIN to decrypt the system. They basically changed the user experience.

You must log in to answer this question.

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