Biometrics: any reason to store the raw password rather than the transformed final password? #953
Replies: 3 comments 1 reply
-
Sorry, quick correction. I just re-read the code and I think I was wrong about the base64 part. Seems it uses a cipher and not just simple base64 decoding. But still, it seems what is decrypted is the raw password and not the final key. So my question is still the same. |
Beta Was this translation helpful? Give feedback.
-
Hi Aamer, The main password is obviously encrypted in the Keystore of the device with a cipher and a key that can be temporary depending on the options you have chosen. https://github.com/Kunzisoft/KeePassDX/wiki/Advanced-Unlocking#e-optional-temporary-encrypted-key-memory There are several reasons to get only the raw password:
If you make a pull request for this feature, it would be good leave the current operation too. So a setting would be a good idea but I'm afraid that users would be confused (perhaps only an explanation on the wiki is needed) The unlock time is an important concept but as phones are now as powerful as computers (and I'm trying to improve the KDF algorithms), the unlock time is the same as on PC so for me is not really a problem. |
Beta Was this translation helpful? Give feedback.
-
The database could be modified by another application or on another device to reconfigure the password hashing (without changing the password). It wouldn't be possible to open the newer version of the database unless the raw password had been stored. Users may want to reconfigure password hashing based on the performance of all devices that need to unlock the database without having to re-enter the password everywhere. |
Beta Was this translation helpful? Give feedback.
-
Hi Jeremy,
I was just debugging the app out of curiosity and wanted to see how biometric unlocking works. If I understand correctly, the app relies on the Android Key Manager and does a simple base64 encoding before storing the raw password (https://github.com/Kunzisoft/KeePassDX/blob/master/app/src/main/java/com/kunzisoft/keepass/biometric/AdvancedUnlockManager.kt#L258).
Is this accurate? If so, why not store the final transformed key instead of the raw password? This would make the unlock much faster since it would not have to go through all the transform rounds to unlock the database. I was actually thinking about doing this as a weekend project and submitting a pull request.
However, I thought about this and I see a security issue. The issue is what would happen if you are using a key file. In this case, even if the keyfile is deleted, the biometrics would allow the user to unlock the database. This seems like a security flaw, of course.
I wanted to check with you to see what your thoughts are on this. Is the keyfile scenario the reason why you choose to store the raw password rather than the final transformed password?
Beta Was this translation helpful? Give feedback.
All reactions