1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495 |
- # Work in progress
- enc = CryptoEngine.get() in ui/cli.py (L:940)
- is called before the db is even set !
- when priniting nodes, decrypt is first called by:
- this initializes CryptoEngine instance,
- and sets the following instance properties:
- - _callback
- - _instance
- - _keycrypted
- - _timeout
- - _cypher
- this initialization asks the user for the decryption key
- of the database.
- the action that user does called the respective db function which
- returns an ENCRYPTED STRING!,
- which is then given to decryption via nodes.py or tags.py which do the
- actual decryption on each decrypted string returned from the DB.
- for example print_node:
- initializing a _db instance, then we call _db.open()
- calling do_print(10) calls _db.getnodes([i]) at this point
- the database is still not decrypted ... e.g. _cypher is still empty
- when _db.getnodes([i]) is done node inside print_node is containing
- alot of encrypted string.
- now print_node will be called, at which point the different methods
- of node instance will decrypt their respective string:
- e.g. get_username(self) instide nodes.py:
-
- self._username -> OexYH7vT/WVpXO0ZBM93RF/l8+o8/QU8ykgDB4qY8+BxBaKylAOeJWEQ+edjpLTU\n
- enc = CryptoEngine.get()
- enc.decrypt(self._username) -> nahum.oz@gmail.com
- to see this in work:
- insert
- import ipdb; ipdb.set_trace()
- to def getnodes(self, ids) in "pwman/data/drivers/sqlite.py.
- continue to pwman3/pwman/ui/cli.py(382) self.print_node(node[0])
- and then step into this function.
- continue further into def print_node(self, node) inside pwman3/pwman/ui/cli.py,
- finally you should step into:
- node.get_username()
- # New features to implement:
- 1. Password expiry date - register password date, remind when password is about to expire.
- 2. Make new passwords according to user defined rules.
- # build the package with
- python setup.py sdist
- # upload
- python setup.py sdist upload
- # PyCrypto Alternatives:
- * http://wiki.yobi.be/wiki/PyCryptoPlus#Differences_with_pycrypto
- * http://brandon.sternefamily.net/2007/06/aes-tutorial-python-implementation/
- * puresalsa20 - not document so good
- * http://code.google.com/p/pycrypt/
- * https://github.com/trevp/tlslite/tree/master/tlslite/utils
- * seems like the best next standard, but very young:
- https://github.com/alex/cryptography
- * another salsa Alternative: www.seanet.com/~bugbee/crypto/salsa20/salsa20.pyb
-
- # for windows port: https://pypi.python.org/pypi/colorama
- # db ... https://github.com/coleifer/peewee
- http://sqlobject.org/
- http://www.sqlalchemy.org/
-
- # when developing pwman3 you might be using a debugger. if so add the following
- pre-commit hook to your .git/ :
- $ cat .git/hooks/pre-commit
- #!/bin/bash
- VAR=$(git diff --cached | grep "import ipdb; ipdb.set_trace")
- if [ ! -z "$VAR" ]; then
- echo "You've left a BREAK POINT in one of your files! Aborting commit..."
- exit 1
- fi
- exit 0
|