I wrote a Python tool that uses your pykeepass library. I used it to write some filenames into a KDBX file generated by KeePassDX, and it worked—or so I thought. Later I found out that KeePassDX could no longer open that database file. I don't remember whether it was V2 or V3 back then (this was before the V4 release), but at the time KeePassDX opened it just fine. My mistake: I didn't keep a backup.
After hours of troubleshooting, I first noticed that pykeepass could still open the file, so I wrote a small script to dump it to XML—and the contents came out perfectly intact. Then I dove into the source code of KeePassXC, KeePassDX, and pykeepass, trying to pinpoint the issue. I tweaked Argon2's memory parameter, messed with the AWS UUID, played around with padding, and read through multiple KeePass codebases to understand the KDBX structure, the recognition logic, encryption, decryption, the overall flow, and the standard spec.
Within the first two or three hours, I already had a self-ported KeePassXC-CLI, the web tool app.keeweb.info, your pykeepass, and my own little KDBX utility all able to open the file—but KeePassDX still wouldn't. I've been using a key file with no password from the start. At first I thought the --no-password flag might be the culprit, but that turned out to be a dead end. Eventually I hacked together a KeePassDX-like command-line tool based on its own source code, and that actually worked. I thought I was finally done—until I tried opening the file on my phone with the actual KeePassDX app. Still no luck.
I've tried nine different fixes in total, and every single one of them failed. Every attempt just gave me the same error: "Failed to load database."
To be honest, my technical skills just aren't cutting it here. So I'm out of ideas. Figured I'd reach out to the original author of pykeepass and see if you have any insight.
I will upload my tool to my Github repository.You can check it.
I wrote a Python tool that uses your pykeepass library. I used it to write some filenames into a KDBX file generated by KeePassDX, and it worked—or so I thought. Later I found out that KeePassDX could no longer open that database file. I don't remember whether it was V2 or V3 back then (this was before the V4 release), but at the time KeePassDX opened it just fine. My mistake: I didn't keep a backup.
After hours of troubleshooting, I first noticed that pykeepass could still open the file, so I wrote a small script to dump it to XML—and the contents came out perfectly intact. Then I dove into the source code of KeePassXC, KeePassDX, and pykeepass, trying to pinpoint the issue. I tweaked Argon2's memory parameter, messed with the AWS UUID, played around with padding, and read through multiple KeePass codebases to understand the KDBX structure, the recognition logic, encryption, decryption, the overall flow, and the standard spec.
Within the first two or three hours, I already had a self-ported KeePassXC-CLI, the web tool app.keeweb.info, your pykeepass, and my own little KDBX utility all able to open the file—but KeePassDX still wouldn't. I've been using a key file with no password from the start. At first I thought the --no-password flag might be the culprit, but that turned out to be a dead end. Eventually I hacked together a KeePassDX-like command-line tool based on its own source code, and that actually worked. I thought I was finally done—until I tried opening the file on my phone with the actual KeePassDX app. Still no luck.
I've tried nine different fixes in total, and every single one of them failed. Every attempt just gave me the same error: "Failed to load database."
To be honest, my technical skills just aren't cutting it here. So I'm out of ideas. Figured I'd reach out to the original author of pykeepass and see if you have any insight.
I will upload my tool to my Github repository.You can check it.