News for hackers. Stuff that matters.
Re:Android account passwords are stored on disk in plain text by markbao on Friday July 22, 2011 @07:51PM (#2795632)
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 plain text (encrypted but with the key on the device)?

Re:Android account passwords are stored on disk in plain text by daeken on Friday July 22, 2011 @07:55PM (#2795640)
You derive a key from some piece of user input and use that to encrypt it. If you also mix in, say, a hardware ID, then you also make it impossible to distribute a set of common keys.
Re:Android account passwords are stored on disk in plain text by markbao on Friday July 22, 2011 @08:00PM (#2795653)
Right, but even if you did that, wouldn't you still have to store that key somewhere?

Also, hi from downstairs!

Re:Android account passwords are stored on disk in plain text by daeken on Friday July 22, 2011 @08:06PM (#2795663)
1) Assuming a virgin device, applications can't access the DB this stuff is stored in, or other applications' files (if an application wants to safely store stuff on its own, outside of the OS mechanisms), so it's not too big a concern that applications be unable to do this.

2) If you get physical access to the device, you can pull the DB and whatever IDs are involved. Without encryption, this is game over instantly; with encryption, your goal is to delay it as long as humanly possible.

Re:Android account passwords are stored on disk in plain text by FaceKicker on Friday July 22, 2011 @08:16PM (#2795683)
Couldn't you have something like:

key = hash(hardware serial number, user password)

And then store the key only in memory every time the user unlocks the phone and wipe it from memory when they lock their phone?

Re:Android account passwords are stored on disk in plain text by ENOTTY on Friday July 22, 2011 @09:40PM (#2795849)
If you do that, I'd imagine that the phone would not be able to pull updates from those services while the phone is locked.
Re:Android account passwords are stored on disk in plain text by mentat on Saturday July 23, 2011 @12:16PM (#2797151)
If you're a registered Apple developer, it's worth watching how they're dealing with this in iOS 5.
Re:Android account passwords are stored on disk in plain text by IgorPartola on Friday July 22, 2011 @10:51PM (#2795982)
Unless it is a dumb protocol, you should be fine. Session IDs FTW.
Re:Android account passwords are stored on disk in plain text by FaceKicker on Friday July 22, 2011 @09:47PM (#2795863)
Damn, good point. I'm out of ideas then. :)
Re:Android account passwords are stored on disk in plain text by daeken on Friday July 22, 2011 @08:23PM (#2795698)
Yep, that's pretty much it. Where 'hash' is PBKDF2 with a good HMAC function and 10k+ rounds.
Re:Android account passwords are stored on disk in plain text by walexander on Friday July 22, 2011 @08:25PM (#2795705)
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.
Re:Android account passwords are stored on disk in plain text by sdizdar on Friday July 22, 2011 @08:33PM (#2795722)
Does Apple iPhone uses mobile TPM? Any known mobile phone?
Re:Android account passwords are stored on disk in plain text by daeken on Friday July 22, 2011 @09:10PM (#2795798)
The iPhone does not, and I'm not aware of any that do. Even the Blackberry, which is intended for high security of such things, simply uses PBKDF2. However, a TPM is the best solution here.
Re:Android account passwords are stored on disk in plain text by zobzu on Friday July 22, 2011 @08:28PM (#2795714)
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)