Live data from Hacker News

Android account passwords are stored on disk in plain text

code.google.com

21–30 of 93 posts

Re: Android account passwords are stored on disk in plain text

#21
post #18

I'm not security expert at all, so I have a question. If I lock my phone using pin does it mean that my passwords and keys (mentioned in comment #48) are not encrypted using pin+some phone HW ID? Also does encrypting my passwords and keys using pin+some phone HW ID really solves the problem?

> If I lock my phone using pin does it mean that my passwords and keys (mentioned in comment #48) are not encrypted using pin+some phone HW ID?

Yes.

> Also does encrypting my passwords and keys using pin+some phone HW ID really solves the problem?

Yes. No. Sort of. It really depends on what you're trying to protect against. It's absolutely not a panacea, but it will certainly make most attacks against it, where you solely have the DB and any relevant IDs, significantly more expensive. However, it won't help if, say, you can escalate to root from an app (or remotely!) and backdoor the PIN entry.

Re: Android account passwords are stored on disk in plain text

#22
post #9
post #3

I recently joined the cult of the smartphone (after my feature phone finally kicked the bucket). Since I, like presumably many folks, set things up so that I could check my email, used the web browser and let it store some passwords, I became curious about how those passwords are being stored. It turns out that it's just an SQLite database where they're stored in plain text. This leaves me somewhat disconcerted since…

Edit: This is COMPLETELY INCORRECT (as pointed out by wallflower) but left for context. I can't test right now, but if your phone has ADB enabled, can't you pull this file over USB? I could be totally, totally off on that, though.

No, /data/data/* is protected (as it should be) on non-rooted phones.

mediapc:platform-tools media$ ./adb shell

$ ls /data/data

opendir failed, Permission denied

$

Re: Android account passwords are stored on disk in plain text

#23
post #6

Well, what's the right way to encrypt this kind of stuff? Even if you're doing some kind of public-key cryptography, you're still going to have to store the private key at some location on the device, to decrypt the password for IMAP/SMTP/whatever authentication. Is there some foolproof way to do this that I'm not aware of? How are you supposed to store a password for future retrieval, not in plain text or basically…

the truely right way of doing that is having a digital key, not a password, that is part of your keyring, which do not reside on the phone, and be able to revoke that key when you lose the phone additionally that key should be protected by e.g. your PIN code although its quite crappy its better than nothing

note that the key is only there in my post because its way easier to revoke and regen than to memorize a new complex password every time.

ideally the phone should also be encrypted with a non trivial key (not your PIN)

Re: Android account passwords are stored on disk in plain text

#25
post #2

Cleartext passwords are perfectly fine in this case. I speak as a software engineer specialized in security. This bug report was filed by someone who doesn't understand that obfuscating a password is different from encrypting it. No matter how you store it, the application must be able to extract a cleartext password from whatever storage options are available on the Android device. For a longer explanation: http://d…

http://whispersys.com/whispercore.html implements full-disk encryption for android.

unfortunately it requires unlocking the boot loader and installing that company's android rom, so it's not an option for many users.

Re: Android account passwords are stored on disk in plain text

#26
post #3

I recently joined the cult of the smartphone (after my feature phone finally kicked the bucket). Since I, like presumably many folks, set things up so that I could check my email, used the web browser and let it store some passwords, I became curious about how those passwords are being stored. It turns out that it's just an SQLite database where they're stored in plain text. This leaves me somewhat disconcerted since…

No. No it's not. please tell me how someone is going to get those passwords without root. (hint, they're not)

additionally, how is this different than NY laptop with Pidgin accounts, my IMAP client, Firefox's stored passwords, etc.

Re: Android account passwords are stored on disk in plain text

#27
post #11

Earlier quoted context omitted.

Right, but even if you did that, wouldn't you still have to store that key somewhere? Also, hi from downstairs!

The correct answer is to use a TPM - Trusted Platform Module - for that key. Accessing the TPM itself requires a password, but the hardware prevents against bruteforce/dictionary attacks.

Does Apple iPhone uses mobile TPM? Any known mobile phone?

Re: Android account passwords are stored on disk in plain text

#28
post #7
post #2

Cleartext passwords are perfectly fine in this case. I speak as a software engineer specialized in security. This bug report was filed by someone who doesn't understand that obfuscating a password is different from encrypting it. No matter how you store it, the application must be able to extract a cleartext password from whatever storage options are available on the Android device. For a longer explanation: http://d…

Actually, they are not perfectly fine in this case. They should take the Apple approach and use PBKDF2 to derive a key from the PIN/passphrase, if one is set, then use that to encrypt the database. Anything less is simply not OK. Edit: You should also use some sort of hardware ID in addition to the PIN/passphrase, otherwise it's trivial to distribute a database of, say, all the <=7-digit PINs.

I guess we agree (see my edit).

By "hardware ID", you mean a unique salt.

Unfortunately even with a unique salt, 7-digit PINs are not strong enough if, from a theoretical viewpoint, we assume they can be bruteforced at a few thousand per second.

Does Apple IOS really use PBKDF2? The Fraunhofer paper does not mention it. http://sit.sit.fraunhofer.de/studies/en/sc-iphone-passwords....

Re: Android account passwords are stored on disk in plain text

#29
post #28
post #7

Earlier quoted context omitted.

Actually, they are not perfectly fine in this case. They should take the Apple approach and use PBKDF2 to derive a key from the PIN/passphrase, if one is set, then use that to encrypt the database. Anything less is simply not OK. Edit: You should also use some sort of hardware ID in addition to the PIN/passphrase, otherwise it's trivial to distribute a database of, say, all the <=7-digit PINs.

I guess we agree (see my edit). By "hardware ID", you mean a unique salt. Unfortunately even with a unique salt, 7-digit PINs are not strong enough if, from a theoretical viewpoint, we assume they can be bruteforced at a few thousand per second. Does Apple IOS really use PBKDF2? The Fraunhofer paper does not mention it. http://sit.sit.fraunhofer.de/studies/en/sc-iphone-passwords....

If you use a TPM to store your device encryption key, a PIN combination should be fine. Of course, by definition that requires hardware support.

I work in Android security in particular for a manufacturer. We came across the unencrypted email pass ourselves, but decided it was fine for two reasons:

1) If you don't get rooted, there should be no way to pull from /data/data/* in the first place.

2) With filesystem encryption turned on, you essentially get the benefit of encrypting that pass along with everything else.

Re: Android account passwords are stored on disk in plain text

#30
post #28
post #7

Earlier quoted context omitted.

Actually, they are not perfectly fine in this case. They should take the Apple approach and use PBKDF2 to derive a key from the PIN/passphrase, if one is set, then use that to encrypt the database. Anything less is simply not OK. Edit: You should also use some sort of hardware ID in addition to the PIN/passphrase, otherwise it's trivial to distribute a database of, say, all the <=7-digit PINs.

I guess we agree (see my edit). By "hardware ID", you mean a unique salt. Unfortunately even with a unique salt, 7-digit PINs are not strong enough if, from a theoretical viewpoint, we assume they can be bruteforced at a few thousand per second. Does Apple IOS really use PBKDF2? The Fraunhofer paper does not mention it. http://sit.sit.fraunhofer.de/studies/en/sc-iphone-passwords....

http://www.infoworld.com/%5Bprimary-term-alias-prefix%5D/%5B... According to this (mind you, this is my sole source), iOS 3+ use PBKDF2, with iOS 4 using 10k rounds.
Post reply on HN