Answered step by step
Verified Expert Solution
Link Copied!

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 Alice(Bob) wants to communicate with Bob(Alice), she(he) 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: 127.0.0.1 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
pk_R is the receivers public key, and sk_R is the receivers secret key.
pk_S is the senders public key and sk_S is the senders secret key.
Adopted Cryptography includes:
H, which is a cryptography hash function (the SHA-1 hash function).
E and D, which are encryption algorithm and decryption algorithm of symmetric-key encryption (AES for
example)
About the key pair, sk=x and pk=g^x.(based on cyclic groups)
You can use an open-source crypto library or some open-source 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 Z_p and compute g^r and TK=(pk_R)^r.
Use TK to encrypt M denoted by C=E(TK, M)
Compute LK=(pk_R)^{sk_s}.
Compute MAC=H(LK || g^r || C || LK). Here, || denotes the string concatenation.
Send (g^r, C, MAC) to the receiver.
The sender part should display M and (g^r, C, MAC)
That is, for security purpose, M is replaced with (g^r, C, MAC)
Note: TK can be seen as a shared secret key that can be computed by both two parties.
When the receiver receives (g^r, C, MAC) from the sender, the app will do as follows.
Compute TK=(g^r)^{sk_R}.
Compute LK=(pk_S)^{sk_R}
Compute MAC=H(LK || g^r || C || LK). Here, || denotes the string concatenation.
If MAC=MAC, go to next step. Otherwise, output ERROR
Compute M=D(TK, C).
The receiver part should display
**The decryption on**
(g^r, C, MAC)
**is**
M(or ERROR)
Note: the receiver can reply the message. The receiver becomes the sender, and the seconder becomes receiver.
Coding requirement:
You can use any open-source code as you like. You can use a crypto library or some open-source 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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Relational Database And Transact SQL

Authors: Lucy Scott

1st Edition

1974679985, 978-1974679980

More Books

Students also viewed these Databases questions

Question

Explain the factors influencing wage and salary administration.

Answered: 1 week ago

Question

Examine various types of executive compensation plans.

Answered: 1 week ago

Question

1. What is the meaning and definition of banks ?

Answered: 1 week ago