Answered step by step
Verified Expert Solution
Question
1 Approved Answer
The above is an app for communications between Alice and Bob using the UDP protocol. You should be family with this app and its function
The above is an app for communications between Alice and Bob using the UDP protocol. You should be family
with this app and its function before doing this assignment.
This app, however, it is not secure What you are going to do is to secure it For simplicity, there is no GUI
required in this assignment. That is messages are simply typed on the senders window and printed on the
receivers window. The looping should continue until the connection is terminated.
Idea:
When AliceBob wants to communicate with BobAlice shehe needs to input:
Remote IP Remote Port, Remote PK receiver
Local IP Local Port, Local PK sender
The above info can be stored in a file and read it when using it please use the local IP: inside the file
for simplifying the marking process.
Here, pk refers to the users public key. That is the secure communication requires that Alice and Bob know
the others public key first. Suppose that
pkR is the receivers public key, and skR is the receivers secret key.
pkS is the senders public key and skS is the senders secret key.
Adopted Cryptography includes:
H which is a cryptography hash function the SHA hash function
E and D which are encryption algorithm and decryption algorithm of symmetrickey encryption AES for
example
About the key pair, skx and pkgxbased on cyclic groups
You can use an opensource crypto library or some opensource code to implement the above cryptography.
What you need to code is the following algorithms.
When the sender inputs a message M and clicks Send the app will do as follows before sending it to the
receiver.
Choose a random number r nonce from Zp and compute gr and TKpkRr
Use TK to encrypt M denoted by CETK M
Compute LKpkRsks
Compute MACHLK gr C LK Here, denotes the string concatenation.
Send gr C MAC to the receiver.
The sender part should display M and gr C MAC
That is for security purpose, M is replaced with gr C MAC
Note: TK can be seen as a shared secret key that can be computed by both two parties.
When the receiver receives gr C MAC from the sender the app will do as follows.
Compute TKgrskR
Compute LKpkSskR
Compute MACHLK gr C LK Here, denotes the string concatenation.
If MACMAC go to next step. Otherwise, output ERROR
Compute MDTK C
The receiver part should display
The decryption on
gr C MAC
is
Mor ERROR
Note: the receiver can reply the message. The receiver becomes the sender and the seconder becomes receiver.
Coding requirement:
You can use any opensource code as you like. You can use a crypto library or some opensource code to
implement the encryption and hashing functions and the related group generation and key pair generation. You
should cite the source if you use a downloaded code.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started