|
|||||||||||||||||||||||||
|
Database EncryptionKeePass database files are encrypted. KeePass encrypts the whole database, i.e. not only your passwords, but also your user names, URLs, notes, etc. The following encryption algorithms are supported: KeePass 1.x:
KeePass 2.x:
These well-known and thoroughly analyzed algorithms are considered to be very secure. AES (Rijndael) became effective as a U.S. federal government standard and is approved by the National Security Agency (NSA) for top secret information. Twofish was one of the other four AES finalists. ChaCha20 is the successor of the Salsa20 algorithm (which is included in the eSTREAM portfolio). The block ciphers are used in the Cipher Block Chaining (CBC) block cipher mode. In CBC mode, plaintext patterns are concealed. An initialization vector (IV) is generated randomly each time a database is saved. Thus, multiple databases encrypted with the same master key (e.g. backups) are no problem. Data authenticity and integrity: KeePass 1.x Only
The authenticity and integrity of the data is ensured using
a SHA-256 hash of the plaintext.
KeePass 2.x Only
The authenticity and integrity of the data is ensured using
a HMAC-SHA-256 hash of the ciphertext (Encrypt-then-MAC scheme).
See also: Key Hashing and Key DerivationSHA-256 is used for compressing the components of the master key (consisting of a master password, a key file, a Windows user account key and/or a key provided by a plugin) to a 256-bit key K. SHA-256 is a cryptographic hash function that is considered to be very secure. It has been standardized in NIST FIPS 180-4. The attack against SHA-1 discovered in 2005 does not affect the security of SHA-256. In order to generate the key for the encryption algorithm, K is transformed using a key derivation function (with a random salt). This prevents precomputation of keys and makes dictionary and guessing attacks harder. For details, see the section 'Protection against Dictionary Attacks'. Protection against Dictionary AttacksKeePass features a protection against dictionary and guessing attacks. Such attacks cannot be prevented, but they can be made harder. For this, the key K derived from the user's master key (see above) is transformed using a key derivation function with a random salt. This prevents a precomputation of keys and adds a work factor that the user can make as large as desired to increase the computational effort of a dictionary or guessing attack. Multiple key derivation functions are supported. In the database settings dialog, you can select one and specify certain parameters for it. By clicking the '1 Second Delay' button in the database settings dialog, KeePass computes the number of iterations that results in a 1 second delay when loading/saving a database. Furthermore, KeePass 2.x has a button 'Test' that performs a key transformation with the specified parameters (which can be cancelled) and reports the required time. The key transformation may require more or less time on other devices. If you are using KeePass or a port of it on other devices, make sure that all devices are fast enough (and have sufficient memory) to load the database with your parameters within an acceptable time. Supported key derivation functions:
Argon2 on iOS. If you are using a KeePass-compatible app on iOS, please note the following limitation of iOS. If the app uses a lot of RAM (e.g. due to using Argon2 with a large memory parameter), then AutoFill may not work. In this case, we recommend to use a relatively low value for the Argon2 memory parameter (64 MB or less, depending on the app and the database size) and a relatively high number of iterations. KeePassX. In contrast to KeePass, the Linux port KeePassX only partially supports protection against dictionary and guessing attacks. Random Number GenerationKeePass first creates an entropy pool using various entropy sources (including random numbers generated by the system cryptographic provider, current date/time and uptime, cursor position, operating system version, processor count, environment variables, process and memory statistics, current culture, a new random GUID, etc.). The random bits for the high-level generation methods are generated using a cryptographically secure pseudo-random number generator (based on SHA-256/SHA-512 and ChaCha20) that is initialized using the entropy pool. Process Memory ProtectionWhile KeePass is running, sensitive data is stored encryptedly in the process memory. This means that even if you would dump the KeePass process memory to disk, you could not find any sensitive data. For performance reasons, the process memory protection only applies to sensitive data; sensitive data here includes for instance the master key and entry passwords, but not user names, notes and file attachments. Note that this has nothing to do with the encryption of database files; in database files, all data (including user names, etc.) is encrypted. Furthermore, KeePass erases all security-critical memory (if possible) when it is not needed anymore, i.e. it overwrites these memory areas before releasing them. KeePass uses the Windows DPAPI for encrypting sensitive data in memory (via CryptProtectMemory / ProtectedMemory). With DPAPI, the key for the memory encryption is stored in a secure, non-swappable memory area managed by Windows. DPAPI is available on Windows 2000 and higher. KeePass 2.x always uses DPAPI if it is available; in KeePass 1.x, it can be disabled (in the advanced options; DPAPI usage is enabled by default). If DPAPI is unavailable or disabled, KeePass falls back to encrypting the process memory using ChaCha20 with a random key; note that this is less secure than DPAPI, because the key is also stored in swappable process memory. On Unix-like systems, KeePass 2.x uses ChaCha20, because Mono does not provide any effective memory protection method. For some operations, KeePass must make sensitive data available unencryptedly in the process memory. For example, in order to show a password in the standard list view control provided by Windows, KeePass must supply the cell content (the password) as unencrypted string (unless hiding using asterisks is enabled). Operations that result in unencrypted data in the process memory include, but are not limited to: displaying data (not asterisks) in standard controls, transferring data to/from other applications (via the clipboard, drag&drop, StdIn/StdOut, ...), replacing placeholders (e.g. during auto-type), searching data (e.g. the commands in the 'Find' menu that involve sensitive data), importing/exporting files (except KDBX) and loading/saving unencrypted files. Windows and .NET may make copies of the data (in the process memory) that cannot be erased by KeePass. Enter Master Key on Secure Desktop (Protection against Keyloggers)KeePass 2.x has an option (in 'Tools' → 'Options' → tab 'Security') to show master key dialogs on a different/secure desktop (supported on Windows 2000 and higher), similar to Windows' User Account Control (UAC). Almost no keylogger works on a secure desktop. The option is turned off by default for compatibility reasons. More information can be found on the Secure Desktop help page. KeePass 2.x Only
Note that auto-type can be secured against keyloggers, too, by using
Two-Channel Auto-Type Obfuscation.
Note: KeePass was one of the first password managers that allow entering the master key on a different/secure desktop! Locking the WorkspaceWhen locking the workspace, KeePass closes the database file and only remembers its path and certain view parameters. This provides maximum security: unlocking the workspace is as hard as opening the database file the normal way. Also, it prevents data loss (the computer can crash while KeePass is locked, without doing any damage to the database). When a sub-dialog is open, the workspace may not be locked; for details, see the FAQ. Viewing/Editing AttachmentsKeePass 2.x has an internal viewer/editor for attachments. For details how to use it for working with texts, see 'How to store and work with large amounts of (formatted) text?'. The internal viewer/editor works with the data in main memory. It does not extract/store the data onto disk. When trying to open an attachment that the internal viewer/editor cannot handle (e.g. a PDF file), KeePass extracts the attachment to a (EFS-encrypted) temporary file and opens it using the default application associated with this file type. After finishing viewing/editing, the user can choose between importing or discarding any changes made to the temporary file. In any case, KeePass afterwards securely deletes the temporary file (including overwriting it). PluginsSeparate pages exist about the security of plugins: Plugin Security (KeePass 1.x), Plugin Security (KeePass 2.x). Self-TestsEach time you start KeePass, the program performs a quick self-test to see whether the encryption and hash algorithms work correctly and pass their test vectors. If one of the algorithms does not pass its test vectors, KeePass shows a security exception dialog. Specialized SpywareThis section gives answers to questions like the following:
The answer to all these questions is: no. Adding any of these features would not increase security. All security features in KeePass protect against generic threats like keyloggers, clipboard monitors, password control monitors, etc. (and against non-runtime attacks on the database, memory dump analyzers, ...). However in all the questions above we are assuming that there is a spyware program running on the system that is specialized on attacking KeePass. In this situation, the best security features will fail.
This is law #1 of the
Ten Immutable Laws of Security
(Microsoft TechNet article; see also the
Microsoft TechNet article
Revisiting the 10 Immutable Laws of Security, Part 1): For example, consider the following very simple spyware specialized for KeePass: an application that waits for KeePass to be started, then hides the started application and imitates KeePass itself. All interactions (like entering a password for decrypting the configuration, etc.) can be simulated. The only way to discover this spyware is to use a program that the spyware does not know about or cannot manipulate (secure desktop); in any case it cannot be KeePass. For protecting your PC, we recommend using an anti-virus software. Use a proper firewall, only run software from trusted sources, do not open unknown e-mail attachments, etc. Malicious DataThe user should check all data that he enters and/or runs. If you enter/run data without checking it first, this can lead to security problems (like for instance a disclosure of sensitive data or an execution of malicious code). This is a general principle; it applies to most applications, not only to KeePass. Examples:
If the user checks the data that he enters/runs, none of the "attacks" above works. Entering data is a manual operation (i.e. an attacker cannot do this himself), and only the user can decide whether the resulting effect is intended or not. Showing warning/confirmation dialogs all the time would not be reasonable. When opening a database that has been created/modified by someone else, you should carefully check all data that you want to use. If you do not fully trust the creator of the database, do not open any files attached to entries. Options for ExpertsMost security options can be configured in the options dialog of KeePass (menu 'Tools' → 'Options') and in the database settings dialog (menu 'File' → 'Database Settings'). However, in KeePass 2.x, there additionally are a few security options for experts that cannot be configured in the user interface. For example, KeePass can protect its process with a discretionary access control list (DACL), and its windows can be protected against certain screen capture operations. Activating these options for experts may result in compatibility problems and may make KeePass unusable. Therefore, these options can only be activated by editing the configuration file manually (using an XML or text editor). This ensures that users know how they can deactivate the problematic options (by editing the configuration file once more) in order to make KeePass usable again. If you know how the configuration system of KeePass works, then see the customization help page, on which these options are documented. Options for AdministratorsAdministrators can enforce certain settings, disallow certain functions, specify requirements for master passwords, and much more. Details can be found on the following help pages:
Security IssuesFor a list of security issues, their status and clarifications, please see the page Security Issues. |
|
|||||||||||||||||||||||