A generic, super-slim password locker for the console written in Python3. It supports a few different commands (list, add, edit, delete - see pwl -h
) and stores all data within an AES blob (EAX mode).
Why did you write this? What's wrong with keepassx or pass?
...
* Python 3.11
* argparse
* base64
* os
* secrets
* subprocess
* time
pycryptodome (https://www.pycryptodome.org/en/latest/)
* Cryptodome.Cipher
* Cryptodome.Random
Note: pycryptodome
can be dropped or overwritten during various python3 upgrades or when using pyenv
. If you experience any errors about python3 not being able to find objects under the Cryptodome
module, you should 1) double-check that pycryptodome
is correctly installed for python3 and 2) that it is not conflicting with older modules like pycrypto
or crypto
. This may involve uninstalling any older, conflicting modules and then uninstalling and re-installing pycryptodome
.
git clone https://github.com/sbassett29/PWL.git
pip install pycryptodome
(if you haven't already)- Set
self.pwl_file_name
on line 23 to a valid file name. You can runpwl -n
for some suggestions. - You'll want to select a random key to use to enc/dec the AES file that
pwl
creates. You can runpwl -k
for some suggestions (base64-encoded random byte strings.) DON'T LOSE THIS KEY, OBVIOUSLY! You'll be prompted for it any time you wish to read/write data. - Run
pwl -h
for help and options.
There are a few options, set in the constructor for now (will probably turn into env vars at some point):
pwl_length
- must be 16 for nowpwl_file_name
- full path of the encrypted file where all data will be storedterminal_width
- must be 120 for nowcol_one_width
- must be 28 for nowcol_two_width
- must be 28 for nowcol_three_width
- must be 60 for nowenc_dec_key
- default, unusable valueenc_dec_length
- must be 16 for nowencoding
- utf8 pleaseclear_list_time
- optional time to clear screen afterpwl -l
, set to 0 or less for more dangerclear_list_cmd
- whatever you use to clear your term, default is based upon macos terminal
Again, see pwl -h
. But basically, pwl -l
displays the password data to the terminal, pwl -a
and pwl -e {#}
add and edit data via a few prompts. And pwl -d {#}
will delete an item, forever. Oh, you'll probably want to alias the pwl
file so you don't have to prepend "./" or whatever every time.
We use SemVer for versioning. For the versions available, see the tags on this repository.
- The current data delimiter (|||) isn't great and should be changed or made configurable. Or just use JSON or YAML :)
- All of the screen settings (widths, etc) are fixed. This may or may not change.
- Really only tested under MacOS (Mojave 10.14.3) at the moment.
- Scott Bassett - Initial work - sbassett29
This project is licensed under the CC0 License - see the LICENSE file for details.