1

I am thinking of moving away from hosted solutions (ex: 1Password, BitWarden) and am interested in using a KeePass database to store my secrets.

Historically I didn't pay much attention to KeePass as the app never looked all that visually appealing but I now know that KeePass itself has a database format that can be used with various apps.

How much variation is there between these different apps and how secure does the database remain on its own? Are there any risks I should be aware of using these types of apps?

I'm looking at a solution like Strongbox or KeePassium as I almost exclusively work in the Apple ecosystem and they seem to be highly recommended. They also seem to support cloud storage sync, which I'd like to have if possible.

I'd be looking to secure my database with a strong master password as well as a set of YubiKeys, but I am unclear if the YubiKeys are tied to the specific app or if it's actually a feature of the KeePass database format and could be opened with something like KeePassXC if Strongbox went out of business suddenly and stopped working for whatever reason.

Assuming that I have a database setup with a secure master password and YubiKeys even if someone were to access my database file and have my master password, would the YubiKey protect it regardless of what application they were using? The concern obviously being that once the file is out there, it's out there. Unlike something like 1Password where you can revoke access to a degree.

Is the biggest risk with using something like Strongbox or KeePassium that a rogue update could be pushed out by one of the developers to steal your credentials?

If so seeing as they're both on the App Store that makes me feel a little better as I know there's at least some checking on that platform (though I am aware it's not perfect).

If anybody could shed some light for me that'd be great! I did do a good bit of research but due to all the different variations nothing seems super straight forward to me and I run on the paranoid side.

3
  • 1
    What do you “how does it work”, full programming documentation is available, so the individual program must support it.
    – Ramhound
    Commented Nov 22, 2023 at 18:10
  • Sure, so I guess I am saying if someone opens a KeePass database file that's secured with a YubiKey in an app that doesn't support YubiKey is it unusable or does that bypass it? I guess that's what I don't understand. It seems like not all apps support it based on what I've seen in the documentations.
    – fyrekcaz
    Commented Nov 22, 2023 at 18:23
  • I did, I make these mistakes frequently. 🤷‍♂️
    – fyrekcaz
    Commented Nov 23, 2023 at 0:24

2 Answers 2

6

KeePassium author here.

How much variation is there between these different apps

These are independent apps by different developers, so they vary by design, support and amount of extra features. But their common denominator is the database format, so every app will support the main features features. (Just like any spreadsheet app would open and edit an Excel file, even if without fancy formatting.)

how secure does the database remain on its own?

As secure as it gets: it is well-encrypted, it has protection against dictionary attacks, and you can control the level of that protection. The database file is always encrypted, the data is decrypted only to device memory (RAM). Theoretically, one can even publish their database online for everyone to see. Without the master key, it's just an encrypted binary blob.

Are there any risks I should be aware of using these types of apps?

First of all, make sure you get the genuine app. There are a few websites with a fake "KeePass". There used to be an iOS app called "KeePass" that simply abused the name and had nothing to do with the real app.

Then, google the app history/reputation. There are apps that should be open, but they don't release their source code (KeePass Touch). There was an app that looked fine, but started behaving suspiciously and its dev simply shut down the project without much explanations (IOSKeePass/KeePassMini, not to be confused with MiniKeePass).

I'd be looking to secure my database with a strong master password as well as a set of YubiKeys, but I am unclear if the YubiKeys are tied to the specific app or if it's actually a feature of the KeePass database format and could be opened with something like KeePassXC if Strongbox went out of business suddenly and stopped working for whatever reason.

YubiKeys are not tied to the specific app. So yes, you can open a YubiKey-protected database in KeePassXC, KeePassium, Strongbox, Keepass2Android and probably some other apps. (Remarkably, not in KeePass: its only YubiKey-related plugin, KeeChallenge, uses its own encryption scheme and ought to be avoided.)

However, YubiKey are not a feature of database format, either. It is more of an after-market extension to the algorithm that calculates the encryption key from its components. Database file does not contain any indications of which key components are used. It just takes whatever master key the user provides, and tries to decrypt the database using these data.

The original method is:

masterKey = hash(hash(passwordBytes) + hash(keyFileBytes))

With a YubiKey, it becomes:

masterKey = hash(hash(passwordBytes) + hash(keyFileBytes) + hash(yubikeyResponse))

where yubikeyResponse is the data returned by YubiKey's HMAC-SHA1 challenge-response (CR) feature. There, the YubiKey serves as a black box that receives some data (challenge), transforms it in some predefined way (based on a secret you configured during YubiKey CR setup), and returns the transformed result (response). This computation does not leave any traces on the YubiKey. The challenge is just a sequence of random bytes stored in database header in plain text, it is re-randomized whenever you save the database.

As a side effect, if you store the same secret on two YubiKeys, they will behave exactly the same in CR mode and can be used interchangeably. This is handy as a backup in case your main key is lost or damaged.

Please note that challenge-response mode is pretty much limited to YubiKeys, it is not available on cheap FIDO keys (including YubiKey FIDO keys).

Assuming that I have a database setup with a secure master password and YubiKeys even if someone were to access my database file and have my master password, would the YubiKey protect it regardless of what application they were using?

Yes. The attacker will need your database, your master password, and your YubiKey. Moreover, it would have to be the very same physical key: CR secret is a write-only property, it cannot be extracted from the key, so the key cannot be cloned. (In contrast to key files that can.) This makes any kind of remote attack much harder to pull off. Even if you forget your YubiKey plugged in a USB port, the key won't respond to any software requests until you physically touch a button on the YubiKey. No physical confirmation — no response from the YubiKey.

Is the biggest risk with using something like Strongbox or KeePassium that a rouge update could be pushed out by one of the developers to steal your credentials?

The risks depend on your specific case. For many users, the biggest risk is forgetting their master password, followed by not making database backups.

But yes, there is always a risk of a rogue update. It won't be intentional, mind you, because both KeePassium and Strongbox have a lot at stake (not anonymous, in European countries with strong laws, are the livelihood of their authors). But bugs happen and some of them can corrupt your database, so you should be keeping backups.

1
  • 1
    This is incredibly helpful and I thank you for taking the time to write this.
    – fyrekcaz
    Commented Nov 24, 2023 at 5:31
1

As far as I know, this feature only uses the Yubikey as a convenient way to store an encryption key (similar to a keyfile); typically using the HMAC feature that many FIDO keys have (i.e. most likely not using Yubikey-specific traditional functionality). Much like a keyfile, it can be neither bypassed nor bruteforced.

(It can, however, be extracted from the Yubikey as it's fundamentally a static key; a very different situation from the most common usage of Yubikeys and/or FIDO keys.)

Different programs can use the same Yubikey in the same way, as long as they agree on how to use it, e.g. FIDO HMAC vs Yubikey slots, what input to provide for HMAC, etc.

3
  • Yes, I did see in the documentation that it's not a typical use of a Yubikey and requires you to configure it via the app. It seems like the key file is universally supported and you're saying the Yubikey essentially just stores the key file?
    – fyrekcaz
    Commented Nov 22, 2023 at 19:06
  • @fyrekcaz - Exactly
    – Ramhound
    Commented Nov 22, 2023 at 19:31
  • Awesome, that's good to know. I was getting a little confused as documentation from Strongbox says you can use a master password, hardware key, and a key file all at once (or any combo) so I didn't realize they were the same thing. In that use case are you essentially using multiple key files?
    – fyrekcaz
    Commented Nov 22, 2023 at 19:39

You must log in to answer this question.

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