Skip to content

Commit 70e0187

Browse files
committed
passgen-py: made the labels case-sensitive
incremented keylist version to 2 also updated project readme to mention the python version
1 parent eb28818 commit 70e0187

File tree

5 files changed

+44
-19
lines changed

5 files changed

+44
-19
lines changed

README.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@ I then added some convenience features, like storing the list of keys which is d
1111

1212
You can still use this tool along with a regular password manager (for mobile sync), it would replace the manager's random password generation, and you would still get the benefit of always having access to your passwords regardless of the manager's availability.
1313

14+
## Download
15+
- Windows: Check [Releases Page](https://github.com/hassanselim0/PassGen/releases/latest)
16+
- Linux/MacOS: `pip install passgen-py`
17+
1418
## FAQ
1519
- **Q: Isn't storing a hash of the master password a bad idea?**
1620
- A: It's the old security vs convenience balance, also the hash is generated using salted PBKDF2 HMAC-SHA256 (in v2 keylists). However I do intend to add the ability to disable that convenience.
@@ -25,7 +29,7 @@ You can still use this tool along with a regular password manager (for mobile sy
2529
- **Q: Android Version?**
2630
- A: I initially wanted to build an Android version for this tool, but I gave up and used a password manager for the few passwords that I use on my phone, feel free to build your own and ping me.
2731
- **Q: Linux Version?**
28-
- A: I do have a very rough python script that reads the keylist file and generates passwords, but it obviously lacks a lot of convenience features. I might add it to this repo or as a gist.
32+
- A: Yes! Thanks to @mariamrf there is now a Python CLI version of PassGen that can run anywhere where Python runs!
2933
- **Q: This code is ugly and doesn't use MVVM!**
3034
- A: This is a hobby-project initially made for personal use, very few hours were put into the first version of this.
3135
- **Q: I don't see a value in this tool.**

passgen-py/setup.py

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
from setuptools import setup, find_packages
22

33
setup(
4-
name = 'passgen-py',
5-
packages = find_packages(),
6-
version = '0.1.1',
7-
description = 'Generate Passwords Deterministically based on a Master Password.',
8-
classifiers = [
9-
'Development Status :: 3 - Alpha',
10-
'License :: OSI Approved :: MIT License',
11-
'Programming Language :: Python :: 3'
12-
],
13-
python_requires='>=3.6, <4',
14-
entry_points={
4+
name='passgen-py',
5+
packages=find_packages(),
6+
version='1.1',
7+
description='Generate Passwords Deterministically based on a Master Password.',
8+
classifiers=[
9+
'Development Status :: 3 - Alpha',
10+
'License :: OSI Approved :: MIT License',
11+
'Programming Language :: Python :: 3'
12+
],
13+
python_requires='>=3.6, <4',
14+
entry_points={
1515
'console_scripts': [
1616
'passgen=src:cli',
1717
],

passgen-py/src/__init__.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ def init(master_password, iter_count, keylist_path):
3939
'-p', '--master-password',
4040
prompt=True, hide_input=True, type=str)
4141
@click.option(
42-
'-l', '--label', help='Case-insensitive label for passwords.',
42+
'-l', '--label', help='Case-sensitive label for passwords.',
4343
prompt=True)
4444
@click.option(
4545
'-kp', '--keylist-path',
@@ -49,7 +49,6 @@ def generate(master_password, label, keylist_path):
4949
keylist = utils.load_keylist(keylist_path)
5050
abort_if_incorrect_master(master_password, keylist, keylist_path)
5151

52-
label = label.lower()
5352
key = keylist.get_key(label)
5453
if key is None:
5554
max_length = click.prompt('Max Length', type=int, default=-1)
@@ -72,7 +71,7 @@ def generate(master_password, label, keylist_path):
7271
'-p', '--master-password',
7372
prompt=True, hide_input=True, type=str)
7473
@click.option(
75-
'-l', '--label', help='Case-insensitive label for passwords.',
74+
'-l', '--label', help='Case-sensitive label for passwords.',
7675
prompt=True)
7776
@click.option(
7877
'-kp', '--keylist-path',
@@ -83,8 +82,6 @@ def reset(ctx, master_password, label, keylist_path):
8382
keylist = utils.load_keylist(keylist_path)
8483
abort_if_incorrect_master(master_password, keylist, keylist_path)
8584

86-
label = label.lower()
87-
8885
keylist.remove_key(label)
8986
utils.save_keylist(keylist_path, keylist)
9087
ctx.invoke(generate, master_password, label, keylist_path)

passgen-py/src/models.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33

44
class KeyList:
5-
def __init__(self, master, keys=[], version=1):
5+
def __init__(self, master, keys=[], version=2):
66
self.master = master
77
self.version = version
88
self.keys = keys
Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,25 @@
1-
{"Master": {"Hash": "iW1VFYWsCf20F9uCVKy+xiZg3Dx9+U6vhZcdaPLcHgw=", "Salt": "SWM4psr0po5UVU+eGBTgJ2D406hAQ3a1NxOCILXd7/s=", "IterCount": 1000}, "Version": 1, "Keys": [{"Label": "somelabel", "GenMode": "Base64", "MaxLength": 5}, {"Label": "anotherlabel", "GenMode": "Base64", "MaxLength": null}, {"Label": "onemorelabel", "GenMode": "AlphaNum", "MaxLength": null}]}
1+
{
2+
"Master": {
3+
"Hash": "iW1VFYWsCf20F9uCVKy+xiZg3Dx9+U6vhZcdaPLcHgw=",
4+
"Salt": "SWM4psr0po5UVU+eGBTgJ2D406hAQ3a1NxOCILXd7/s=",
5+
"IterCount": 1000
6+
},
7+
"Version": 2,
8+
"Keys": [
9+
{
10+
"Label": "somelabel",
11+
"GenMode": "Base64",
12+
"MaxLength": 5
13+
},
14+
{
15+
"Label": "anotherlabel",
16+
"GenMode": "Base64",
17+
"MaxLength": null
18+
},
19+
{
20+
"Label": "onemorelabel",
21+
"GenMode": "AlphaNum",
22+
"MaxLength": null
23+
}
24+
]
25+
}

0 commit comments

Comments
 (0)