Hack Forums
[C] Why does my cracker takes time to crack more than 8 password lenght - Printable Version

+- Hack Forums (https://hackforums.net)
+-- Forum: Tech (https://hackforums.net/forumdisplay.php?fid=444)
+--- Forum: Coding (https://hackforums.net/forumdisplay.php?fid=151)
+---- Forum: Software Development (https://hackforums.net/forumdisplay.php?fid=118)
+---- Thread: [C] Why does my cracker takes time to crack more than 8 password lenght (/showthread.php?tid=6095364)

Pages: Pages 1 2


Why does my cracker takes time to crack more than 8 password lenght - HiddenEyE - Jul 16, 2020

Please has anyone coded a cracker and notice that it takes time to be able to crack more than 8 password length.
Please share your experience and possible solution.
Have tried a lot of optimization to they best of my knowledge.but I think in c/c++ everything is possible.I need help.
Is for educational purposes.thanks


RE: Why does my cracker takes time to crack more than 8 password lenght - saltycracker - Jul 16, 2020

You could post your code and at bit of an explanation to what it does.


RE: Why does my cracker takes time to crack more than 8 password lenght - Vibe - Jul 16, 2020

Could you maybe need more processing power to speed it up?


RE: Why does my cracker takes time to crack more than 8 password lenght - m8than - Jul 16, 2020

Because every time you add a character the total amount of passwords to guess exponentially increases. Think about it, you are adding at least like 35 characters on top of every single previous password checked.


RE: Why does my cracker takes time to crack more than 8 password lenght - Pawnhub - Jul 16, 2020

Let's say there's 33 possible character combinations you're generating for each character you'd have 1^33 possible combinations.
if the passwords has a length of 8 you are generating 8^33 possible combinations.
if 9 it'd be 9^33'd.

9 characters all possible combinations would equal: 30,903,154,382,632,612,361,920,641,803,529
VS lets say a password with 4 characters: 73,786,976,294,838,206,464


and if the cracker is webbased, it's probably your implementation of requesting to the site and lack of multithreading or parallel processing.


RE: Why does my cracker takes time to crack more than 8 password lenght - Xora - Jul 17, 2020

I just wrote a test prog. It takes me 35 seconds to generate 1 billion 8 character passwords (28.5 million passwords per second) with 40 lines of code. It has no logic though, it just creates random passwords.

What's a good time for this type of thing?

Here's the code, BTW. Pretty shit but maybe you can improve it and use it somehow.

Code
#define var unsigned int
#define avar __declspec(align(4)) var
const char g_chars[] = { "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()_+-=" };
const avar g_char_cnt = sizeof(g_chars);
char g_buff[9];
avar a = 0x499602d2, b = 0x159a55e5, c = 0x1f123bb5, d = 0x05491333;
const var xrand()
{
    register avar t = a ^ (a << 0xb);
    a = b; b = c; c = d;
    d ^= (d >> 0x13) ^ (t ^ (t >> 0x8));
    return 1 + (t % g_char_cnt);
}
#define randchr g_chars[xrand()]
const char * rand_str()
{
    *(avar *)g_buff = ((BYTE)randchr << 24) | ((BYTE)randchr << 16) | ((BYTE)randchr << 8) | (BYTE)randchr;
    *(avar *)((avar)g_buff + sizeof(var)) = ((BYTE)randchr << 24) | ((BYTE)randchr << 16) | ((BYTE)randchr << 8)
        | (BYTE)randchr;
    return g_buff;
}
#define zero(x) memset(&x, 0, sizeof(x))
#define zeroa(x) memset(&x, 0, sizeof(x) / sizeof(*x))
const avar g_maxpwd = 1000000000;
int main()
{
    LARGE_INTEGER f, s, e, el; zero(f); zero(s); zero(e); zero(el);
    zeroa(g_buff);
    QueryPerformanceFrequency(&f);
    const HANDLE thisthr = GetCurrentThread();
    avar oldpr = GetThreadPriority(thisthr);
    SetThreadPriority(thisthr, THREAD_PRIORITY_TIME_CRITICAL);
    QueryPerformanceCounter(&s);
    for(register avar i = 0; i < g_maxpwd; ++i)
    {
        rand_str();
    }
    QueryPerformanceCounter(&e);
    SetThreadPriority(thisthr, oldpr);
    el.QuadPart = e.QuadPart - s.QuadPart;
    el.QuadPart *= 1000000000;
    el.QuadPart /= f.QuadPart;
    const DOUBLE sec = (DOUBLE)el.QuadPart / 1000000000.0;
    const DOUBLE gps = g_maxpwd / sec;
    printf("generated %d 8 character passwords in:\n\t%lld nanoseconds,\n\t%.1f seconds,\n\t%.1f passwords/second", g_maxpwd,
           el.QuadPart, sec, gps);
    getchar();
    return 0;
}



RE: Why does my cracker takes time to crack more than 8 password lenght - HiddenEyE - Jul 17, 2020

(Jul 17, 2020 01:04 AM)Xora Wrote:  I just wrote a test prog. It takes me 35 seconds to generate 1 billion 8 character passwords (28.5 million passwords per second) with 40 lines of code. It has no logic though, it just creates random passwords.

What's a good time for this type of thing?

Here's the code, BTW. Pretty shit but maybe you can improve it and use it somehow.

Code
#define var unsigned int
#define avar __declspec(align(4)) var
const char g_chars[] = { "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()_+-=" };
const avar g_char_cnt = sizeof(g_chars);
char g_buff[9];
avar a = 0x499602d2, b = 0x159a55e5, c = 0x1f123bb5, d = 0x05491333;
const var xrand()
{
register avar t = a ^ (a << 0xb);
a = b; b = c; c = d;
d ^= (d >> 0x13) ^ (t ^ (t >> 0x8));
return 1 + (t % g_char_cnt);
}
#define randchr g_chars[xrand()]
const char * rand_str()
{
*(avar *)g_buff = ((BYTE)randchr << 24) | ((BYTE)randchr << 16) | ((BYTE)randchr << 8) | (BYTE)randchr;
*(avar *)((avar)g_buff + sizeof(var)) = ((BYTE)randchr << 24) | ((BYTE)randchr << 16) | ((BYTE)randchr << 8)
| (BYTE)randchr;
return g_buff;
}
#define zero(x) memset(&x, 0, sizeof(x))
#define zeroa(x) memset(&x, 0, sizeof(x) / sizeof(*x))
const avar g_maxpwd = 1000000000;
int main()
{
LARGE_INTEGER f, s, e, el; zero(f); zero(s); zero(e); zero(el);
zeroa(g_buff);
QueryPerformanceFrequency(&f);
const HANDLE thisthr = GetCurrentThread();
avar oldpr = GetThreadPriority(thisthr);
SetThreadPriority(thisthr, THREAD_PRIORITY_TIME_CRITICAL);
QueryPerformanceCounter(&s);
for(register avar i = 0; i < g_maxpwd; ++i)
{
rand_str();
}
QueryPerformanceCounter(&e);
SetThreadPriority(thisthr, oldpr);
el.QuadPart = e.QuadPart - s.QuadPart;
el.QuadPart *= 1000000000;
el.QuadPart /= f.QuadPart;
const DOUBLE sec = (DOUBLE)el.QuadPart / 1000000000.0;
const DOUBLE gps = g_maxpwd / sec;
printf("generated %d 8 character passwords in:\n\t%lld nanoseconds,\n\t%.1f seconds,\n\t%.1f passwords/second", g_maxpwd,
  el.QuadPart, sec, gps);
getchar();
return 0;
}
Pm you now mate


(Jul 16, 2020 11:20 AM)m8than Wrote:  Because every time you add a character the total amount of passwords to guess exponentially increases. Think about it, you are adding at least like 35 characters on top of every single previous password checked.

Yes mate Crackers grows exponentially.
The question is that how can one reduce the huge time interval involve in cracking like 24 password length.


(Jul 16, 2020 10:30 PM)UnknownPawn Wrote:  Let's say there's 33 possible character combinations you're generating for each character you'd have 1^33 possible combinations.
if the passwords has a length of 8 you are generating 8^33 possible combinations.
if 9 it'd be 9^33'd.

9 characters all possible combinations would equal: 30,903,154,382,632,612,361,920,641,803,529
VS lets say a password with 4 characters: 73,786,976,294,838,206,464


and if the cracker is webbased, it's probably your implementation of requesting to the site and lack of multithreading or parallel processing.

Yes I know mate. I need method being used by others in reducing the time interval.


RE: Why does my cracker takes time to crack more than 8 password lenght - m8than - Jul 17, 2020

(Jul 17, 2020 03:33 AM)HiddenEyE Wrote:  Pm you now mate



Yes mate Crackers grows exponentially.
The question is that how can one reduce the huge time interval involve in cracking like 24 password length.



Yes I know mate. I need method being used by others in reducing the time interval.

I mean you can just do micro optimisations, every little counts but bruteforcing a long password is probably impossible for modern computers.


RE: Why does my cracker takes time to crack more than 8 password lenght - Xora - Jul 18, 2020

(Jul 17, 2020 03:33 AM)HiddenEyE Wrote:  Pm you now mate

Unfortunately, mate, it seems I am not l33t enough to figure out how to generate all possible combinations using a list of characters, so I can only help you if you (with optimizing the code) or someone else provides me with a clear code that demonstrates how to do it and does not use any STL or some other external library.


RE: Why does my cracker takes time to crack more than 8 password lenght - Pernat1y - Jul 20, 2020

(Jul 17, 2020 03:33 AM)HiddenEyE Wrote:  The question is that how can one reduce the huge time interval involve in cracking like 24 password length.
Get quantum computer. It helps.


RE: Why does my cracker takes time to crack more than 8 password lenght - Goodies - Jul 20, 2020

1 character is 128
2 characters is 128*128
3 characters is 128*128*128

etc...

so it's just 128**n where n=the number of characters.

Every additional character is 2 orders of magnitude greater in terms of average time taken to crack.


RE: Why does my cracker takes time to crack more than 8 password lenght - HiddenEyE - Jul 21, 2020

(Jul 20, 2020 03:35 PM)Goodies Wrote:  1 character is 128
2 characters is 128*128
3 characters is 128*128*128

etc...

so it's just 128**n where n=the number of characters.

Every additional character is 2 orders of magnitude greater in terms of average time taken to crack.
What are they work around for reducing time spent in cracking 24 password lenght


RE: Why does my cracker takes time to crack more than 8 password lenght - Goodies - Jul 21, 2020

(Jul 21, 2020 01:29 AM)HiddenEyE Wrote:  What are they work around for reducing time spent in cracking 24 password lenght

Rainbowtables are the most efficient way of searching for previously cracked passwords, far more efficient than hashing/checking


RE: Why does my cracker takes time to crack more than 8 password lenght - iolaka - Jul 24, 2020

Are you talking about a web cracker or what? This question has no info.


RE: Why does my cracker takes time to crack more than 8 password lenght - Laggy - Jul 28, 2020

I'd assume you either need a more powerful computer or more efficient code. Every time you add another character to a string, it becomes exponentially more difficult to crack, hence why having a password of length 10 that consists of purely random characters is the strongest you can have, it'd take far too long for any brute force to crack.