Jump to content
  • Advertisement
Sign in to follow this  
vNeeki

Predict possible password combinations?

This topic is 2766 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I want to make an application that will predict all possible password combinations using
a character list and then i could use those passwords for my imaginary software.

The registration form should have a field of this form:

[A - Z ,a - z, 0 - 9]
[Client ID hash]

But i can't figure out how to generate every possible combination for the product key
since each product key will have 32character key of this form:
AFPjgnalqptoy295GJYPQTIBZLAPOGIJ91

So how would i go about generating 32char versions of this character table with every
possible combination ?

char chars[]={
'a','b','c','d','e','f','g','h','i','j',
'k','l','m','n','o','p','q','r','s','t',
'u','v','w','x','y','z','A','B','C','D','E',
'F','G','H','I','J','K','L','M','N','O',
'P','Q','R','S','T','U','V','W','X','Y','Z',
'0','1','2','3','4','5','6','7','8','9'
};


Thanks for any help.

Share this post


Link to post
Share on other sites
Advertisement
Given that there are approximately 2.2 x 10^57 possible permutations, I don't think you really want to do that. (EDIT: corrected from previous overestimate...)

Share this post


Link to post
Share on other sites
Quote:
Original post by Kylotan
Given that there are approximately 2.2 x 10^57 possible permutations, I don't think you really want to do that. (EDIT: corrected from previous overestimate...)


Then what if i split it to 8x4 fields?Like so:
[1234] [1234] [1234] [1234] [1234] [1234] [1234] [1234]

Then i could make multiple versions of each field.

If anyone could show me the idea behind this , i will customize the code for my needs.

Share this post


Link to post
Share on other sites
#include <iostream>

const char chars[]={
'a','b','c','d','e','f','g','h','i','j',
'k','l','m','n','o','p','q','r','s','t',
'u','v','w','x','y','z','A','B','C','D','E',
'F','G','H','I','J','K','L','M','N','O',
'P','Q','R','S','T','U','V','W','X','Y','Z',
'0','1','2','3','4','5','6','7','8','9'
};

void generate(char *s, int length, int n_chars_already_assigned) {
if (n_chars_already_assigned == length) {
s[length] = '\0';
std::cout << s << '\n';
}
else {
for (int i=0; i<sizeof(chars); ++i) {
s[n_chars_already_assigned] = chars;
generate(s, length, n_chars_already_assigned + 1);
}
}
}

int main() {
char s[33];
generate(s,32,0);
}




Enjoy!

Share this post


Link to post
Share on other sites
Quote:
Original post by vNeeki
If anyone could show me the idea behind this , i will customize the code for my needs.


I think you're not grasping how large the combination space is here. To put it another way, there are vastly more combinations of those letters than there have been seconds since the universe was created. Running a program to generate the combinations will both take you thousands(millions/billions?) of years and exhaust any possible storage you have.

What are you actually trying to do? I guarantee that there is a better way to solve it.

-me

Share this post


Link to post
Share on other sites
Quote:
Original post by vNeeki
The registration form should have a field of this form ...
But i can't figure out how to generate every possible combination for the product key...
So how would i go about generating [it] with every possible combination ?

Although it seems you don't grasp how long this will take to exhaust the search space, I'm comforted that it appears to be a good thing.

Share this post


Link to post
Share on other sites
You talk about 'product key' a lot, and trying to generate all possibilities?

...Are you trying to bruteforce product keys for a game so that you can get it for free? O_o

Share this post


Link to post
Share on other sites
Quote:
Original post by braindigitalis
You talk about 'product key' a lot, and trying to generate all possibilities?

...Are you trying to bruteforce product keys for a game so that you can get it for free? O_o


Well if he is, it will be his great great grandchildren who get to play it! :D

Share this post


Link to post
Share on other sites
How can you get all combination of numbers between 0 and 100 inclusive? Exactly: You start at 0, and then increment by one and repeat that, up to 100.

With strings it is basically the same. Just the numeric base has changed:

Assume A, B, and C are allowed:

AA
AB
AC
BA
BB
BC
CA
CB
CC


And if you have just 26 small letters, 26 capital, and digits 0-9, then the number of permutations for just a 10 character password is (26+26+10)^10==62^10==839,299,365,868,340,224. That is, 839,299,365,868 million, meaning 839,299,366 billion.

Really, get a rainbow table, but forget any cracker attempt using brute force search. You don't have that much computation power. Only Chuck Norris and Steven Segal have.

edit: You may find this interesting.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!