How many possible passwords are there for 8-100 characters?

449 Views Asked by At

Requirements/Restrictions: Minimum of 8. Maximum of 100. At least 1 letter from the latin alphabet (capitalisation doesn’t matter—g is same as G, 26 letters), at least 1 number (0-9, 10 numbers) and it may also include special characters (33 special characters/symbols).

Here’s what I did:

$26 \times 10 \times 69^6 \times 70^{92} = \\1574300283675196381393274771319731729003339411333808462\\ 6274484198008813380319383474217713060000000000000000000\\ 00000000000000000000000000000000000000000000000000000000000000000000000000$

One of the characters must be a letter (26), then another must be a number ($26 \times 10$), there are 6 spots left to reach the minimum, all the possible characters added together is $69 (= 33 + 26 + 10)$ so ($26 \times 10 \times 69^6$). Then there are 92 spots left, since they don’t have to be filled, the user has the option of leaving it blank, so now instead of 69 options, it’s 70. Hence, ($26 \times 10 \times 69^6 \times 70^{92}$).

I would appreciate it if someone confirmed whether I am correct or not.

Thank you :)

1

There are 1 best solutions below

7
On BEST ANSWER

26 alphabet characters, 10 numeric characters, 33 special characters (including blank space, which can be placed anywhere) - that’s 69 total

For an N-length password:
If there were no “at least 1” conditions, you’d have $69^N$ posibilities. Then, to satisfy “atleast 1 letter”, we need to remove all options without a letter: $(69-26)^N$. And to satisfy “at least 1 number”, we need to remove all options without a number: $(69-10)^N$.
But then we need to add back in all options without a number OR a letter, i.e., with only special characters (since we’ve removed those twice): $33^N$

So, for an N-length password, the number of possibilities is $69^N - 43^N - 59^N + 33^N$

So for the total you want the sum of each different possible length, i.e., your answer is $$\sum_{N=8}^{100}(69^N - 43^N - 59^N + 33^N)$$

Stick this in some code to calculate it nice and quickly, and you get 7784830887958863955006123907413479732322179460547538436324402442938556231147248052155742398941820197907332216822738647248662040228937662527224075073302550548119136634116724084874159040 $\approx 7.78 \times 10^{183}$ options.