Droidcedas : Changing Android's Disk Encryption Password

We've been discussing some of Jelly Bean's new security features, but this post service volition receive got a few steps dorsum as well as focus on an older i that has been available since Honeycomb (3.0), announced inward the commencement of the at i time distant 2011: disk encryption. We'll glance over the implementation, hash out how passwords are managed as well as innovate a uncomplicated tool that lets yous modify the password from the comfort of Android's UI.

Android disk encryption implementation

Android 3.0 introduced disk encryption along amongst device administrator policies that tin enforce it, as well as advertised it equally i of several 'enhancements for the enterprise'. Of course of teaching Honeycomb tablets never genuinely took off, allow lone inward the enterprise. Disk encryption yet persevered as well as  has been available inward all subsequent versions. Now that ICS is on about 16% of all Android devices as well as Jelly Bean's part volition start to increase equally good inward the coming months, disk encryption powerfulness finally run across wider adoption.

Unlike most internal Android features, disk encryption has genuinely been publicly documented quite extensively, so if yous are interested inward the details, practise read the implementation notes. We'll solely give a brusque overview here, focusing on cardinal as well as password management.

Android's disk encryption makes purpose of dm-crypt, which is at i time the touchstone disk encryption sybsystem inward the Linux kernel. dm-crypt maps an encrypted physical block device to a logical manifestly text i as well as all reads as well as writes to it are decrypted/encrypted transparently. The encryption machinery used for the filesystem inward Android is 128 AES amongst CBC as well as ESSIV:SHA256. The master copy cardinal is encrypted amongst some other 128 flake AES key, derived from a user-supplied password using 2000 rounds of PBKDF2 amongst a 128 flake random salt. The resulting encrypted master copy cardinal as well as the tabular array salt used inward the derivation physical care for are stored, along amongst other metadata, inward a footer construction at the halt of the encrypted segmentation (last xvi Kbytes). This allows for changing the decryption password quickly, since the solely affair that needs to live re-encrypted amongst the newly derived cardinal is the master copy cardinal (16 bytes).

The user-mode business office of disk encryption is implemented inward the cryptfs module of Android's book daemon (vold). crypfs has commands for both creating as well as mounting an encrypted partition, equally good equally for verifying as well as changing the master copy cardinal encryption password. Android organization services communicate amongst cryptfs yesteryear sending commands to vold through a local socket, as well as it inward plough sets organization properties that depict the electrical flow put down of the encryption or mountain process. This results inward a fairly complex kicking procedure, described inward particular inward the implementation notes. We are however, to a greater extent than interested inward how the encryption password is laid as well as managed.

Disk encryption password

When yous foremost encrypt the device, yous are asked to either confirm your device unlock PIN/password or laid i if yous haven't already, or are using the pattern covert lock. This password or PIN is as well as so used to derive the master copy cardinal encryption key, as well as yous are required to piece of work into it each fourth dimension yous kicking the device, as well as so i time to a greater extent than to unlock the covert afterwards it starts. As yous tin run across from the screenshot below, Android doesn't receive got a dedicated setting to create practise the encryption password i time the device is encrypted: changing the covert lock password/PIN volition also silently modify the device encryption password.


This is most in all probability a usability-driven decision: most users would live confused yesteryear having to retrieve as well as piece of work into 2 dissimilar passwords, at dissimilar times, as well as would in all probability speedily forget the less oft used i (for disk encryption). While this pattern is proficient for usability, it effectively forces yous to purpose a uncomplicated disk encryption password, since yous receive got to piece of work into it each fourth dimension yous unlock the device, commonly dozens of times a day. No i would piece of work into a complex password that many times, as well as therefore most users opt for a uncomplicated numeric PIN. Additionally, passwords are express to xvi characters, so using a passphrase is non an option.

