Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Keys are not encrypted at rest #2

Open
iamMehedi opened this issue Sep 2, 2016 · 4 comments
Open

Keys are not encrypted at rest #2

iamMehedi opened this issue Sep 2, 2016 · 4 comments
Assignees

Comments

@iamMehedi
Copy link
Owner

Currently the keys stored in the KeyStore aren't encrypted at rest. We need to look out for a fix from Google for the issue 61989.

In case of no fix from Google, some options might be:

  • Let the library forget about the unrecoverable data and start over again.
  • Come up with a way to recover and migrate the data when the lock screen protection changes.
@iamMehedi
Copy link
Owner Author

Keys still get deleted in API levels lower than 21. But on API level 21+ we might be able to enforce key encryption at rest. Some testing is required and if everything seems ok then I'll set the library's minSDK level to be 21 and turn on key encryption at rest.

@StuStirling
Copy link
Contributor

In API 21+, do keys not get deleted? It was my understanding that not every device can provide the hardware-backed keystore and in those cases, if the keys are encrypted at rest, they are encrypted using the device lock and I would assume they would have to be deleted upon a change? Did you get round to testing this?

@iamMehedi
Copy link
Owner Author

In API 21+ if there is a hardware backed store available then the keys aren't supposed to get deleted. But keys are still reported to be lost or rendered unrecoverable on some devices. That's why the library now has a recovery mechanism (actually a notifying mechanism) to handle that kind of an event.

@StuStirling
Copy link
Contributor

StuStirling commented Mar 21, 2017

Also see the comment from a Google engineer who says the following about the setEncryptionRequired method in API < 21:

(in the opinion of the Android security team) unnecessary encryption

and justifies it with the following argument:

it provides very little security, because you have to root the device to get at the encrypted keys, and once you've done that you have all sorts of options to get at the plaintext.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants