1. Homepage
  2. Programming
  3. 159342 Assignment 2: Cryptography: RSA algorithm with Cipher Block Chaining

159342 Assignment 2: Cryptography: RSA algorithm with Cipher Block Chaining

Engage in a Conversation
New ZealandMassey University159342Operating Systems and NetworksCryptographyRSA algorithm with Cipher Block Chaining

Operating Systems and Networks 159.342

                                             Assignment 2

Cryptography: RSA algorithm with Cipher Block Chaining

  CourseNana.COM

Secure Communication Protocol CourseNana.COM

In this assignment your task is to implement a hybrid encryption algorithm called RSA with Cipher Block Chaining for communicating TCP client-server applications.  You are not allowed to use any third-party libraries that implement network security protocols and algorithms (e.g. OpenSSL, GMP, etc.), or other toolset with built-in cryptographic functions (e.g. Qt), etc. except for Boost https://www.boost.org/.  You need to implement the RSA and CBC algorithms in C/C++ from scratch.   CourseNana.COM

  CourseNana.COM

In the TCP client-server examples, as you might remember, a client types a message, and then sends it to a server.  In turn, the server echoes back the message.  In this assignment, you have to modify the client so that it encrypts all messages sent to the server. In addition, you also have to modify the server, so that it decrypts the encrypted message locally. CourseNana.COM

  CourseNana.COM

Below are the basic steps describing the secure communication protocol. CourseNana.COM

  CourseNana.COM

Create a fixed RSA private key (dCA) and public key (eCA) for a CA (certification authority) CourseNana.COM

Assume that the CA issued a certificate for a server, containing its public key.  That means the server has dCA(e,n).  This is an encrypted public key of the server.  Assume further that the client knows the public key of the certification authority (eCA), who issued the certificate. CourseNana.COM

  CourseNana.COM

Note:  In this assignment, there is no commercial CA involvement.  We will only make our own dCA(e, n) and eCA. CourseNana.COM

  CourseNana.COM

As always, the server must be up and running prior to a client connecting to it. CourseNana.COM

After the server accepts a client connection request, establishing a TCP connection, the server must send the client its encrypted public key dCA(e,n). In turn, the client extracts the public key using its copy of the certification authority’s public key: eCA(dCA(e,n)), then ACKs the receipt of the keyNext, the client informs the server of the random number (nonce) that will be used for the initial encryption and decryption operations.  This nonce is sent encrypted using e(nonce). Successive messages coming from the client will then be encrypted accordingly using RSA-CBC, and the server will decrypt the received messages using RSA-CBC.  The server may also echo back to the client the decrypted messages (this is optional - not required). CourseNana.COM

  CourseNana.COM

  CourseNana.COM

The client/server must be able to show the original, encrypted and decrypted messages, as seen in the example below: CourseNana.COM

  CourseNana.COM

- The client types:                     hello CourseNana.COM

  CourseNana.COM

- The server prints locally:        The received encrypted message was: 10898 15630  8308  321  13772  22674  22040 CourseNana.COM

                                    After decryption, the message found is: hello CourseNana.COM

Design issues CourseNana.COM

There are many details in the implementation of a real RSA with Cipher Block Chaining that might have to be left out in order to keep it under the scope of an assignment. You have to ask the following questions regarding some decisions about the implementation: CourseNana.COM

  CourseNana.COM

a) What are the sizes of the keys? (aim for a big number(in the thousands) for the variable n in RSA) CourseNana.COM

b) Should the encryption be done character by character, or by block of characters? CourseNana.COM

c) Should padding be used? CourseNana.COM

d) Do you need an arbitrary precision library, or the keys are small enough to use a simple exponential code? CourseNana.COM

e) How are the keys sent to the client (your protocol design should specify: format, message order, etc). CourseNana.COM

  CourseNana.COM

The answers to these questions will establish how your own “encryption protocol” works. CourseNana.COM

  CourseNana.COM

For more details, check out the following documents: CourseNana.COM

  1. The details of the core algorithm that must be implemented can be found in “Week_06_Network_Security_Implementing RSA_CBC_v2.pptx” You are allowed to use relatively small prime number pairs, but do not use pairs that will generate the same original message after encryption.
  2. Use the cross-platform start-up codes provided for Assignment #2.  I have separated the start-up codes for Windows and Unix-based based systems, but their only differences are the makefile, run.bat (for Windows) and run.sh (for Unix) files.  Modify these source codes for your implementation of the secure communication protocol.

  CourseNana.COM

For verification and accurate marking of the assignment, the following information must be displayed on screen, as part of the secure server and secure client implementations. CourseNana.COM

Secure Server: CourseNana.COM

1.     Print on screen the secure server’s: CourseNana.COM

·       Public key (e, n) CourseNana.COM

·       Private key (d, n) CourseNana.COM

·       Certificate issued by a Certification Authority (CA) – make your own dCA(e,n) CourseNana.COM

2.     Print on screen the received encrypted NONCE e(NONCE). CourseNana.COM

3.     Print on screen the decrypted NONCE d(e(NONCE)). CourseNana.COM

4.     Once the NONCE is correctly decrypted, print on screen the ACK transmitted to the client CourseNana.COM

·       ACK 220 nonce ok. CourseNana.COM

5.     During the communication session: CourseNana.COM

·       Print the encrypted message received from the client. CourseNana.COM

·       Print the decrypted message after applying RSA-CBC. CourseNana.COM

  CourseNana.COM

Secure Client: CourseNana.COM

1.     Print on screen the received certificate from the secure server: CourseNana.COM

·       dCA(e,n) CourseNana.COM

2.     Print on screen the decrypted certificate from the secure server: CourseNana.COM

·       eCA(dCA(e,n)) CourseNana.COM

3.     Print on screen the ACK transmitted by the client once it has decrypted the certificate of the server successfully. CourseNana.COM

·       ACK 226 public key received. CourseNana.COM

4.     Print on screen the NONCE. CourseNana.COM

5.     Print on screen the encrypted NONCE e(NONCE). CourseNana.COM

6.     Print ACK transmitted by the client once it has encrypted the NONCE successfully. CourseNana.COM

·       ACK 226 public key received. CourseNana.COM

7.     During the communication session: CourseNana.COM

·       Print the plaintext message. CourseNana.COM

·       Print the encrypted message (using RSA-CBC). CourseNana.COM

Restrictions: CourseNana.COM

·       Big Number Library: You may only the Boost C++ library for implementing big numbers in your cryptographic method.  No other libraries are allowed (i.e. GMP library is not allowed) CourseNana.COM

·       OpenSSL (or other libraries with built-in cryptographic functions) is not allowed in this assignment as students are expected to learn how to implement the core algorithms from scratch. CourseNana.COM

·       The cross-platform start-up code compiles and runs on both Windows and Unix-based systems but the assignment will be marked only in a Windows environment. CourseNana.COM

Get in Touch with Our Experts

WeChat WeChat
Whatsapp WhatsApp
New Zealand代写,Massey University代写,159342代写,Operating Systems and Networks代写,Cryptography代写,RSA algorithm with Cipher Block Chaining代写,New Zealand代编,Massey University代编,159342代编,Operating Systems and Networks代编,Cryptography代编,RSA algorithm with Cipher Block Chaining代编,New Zealand代考,Massey University代考,159342代考,Operating Systems and Networks代考,Cryptography代考,RSA algorithm with Cipher Block Chaining代考,New Zealandhelp,Massey Universityhelp,159342help,Operating Systems and Networkshelp,Cryptographyhelp,RSA algorithm with Cipher Block Chaininghelp,New Zealand作业代写,Massey University作业代写,159342作业代写,Operating Systems and Networks作业代写,Cryptography作业代写,RSA algorithm with Cipher Block Chaining作业代写,New Zealand编程代写,Massey University编程代写,159342编程代写,Operating Systems and Networks编程代写,Cryptography编程代写,RSA algorithm with Cipher Block Chaining编程代写,New Zealandprogramming help,Massey Universityprogramming help,159342programming help,Operating Systems and Networksprogramming help,Cryptographyprogramming help,RSA algorithm with Cipher Block Chainingprogramming help,New Zealandassignment help,Massey Universityassignment help,159342assignment help,Operating Systems and Networksassignment help,Cryptographyassignment help,RSA algorithm with Cipher Block Chainingassignment help,New Zealandsolution,Massey Universitysolution,159342solution,Operating Systems and Networkssolution,Cryptographysolution,RSA algorithm with Cipher Block Chainingsolution,