Giter Club home page Giter Club logo

Comments (8)

jorabin avatar jorabin commented on August 20, 2024

Not at present, I'm afraid.

from keepassjava2.

i4s-dvelez avatar i4s-dvelez commented on August 20, 2024

In case anyone need it.

I've created a workaround:

public class MyCredentials implements Credentials {

private final byte[] key;

public MyCredentials(String password, InputStream inputStream) {
    MessageDigest md = Encryption.getMessageDigestInstance();
    byte[] pwKey = md.digest(password.getBytes());

    byte[] keyFileData = new byte[0];
    try {
        keyFileData = ByteStreams.toByteArray(inputStream);
    } catch (IOException e) {
        e.printStackTrace();
    }
    if(keyFileData == null) {
        throw new IllegalStateException("Could not read key file");
    } else {
        key = md.digest(Bytes.concat(pwKey, keyFileData));
    }
}

public byte[] getKey() {
    return this.key;
}

}

from keepassjava2.

jorabin avatar jorabin commented on August 20, 2024

to be clear, this is for kdb files rather than kdbx?

from keepassjava2.

i4s-dvelez avatar i4s-dvelez commented on August 20, 2024

Yes, actually is for a kdb file generated with KeePass 1.x

from keepassjava2.

jorabin avatar jorabin commented on August 20, 2024

I had a problem using this, since it seems that I can only generate hex encoded kdb key files and this doesn't convert from hex.

I've pushed a modification to KdbCredentials to the develop branch. It would be great if you could test it please. And if you have an example keyfile that is not hex encoded it would be useful to have this for testing.

from keepassjava2.

i4s-dvelez avatar i4s-dvelez commented on August 20, 2024

from keepassjava2.

i4s-dvelez avatar i4s-dvelez commented on August 20, 2024

from keepassjava2.

jorabin avatar jorabin commented on August 20, 2024

OK, thanks. I'll merge to master anyway.

from keepassjava2.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.