So what's the occupation amongst this? After all, to learn to the information on the telephone yous demand to approximate the covert unlock password anyway, so why bother amongst a split upward i for disk encryption? Because the 2 passwords protect your telephone against 2 dissimilar types of attack. Most covert lock attacks would live online, fauna forcefulness ones: essentially individual trying out dissimilar passwords on a running device afterwards they learn brief access to it. After a few unsuccessful attempts, Android volition lock the covert for a few minutes (rate-limiting), as well as so if to a greater extent than failed unlock attempts ensue, completely lock (requiring Google describe of piece of work concern human relationship authentication to unlock) or fifty-fifty wipe the device. Thus fifty-fifty a relatively brusque covert lock PIN offers adequate protection inward most cases. Of course, if individual has physical access to the device or a disk icon of it, they tin extract password hashes as well as cleft them offline without worrying nearly rate-limiting or device wiping. This inward fact, is the scenario that total disk encryption is designed to protect from: i time a device is stolen or confiscated for some reason, the aggressor tin either fauna forcefulness the actual device, or re-create its information as well as analyze it fifty-fifty afterwards the device is returned or disposed of. As nosotros mentioned inward the previous section, the encrypted master copy cardinal is stored on disk, as well as if the password used to derive its encryption cardinal is based on a brusque numeric PIN, it tin live fauna forced inward seconds, or at worst, minutes. This presentation yesteryear viaForensics details i such onrush (slides 25-27) as well as shows that this is far from theoretical as well as tin live achieved amongst readily available tools. Influenza A virus subtype H5N1 remote wipe solution could forestall this onrush yesteryear deleting the master copy key, which solely takes a 2nd as well as renders the device useless, but this is oft non an option, since the device powerfulness live offline or turned off.

Hopefully we've established that having a rigid disk encryption password is a proficient idea, but how tin nosotros laid i without making covert unlocking unusable?

Changing the disk encryption password

As nosotros mentioned inward the foremost section, Android services communicate amongst the cryptfs module yesteryear sending it commands through a local socket. This is of course of teaching express to organization applications, but Android comes amongst a minor utility ascendency that tin straight communicate amongst vold as well as tin live used from a rootage shell. So equally long equally your telephone is rooted, i.e., yous receive got a SUID su binary installed, yous tin transportation the next cryptfs ascendency to modify the disk encryption password:

$ su -c vdc cryptfs changepw newpass su -c vdc cryptfs changepw newpass 200 0 0 

This doesn't impact the covert unlock password/PIN inward whatsoever way, as well as doesn't impose whatsoever limits on password length, so yous are gratis to laid a complex password or passphrase. The downside is that if yous modify the covert unlock password, the device encryption i volition live automatically changed equally good as well as yous volition demand to repeat the procedure. This is non terribly difficult, but tin live cumbersome, particularly if yous are on the go. You should definitely start this Android issue to receive got it integrated inward Android's organization UI (which volition in all probability require extending the device policy equally well), but inward the meantime yous tin purpose my Cryptfs Password tool to easily modify the device encryption password.


The app tries to brand the physical care for relatively foolproof yesteryear foremost checking your electrical flow password as well as and so displaying the novel i inward a dialog if the modify succeeds. However, yous volition solely live required to purpose the novel password at the adjacent boot, so it is of import non to forget it until then, as well as receive got a total backup exactly inward case. Short of brute-forcing, the solely agency to recover from a forgotten encryption password is to mill reset the device, deleting all user information inward the process, so maintain amongst caution. The app volition verify that yous receive got rootage access yesteryear checking if yous receive got i of the to a greater extent than pop 'superuser' apps (Superuser or SuperSU) installed, as well as trying to execute a dummy ascendency amongst su at startup. If your device is non encrypted, it volition turn down to start.

The implementation is quite straightforward: it exactly invokes the verifypw as well as changepw cryptfs ascendency using the passwords yous provided. If yous are interested inward the details, or exactly won't allow a random app mess amongst your device encryption password, clone the code as well as create it yourself. If yous are the to a greater extent than trusting kind, yous tin install via Google Play.

Summary

While Android's disk encryption is a useful safety characteristic without whatsoever (currently) know flaws, its biggest weakness is that it requires yous to purpose the device unlock PIN or password to protect the disk encryption key. Since those are commonly rather short, this opens to door to practical fauna forcefulness attacks against encrypted volumes. Setting a separate, to a greater extent than complex disk encryption password using the provided tool (or the straight amongst the vdc command) makes those attacks far less effective. This does currently require rootage access however, so yous also demand to brand certain that your device is otherwise secured equally well, mainly yesteryear relocking the bootloader, equally described inward this article
0 Komentar untuk "Droidcedas : Changing Android's Disk Encryption Password"

Back To Top