Skip to main content
gamedev.net
🔒 Locked

Crack the code!

Started by Nice Coder Mar 7, 2005 at 4:46 AM 13 replies 3.1k views
Original Post
Nice Coder
Nice Coder
My code is simple. I start with a number: N, which can be anything Prime or composite, of any value, up to 2^64. The code is basically N =(N^2 mod p) Output = input ^ (n % 256) p = qr, where q and r are primes. And i continue iterating through that as nessisary. Nulls have an input value of 0, and are ignored. Once someone has cracked my code, that person should make a (crackable) code for us to crack. p = 1811668653769340472976048477 (i know you'll crack this in seconds, but vb won't handle more then 15 digits, and i don't knwon a python random prime function). Code reads 146 185 219 137 75 80 228 37 15 236 155 See if you can crack it! From, Nice coder
Click here to patch the mozilla IDN exploit, or click Here then type in Network.enableidn and set its value to false. Restart the browser for the patches to work.
Dmytry
Dmytry
now tell me: what to crack, exactly?

Knowing output, and input, find initial N? Knowing output only, find N that corresponding input is words? What you mean by "code reads" ?

i'm affraid i don't understand you at all.
MrEvil
MrEvil
Dmytry:
My interpretation is:
He wants you to find both the input and N, given the output and the encryption function.
The output from the function is an array of numbers
146,185,219,137,75,80,228,37,15,236,155

This code
N =(N^2 mod p)Output = input ^ (n % 256)
is executed for each character.
I wonder if that makes more sense..
Dmytry
Dmytry
If input would be truly unknown there would be no way to solve it. So, let's assume the only thing we know about input is that it "makes sense".

Output quite possibly is too short to find N:

N contains 64 bits of information, that is, 8 bytes. Output is 11 bytes long. If we would know input and output precisely, we would have whole 11 bytes of information, and it would be most likely possible to find N from it. But the only thing we know about input is that "it makes sense". If there is M possible values of input that makes sense, we have 11*8-log2(M) bits of information. Quite likely, it is less than 64 bits, and there is several different "solutions".

Normally, you need *significantly* longer sequence to break something when you only know that "input makes sense". In most real world cases, you just know that input contains certain strings such as file headers, etc.
MrEvil
MrEvil
I opt for crack by guessing: [grin]
Hello World
Dmytry
Dmytry
Quote:
Original post by MrEvil
I opt for crack by guessing: [grin]
Hello World

1000% sure you're right. There's aint no other 11-letter string he would use .
Nice Coder
Nice Coder
Ok, the input is made up of two greek "letters" (the pronunciation in english, like "Theta" or "Delta"). First letter for both words are capitals. Theres a space between them. They are encoded in ascii.

Can you find the initial N from that? (or at least an N).

How long a sequence would you need to find N?
How about decrypting the sequence, if it was encrypting a few thousand passwords?

From,
Nice coder
Click here to patch the mozilla IDN exploit, or click Here then type in Network.enableidn and set its value to false. Restart the browser for the patches to work.
Nice Coder
Nice Coder
Quote:
Original post by MrEvil
I opt for crack by guessing: [grin]
Hello World


Nope. I will wait for 10 million years before accepting another guess from you.

Estimated cracking time: Never (the universe would be dead by the end of it).

From,
Nice coder
Click here to patch the mozilla IDN exploit, or click Here then type in Network.enableidn and set its value to false. Restart the browser for the patches to work.
Nice Coder
Nice Coder
heres a few nice sequences. (N%255, for N=100 as an egsample).

N = 10055220205205205205205205205205205205205205205205205205


See what happened? It just sticks there. And it doesn't change (see why i said my code was really simple. I expected someone to decrypt it in a few seconds...
Now if i was to actually encrypt something with it, the last how many digits are all xored with the same thing!

From,
Nice coder

[Edited by - Nice Coder on March 7, 2005 10:49:19 PM]
Click here to patch the mozilla IDN exploit, or click Here then type in Network.enableidn and set its value to false. Restart the browser for the patches to work.
Nice Coder
Nice Coder
Somebody crack it!

I managed to, and it took me 5 minutes to write the program and a minute to find the key.

Somebody needs to claim the prise...

From,
Nice coder
Click here to patch the mozilla IDN exploit, or click Here then type in Network.enableidn and set its value to false. Restart the browser for the patches to work.
Skizz
Skizz
I think there's a bug in your code. The n=100 sequence doesn't correspond to the algorithm you posted:
n = n2%p
so, if n=100, n2 = 10000 and n2%p = n2 for n2 < p. So, the second n%256 is 10000%256 which is 16 and not 55.

Skizz
gcs584
gcs584

Hmm...

Call me "stupid", but this doesn't make too much sense to me. What happens if n euals 1? Then they are equal. Maybe i'm not understanding the question, for my math skills are not the best.

Later,

GCS584
Nice Coder
Nice Coder
That is why you don't use n=1.

Also, i left off the first number in the sequence (Nice that you picked it).

Can anybody Crack The Code!

From,
Nice coder
Click here to patch the mozilla IDN exploit, or click Here then type in Network.enableidn and set its value to false. Restart the browser for the patches to work.
CProgrammer
CProgrammer
Yes its very easy to crack:
Just find two primes that multiplied equal p = qr.
then using these two primes calculate the euler function of p. Which equals (q-1)(r-1).
To do this I have two choices(use java for BigInteger class):
- Guess random numbers and use a prime test to determine wether they are primes and check wether the product is p.
- Use Erathostenes Algo to determine tons of primes and try.

('=' means kongruent here):
n is used to encode. So we find an m with mn=1 mod p.
then we calculate the input:
input = (your output)^m mod p ('=' means kongruent again).

Voila, the only real job is finding the two primes, since I dont have the algorithm handy at present and im kinda in a hurry Ill have to pass for now. If nobody has it later Ill test if my soltion is correct.

By the way this is the RSA-Crypto system.
Nice Coder
Nice Coder
This is nowhere near the rsa crypto.

Rsa is c^d mod n, and e^c mod n. For decryption and encryption respectivelly.

It is nowhere near.

Also, whachu doin' factorisin' me number! (and why are you doing it?)

Its the modulous!

You have to find n, which is the descreet logorithm problem.

:)

But its still very simple (if i would have done this the hard way, nobody would have figured it out.)

From,
Nice coder
Click here to patch the mozilla IDN exploit, or click Here then type in Network.enableidn and set its value to false. Restart the browser for the patches to work.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.