KeePassium icon indicating copy to clipboard operation
KeePassium copied to clipboard

Some references to master key in App and Data Protection should be changed to master password

Open wellread1 opened this issue 4 years ago • 4 comments

While helping a user configure KeePassium I noticed that the Add and Data Protection sections refer to deleting the "master key" when what was probably meant is deleting the "master password". This is a bit confusing because deleting the key file component of a master key would be highly disruptive.

I did not test most instances where the text referred to "master key" because I did not want to risk deleting the key file from the user's phone, but I suspect at least some instances actually meant master password.

wellread1 avatar May 16 '20 17:05 wellread1

Hi, thanks for the feedback!

As you know, master password and key file are parts of the composite master key. When the composite master key goes through the key derivation function (KDF), we get the encryption key.

When the "Remember Master Keys" option is enabled, KeePassium stores the composite master key — not just the master password + key file name, but already mixed the pre-KDF hash. The reason is that reading and hashing the key file is a relatively slow operation. And since we are storing something sensitive anyway, why not store the already mixed combination.

Therefore I believe that referring to "master password" would be misleading: this is not what happens. For expert users, the difference can be important (as we can see from this very discussion :) For casual users, "master key" and "master password" are very similar terms anyway.

(For anyone reading this without context: all sensitive keys are stored in the system's keychain service, specifically intended for this purpose. This is an optional convenience feature that can be disabled in the settings.)

P.S. For some reason, I have not received a GitHub notification about this issue, so apologies for the late reply.

keepassium avatar May 18 '20 20:05 keepassium

KeePassium stores the composite master key — not just the master password + key file name, but already mixed the pre-KDF hash.

I don't consider that "master key" and "pre-KDF hash" are synonymous for the following reasons:

Your usage of the term "master key" deviates from that defined in the KeePass documentation at https://keepass.info/help/base/keys.html. Throughout the KeePass documentation the terms "master key" and "composite master key" are treated as synonymous. "Composite master key" is defined as consisting of "...master password, a key file...". A key file is defined as "...basically a master password in a file". Additional text expands on the idea that the key file component of the master key is a file. I believe that earlier versions of KeePass documentation alluded to the derivation of the pre-KDF hash, but I don't ever recall that it referred to this hash as the "master key".

For the most part, users won't look at the code or be familiar with key derivation concepts, but many KeePass users will be familiar with a definition of "master key" that includes a master password (secret that they know) and/or a key file (a file that they have). In that context, delete the "master key" means delete the master password and delete the key file.

If you wish to be clear to users and experts alike that deleting the master key does NOT mean deleting the key file from the phone you could say:

Remove the master key secret from memory

This wording above is clear that something related to the master key (the secret) is being removed from memory. It is accurate to the extent that "master key secret" is synonymous with "pre-KDF hash". Finally, it is not a term that has been previously defined in the KeePass documentation. By using a term different than "master key" you avoid the confusion created by two different definitions of "master key".

An alternate wording that is clear enought but has the disadvantage of perpetuating dual meanings of the term "master key":

Remove the master key from memory

An alternate wording that is more technical might be:

Delete the pre-KDF hash derived from the master key


In the end you may be correct in believing that users won't be troubled by a term that raises the possibility that the key file will be deleted from the phone. Initially, I was inhibited by ambiguity but finally plunged ahead.

wellread1 avatar May 18 '20 22:05 wellread1

Thank you for elaborating your point. I agree there is a slight ambiguity between KeePass documentation and my use of the term "master key".

KeePass documentation uses "master key" as a shorter equivalent of "composite master key". The user can enter the master key, change it in the UI, and so on.

In KeePassium, the term "master key" is extended to include what you've called a "master key secret" — a sequence of bytes that can be used (possibly after some transformation) to decrypt the DB.

There is a long-pending redesign of the Data Protection settings page, and I will make sure to use a clearer terminology then.

In the meanwhile, I would leave this as-is: clarifying the text would break the translations, which is more damaging than the expected benefit from clearer wording. Also, since this issue is raised almost a year after the first release, I guess we can consider possible misinterpretation a rare event :)

keepassium avatar May 19 '20 21:05 keepassium

Thanks for taking the time to consider this. I appreciate that I might have made a fuss about nothing, given the fact that the setting does not delete the key file.

wellread1 avatar May 20 '20 00:05 wellread1