Tarun Anand - 16CO147
Archit Pandey - 16CO153
- Python
- Wireshark
Reference
An oblivious transfer (OT) protocol is a type of protocol in which a sender transfers one of potentially many pieces of information to a receiver, but remains oblivious as to what piece (if any) has been transferred. The receiver is also oblivious of the non accepted messages transmitted by the sender.
Oblivious Transfer is a fundamental building block for more complex cryptographic protocols such as secure multiparty computation protocols.
The paper we have chosen describes the simplest and most efficient protocol for 1-out-of-n OT to date, which is obtained by tweaking the Diffie-Hellman key-exchange protocol.
Reference
Diffie-Hellman is an algorithm used to establish a shared secret between two parties. It is primarily used as a method of exchanging cryptography keys for use in symmetric encryption algorithms like AES.
Let's assume that Alice wants to establish a shared secret with Bob.
The algorithm is secure because the values of a and b, which are required to derive s are not transmitted across the wire at all.
The above image demonstrates the working of the implemented oblivious transfer protocol. This version of OTT is based upon the Diffie-Hellman Key Exchange. The security of this protocol is dependent upon the security of the Diffie-Hellman protocol.
The steps are as follows-
We use wireshark to capture the packets while being transit and show that it is not possible to obtain any of the possible messages which are being transmitted.
Reference
The Diffie-Hellman key exchange is vulnerable to a man-in-the-middle attack. In this attack, an opponent Carol intercepts Alice's public value and sends her own public value to Bob. When Bob transmits his public value, Carol substitutes it with her own and sends it to Alice. Carol and Alice thus agree on one shared key and Carol and Bob agree on another shared key. After this exchange, Carol simply decrypts any messages sent out by Alice or Bob, and then reads and possibly modifies them before re-encrypting with the appropriate key and transmitting them to the other party. This vulnerability is present because Diffie-Hellman key exchange does not authenticate the participants.
Since our version of oblivious transfer is based on the Diffie-Hellman key exchange, it is also vulnerable to a man in the middle attack. We implemented a man in the middle script to demonstrate this vulnerability.
Modern implementations of Diffie-Hellman is typically preceded by authentication of both the users by use of a public and private key. This prevents a man in the middle attack from taking place. Utilizing this version of the Diffie-Hellman algorithm will also prevent a man in the middle attack from affecting oblivious transfer. Implementing oblivious transfer using this modified Diffie-Hellman can be taken up as future progress with respect to this project.
- img - Directory that contains all the images and Screenshots
- unused - Contains the code from the initial approach to completing the project
- src/DiffieHellman.py - Code for the Diffie-Hellman protocol
- src/encrypt.py - Code pertaining to the cryptographic functions utilized
- src/RabinMiller.py - Code that generates prime numbers utilized in the oblivious transfer.
- src/sender.py - OTT sender
- src/receiver.py - OTT receiver
- src/ManinMiddle.py - OTT man in the middle
- Ensure python3 and python3-pip are installed .
- Run the following command
- Navigate to the src Directory
- To run the DiffieHellman
- To run the sender
- To run the receiver
- To run the Man in the Middle attack
Man in the Middle