Skip to content

Commit 42157bc

Browse files
committed
feat: new GenMode Base64WithSymbol
This just adds an exclamation mark at the end of the password
1 parent 47eaf62 commit 42157bc

File tree

4 files changed

+11
-2
lines changed

4 files changed

+11
-2
lines changed

PassGen-Core/Engine.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ public string GeneratePass(Key key, string master)
2222
var pass = key.GenMode switch
2323
{
2424
GenMode.Base64 => hashedBytes.ToBase64(),
25+
GenMode.Base64WithSymbol => hashedBytes.ToBase64() + "!",
2526
GenMode.AlphaNum => hashedBytes.ToBase64().Replace("/", "").Replace("+", "").Replace("=", ""),
2627
_ => throw new Exception("Unexpected GenMode"),
2728
};

PassGen-Core/Models.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,5 +38,6 @@ public class Key
3838
public enum GenMode
3939
{
4040
Base64,
41+
Base64WithSymbol,
4142
AlphaNum,
4243
}

README.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,12 @@ You can still use this tool along with a regular password manager (for mobile sy
2020
- 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.
2121
- **Q: Can I have more than one key list?**
2222
- A: Yes! You can also pass in the key list name as an argument to the executable to launch the tool with that key list pre-selected and loaded. You can then create shortcuts or batch files pinned in start for each of your key lists, this would let allow you to launch the tool very quickly from Search (Win+S).
23-
- **Q: How can I customize the password generation?**
24-
- A: There is currently no UI for this, but you can edit the key file to enforce a max length of the password or to remove symbols from the password. I know, some services have unreasonable limitations on passwords, some are quite dangerous.
23+
- **Q: My password needs to be shorter, what do I do?**
24+
- A: Some services have a very small upper limit on password length (which is silly and insecure), you can edit the keylist file and add `"MaxLength": 10` (or any other number) to the relevant key, this will strip the end of the generated password so that it's no longer than the specified length.
25+
- **Q: My password isn't allowed to have symbols, what do I do?**
26+
- A: Some services don't allow symbols in passwords (which is also silly and insecure), you can edit the keylist file and add `"GenMode": "AlphaNum"` to the relevant key, this will generate a password that is Base64 encoded but with all the symbols are removed.
27+
- **Q: My password needs to have symbols, what do I do?**
28+
- A: Some services require you to add at least one symbol to the password (and for some reason they don't consider `=` to be a symbol), so as of version 1.2 you can edit the keylist file and add `"GenMode": "Base64WithSymbol"` to the relevant key, this will generate a password that is Base64 encoded and has an exclamation mark at the end (sounds unsafe, but it's those damn unreasonable password rules that are actually unsafe!).
2529
- **Q: What if I need to change my password?**
2630
- A: In you need to change to a newer password for the same service (eg: the password got leaked or the service detects suspicious logins). You can create a new key for it, or (as of version 1.2) you can edit the keylist file and add `"PasswordChanges": 1` (or any higher number) to the relevant key, this number will be concatenated to the key's label during password generation. And from now on you'll be generating a new password for that key.
2731
- **Q: How can I synchronize the key list?**

passgen-py/src/utils.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,9 @@ def generate_password(master, key):
3131
master.encode(), msg=input, digestmod=sha256).digest()
3232
hashed = base64.b64encode(hashed).decode('utf-8')
3333

34+
if key.gen_mode.lower() == 'base64withsymbol':
35+
hashed += '!'
36+
3437
if key.gen_mode.lower() == 'alphanum':
3538
hashed = ''.join([c for c in hashed if c.isalnum()])
3639

0 commit comments

Comments
 (0)