Hello, dear friend, you can consult us at any time if you have any questions, add WeChat: THEend8_
Objective
On completion of this assignment, you should be able to use some basic cryptographic techniques to secure remote communications.
Programing Task
Write (Java/C++/Python) UDP programs to allow two parties to perform authentication and establish a secure communication channel. For simplicity, let us call the programs “Host” and “Client”, which are executed by Alice and Bob, respectively.
Alice and Bob share a common password PW, which contains 8 alphanumeric characters. Alice also has a public and privacy key pair (pk, sk) for the RSA encryption scheme. They want to establish a secure communication channel that can provide data confidentiality and integrity. This will be done via the following steps: (1) perform an authentication and key establishment protocol to establish a fresh secret key; and (2) use the established secret key to secure the real communication.
Step 1 is done via the following authentication and key establishment protocol:
1: B → A: Bob, NB
2: A → B: Alice, pk, NA
3: B → A: C1 = PKE pk(PW, K)
Alice decrypts C1 using sk to get PW and K, and then verifies PW. Alice sends either “Connection Okay” or “Connection Failed” to Bob to indicate whether the connection is successful or not.
4: A → B: Connection Okay/Failed
In the above protocol, NB and NA denote two 128-bit random strings chosen by Bob and Alice, respectively, and PKE denotes the RSA encryption. K is a 128-bit random secret key selected by Bob. Alice and Bob then compute the shared secret key as ssk = H(K,NB,NA) where H denotes the SHA-1 hash algorithm.
After establishing the secret session key, step 2 is done as follows:
1. whenever Alice wants to send a message m to Bob, Alice first computes an integrity check value h = H(ssk, m), and then computes C = SKEssk(m||h) and sends C to Bob;
2. upon receiving a ciphertext C, Bob first runs the decryption algorithm to obtain m||h. After that, Bob computes h ’ = H(ssk, m) and checks if h = h ’. If the equation holds, then Bob accepts m; otherwise, Bob rejects the ciphertext;
3. the same operations are performed when Bob sends a message to Alice.
The SKE in step 2 denotes the RC4 stream cipher.