Advertisement

How would modern code breaking work? Codes can be so complicated

Started by November 13, 2003 11:21 PM
13 comments, last by johnnyBravo 21 years ago
Your code cannot be reversed, either by a malicious hacker or by its intended recipient.

The reason for this is the following code:

yy = (Int(Rnd *bb\2)+Int(bb/2))
tt = Format(yy, "000")
rr = bb - tt

Every other step you perform is reversible. However, by using Rnd, you will get a different output each time the algorithm is run, even if the inputs are identical. Thus without knowing the random seed, someone else cannot go from code to plaintext reliably.

Also, your obfuscation at the end is cryptographically insignificant (i.e. because of the way it is formatted, I know that characters 5, 6, 7, 15, 16, 17, 25, 26, 27 and so on are part of the code and everything else is just random garbage, so I just examine characters (i, i+1, i+2) for all i such that i = 10*k + 5 and i < Len(input) for k=0, 1, 2, ... and ignore everything else.

[edited by - gibson on November 15, 2003 2:40:23 PM]
quote: Original post by gibson
Your code cannot be reversed, either by a malicious hacker or by its intended recipient.


well this code decrypts it
theCode = TDecode.TexttheDecode = ""i = 1counter = 0Do While i < Len(theCode)    counter = counter + 1    cc = Mid(theCode, i + 4, 3)    dd = Val(cc) - counter    ee = dd + Mid(theCode, 9 + i, 3)    qq = Chr(ee)    theDecode = theDecode + qq    i = i + 3 + 2 + 4 + 2 + 1 + 2LoopTInput.Text = theDecode



or are you trying to say something else...sorry if you are...


[edited by - johnnyBravo on November 16, 2003 8:41:55 AM]
Advertisement
Confusion over code breaking is because you''re forgetting the different kinds of codes

public key: super computers trying to factor the number. (hard)

One Time Pad: uhhh.. act of god.

secret key or algorithm: frequency analysis, and other things.

I would have found these facts interesting back when i was first studying this.

First the RC4 algo its essentially (not mine. ripped. and not copyrighted)
   while (length--) {    x++; sx = state[x]; y += sx;    sy = state[y]; state[y] = sx; state[x] = sy;    *data++ ^= state[(sx+sy)&0xFF];} 


Youll note most things modern dont actually exchange letters to numbers persay. They xor the byte for the letter by something "secret" then give the stream of bytes out as encrypted. The above is essentially the way your browswer xors things when it needs to encrypt data for transfer. Its not too complicated. You can cook book some simplier home made versions pretty easy.


And then theres "well what should i xor my letters by thats secret" Thats where keys come in.

And the most common algo for that is:
quote:
RSA is the name of the most prevalent public/private key algorithm. It is also the name of the company (RSA Security) that originally held the patent rights to this system. It was invented in 1977 by Ron Rivest, Adi Shamir, and Leonard Adleman.
Details: In order to generate the keys:

First, some random data is generated. Most of the successful attacks against RSA implementations have been against this step.
Two large primes are randomly chosen. This can be a time consuming step as the computer randomly generates numbers and tests to see if they are prime. These two numbers are traditionally called p and q.
The two numbers are multiplied together, n = pq. We will be publishing n as part of the public-key. The security of RSA lies in the fact that it is computationally too difficult to factor n back into p and q. (However, somebody may in the future discover a way to easily factor large numbers, in which case all of today''s cryptography will be rendered useless in one fell swoop).
A number e is chosen, where e is less than n and "relatively prime" (no common factors) to (p-1)(q-1). The public-key will consist of the pair (n,e).
A number d is chosen, where (ed-1) is divisible by (p-1)(q-1). The private-key consists of the pair (n,d). Usually, the original prime numbers p and q are discarded after this step.
The numbers n, e, and d are of interest because they serve as fields within digital certificates.
Details: In order to encrypt/decrypt something using RSA, the following algorithm is used.

Start with the original message called m. Note that in reality, we''ve already encrypted the real message with a randomly generated symmetric key, and we really are just encrypting this key to send along with the encrypted message. Public-key cryptography is generally used for key-exchange because it is too slow for general-purpose encryption. Therefore, m is really just a small 128-bit key rather than the entire message.
Create the ciphertext c using the equation c = me mod n, where (n,e) are the public-key.
Send the ciphertext message c.
Upon reception, use the equation m = cd mod n, where (n,d) is the private-key and m is the decrypted message. (Again, this is usually just the symmetric key that we will use to decrypt the actual message).


Now thats a bit harder. But still prolly the simpliest explanation ive ever seen.

Now that were on the same page. The question might be: ok lets say i use public key/private key then i shake it up with my own special blend of pure chaos how would anyone figure it out?

Its a good question but i suspect pattern matching would eventually crack it and reduce it to a key problem depending on what you were hiding.

NOTE:
the quotes are from:
http://www.robertgraham.com/pubs/hacking-dict.html
(dont worry mods its not a thinly vieled site designed to show you how to run scripts. Its legit.)



interesting, i didnt really think much about other ways of codes being made.

You must be a genius to write an efficient code breaker!

This topic is closed to new replies.

Advertisement