Kunzisoft / KeePassDX

Lightweight vault and password manager for Android, KeePassDX allows editing encrypted data in a single file in KeePass format and fill in the forms in a secure way.
https://www.keepassdx.com/
GNU General Public License v3.0
4.35k stars 262 forks source link

Why the database saved by KeePassDX have different file size compared to the PC KeePass saved? #1016

Closed HaujetZhao closed 3 years ago

HaujetZhao commented 3 years ago

Describe the bug

I am using Syncthing to sync the database between my phone and my PC, and I noticed that, every time I saved the database by KeepassDX, it's size become about 1.7MB, and every time I saved the database by PC KeePass, it's size become about 3.51MB, why would this happen?

Expected behavior Using same alogrism, I suppose they should have size after saving.

KeePass Database

KeePassDX (please complete the following information):

Android (please complete the following information):

J-Jamet commented 3 years ago

There can be two explanations

  1. The third-party applications you use to synchronize files do not update caches and backups are not visible. In this case, you should contact the developers of these other applications to find solutions.
  2. Maybe an old bug in KeePassDX that prevents from formatting correctly the binary format of the attached files. (update your app)

Can you upload a test database to reproduce the problem? Have you tried to recover the file manually to see if KeePassDX was saving correctly with a local file manager? Because I did the tests on my side and I have no problem.

J-Jamet commented 3 years ago

Of course, your KeePassDX application must be up to date: 2.10.2

J-Jamet commented 3 years ago

I can't test your test bases without the associated passwords.

J-Jamet commented 3 years ago

Each time sync, Syncthing will make a copy of old file as a backup.

If this is not the expected behavior, open a ticket on the Syncthink project.

HaujetZhao commented 3 years ago

@J-Jamet Just wanna check it out, did this reproduced with the database I uploaded?

J-Jamet commented 3 years ago

No, can't reproduce. You don't indicate the entry that contains the attachments, there are many of them. Note that there is a history to your base. And for you ? the problem is reproducible since you updated the application?

HaujetZhao commented 3 years ago

Ah ah, forgot the history...A Lot of work then.

I'll record a video later.

HaujetZhao commented 3 years ago

Have this new created vault as an example, it's saved by Windows Keepass 2.44, it's size is 509KB (contains 2 attachments) test vault.zip, password is happy

But if you save it with KeepassDX, it's size will become 287KB.

J-Jamet commented 3 years ago

I just checked and I don't see any problem. The attached files are not altered during the save (binaries hashes remain the same) and the file formatting is repaired and ordered to take less space. https://github.com/Kunzisoft/KeePassDX/wiki/FAQ#why-is-the-database-file-smaller-after-a-save