keepass-db

Crates.iokeepass-db
lib.rskeepass-db
version0.0.2
sourcesrc
created_at2023-09-12 18:52:32.273632
updated_at2023-10-01 06:18:43.682325
descriptionKeePass password database library and tools
homepagehttps://github.north-winds.org/keepass-db
repositoryhttps://github.com/penguin359/keepass-db
max_upload_size
id970885
size381,735
Loren M. Lang (penguin359)

documentation

README

KeePass-DB: KeePass database for KBD and KBDX file formats

KeePass-DB GitHub Actions KeePass-DB on crates.io KeePass-DB on docs.rs Chat codecov.io dependency status License file

Read and write KeePass password databases. This should be able to read all known versions supported by the official KeePass software package and as well as a few variants only supported via extensions.

Write support is currently experimental.

Example code

To find and print a password based on website URL:

use keepass_db::{KeePassDoc, protected_stream::CipherValue, Key};
fn main() -> Result<(), Error> {
    let mut key = Key::new();
    key.set_user_password("secret");
    let mut doc = KeePassDoc::load_file("passwords.kdbx", &key)?;
    let database = doc.file;
    let stream = &mut doc.cipher;
    let basic_entry = database.root_group().all_entries().filter(|e| e.url().unprotect(stream).unwrap() == "https://www.example.com/").last().unwrap();
    println!("Password: {}", basic_entry.password().unprotect(stream).unwrap());
    Ok(())
}

Crate features

Default features:

  • argonautica: Default, well-tested Argon2 implementation

Optional features:

  • rust-argon2: Original Argon2 support. Not recommended. Must not be enabled with other Argon2 features.
  • argon2-kdf: Original C implementation of Argon2. Must not be enabled with other Argon2 features.
  • write: Experimental: Enable write support for KeePass database.

Rust version requirements

The Minimum Supported Rust Version (MSRV) is currently Rust 1.70.0.

The MSRV is explicitly tested in CI. It may be bumped in minor releases, but this is not done lightly.

License

This project is licensed under

Commit count: 200

cargo fmt