keepassxreboot / keepassxc

KeePassXC is a cross-platform community-driven port of the Windows application “Keepass Password Safe”.
https://keepassxc.org/
Other
21.27k stars 1.47k forks source link

Decrypt password on access by Yubikey #3105

Closed fruh closed 5 years ago

fruh commented 5 years ago

Summary

Current situation of yubikey usage is following:

It would be great security feature, if password and attachments are nor decrypted to memory on database unlock, but only on read/write access (copy, edit).

Desired Behavior

It should work in following steps:

Context

It makes stronger security to password database:

phoerious commented 5 years ago

Thank you for your suggestion, but this is almost certainly a wontfix.

Your description of how YubiKey decryption works isn't quite correct. A YubiKey only generates an extra key component which is then used by KeePassXC together with a password and/or a keyfile to calculate the final master key, which is then run through the key derivation function.

Usage of a YubiKey as you suggest is incompatible with kdbx. It could perhaps be implemented, but no other program except KeePassXC would be able to read passwords and attachments. The challenge-response mode of the YubiKey also isn't really meant to be used with key presses, but as a passive dongle that does not require further user interaction. Though, if you do require user interaction, it makes exporting a database or merging entries virtually impossible (but even without, it would be extremely slow and error-prone). It also prevents searching within the database, but I think by far the worst issue is that you would permanently lose access to all passwords and attachments if you want to remove or change the YubiKey associated with the database, unless you re-encrypt all of them, which is pretty much impossible. We would need to decrypt them first and and then re-encrypt with the new key, which is entirely infeasible, particularly with user interaction for each decryption and encryption operation. You would also need to write a decrypted version first or have both keys plugged in at the same time.

tinyapps commented 1 year ago

Hi @fruh, You're probably already familiar with it, but for anyone else stumbling onto this thread, ZX2C4's pass offers exactly this sort of protection: all passwords remain encrypted other than the one requested. However, this comes at the expense of exposing some metadata (though there is apparently an extension to hide it).