Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Invalid header when opening Twofish-encrypted database file #109

Closed
vaygr opened this issue Apr 18, 2024 · 9 comments
Closed

Invalid header when opening Twofish-encrypted database file #109

vaygr opened this issue Apr 18, 2024 · 9 comments

Comments

@vaygr
Copy link

vaygr commented Apr 18, 2024

Steps to reproduce:

  1. Create a Twofish-encrypted database with KeePassXC
  2. Run the code:
package main

import (
    "fmt"
    "github.com/tobischo/gokeepasslib/v3"
    "os"
)

func main() {
    file, _ := os.Open("/path/to/the/database.kdbx")

    db := gokeepasslib.NewDatabase()
    db.Credentials = gokeepasslib.NewPasswordCredentials("password")

    if err := gokeepasslib.NewDecoder(file).Decode(db); err != nil {
        fmt.Println("failed to decode db -", err)
    }
}

Error returned is gzip: invalid header. AES/ChaCha20 work fine.

@tobischo
Copy link
Owner

@vaygr Thank you for raising the issue. Do you happen to have an example file? I am not using KeepassXC anywhere.

Maybe I am missing something but the original Keepass2 does not seem to have twofish as an option when creating new files.

@vaygr
Copy link
Author

vaygr commented Apr 18, 2024

Yes, attaching it here (password test). I'm not sure about Keepass2, but in a widely used KeePassXC it's one of 3 options available.

shot-2024-04-18_110413

Passwords.kdbx.zip

@tobischo
Copy link
Owner

Keepass2

Interesting. In Keepass2 it is only those 2 options

I'll take a look and see what I can do

@tobischo
Copy link
Owner

tobischo commented Apr 18, 2024

Apparently it is possible to add twofish as a plugin in keepass2

https://keepass.info/plugins.html#twofishcipher

@tobischo
Copy link
Owner

@vaygr Please take a look at #110

@vaygr
Copy link
Author

vaygr commented Apr 18, 2024

Thank you very much, that works as expected.

@vaygr vaygr closed this as completed Apr 18, 2024
@tobischo
Copy link
Owner

Alright, will merge and release it probably this evening

@tobischo
Copy link
Owner

Released as v3.6.0

@vaygr
Copy link
Author

vaygr commented Apr 19, 2024

Thank you for quickly resolving this!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants