![]() |
Master KeyDetails about components of a master key. |
Your KeePass database file is encrypted using a master key. This master key can consist of multiple components: a master password, a key file and/or a key that is protected using the current Windows user account.
For opening a database file, all components of the master key are required.
If you forget/lose any of the master key components (or forget the composition), all data stored in the database is lost. There is no backdoor and no universal key that can open your database.
If you use a master password, you only have to remember one password or passphrase (which should be good!) to open your database.
KeePass features a protection against brute-force and dictionary attacks; see the security help page for details.
A key file is a file that contains a key (and possibly additional data, e.g. a hash that allows to verify the integrity of the key). The file extension typically is 'keyx' or 'key'.
A key file must not be modified, otherwise you cannot open your database anymore. If you want to use a different key file, open the dialog for changing the master key (via 'File' → 'Change Master Key') and create/select the new key file.
Two-factor protection. A key file is something that you must have in order to be able to open the database (in contrast to a master password, which you must know). If you use both a key file and a master password, you have a two-factor protection: possession and knowledge.
Location. As mentioned above, the idea of a key file is that you have something. If an attacker obtains both your database file and your key file, then the key file provides no protection. Therefore, the two files must be stored in different locations. For example, you could store the key file on a separate USB stick.
Hiding the location. The key file content must be kept secret, not its location (file path/name). Trying to hide the key file (e.g. by storing it among a thousand other files, in the hope that an attacker does not know which file is the correct one) typically does not increase the security, because it is easy to find out the correct file (e.g. by inspecting the last access times of files, lists of recently used files of the operating system, file system auditing logs, anti-virus software logs, etc.). KeePass has an option for remembering the paths of key files, which is turned on by default; turning it off typically just decreases the usability without increasing the security.
Backup. You should create a backup of your key file (onto an independent data storage device). If your key file is an XML file (which is the default), you can also create a backup on paper (KeePass 2.x provides a command for printing a key file backup in the menu 'File' → 'Print'). In any case, the backup should be stored in a secure location, where only you and possibly a few other people that you trust have access to. More details about backing up a key file can be found in the ABP FAQ.
Formats. KeePass supports the following key file formats:
<!-- ... -->
).
It is the most flexible format; new features can be added easily
in the future.Reuse. You can use one key file for multiple database files. This can be convenient, but please keep in mind that when an attacker obtains your key file, you have to change the master keys of all database files protected with this key file.
In order to reuse an existing key file, click on the 'Browse' button in the master key creation dialog.NET USER <User> <NewPassword>
command) are two different things.
After changing your password, you can still open your KeePass database.
When resetting the password to a new one, access usually is not possible
anymore (because the user's DPAPI keys are lost), but there are exceptions
(for example when the user is in a domain, Windows can retrieve the user's DPAPI keys
from a domain controller, or a home user can use a previously created
Password Reset Disk).
Details can be found in the MSDN article
'Windows Data Protection' and in the support article
'How to troubleshoot the Data Protection API (DPAPI)'.Administrators can specify a minimum length and/or the minimum estimated quality that master passwords must have in order to be accepted. You can tell KeePass to check these two minimum requirements by adding/editing appropriate definitions in the INI/XML configuration file.
The value of theSecurity/MasterPassword/MinimumLength
node specifies
the minimum master password length (in characters). For example, by setting
it to 10
, KeePass will only accept
master passwords that consist of at least 10 characters.Security/MasterPassword/MinimumQuality
node specifies
the minimum estimated quality (in bits) that master passwords must have.
For example, by setting it to 80
, only master passwords
with an estimated quality of at least 80 bits will be accepted.Security/MasterKeyExpiryRec
and Security/MasterKeyExpiryForce
nodes can be set to an XSD date or an XSD duration (see
XSD Date and Time Data Types).
If the master key has not been changed since the specified date or
if the time span between now and the last master key change exceeds
the specified duration, KeePass recommends/forces to change it.
These settings apply to all databases that are opened with this
KeePass instance; a master key expiry can also be configured for
each database individually (in 'File' → 'Database Settings' →
tab 'Advanced').KeyCreationFlags
and/or KeyPromptFlags
(in the UI
node), you can force states (enabled, disabled,
checked, unchecked) of key source controls in the master key creation and
prompt dialogs. These values can be bitwise combinations of one or more of
the following flags:Flag (Hex) | Flag (Dec) | Description |
---|---|---|
0x0 | 0 | Don't force any states (default). |
0x1 | 1 | Enable password. |
0x2 | 2 | Enable key file. |
0x4 | 4 | Enable user account. |
0x8 | 8 | Enable 'hide password' button. |
0x100 | 256 | Disable password. |
0x200 | 512 | Disable key file. |
0x400 | 1024 | Disable user account. |
0x800 | 2048 | Disable 'hide password' button. |
0x10000 | 65536 | Check password. |
0x20000 | 131072 | Check key file. |
0x40000 | 262144 | Check user account. |
0x80000 | 524288 | Check 'hide password' option/button. |
0x1000000 | 16777216 | Uncheck password. |
0x2000000 | 33554432 | Uncheck key file. |
0x4000000 | 67108864 | Uncheck user account. |
0x8000000 | 134217728 | Uncheck 'hide password' option/button. |
KeyCreationFlags
and KeyPromptFlags
must be specified in decimal notation.