Home Upgrade Search Memberlist Extras Hacker Tools Award Goals Help Wiki Contact

C 

Why does my cracker takes time to crack more than 8 password lenght

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
#c/c++# & #asm#  

The way to patch bad code is to remove the bad code, not to add new bad code that hides the old bad code 
You could post your code and at bit of an explanation to what it does.
May you be given directions by software engineer document writers.
Could you maybe need more processing power to speed it up?
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.
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.
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;
}
(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)Pawnhub 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.
#c/c++# & #asm#  

The way to patch bad code is to remove the bad code, not to add new bad code that hides the old bad code 
(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.
(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.
(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.
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.
SRPP Discord Server

I am a professional network/cloud security architect.
My Old Tutorials
(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
#c/c++# & #asm#  

The way to patch bad code is to remove the bad code, not to add new bad code that hides the old bad code 
(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
SRPP Discord Server

I am a professional network/cloud security architect.
My Old Tutorials
Are you talking about a web cracker or what? This question has no info.
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.


Possibly Related Threads...
Thread / Author Replies Views Last Post
[Python] by AmanththonaniaJan 19, 2019 02:47 AM 2 146 Jan 19, 2019 02:47 AM
Last Post: Amanththonania
[C] by pmtobefriendJul 29, 2018 07:23 PM 3 216 Jul 29, 2018 07:23 PM
Last Post: notsteve
[C#] by BahNahNahMay 30, 2015 09:05 AM 22 1,019 May 30, 2015 09:05 AM
Last Post: Hacklinx