EDIT: according to x0x0 things are better than I naively imagined =)
EDIT: according to x0x0 things are better than I naively imagined =)
On modern phones, even if you have an image of the phone's storage, the code you enter is merged (wrong word) with a large random number stored in an externally inaccessible chip in the phone (different for each phone, obviously). This large random number is then used as a seed to encrypt the drive. So it's not anything like just extracting the disk image then brute force attempting the 10000 valid codes from 0000-9999.
edit: here is a better explanation
Apple was a front runner in implementing some sort of encryption long before
others even thought about it. Apple uses a 256-bit device-unique secret key
(UID) stored in the phone’s hardware, where it’s hard to extract from. Apple
says this UID is unique to the device and it doesn’t store these values. It
also says that no software or hardware can read this key. This UID is mixed
with the passcode to generate a new key (passcode key) to secure data on the
device. Unlike Android, this UID key can’t be extracted from the device, so
all the brute forcing attempts have to be done on the device itself. [1]
So I would guess it's reasonably secure to non-governmental adversaries. If you're worried about governments, the US now supports torture (the only person punished for torture during the war on terror was a whistleblower), so the NSA is free to torture your code out of you.[1] http://resources.infosecinstitute.com/understanding-disk-enc...
But, if Google just mandated TPMs, then a 4-digit PIN is fine as the hardware can perform a lockout/cooloff/self-destruct.
TPMs aren't super-hardened, but against losing your phone in a taxi, or random local cops trying to crack it, it's probably good enough.