raymontag / kppy Goto Github PK
View Code? Open in Web Editor NEWA Python-module to provide an API to KeePass 1.x files commonly used by KeePassX.
Home Page: http://raymontag.github.com/kppy
License: ISC License
A Python-module to provide an API to KeePass 1.x files commonly used by KeePassX.
Home Page: http://raymontag.github.com/kppy
License: ISC License
I was thinking about the warning given in the readme, "the password is saved as plain text in RAM". Is it possible and not too costly to store the password encrypted in RAM and when applying it decrypt it on the fly?
KeepassX supports the creation of databases encrypted with TwoFish. I am not able to open such a db with your program.
Find out how KeePass 2.x files are structured and which features need to be implemented.
TypeError: Unicode-objects must be encoded before hashing
1224 line must be
sha.update(self.password.encode('utf-8'))
Kpc stopped working for me on Debian Jessie, and gives the following error:
Traceback (most recent call last):
File "/usr/local/bin/keepassc", line 31, in <module>
from kppy.database import KPDBv1
File "/usr/local/lib/python3.4/dist-packages/kppy/database.py", line 26, in <module>
from Crypto import Random
ImportError: No module named 'Crypto'
Python-crypto is fully updated and currently the version is 2.6.1-5.
Hi, can i use your utility with python version 2.7.x?
Now i have some error:
Traceback (most recent call last):
File "window.py", line 166, in setDatabase
self.db = KPDB(file, self.password)
File ".../kppy.py", line 474, in init
self.load()
File ".../kppy.py", line 570, in load
decrypted_content = self._cbc_decrypt(final_key, crypted_content)
File ".../kppy.py", line 1263, in _cbc_decrypt
decrypted_content = decrypted_content[:len(decrypted_content)-padding]
TypeError: unsupported operand type(s) for -: 'int' and 'str'
len(decrypted_content) - int
padding = " "
when i set padding = decrypted_content[-10], i got padding = " "
So, just set padding = int(padding) don't work
Implement the password generator feature
The documentation here shows to do from kppy import KPDB, KPError
However, from looking through the source, it looks like this should be
from kppy.exceptions import KPError
from kppy.database import KPDBv1
A few changes to the examples are necessary after changing these import statements, too.
Implement the remaining features of KeePass 2.x files.
Implement parsing of KeePass 2.x files.
iMac-TMP:mykeepassc180 joe$ virtualenv -ppython3 v
Running virtualenv with interpreter /usr/local/bin/python3
Using base prefix '/usr/local/Cellar/python/3.6.5/Frameworks/Python.framework/Versions/3.6'
New python executable in /Users/joe/Developer/mykeepassc180/v/bin/python3.6
Also creating executable in /Users/joe/Developer/mykeepassc180/v/bin/python
Installing setuptools, pip, wheel...done.
iMac-TMP:mykeepassc180 joe$ . v/bin/activate
(v) iMac-TMP:mykeepassc180 joe$ pip3 install keepassc
Collecting keepassc
Collecting kppy (from keepassc)
Collecting PyCryptodome (from keepassc)
Using cached https://files.pythonhosted.org/packages/9c/83/8f8a9e94d3cc495dd49082ac79e366b368cd10c8d25734fbcea59de93e5a/pycryptodome-3.6.1-cp36-cp36m-macosx_10_6_intel.whl
Installing collected packages: PyCryptodome, kppy, keepassc
Successfully installed PyCryptodome-3.6.1 keepassc-1.8.0 kppy-1.5.1
(v) iMac-TMP:mykeepassc180 joe$ ./v/bin/keepassc --help
Traceback (most recent call last):
File "./v/bin/keepassc", line 13, in <module>
from kppy.database import KPDBv1
File "/Users/joe/Developer/mykeepassc180/v/lib/python3.6/site-packages/kppy/database.py", line 11, in <module>
from Cryptodome import Random
ModuleNotFoundError: No module named 'Cryptodome'
(v) iMac-TMP:mykeepassc180 joe$ pip3 install pycryptodomex
Collecting pycryptodomex
Using cached https://files.pythonhosted.org/packages/11/8d/05bcf8e039e989c0dd4a645a66e5fcda873718b2ff8350c7d77c3b1f2a20/pycryptodomex-3.6.1-cp36-cp36m-macosx_10_6_intel.whl
Installing collected packages: pycryptodomex
Successfully installed pycryptodomex-3.6.1
(v) iMac-TMP:mykeepassc180 joe$ ./v/bin/keepassc --help
usage: keepassc [-h] [--asroot] [-d DATABASE] [-k KEYFILE] [-c]
[-as ADDRESS_SERVER] [-ps PORT_SERVER] [-pa PORT_AGENT] [-a]
[-dc] [-s] [-e ENTRY] [-l]
optional arguments:
-h, --help show this help message and exit
--asroot parse option to execute keepassc as root user
-d DATABASE, --database DATABASE
Path to database file.
-k KEYFILE, --keyfile KEYFILE
Path to keyfile.
-c, --curses Use curses interface while using a remote connection.
-as ADDRESS_SERVER, --address_server ADDRESS_SERVER
Server address (not required if using agent)
-ps PORT_SERVER, --port_server PORT_SERVER
Server port (not required if using agent)
-pa PORT_AGENT, --port_agent PORT_AGENT
Agent port
-a, --agent Use agent for remote connection
-dc, --direct_conn Connect directly to server
-s, --ssl Use SSL/TLS
-e ENTRY, --entry ENTRY
Print entry with parsed title You will see a password
prompt; leave it blank if you only want to use a key-
file Just type a part of the entry title lower-case,
it's case-insensitive and will search for matching
string parts WARNING: Your passwords will be displayed
directly on your command line!
-l, --log_level Set logging level for network use. Default is ERROR
but for analyzing network flow INFO could be useful.
Set it with keepassc [...] -l [...] to INFO
(v) iMac-TMP:mykeepassc180 joe$
Running # python setup.py install
gives me:
/usr/lib/python3.6/distutils/dist.py:261: UserWarning: Unknown distribution option: 'install_requires'
warnings.warn(msg)
running install
running build
running build_py
running install_lib
creating /usr/lib/python3.6/site-packages/kppy
copying build/lib/kppy/exceptions.py -> /usr/lib/python3.6/site-packages/kppy
copying build/lib/kppy/entries.py -> /usr/lib/python3.6/site-packages/kppy
copying build/lib/kppy/__init__.py -> /usr/lib/python3.6/site-packages/kppy
copying build/lib/kppy/groups.py -> /usr/lib/python3.6/site-packages/kppy
copying build/lib/kppy/database.py -> /usr/lib/python3.6/site-packages/kppy
byte-compiling /usr/lib/python3.6/site-packages/kppy/exceptions.py to exceptions.cpython-36.pyc
byte-compiling /usr/lib/python3.6/site-packages/kppy/entries.py to entries.cpython-36.pyc
byte-compiling /usr/lib/python3.6/site-packages/kppy/__init__.py to __init__.cpython-36.pyc
byte-compiling /usr/lib/python3.6/site-packages/kppy/groups.py to groups.cpython-36.pyc
byte-compiling /usr/lib/python3.6/site-packages/kppy/database.py to database.cpython-36.pyc
running install_data
creating /usr/share/doc/kppy
error: can't copy 'README': doesn't exist or not a regular file
What's up?
Implemend editing and saving of KeePass 2.x files.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.