Code Cracking

  • Thread starter Raza
  • Start date
  • #1
203
0
Hi,
I have recently cracked a password for a zip file using brute force which got me thinking. Lets say that the password is only 3 digits, how many outcome could it possibly have?
I know it's 999 but is there a equation that I can use to figure this out?
or lets say that it contains only 3 alphabets, how many outcome could it possibly have, or lets say that the password's length is three characters and it could have either alphabets or numbers, what are the possible outcome?

Please give me brief explanation and some equation.

Thanks
 

Answers and Replies

  • #2
107
1
in general, if you have a items with b places to but them, the number of outcomes is a^b.

for 3 digits there are actually 10^3= 1000 different choices (which can easily be seen by considering it is 000=choice 1, 001 = choice 2,...999= choice 1000).

if a password is 3 characters and can have alphabets or numbers, it is (26+10)^3.

these questions become harder if you start putting restrictions on order.
 
  • #3
berkeman
Mentor
60,919
11,305
For each position, you know how many possible options there are, so you just multiply out to get the total number of possible results.

Like, if you have a single number position, and you are working in base 10, then there are 10 possible results, 0-9.

If you have a 2-digit number, then each position (the 1's postion and the 10's position) has 10 possibilities, so you get a total of 10 * 10 = 100 possible results (0-99).

If you have a capital character position, A-Z, that position has 26 possible outcomes. Two capital letter positions have 26 * 26 possible outcomes, etc.

So as a final example, in California, the standard license plates are formatted like this:

<1 number> <3 chars> <3 numbers>

So the total number of possible plates in that format would be 10 * 26^3 * 10^3.

Makes sense?


EDIT -- matticus beat me to it!
 
  • #4
203
0
Thanks, I got it.
It's simply amazing how math works.
Right now, I am cracking another zip password, which is 12 characters, alphabets and numbers, so it would be (10+26)12,right?
 
  • #5
berkeman
Mentor
60,919
11,305
Thanks, I got it.
It's simply amazing how math works.
Right now, I am cracking another zip password, which is 12 characters, alphabets and numbers, so it would be (10+26)12,right?

So now you're asking for help hacking passwords.... :rolleyes:

No, sorry, your answer is all wrong. It should be the two's-complement of that number to be correct. :bugeye:
 
  • #6
CRGreathouse
Science Advisor
Homework Helper
2,824
0
Right now, I am cracking another zip password, which is 12 characters, alphabets and numbers, so it would be (10+26)12,right?

36^12 if all letters are known to be lowercase (or case-insensitive); 62^12 if letters can be of any case.
 

Related Threads on Code Cracking

  • Last Post
Replies
3
Views
13K
  • Last Post
Replies
9
Views
2K
  • Last Post
Replies
10
Views
1K
  • Last Post
Replies
1
Views
4K
Replies
24
Views
12K
  • Last Post
Replies
1
Views
2K
  • Last Post
Replies
1
Views
1K
Replies
2
Views
587
Replies
4
Views
2K
  • Last Post
Replies
9
Views
2K
Top