CybrZone / phishkiller

The Unlicense
66 stars 36 forks source link

"Issue" with the password generation >.<. #20

Open Nanaleafy opened 3 days ago

Nanaleafy commented 3 days ago

Nyaaa, I want to help too.

The function "generate_random_password" will always generate a password that is eight characters long. This is really easy to detect, filter or block.

This little thingy will generate a "strong" password with a length of 8 - maximal length (20 as default) characters:

def generate_random_password(maximal_length: int = 20):
    length_list = [x for x in range(8, maximal_length + 1)]
    return ''.join(secrets.choice(string.ascii_letters + string.digits) for _ in range(secrets.choice(length_list)))

Or with the random module, for a less "strong" password, but better performance:

def generate_random_password(maximal_length: int = 20):
    return ''.join(
        random.choice(string.ascii_letters + string.digits) for _ in range(random.randint(8, maximal_length)))
lp-pinkk commented 3 days ago

another idea would be to use something like rockyou.txt randomly pick and have a function to randomally change some characters

JanEickholt commented 3 days ago

another idea would be to use something like rockyou.txt randomly pick and have a function to randomally change some characters

Already on it, implementing it in rust

lp-pinkk commented 3 days ago

Mega!