-
Notifications
You must be signed in to change notification settings - Fork 740
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
Backup encryption is not using a key derivation function #817
Comments
I've pointed this issue to a friend with proper experience in implemeting crypto algorithm whose reaction was the following:
|
Well,… never build your own crypto! |
Encrypted backups are poorly implemented (both by TWRP for padding a password with zeros to achieve an AES key and openaes for using non-standard CBC) and not to be trusted. Do not give users a false sense of security by offering this option. Remove the ability to use openaes to encrypt backups, but still allow already openaes-encrypted backups to be restored. Ref: TeamWin/Team-Win-Recovery-Project#817 Change-Id: Ibc1802372d8caa8c475039e66fb08ce163df27e9
Encrypted backups are poorly implemented (both by TWRP for padding a password with zeros to achieve an AES key and openaes for using non-standard CBC) and not to be trusted. Do not give users a false sense of security by offering this option. Remove the ability to use openaes to encrypt backups, but still allow already openaes-encrypted backups to be restored. Ref: TeamWin/Team-Win-Recovery-Project#817 Change-Id: Ibc1802372d8caa8c475039e66fb08ce163df27e9
Encrypted backups are poorly implemented (both by TWRP for padding a password with zeros to achieve an AES key and openaes for using non-standard CBC) and not to be trusted. Do not give users a false sense of security by offering this option. Remove the ability to use openaes to encrypt backups, but still allow already openaes-encrypted backups to be restored. Ref: TeamWin/Team-Win-Recovery-Project#817 Change-Id: Ibc1802372d8caa8c475039e66fb08ce163df27e9
Encrypted backups are poorly implemented (both by TWRP for padding a password with zeros to achieve an AES key and openaes for using non-standard CBC) and not to be trusted. Do not give users a false sense of security by offering this option. Remove the ability to use openaes to encrypt backups, but still allow already openaes-encrypted backups to be restored. Ref: TeamWin/Team-Win-Recovery-Project#817 Change-Id: Ibc1802372d8caa8c475039e66fb08ce163df27e9
Hi!
The encryption mechanism used for backups is currently using the given password as the AES key as ASCII bytes, later padded with 0 to reach the required 256 bits.
This seriously reduces the encryption security as it makes the actual keyspace quite tiny. I haven't verified this, but I suspect passwords will silently be truncated to 31 characters in case they are longer.
Proper key stretching should be implemented. I see it's already implemented in crypto/lollipop/cryptfs.c and crypto/ext4crypt/KeyStorage.cpp, both with scrypt and PKDF2.
I guess one question is how to keep compatibility with older backups. In all cases, I guess trying twice, with derived key and then with the raw password would work.
The text was updated successfully, but these errors were encountered: