keepass v0.3.0

Keepass KDBX v2/v3 parser for Crystal

Keepass

A Keepass KDBX v2/v3 parser for Crystal.

Requirements

This library requires libsodium. On Ubuntu 17.04 you can install it via sudo apt install libsodium-dev. For other distros, please check the libsodium docs.

Install

Add the following lines to your shard.yml:

dependencies:
  keepass:
    github: lipanski/keepass

...and run crystal deps or shards install.

Usage

When the file is encrypted with a password:

require "keepass"

database = Keepass.parse!("/path/to/keepass.kdbx", "password")

When the file is encrypted with a password and a key file:

require "keepass"

database = Keepass.parse!("/path/to/keepass.kdbx", "password", "/path/to/keyfile")

The Keepass::Database object

Read the version:

database.version #=> String

Show the groups:

database.groups #=> Array(Keepass::Group)

The Keepass::Group object

Show the name:

group.name #=> String

Show the ID:

group.uuid #=> String

Show the entries directly under this group:

group.entries #=> Array(Keepass::Entry)

Show all entries (including entries contained by sub-groups):

group.all_entries #=> Array(Keepass::Entry)

Show sub-groups:

group.groups #=> Array(Keepas::Group)

Show the parent group (if any):

group.parent #=> Group?

The Keepass::Entry object

Show the title:

entry.title #=> String?

Show the ID:

entry.uuid #=> String

Show the user name:

entry.user_name #=> String?

Show the password:

entry.password #=> String?

Show the notes:

entry.notes #=> String?

Show some helpful timestamps:

entry.created_at #=> Time?
entry.updated_at #=> Time?
entry.last_accessed_at #=> Time?

Show the usage count (if available):

entry.usage_count #=> Int32?

Errors

Check the src/keepass/error.cr file for a list of the errors that will be raised.

TODO

  • Accept key files.
  • Write KDBX files.
  • Parse KDB.
  • Parse KDBX4.

Pull requests are welcome.

Resources

Repository

keepass

Owner
Statistic
  • 12
  • 0
  • 0
  • 0
  • 0
  • about 3 years ago
  • December 24, 2017
License

MIT License

Links
Synced at

Fri, 03 May 2024 20:29:12 GMT

Languages