array index out of range: -98

  • shltj

    shltj - 2010-04-21

    I am using keepass2.09 on my desktop pc, with key file and usual password. Now I want to carry my db with me on nokia 5800. I DL keepassj2me1.3.0, exported 2.x kdbx to 1.x kdb, and copied key file and kdb to 5800 TF card, the problem now is if I load kdb with key file, it shows "Array index out of range: -98", any idea what is this and how to reslove it?

  • Stepan

    Stepan - 2010-04-21

    You can describe in more detail how to reproduce the error?
    You can check it is in version 1.4.0 Beta 3?

  • shltj

    shltj - 2010-04-22

    Hi Stepan, I tried 1.4.0 Beta 3, it had the same error.

    I did some further investigation; found maybe it’s the way how your code treated key file caused error.

    I noticed the key file generated by Keepass desktop is ascii based xml file, and key data is a string of characters between <data> tag, but what I use for key file is anything from text file to executable file, and even jpg file, with or without file extension. I try to hide my key file among hundreds files on my hard disk, so the particular key file I used was a binary file.

    With above finding I tested again using Keepass desktop to create an ascii key file, encrypted my kdbx with that new key file, export kdbx to 1.x kdb, copy both ascii key file and kdb file to Nokia 5800, Keepassj2me decrypted kdb successfully.

    So you just need a conditional branch to test if key file is not xml, just treat the entire file as the key data.

    Hope that helps, and I love the extra function in 1.4 beta.

  • Stepan

    Stepan - 2010-04-23

    Key files in XML are not supported. Supports three types of key files:
    1. Length of 32 bytes of data - is that it really was the key.
    2. Length of 64 bytes - hex encoded keys.
    3. All others are treated as binary files and to get the key computed hash content.

    Your file was probably 64 bytes and contain binary data? And this causes an error when trying to decode it. I fixed and now in an unsuccessful decoding it would be considered as a binary. Soon I'll upload the fixed version.

  • Stepan

    Stepan - 2010-04-26

    I uploaded the fixed version (1.4.0 beta 4).
    Please try it.

  • shltj

    shltj - 2010-05-10

    Hi Stepan, thanks for Beta4, sorry I went away for a while.

    yes, you were right. I use 64 bytes binary file as key file, but with your beta release 4, I got "
    Wrong password, keyfile or database corrupted (database did not decrypt correctly (1)) "
    that is the exact copy of my nokia screen, andI am sure I gavethe correct password and key file.

  • shltj

    shltj - 2010-05-10

    I found key file produced by  Key file generator within pc based Keepass2.10 and keepass1.17 gave different key file format.
    Key file generated from Keepass1.17 is a text file contains a string like this:
    while key file generated by Keepass2.10 is like that:
    <?xml version="1.0" encoding="utf-8"?>
    since I use Keepass2.10 on my pc, I always export 2.x KDBX to 1.x KDB before copy to mobile, but it seems Keepass1.17 handles XML like key file from 2.10 well.

  • shltj

    shltj - 2010-05-10

    keepassj2me 1.40.4 handles XML like key file well if I replace binary key file with 2.10 produced XML key file, but the original binary key file is still a pain.

  • Stepan

    Stepan - 2010-05-13

    Yes, XML key file will be interpreted as a binary, I think before using it will need to convert.

    You can create an example kdb and key file?
    I propose to use the tracker and attach the problematic files.


Log in to post a comment.