Welcome to the new Woodmann RCE Messageboards Regroupment
Please be patient while the rest of the site is restored.

To all Members of the old RCE Forums:
In order to log in, it will be necessary to reset your forum login password ("I forgot my password") using the original email address you registered with. You will be sent an email with a link to reset your password for that member account.

The old vBulletin forum was converted to phpBB format, requiring the passwords to be reset. If this is a problem for some because of a forgotten email address, please feel free to re-register with a new username. We are happy to welcome old and new members back to the forums! Thanks.

All new accounts are manually activated before you can post. Any questions can be PM'ed to Kayaker.

Delphi RNG reversing

To discuss DES MD5 El-Gamal RSA PGP and others....
User avatar
LaptoniC
Senior Member
Posts: 199
Joined: Fri Oct 27, 2000 9:35 am
Location: Turkey
Contact:

Post by LaptoniC »

As I said in earlier post this program uses QueryPerformanceCounter for initial seed. However I didn't get what you mean by
If that's the case, then your keyspace just dropped dramatically.
How we can predict the result of QueryPerformanceCounter? Could you elaborate on this topic?
"There is only one road to human greatness: through the school of hard knocks." Albert Einstein
FrankRizzo
Posts: 359
Joined: Sat Nov 27, 2004 7:43 pm
Contact:

Post by FrankRizzo »

What I was saying was that if they use the value of Query... for range limiting the acceptable values, and that value is LOW, then that limits the range of the random numbers, and might reduce the area you have to search.
User avatar
LaptoniC
Senior Member
Posts: 199
Joined: Fri Oct 27, 2000 9:35 am
Location: Turkey
Contact:

Post by LaptoniC »

I want to know what is predictable the range of QueryPerformanceCounter if you know. I didn't come up with any predictable range. That is why I am searching 0-FFFFFFFFh range. Another problem is we also don't know how many times author generated big number. Each generation also affects RandomSeed. However, I am open to new ideas always.
"There is only one road to human greatness: through the school of hard knocks." Albert Einstein
ShyKittten

Recca ?

Post by ShyKittten »

Why do you search the next prime number ?

prime(M) + b = M with M the 1st random number and b a small number
prime(N) + c = N with N the 2nd random number and c a small number

So :
- choose a seed
- compute M and N
- if (M*N - P) is small enough, you probably find the seed (with P = prime(M)*prime(N)), In other words : Take the most significant 32 bits of N and M, multiply, if the result is close to the most significant bits of P, take the next 32 bits of N and M, multiply...

Bruteforce would be easy...
User avatar
LaptoniC
Senior Member
Posts: 199
Joined: Fri Oct 27, 2000 9:35 am
Location: Turkey
Contact:

Post by LaptoniC »

What is the relation between M, N and P?
Program generates P and Q (primes of RSA) by using Random function and searching next prime like this

Code: Select all

P=Random(Seed)
P=FindNextPrime(P)
Q=Random(Seed)
Q=FindNextPrime(Q)
N=P*Q
The idea is if we can find fast method to find IsPrime function we can speed up searching. Because if we can recover the seed either seed of P or seed of Q we will find the prime numbers. Other than that I didn't get what you mean by M and N. drizz's code is very detailed and fast but I abandoned the project until I get my new computer.
"There is only one road to human greatness: through the school of hard knocks." Albert Einstein
ShyKittten

Post by ShyKittten »

In my previous post : P = M*N.

You say :

Code: Select all

P=Random(Seed)
P=FindNextPrime(P)
Q=Random(Seed)
Q=FindNextPrime(Q)
N=P*Q
My idea :

Code: Select all

P'=Random(Seed)
Q'=Random(Seed)
N'=P'*Q'
if(|N'-N| small enough)
{
       P=FindNextPrime(P')
       Q=FindNextPrime(Q')
       if(N==P*Q)
       {
              Correct Seed !
       }
}

I use it to break RSA-1024 with similar weak RNG (<1h to check all the 32-bits values).
User avatar
LaptoniC
Senior Member
Posts: 199
Joined: Fri Oct 27, 2000 9:35 am
Location: Turkey
Contact:

Post by LaptoniC »

What is that small enough number? I have searched prime gaps and found that biggest gap is 4724 for 75 digits so theoretically that number will be 4724^2= 22316176 ( http://www.trnicely.net/gaps/g4k.html ) is this info true or it is lower than that?
"There is only one road to human greatness: through the school of hard knocks." Albert Einstein
ShyKittten

Post by ShyKittten »

http://en.wikipedia.org/wiki/Prime_gap#Conjectures_about_gaps_between_primes
g(pn) = O((ln pn)^2)
If P and Q were independents, you would choose the gap carefully,
But, here, P and Q are linked together by the seed so few (P',Q') (and probably only 1) will pass the test even if you choose a too big gap...
User avatar
LaptoniC
Senior Member
Posts: 199
Joined: Fri Oct 27, 2000 9:35 am
Location: Turkey
Contact:

Post by LaptoniC »

Thanks. It worked :)
"There is only one road to human greatness: through the school of hard knocks." Albert Einstein
winndy
Junior Member
Posts: 25
Joined: Tue May 31, 2005 9:31 am

Post by winndy »

Thanks
Here is the tutorial by Laptonic
http://forum.exetools.com/showthread.php?t=14836
Crack and unpack is a way to enjoy life.
Locked