• Bender 39 minutes ago

    Is kdbx broken or has it been causing data loss? I've been using KeepassXC as long as it has existed and no issues for me thus far. If kdbx is not problematic for it's intended use then I think moving to SQLite just makes it more hacker friendly which I have no need for. I have no need for other applications extending the use of my passwords.

    If anything, maybe give people the option to export to SQLite and then use that going forward but keep it entirely optional.

    • ctoth 10 minutes ago

      I don't want to assume you didn't read the article, but this isn't really about the database engine. It's about the shadow schema that has grown up around the format. The database switch would serve as a flag day to unify things. It won't be a permanent fix, nothing at this scale ever is, and we'll probably need another migration in a few decades. Still worth doing.

    • Kwpolska 5 minutes ago

      > So rather than risking sync issues uploading your 20MiB KDBX file on every minor change, you can upload just the 4KiB or so comprising that data.

      Why is your KDBX file 20 MiB? It seems you are storing something that is not actually a good fit for a password manager, and expecting the entire world to change around you instead of storing those files in a more appropriate place.

      • ctoth 2 minutes ago

        "The reasonable man adapts himself to the world; the unreasonable man persists in trying to adapt the world to himself. Therefore, all progress depends on the unreasonable man."

        My kdbx is only 173 KB, but I don't hate this idea.

      • zokier 7 minutes ago

        If you are serious about this proposal, one way to move forwards is to make tool that converts kdbx <-> sqlite. If you can't roundtrip that conversion perfectly then the idea is dead on arrival.

        • advisedwang an hour ago

          > Devising a new schema based on SQLite would allow for current features that are being jerry-rigged into the attributes to have their own real place in the database

          Perfectly possible with XML too

          > An SQLite based store is one of the most tested and optimal formats for document and application storage

          It's optimized for things that largely don't matter for password storage. The testing is admirable, but there's no issue of keepass clients crashing or corrupting data so again, not very relevant (probably because of low concurrency, simple writes etc).

          > A switch this big is a major chance to fix the governance structure and align it more with a democratic consortium than a benevolent-dictator-for-life style of project management

          You don't need a technical change to solve this. In fact, a fork that would fracture clients is the last thing you need when making governance changes.

          > So many quality of life features can be added where the old schema disallowed it

          All of the features they list can be achieved with an XML format. The format isn't what's holding them back.

          • hollow-moe 6 minutes ago

            I don't know if this could count as "corrupting": I made the mistake of syncing my keepassxc database to my macbook with finder webdav client (nextcloud backend) it read the file alright but when I tried to write a new secret it helpfully wrote an empty file in place, wiping nextcloud file versions in the process. Thankfully, Nextcloud was smart enough to move the previous file in the trash bin and I could restore it. It seems keepassxc "save" procedure here was to delete the old file and replace it with a new one and something went catastrophically wrong in the process ? Looking at the settings there's is a parameter for this method for particular circumstances but I didn't enable it back then. Now I just have a second database only on this mac synced to icloud and never letting it near my nextcloud again.

            • ctoth 9 minutes ago

              > All of the features they list can be achieved with an XML format.

              Not writing the entire database on every save?

            • subdavis 32 minutes ago

              The keepass ecosystem is comprised of a dozen implementations of the KDB(X) file spec. Some are better than others.

              I built KeePass Tusk back in 2018, for example. This would kill the project and abandon 30K users without a rewrite of the JS engine (there are several now!)

              I agree with you that KDBX sucks, but at this point a keepass based on SQLite would be keepass in name only, a new password manager to migrate to.

              • ptx an hour ago

                > My cursory (lol, get it?) understanding may be incorrect.

                I don't get it. Is this a reference to database cursors? Or is it implying that the blog post was AI generated?

                • jamespo an hour ago

                  Just checking the size of my .kdbx file: under 100K.

                  • PunchyHamster an hour ago

                    I don't think given the file size it is all that relevant.

                    I mean if I wanted to start new password manager right now it would be a good choice to "just use SQLite" but for existing solution backward compatibility is far more important

                    • ycombinatrix 6 hours ago

                      >Important to note is that every time a KDBX file is updated, no matter how small the edit was, the entire file gets rewritten.

                      This seems like an implementation issue rather than a format/spec issue.

                      • wps 6 hours ago

                        Because KDBX is a gzipped and encrypted stream, this is actually fundamentally an issue with the spec itself. A client must re-encrypt and compress the file prior to writing because a mere append operation is not possible. SQLite solves this issue by allowing you to write with page level granularity rather than being forced to dump the whole file for a single tiny change!

                        • ptx an hour ago

                          Couldn't they simply switch to zip files? Those have an index and allow opening individual files within the archive without reading the whole thing.

                          Also, I don't understand how using XML makes for a brittle schema and how SQL would solve it. If clients choke on unexpected XML elements, they could also do a "SELECT *" in SQL and choke on unexpected columns. And the problem with people adding different attributes seems like just the thing XML namespaces was designed for.

                          • lukeschlather 4 minutes ago

                            It's a single XML file. Zip sounds like the worst of both worlds. You would need a new schema that had individual files at some level (probably at the "row level.") The article mentions SQLCipher which allows encrypting individual values separately with different keys. Using different keys for different parts of a kdbx sounds ridiculous, but I could totally imagine each row being encrypted with a compound key - a database-level key and a row-level key, or using PKI with a hardware token so that you don't need to decrypt the whole row to read a single field, and a passive observer with access to the machine's memory can't gain access to secrets the user didn't explicitly request.

                          • ycombinatrix 6 hours ago

                            I see, thanks. Have you considered moving to Bitwarden?

                            • wps 6 hours ago

                              Yes actually, I have personally onboarded several people to BitWarden! (Including manually migrating their accounts, setting passwords and passkeys, etc) However, I dislike the centralization and lack of control. There was a paper discussed within the past couple days on HN about what a malicious BitWarden server was capable of, despite BitWarden's marketing. I believe BitWarden's team responded promptly and appropriately to the research.

                              VaultWarden is a good compromise (offers the choice of SQLite or Postgres under the hood), putting you in charge of the primary server, but it is honestly overkill for a single personal user compared to a kdbx file on a webdav share.

                              • clircle an hour ago

                                > overkill for a single personal user compared to a kdbx file on a webdav share.

                                Maybe. I'm looking into VaultWarden for my personal passwords because keeping a KBDX file up to date on iOS is painful (without a corporate cloud backing).

                          • rileymichael 20 minutes ago

                            i would say it’s the correct implementation as you can’t edit atomically. write and move is what you have to do

                            • foobiekr 38 minutes ago

                              It's not an issue, write-new-and-swap is probably the best approach for this type of application.

                              • mathfailure an hour ago

                                That's probably a security feature.

                                • PunchyHamster an hour ago

                                  You need format supporting append/edit first before you can implement it "right"