pwManager icon indicating copy to clipboard operation
pwManager copied to clipboard

Simplified hash_maker.py alphabet

Open scaldings opened this issue 4 years ago • 7 comments

scaldings avatar Nov 16 '20 11:11 scaldings

You coud have added the other methods of string in the ALPHABET variable, it would give something like this:

ALPHABET = (string.ascii_letters, string.digits, string.punctuation)

nexxusss avatar Nov 16 '20 13:11 nexxusss

Ironically enough this actually saves on memory, albeit negligible.

Either way, much more pythonic. Good catch @scaldings and I agree @YoungMind44 with the use of the other constants in the string module.

You coud have added the other methods of string in the ALPHABET variable, it would give something like this:

ALPHABET = (string.ascii_letters, string.digits, string.punctuation)

HacDan avatar Nov 17 '20 02:11 HacDan

Wouldn't changing the length of ALPHABET from 4 to 3 change the probability of each character ending up in the password? Because of the conditional probability that is. Now (and originally with ALPHABET being 4 long), the character "1" has a higher probability of ending up in the password than "a", and therefore there would be more numbers than letters in the password. In that case, wouldn't the passwords be easier to crack? Would it be better if it was ALPHABET = string.ascii_letters, + string.digits + string.punctuation? This way each and every character has the same probability of being selected

runarmod avatar Dec 20 '20 18:12 runarmod

I tried to run this Password manager on a Raspberry Pi 4 machine using python 3.7.3 and the terminal giving me this error:

Traceback (most recent call last): Files "password_mananger.py", line 2, in from secret import get_secret_key ImportError: No module named secret

Any idea about this??

aakinpatel avatar Feb 25 '21 17:02 aakinpatel

@aakinpatel This is to be expected. This script requires a file that wasn't included in the repository, which is secret.py

You could make this file yourself, and it would look something like this

def get_secret_key():
  return "Your Secret Key"

HacDan avatar Feb 25 '21 18:02 HacDan

@HacDan Thank you for the help!

By any chance do you know how to fix this error:-

from modules.encryption import DataManip ModuleNotFoundError: No module named 'modules.encryption'; 'modules' is not a package

aakinpatel avatar Mar 07 '21 07:03 aakinpatel

@aakinpatel In an effort not to muddy this up further, please open an issue if you're still experiencing this.

HacDan avatar Oct 14 '21 15:10 HacDan