أخوتي الكرام السلام عليكم ورحمة الله وبركاته

أتمنى مساعدتكم لي في حل هذا البرنامج وذلك بأنه خارج عن طاقتي وخبرتي فيه قليلة ويجب تسليمه في أقل من أسبوع .

إخوتي الكرام مصير أختكم في الدراسة متوقف على هذا البرنامج أرجو منكم المساعده وشكرا .

لغة الجافا أو السي

معلومات السؤال


Programming
Specifications:
Write two (C/C++) UDP programs allowing two users to establish a secure channel for communications. For simplicity, let us call them “Host” and “Client”; each can be used by a user. Again, for simplicity, let us assume that Alice uses Host and Bob uses Client. The protocol is as follows.

· Alice executes Host.
- Host is running and listens to the opened port.
- Her Diffie-Hellman public key (DH key for short) is selected.
· Bob executes Client.
- The connection between Alice and Bob is established.
- His DH key is selected.
- His DH key is sent to Host.
· Alice sends her DH key to Bob, upon receiving Bob’s DH key and computes the shared session key.
· Upon receiving Alice’s DH key, Bob computes the shared session key.
· Now, either Alice or Bob can send a message.
- Encrypt message using RC4 with the shared session key.
- The receiver decrypts the encrypted message with the shared session key.

The DH algorithm can be found from the lecture notes. You should allow long integers to enable strong security. The RC4 cipher should be written in terms of the following algorithm.

Key Scheduling Algorithm:

Initialisation for key K of length p.
for i = 0 ... 255
S[i] = i
for i = 0 ... 255
j = (j + S[i] + K[i mod p]) mod 256
swap(S[i],S[j])

Byte by byte processing:

i = 0
j = 0
loop until whole message encrypted
Get the next input byte
i = (i + 1) mod 256
j = (j + S[i]) mod 256
swap(S[i],S[j])
k = S[(S[i] + S[j]) mod 256]
output: XOR k with input byte

Here, K is the shared session key created from the Diffie-Hellman key exchange.

Handling big integers:

Your program should be able to handle big integers.

C++/C programmers can use NTL (http://www.shoup.net/ntl/) or other big integer library. NTL is available on our Unix machines (e.g., banshee). It is located at /packages/ntl.

You should name the Host host.cpp
How to run?

Your programs should run according to the protocol. Host and Client should be executed on different windows. The key agreement and encryption processes are transparent to users. After the shared session key has been established, a message can be sent by either Alice or Bob. For simplicity, there is no GUI required in this assignment. That is, messages are simply typed on the window and printed on the receiver window. The loop should continue until the moment the user types “exit” to exit.

Java programmers might want to create a GUI window allowing users to type on the window. It is entirely up to you to decide.

Compilation:

All C/C++ programs must be compiled in Unix (e.g., banshee). If you use GUI, please state it in the readme file.