passman is a simple and secure password manager for Linux that uses Chacha20 for encryption, PBKDF2 for key generation, SHA3-256 for hashing and HMAC, and a tamper proof blockchain for logging activities. passman is meant as an example of how to design and implement a tool dealing with critical data - such as a password manager - that requires a sound choice of cryptographic primitives and a thorough evaluation of the trust chain. The following documentation covers the reasons and details behind the design and implementation choices.
As shown in the first figure below, the database contains a table of entries and a set of parameters used for key generation (iter and salt) and encryption/decryption (nonce), as well as for integrity checks (entries HMAC and HMAC). The entries HMAC contains the SHA3-256-HMAC of the table of entries before encryption, and the HMAC contains the SHA3-256-HMAC of all the fields of the database except the HMAC field (obviously!). The HMAC field is used to perform two operations: i) authentication (only possible with the master password), ii) integrity check of the database. The entries HMAC field is used to check the integrity of the table of entries after decryption.
The log is structured as shown in the figures below.
Present pseudocode of what happens for each command.
This command first starts by requesting the user to enter a master password twice. It then verifies whether the entered passwords match and
starts by creating the $HOME/.passman directory, the $HOME/.passman/db file, and the $HOME/.passman/log file.
Detail what add does!
Detail what del does!
Detail what get does!
Detail what list does!
Detail what log does!
Why is passman secure?
Key generation and management
One usage, once key.
Nonce regeneration
One usage, once nonce.
What's lacking for better security?
Simply copy the $HOME/.passman directory in a secure location such as a LUKS encrypted or hardware encrypted flash drive.