CybrZone / phishkiller

The Unlicense
90 stars 41 forks source link

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

Open Nanaleafy opened 4 months ago

Nanaleafy commented 4 months 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)))
ghost commented 4 months ago

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

JanEickholt commented 4 months 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

ghost commented 4 months ago

Mega!

B1GBOOM420 commented 4 months ago

@CybrZone The "issue" has been addressed with the most recent merge - @Nanaleafy Thank you for your contribution!