On my walk to work today I thought of the following encryption algorithm and could not determine the flaw. It uses one time pad's that don't need to be shared and has a Diffie-Hellman key exchange flavor to it:
Say Alice wants to sent a message M to Bob so she generates a random one-time pad A and sends M' = (M xor A) to Bob.
Bob also generates a one-time pad B and sends M'' = (M' xor B) back to Alice.
Alice then uses her one-time pad again and sends M''' = (M'' xor A) back to Bob.
Bob then simply retrieves the original message which is (M''' xor B).
That cypher sent in step 1 is (M xor A). The cypher send in step 2 is (M xor A xor B). The cypher sender in step 3 is (M xor A xor B xor A) = (M xor B). Bob then can decrypt the final message M = (M xor B xor B). All eavesdroppers only see messages encrypted with some safe combination of the keys A and B. Even though Bob can determine Alice's one-time pad A in step 3, there was never any need to share keys.
Here is a simple 32-bit example (^ = xor):
M = 1234ABCD secret message
A = 4A3109AD Alice's key
B = F499803C Bob'e key
M = 1234ABCD
M^A = 5805A260
M^A^B = AC9C225C
M^A^B^A = E6AD2BF1
M^A^B^A^B = 1234ABCD
Why is this not perfectly secure? (P.S., I am ignoring trust issues and man-in-the middle issues -- which may be where the problem lies).