Narigo/keepass-diff

IncorrectKey Error when using Keyfile generated by KeePassXC Windows

opensource25 opened this issue · 2 comments

I tried to diff to databases because of a syncing conflict. I now use Linux but generated the key files under windows with KeePassXC. When I run RUSTBACKTRACE=1 keepass-diff db1.kdbx db1.sync-conflict.kdbx --same-password --keyfiles keyfile.keyx this error occurs.

thread 'main' panicked at ~/.cargo/registry/src/index.crates.io-6f17d22bba15001f/keepass-diff-1.2.0/src/main.rs:122:18:
Error opening database A: Key(IncorrectKey)
stack backtrace:
   0: rust_begin_unwind
             at /rustc/82e1608dfa6e0b5569232559e3d385fea5a93112/library/std/src/panicking.rs:645:5
   1: core::panicking::panic_fmt
             at /rustc/82e1608dfa6e0b5569232559e3d385fea5a93112/library/core/src/panicking.rs:72:14
   2: core::result::unwrap_failed
             at /rustc/82e1608dfa6e0b5569232559e3d385fea5a93112/library/core/src/result.rs:1653:5
   3: keepass_diff::main
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

The password is not the problem trying on a database without keyfile it works and I typed correct. What can I do?

Hi @opensource25 , can you open the files individually with a regular client and the keyfile on Linux? If yes, a workaround for you could be to change / remove the keyfile individually and diff those files then.

Keyfiles should work in general though, so if it doesn't work with a keyfile that you can use to open it with a regular client, there is some bug and it would be helpful if you could provide a reproducer.

One issue that I saw occuring when working with Linux and Windows were different line endings. If your keyfile is text based, maybe there was an issue with that, when moving the file from one system to the other?

nref commented

Thanks for a very useful tool. I get kdbx sync conflicts in Syncthing all the time and this tool helps. I am having this issue on Windows too. I will reply if I can get a minimal repro.