Why is the following protocol never used to share a symetric key between two parties ? ⊕ is the XOR operation.
Alice has M and wants to send it to Bob. Alice generates K₁ randomly. Bob generates K₂ randomly.
- Alice has M.
- Alice : M -- ·⊕K₁ --> M⊕K₁
- Alice sends M⊕K₁ to Bob.
- Bob : M⊕K₁ -- ·⊕K₂ --> M⊕K₁⊕K₂
- Bob sends M⊕K₁⊕K₂ to Alice.
- Alice : M⊕K₁⊕K₂ -- ·⊕K₁ --> M⊕K₂
- Alice sends M⊕K₂ to Bob.
- Bob: M⊕K₂ -- ·⊕K₂ --> M
- Bob has M.
Of course, K₁ and K₂ need to be the same size as M.