mike25025 494 Report post Posted July 18, 2005 This isn't really game related but I don't know where else to put it and someone here may find it interesting. Over the past few weeks I have become interested in cryptography and Ive been working on a code that could make the one time pad more practical. Ive gone through 4 revisions all of which could be broken using basic algebra. This version however, is beyond my skill level and I can see no way of breaking it. I'm hoping someone will be willing to help me. Here is how it works: Alice and Bob have two separate independent keys that are known to both of them. Both Alice and Bob have a source of independent random data. Using the random data and the keys they create a OTP using a system based off of Diffie-Hellman key exchange. Once they both have the OTP, Alice uses it to encode a message and sends it to Bob. Bob then decrypts the message. Mathematics of the system: T is the plaintext C is the ciphertext K_{a} is Alice's key K_{b} is Bob's key R_{a} is Alice's random source R_{b} is Bob's random source M is the modulo i = R_{a} + K_{a} mod M j = R_{b} + K_{b} mod M k = i + j - K_{a} - K_{b} mod M C = k + (T xor K_{a} xor K_{b}) mod M R_{a} and R_{b} are independent. M is some number of the form 2^{n} T, K_{a}, K_{b}, R_{a}, R_{b}, and k are private (Only Alice and Bob know them). i, j, M, and C are public (Everyone knows what they are). Problem: If Eve knows only i, j, M, and C what other info can she get if any? (Or how can this code be broken?) 0 Share this post Link to post Share on other sites
twanvl 512 Report post Posted July 18, 2005 Quote:k = i + j - Ka - Kb mod MC = k + (T xor Ka xor Kb) mod MHow does that work? Only Alice has Ka, and Bob has Kb, right? Or are Ka and Kb previously exchanged using Diffie-Hellman?If Alice and Bob reuse the same keys, say with data C1, C2, randomness Ra1, Ra2, etc. Then Eve can determine:i1 - i2 = Ra1 - Ra2 + Ka - Ka mod M = Ra1 - Ra2 mod Mj1 - j2 = Rb1 - Rb2 + Kb - Kb mod M = Rb1 - Rb2 mod Mk1 - k2 = i1 - i2 + j1 - j2 mod MC1 - C2 = k1 - k2 + (T1 xor Ka xor Kb) - (T2 xor Ka xor Kb) mod MC1 - C2 - (k1 - k2) = (T1 xor Ka xor Kb) - (T2 xor Ka xor Kb) mod MThis sounds like some usefull information can be derived, for example if T1 = T2, then C1 - C2 - (k1 - k2) = 0 mod M. 0 Share this post Link to post Share on other sites
mike25025 494 Report post Posted July 18, 2005 Quote:Only Alice has Ka, and Bob has Kb, right?Alice has K_{a} and K_{b}. So does Bob. The method of key transfer is not important to the problem.Also k is not known to Eve so k_{1} - k_{2} can't be solved for. Unless I missed something in your math. If I did please point it out to me. 0 Share this post Link to post Share on other sites
frostburn 380 Report post Posted July 18, 2005 OTPs were used for pretty short messages.. assuming that is still true (not transmitting serveral GB's at a time) you could store random data on a pair of CDs or DVDs and use that as OTPs. The weakest link here is the pads/keys themselves (the disks). They could be stolen or intercepted and duplicated enroute from Bob to Alice. Barring this it would be totally impossible for others to decrypt the messages. 0 Share this post Link to post Share on other sites
mike25025 494 Report post Posted July 18, 2005 I see it now. Twanvl, you broke my code [bawling].I think thats the last code that Im going try to make. Im not very good at cryptography.Thanks for your time. 0 Share this post Link to post Share on other sites