Question: In this assignment, you will implement secure communications between two parties, Alice and Bob. This assignment is designed to practice key distribution, encryption/decryption, and integrity

In this assignment, you will implement secure communications between two parties, Alice and Bob. This assignment is designed to practice key distribution, encryption/decryption, and integrity protection with secret key cryptography and public key cryptography.

2. Task Description

Communication scenario: Alice (as a Client) needs to send messages to Bob (as a Server). Either TCP or UDP is fine for the transport protocol. Both messages must be encrypted and integrityprotected. Each of Alice and Bob has a pair of under the RSA cryptosystem (their key pairs are different), and they know each others public key beforehand (the public keys can be hard coded into the program or sent to each other).

Step 1: Set up a shared secret key: Alice and Bob set up a shared secret key using the following method: Alice generates a random key k, encrypts it using Bobs public key with the RSA algorithm, and sends the ciphertext to Bob. Bob then decrypts to ciphertext to get the key k.

Step 2: Message encryption and decryption: Alice sends a 30-byte message to Bob. This message is encrypted using AES with the key k distributed in Step 1. Bob decrypts the message.

Step 3: HMAC-based Authentication: Alice sends a 40-byte message to Bob. This message is authenticated with an HMAC generated with key k (distributed in Step 1) using SHA-256 as the underlying hash algorithm. Bob verifies the HMAC to see if the message is from Alice and if it has been modified during transit.

Step 4: Digital Signature-based authentication: Alice sends a 50-byte message to Bob. This message is authenticated with a RSA signature computed over the hash of the message with the SHA-256 hash algorithm. Bob verifies the RSA signature to see if the message is from Alice and if it has been modified during transit.

To evaluate Step 1, your program needs to print the k at Alice and the k decrypted by Bob to see if they are the same.

To evaluate Step 2, your program needs to print the message at Alice and the message decrypted by Bob to see if they are the same.

To evaluate Step 3, your program needs to print the HMAC computed by Alice and the HMAC computed by Bob to see if they are the same.

To evaluate Step 4, the servers (Bobs) program needs to print the result of RSA signature verification operation over the received signature to see if it is the same as the message generated by Alice.

Programming languages: C, C++, Java, or Python.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!