• Stars
    star
    158
  • Rank 237,131 (Top 5 %)
  • Language
    Python
  • License
    Other
  • Created about 14 years ago
  • Updated about 3 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Python interface to KeePass file format v3 (used in KeePass V1.x and KeePassX)

keepassc and python-keepass

This provides command line and Python interfaces for operating on files in KeePass format v3 (used by KeePass 1.x, and KeePassX). Note, this is not the format used by the KeePass application version 2.x.

Notes of caution

Before using this code, understand the its (known) security and correctness limitations:

  • Unlike the KeePass/KeePassX GUI applications this code makes no attempt to secure its memory. Input files read in are stored in memory fully decrypted.

  • It is quite easy to display the stored passwords in plain text, although the defaults try to avoid this.

  • Specifying the master key on the command line will leave traces in your shells history and in the process list.

  • While input files are treated as read-only, keep backups of any files written by KeePass/KeePassX until you are assured that files written by this code are usable.

  • Key files are not currently supported.

Prerequisites and Installation

You will need to install the python-crypto package (providing the "Crypto" module). On a well behaved system do:

sudo apt-get install python-crypto

If installing into a virtualenv this prerequisite will be installed for you:

virtualenv /path/to/venv
source /path/to/venv/bin/activate
cd python-keepass
python setup.py install

Command line

The command line interface is run like:

keepassc [general_options] [command command_options] ...

Multiple commands can be specified and will be executed in order. They operate on an in-memory instance of the database file. An example,

keepass open -m secret file.kdb \
        dump -p -f '%(username)s password is: %(password)s' \
        save -m newsecret backup.kdb

Online help:

keepass -h      # short usage
keepass help    # full usage

Python Modules

Low level file access

from keepass import kpdb
db = kpdb.Database(filename,masterkey)
print db   # warning: displayed passwords in plaintext!

References and Credits

PyCrypto help

The giants on whose shoulders this works stands

First, thanks to the original authors, contributors and community behind KeePass and KeePassX. I am merely a user of KeePassX.

A big credit is due to rudi & shirou (same hacker?) for the following:

Looking through KeePass/KeePassX source made my head swim. Only after reviewing their work could I get started.

See also

  • kppy Python interface and KeepassC command line interface.

License

This package is Free Software licensed to you under the GPL v2 or later at your discretion. See the LICENSE.txt file for details.

More Repositories

1

pygst-tutorial-org

A reworked tutorial for using GStreamer Python bindings.
HTML
83
star
2

cppzmq-tour

A tour of how to develop with cppzmq, the C++ bindings to ZeroMQ libzmq.
CSS
13
star
3

zio

A general I/O system using zeromq to glue things together
C++
7
star
4

docdb-install

Automate the installation of DocDB
Python
6
star
5

herbie

A herbstluftwm interactive environment thingy.
Python
6
star
6

worch

Let the orchestration waf through the suite.
Python
5
star
7

zperfmq

A ZeroMQ performance tester
C++
4
star
8

moo

ruminants on module oriented programming
C++
4
star
9

docdb-docker

Install DocDB in Docker
Python
4
star
10

advanced-shell-history

Save shell history in Sqlite3. This is a fork of https://code.google.com/archive/p/advanced-shell-history/ now resurected by the original author at: https://github.com/barabo/advanced-shell-history
C
4
star
11

cppzmq-houses

ZeroMQ security examples implemented on cppzmq
C++
3
star
12

nbica

Network Boot, Installation and Configuration via Ansible
Python
3
star
13

gegede

General Geometry Description
Python
3
star
14

xchat-scripts

Collection of scripts for extending the XChat IRC client.
Python
2
star
15

nuosc

libnuosc++ - A library for calculating 3 neutrino oscillation probabilities.
C++
2
star
16

metascons

A SCons setup for tying together the building of multiple packages.
Python
1
star
17

brettviren.github.io

gh pages for brettviren
HTML
1
star
18

pochoir

Calculate electrical response to drifting charge.
Python
1
star
19

lbne-conda

Conda recipes for building LBNE software
Shell
1
star
20

scripts

Collection or miscellaneous scripts.
Python
1
star
21

org-pub

Public, org-based web pages.
Python
1
star
22

orgonpy

org-mode + json + python
Python
1
star
23

btdtwf

Been there done that workflow
Python
1
star
24

ersatz

A descrete event simulation based on SimPy.
Python
1
star
25

nox

like nix, but off a bit
Python
1
star
26

ptmp

prototype trigger message passing
C++
1
star
27

generaldomo

ZeroMQ Zguide Majordomo (7/MDP aka v1) examples generalized to use CLIENT/SERVER or DEALER/ROUTER
Python
1
star
28

gravio

A graph generator
Python
1
star
29

garfield-build

Build the GARFIELD simulation package.
Fortran
1
star
30

cowbells

Simulation for water-based liquid scintillator.
C++
1
star
31

shist

Shell history and query using SQLite3 and following advanced-shell-history table schema
Shell
1
star
32

chainbowduino

Rainbowduino firmware and host software.
C++
1
star
33

lcatr

LSST CCD Acceptance Testing Results. Define schema and validation for the FITS files used as input for the backend database.
Python
1
star
34

android-helper

Some bits to help me do things to my Android phone.
1
star