Probability of guessing a password

  • Thread starter alman9898
  • Start date
  • Tags
    Probability
In summary, the conversation discusses a simple password scheme using only two lowercase letters and the probability that a hacker will successfully guess the password in five attempts. The correct solution is to compute the odds that the hacker will fail and then subtract that from 1 to find the probability of success. This can be done by assuming independent attempts and taking into account the number of possible passwords and the number of attempts allowed.
  • #1
alman9898
10
0

Homework Statement


Consider a simple password scheme using only two lowercase letters. A hacker is given 5 chances to guess the pw before being detected. Computer probability hacker is successful.


Homework Equations


p = 1/(26*26)


The Attempt at a Solution



I'm assuming the hacker isn't guessing randomly, but without replacement.

I feel that I may be multiplying the wrong probabilities, but what the heck:

P(attacker is successful) = [tex]\frac{1}{26^{2}} + \frac{1}{26^{2}*(26^{2}-1)} + \frac{1}{26^{2}*(26^{2}-1)*(26^{2}-2)} + \frac{1}{26^{2}*(26^{2}-1)*(26^{2}-2)*(26^{2}-3)} + \frac{1}{26^{2}*(26^{2}-1)*(26^{2}-2)*(26^{2}-3)*(26^{2}-4)}[/tex]

This was an intuitive guess, since each guess is equally likely, I just subtract one from the sample space for each of the five guesses.
 
Physics news on Phys.org
  • #2
There are 26*26 possible passwords. Only one of them is correct. The hacker gets 5 chances. So, yes, the hacker will pick 5 different possibilities of that group of 26*26 passwords. You are way overthinking this problem.
 
  • #3
Wait, what? I don't think 5/(26*26) would be the right answer, since that implies there is a 5 in 26^2 chance that they get the answer right on the first try...

My teacher has since told me to assume the attempts are independent (dumb hacker, I guess) so I'm modeling this as a geometric distribution with p = 1/(26*26). The total probability will be the probability hacker is successful in one try, two tries, three, four, or five tries all summed up. Does that sound right?
 
  • #4
alman9898 said:
Wait, what? I don't think 5/(26*26) would be the right answer, since that implies there is a 5 in 26^2 chance that they get the answer right on the first try...

My teacher has since told me to assume the attempts are independent (dumb hacker, I guess) so I'm modeling this as a geometric distribution with p = 1/(26*26). The total probability will be the probability hacker is successful in one try, two tries, three, four, or five tries all summed up. Does that sound right?

Or do you actually mean the tries are TRULY independent? I.e. he forgets which passwords he's tried before? Oh, I'll bet you do, sorry. Then you can treat the problem more easily by computing the odds the hacker will fail. He needs to guess the wrong password five times in a row.
 
  • #5
For this problem, the wisest way to go about it is the way that you said. Think about it this way. If it is independent and the hacker may or may not retry the same password. One must compute the odds that the hacker will get it right on his first try. That means 1/(26*26). Once we get this we multiply this by five. That will give you the correct answer.
 

Related to Probability of guessing a password

1. What is the probability of guessing a password with only numbers?

The probability of guessing a password with only numbers depends on the length of the password and the number of possible numbers used. For example, if the password is 4 digits long and only uses numbers 0-9, the probability would be 1 in 10,000 (0.01%). However, if the password is 8 digits long and uses numbers 0-9, the probability would be 1 in 100 million (0.0000001%).

2. Does using special characters in a password make it harder to guess?

Yes, using special characters in a password can make it harder to guess. This is because it increases the number of possible combinations and therefore decreases the probability of guessing the correct password. For example, a password with only lowercase letters has 26 possible characters per position, while a password with lowercase letters, uppercase letters, numbers, and special characters has over 90 possible characters per position.

3. Can the probability of guessing a password be calculated?

Yes, the probability of guessing a password can be calculated by taking into account the length of the password, the number of possible characters used, and the number of possible combinations. However, it is important to note that this calculation only provides an estimate and does not guarantee that the password can be guessed with a certain number of attempts.

4. How does the use of a password manager affect the probability of guessing a password?

Using a password manager does not affect the probability of guessing a password as the manager generates and stores strong, unique passwords for each account. However, it is important to use a strong master password to protect the password manager itself.

5. Can a randomly generated password be guessed?

Technically, yes, a randomly generated password can be guessed. However, the probability of guessing a truly random password is extremely low. For example, a password generator with 12 characters using uppercase letters, lowercase letters, numbers, and special characters would have a probability of 1 in 95^12 (0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000

Similar threads

  • Precalculus Mathematics Homework Help
Replies
7
Views
852
  • Precalculus Mathematics Homework Help
Replies
8
Views
1K
Replies
12
Views
640
  • Precalculus Mathematics Homework Help
Replies
1
Views
1K
  • Precalculus Mathematics Homework Help
Replies
6
Views
1K
  • Precalculus Mathematics Homework Help
Replies
12
Views
1K
  • Set Theory, Logic, Probability, Statistics
Replies
5
Views
1K
  • Set Theory, Logic, Probability, Statistics
Replies
1
Views
737
  • Precalculus Mathematics Homework Help
Replies
19
Views
3K
  • Precalculus Mathematics Homework Help
Replies
2
Views
1K
Back
Top