dhondta/python-tinyscript

Password length is always 10

IXEguy opened this issue · 2 comments

IXEguy commented

I'm using the following regex: ^[0-9QWERTYUqwertyu@]{11,15} and it seems to work per regexr.

However, in the pdf password script, whenever I run a len(p) inside the for loop for pypdf, it always returns 10. I've bumped up the starting length from 11 to 12 and it still returns 10.

I even added a counter and let it run over the weekend & so far it is at [INFO] Length: 10 | Passwords attempted: 16401000

Am doing something wrong?

Hi @IXEguy
You can set this through the max_repeat parameter, which is set to 10 by default. See the documentation of the function :

>>> help(re.strings)
Help on function strings in module tinyscript.preimports.regex:

strings(regex, max_repeat=10, any_set=None)
    Generate all possible strings from a regex pattern.

Note that this parameter is mostly important for limiting the string generation from the regular expression when a wildcard is used. A possibility could be to adapt the logic so that your upper bound 15 automatically updates the max_repeat parameter. I will look into this and let you know.