https://github.com/anishgg/diffie-helman-key-exchange
File sharing with 3DES and key exchange using Diffie hellman
https://github.com/anishgg/diffie-helman-key-exchange
3des diffie-hellman python-des socket-programming
Last synced: about 1 year ago
JSON representation
File sharing with 3DES and key exchange using Diffie hellman
- Host: GitHub
- URL: https://github.com/anishgg/diffie-helman-key-exchange
- Owner: AnishGG
- Created: 2020-02-02T19:33:52.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2020-02-03T15:26:26.000Z (over 6 years ago)
- Last Synced: 2025-01-20T22:12:05.127Z (over 1 year ago)
- Topics: 3des, diffie-hellman, python-des, socket-programming
- Language: Python
- Homepage:
- Size: 12.7 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
3DES implementation with Diffie Hellman key exchange
====================================================
Suppose there are n users A (clients) want to securely access the files stored in the database of a user B (server).
At first, each client will make a connection using socket with the server B and then will establish three symmetric keys, say K1 , K2 and K3 which will be used for encryption and decryption using the 3DES with three keys symmetric cryptosystem.
### Dependencies
* python3 is needed in order to run the server and client. It can be installed using the following command.
```bash
apt-get install python3
```
* All the dependencies of the project are given in `requirements.txt`, which can be installed using:
```bash
pip3 install -r requirements.txt
# If you don't have pip3 installed on your system, run:
apt-get install python3-pip
```
To run the server and client, follow the given steps:
```bash
cd path-to-directory/server
python3 server.py
# Open a new terminal
cd path-to-directory/client
python3 client.py 127.0.0.1
# Type 'help' to find out all the commands
```
The protocol messages used in the implementation are provided below
| Opcode | Message | Description |
|:------:|:----------:|:---------------------------------------------------------------------------------:|
| 10 | PUBKEY | Public key Ya/Yb sent to the server/client by the client/server |
| 20 | REQSERV | Request for service (transferring a requested file) from the server to the client |
| 30 | ENCMSG | Sending encrypted message(s) for the file from the server to the client |
| 40 | REQCOM | Request completion message from the server to the client |
| 50 | DISCONNECT | Disconnect request message sent from the client to the server |
### Extra files information
* All the global settings are stored in `settings.py` present in the root directory.
* The common data structures and functions used by server and client side are stored in `common.py` also present in the root directory.
* All the extra dependencies for running the server are stored in `requirements.txt`, which can be installed as described above.