-1

Does KeePass have permanent inner key to encrypt data? Or the key for encryption is a password (and keyfile)? On some website I've run eyes over the discusstion about ways to hack KeePass base. One of assumptions was that there are two ways: one to bruteforce the passphrase and other was about to bruteforce the encrypted masterkey. Is there is really permanent inner master key for data encryption?

4
  • 2
    it is open source, so everyone that cares can read the source code. If there is a master key in the source code, it would be public, and make the whole thing useless.
    – Aganju
    Jul 16, 2016 at 16:03
  • I mean master key which can be generated once at password base creation and is encrypted by user password (and keyfile).
    – Cryptor
    Jul 16, 2016 at 16:23
  • That is what happens by default....
    – Ramhound
    Jul 16, 2016 at 16:30
  • I don't understand... Do you mean that when password base is created, the master key is generated? If so is there a way to force KeePass change master key and re encrypt the base when changing user password? Imagine the situation when someone finds out the password, retreives master key. But base owner doesn't know about it and simply keep changing password base once in some period of time... Things aren't good then...
    – Cryptor
    Jul 16, 2016 at 16:51

1 Answer 1

2

After reading this article it seems that some random bytes are really generated, but only with the aim to complete full 256-bit key:

In order to generate the 256-bit key for the block ciphers, the Secure Hash Algorithm SHA-256 is used. This algorithm compresses the user key provided by the user (consisting of password and/or key file) to a fixed-size key of 256 bits. This transformation is one-way, i.e. it is computationally infeasible to invert the hash function or find a second message that compresses to the same hash.

The recently discovered attack against SHA-1 [2] doesn't affect the security of SHA-256. SHA-256 is still considered as being very secure [3].

Key Derivation:

If only a password is used (i.e. no key file), the password plus a 128-bit random salt are hashed using SHA-256 to form the final key (but note there is some preprocessing: Protection against Dictionary Attacks). The random salt prevents attacks that are based on pre-computed hashes.

When using both password and key file, the final key is derived as follows: SHA-256(SHA-256(password), key file contents), i.e. the hash of the master password is concatenated with the key file bytes and the resulting byte string is hashed with SHA-256 again. If the key file doesn't contain exactly 32 bytes (256 bits), they are hashed with SHA-256, too, to form a 256-bit key. The formula above then changes to: SHA-256(SHA-256(password), SHA-256(key file contents)).

So I make conclusion that there is no inner master key. When user password (and keyfile) is changed, password base is re encrypted with a new key.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .