This topic is 4894 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

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 Ka is Alice's key Kb is Bob's key Ra is Alice's random source Rb is Bob's random source M is the modulo i = Ra + Ka mod M j = Rb + Kb mod M k = i + j - Ka - Kb mod M C = k + (T xor Ka xor Kb) mod M Ra and Rb are independent. M is some number of the form 2n T, Ka, Kb, Ra, Rb, 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?)

##### Share on other sites
Quote:
 k = i + j - Ka - Kb mod MC = k + (T xor Ka xor Kb) mod M

How 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 M

This sounds like some usefull information can be derived, for example if T1 = T2, then C1 - C2 - (k1 - k2) = 0 mod M.

##### Share on other sites
Quote:
 Only Alice has Ka, and Bob has Kb, right?
Alice has Ka and Kb. So does Bob. The method of key transfer is not important to the problem.

Also k is not known to Eve so k1 - k2 can't be solved for. Unless I missed something in your math. If I did please point it out to me.

##### Share on other sites
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.

##### Share on other sites
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.

1. 1
2. 2
3. 3
Rutin
14
4. 4
5. 5

• 9
• 9
• 11
• 11
• 23
• ### Forum Statistics

• Total Topics
633674
• Total Posts
3013277
×