Keepass Falsely Reports Valid File as Corrupted

  • FauxJoe

    I have a Keepass data file which opens perfectly on a desktop and two laptops. It uses a keyfile which presents no problems on those 3 computers.

    On a fourth computer - a netbook - Keepass opens a pw database which is accessed by a password alone. Computer runs fully updated XP.

    My problem is that when I try to open the database file that requires a keyfile, Keepass give a message that says "the file is corrupted" when I direct the program to the keyfile needed for the database.

    Things I have already tried:

    1. Thorough uninstall and reinstall Keepass.
    2. Use copies of the database file and keyfile that work perfectly on other computers.
    3. CRC check files reported as corrupt to see that content is identical to files working
    4. Verify Keepass opens files accessed only by pw.
    5. Open Keepass before Firefox with Keefox has started to run.

    I have no idea about what to try next. Has anyone ever encountered this? Could the computer be infected with some kind of malware? What should I do to try to zero in on the source of the problem?

    The only thing of which I am certain is the database file opens with the same keyfile on three other computers.

  • wellread1

    Is the netbook a Windows computer? What version(s) of KeePass are you using?

    File corrupt messages can occur when there is a KeePass version mismatch because sometimes the database structure was changed at the version change. When this happens the later version can open and earlier version database but not vice versa. If the netbook is using an older version of KeePass, update it to the same as used on the other computers.

    1. Use copies of the database file and keyfile that work perfectly on other computers.

    Did you verify that the database that produces the corrupt database message can be opened after it is copied back to a computer that "works".

    1. Verify Keepass opens files accessed only by pw.

    Did you make a new database on the netbook that uses a keyfile and verify that you can open it?

  • FauxJoe


    Thanks for help.

    Regarding suggestion about Keepass version, all computers were using the same version. Also, I created new databases on the netbook WITH THE SAME KEYFILE USED ELSEWHERE and these worked perfectly on the other computers. Also verified that original files had not been corrupted by Keepass when during the attempt to open them on the netbook.

    This pushed me back to square one, but you did get me jumpstarted.

    Eventually I realized that the big difference between the netbook and the other computers was in memory size: 1 GB on the netbook, 4-16 GB's on the other computers.

    My original keyfile was a 2.6 MB JPG. On one of the other computers, I created a reduced 56 KB version of the JPG and USED THIS REDUCED VERSION as a keyfile for a new Keepass database.

    The database with the smaller keyfile opened perfectly on the netbook.

    To summarize the situation as it now appears to me:

    Assume you are syncing files on different computers where there are considerable differences between computer memory and the size of a keyfile:

    1. A Keepass database created on the computer with the smallest memory will open fine on the computers with larger memories, no matter what the size of the keyfile.
    2. A Keepass data base created on a computer with much larger memory might or might not open properly on the computer with the smallest memory, depending on:
      A. The total memory available on the computer with the smallest RAM.
      B. The size of the keyfile.

    I have no idea why this seems to be happening. Could it be it has something to do with available memory and the hashing process Keepass uses to construct a key from a keyfile?

    Although I solved the practical problem, I would like to understand why this works. Can anyone illuminate this for me and others who might confront the same issue?

    Anyhow, thanks again for getting me going.

    PS: I've given some thought to the possibility that file synchronization might have had some role in the original problem (I first became aware of the problem after syncing files with FreeFileSync), but in my final tests and the development of a practical solution, I used a flash drive to transport the files from one computer to the other. Large or small keyfiles used on the computer with the smallest memory worked fine on the other computers when accessed from the flash drive. Conversely, only files created with a small keyfile worked properly when accessed from the flashdrive on the netbook.

    Last edit: FauxJoe 2013-03-11
  • wellread1

    Also, I created new databases on the netbook WITH THE SAME KEYFILE USED ELSEWHERE and these worked perfectly on the other computers.

    Did the new database (created on the netbook) work on the netbook with the same large keyfile it was created with. If so, it is unlikely that KeePass is the culprit since the AES key generation process from a keyfile must be the same for the encryption and decryption, and you have already demonstrated that encryption on the netbook using the large keyfile was successful.