A simple implementation of the rsa algorithm

Assignment Help Computer Networking
Reference no: EM13342037

Encryption – a simple implementation of the RSA algorithm 

--------------------------------------------------------------------------------------------------------------------------------------- 

In this assignment, your task is to implement RSA in a simple client/server application using sockets. The client program encrypts all messages sent to the server. Once a connection is established, the server has to send its public key for the session to the client. The client will then use the public key to encrypt messages sent to the server. The server uses its private key to decrypt the messages and print out the decrypted messages received. 

For subsequent new connections (new sessions) the server's public and private keys should be different. For this assignment you should use TCP, and you do not have to implement non-blocking communications. 

When running the client and server, if the user types into the client “hello”, the server would receive the message, decrypt it and print something like the following: 

The server received the message “A85CE8DC452CAE51” 

And after decrypting the message received is “hello” 

When printing the message received, you should print it in hexademical as above. Be very careful with newline characters because these can throw off the encrypted ciphertext completely, and decrypting would give the wrong answer. You should remove any newline characters before encrypting and before decrypting. 

-------------------------------------------------------------------------------------------------------------------------------------- 

Implementation Details 

There are unfortunately a lot of details in a real implementation of RSA that might have to be left out in order to keep this task in the scope of an assignment. You have to ask the following questions regarding some decisions about your implementation of a simple RSA algorithm: 

1. What will the sizes of the keys be? 

2. Should encryption be done character by character or computed over a set of characters (block-wise)? 

3. Should messages be padded? 

4. Do you need an arbitrary precision library or will you use keys small enough to use simple exponential code? (Note: you will not be penalised for using small keys). 

5. How will the public key be sent from the server to the client? In hexadecimal? What will the packet format look like? 

6. Where do the public and private key pairs come from? 

The answers to these questions will determine how your encryption protocol works. 

-------------------------------------------------------------------------------------------------------------------------------------Specifications: 

1. You are allowed to use relatively small prime number pairs, but do not use pairs that will make the same keys for encryption and decryption. So avoid the pair p=5 and q=7, for example. 

2. The keys should be different for each subsequent connection (ie. every time a client connects to a running server). You can use a limited set of keys defined statically in your program, or compute a new private/public key pair when the client asks for the establishment of a connection. You can repeat the keys you use every 3 or more connections. 

3. You can use the client and server starter programs on Stream, and feel free to change them as you see fit. 

Notes 

1. Submit your client.c and server.c code electronically via Stream. 

2. This assignment is worth 15 marks. 

3. Marks will be subtracted for obvious copying and/or for delays without justification.

Reference no: EM13342037

Questions Cloud

Fostering friendship with other organization : Some Fair Price manager or residential officer does not allow to help us collecting the egg cartons because they don’t believe this project is real and serious ? – we built a advertisement of our project to the website ( asking for volunteer , donati..
Compute the magnitude of angular acceleration of the roll : a large 17 kg roll of paper with radius r=19cm rests against the wall and is held in place by a bracket attached to a rod through the center of the roll. compute the magnitude of the angular acceleration of the roll
What temp will equilibrium be reached at standard condition : A certain reaction has deltaH standard = 57.3 Kj, DeltaS standard =235 J/K. At what Temp will equilibrium be reached at standard conditions, in celsius
What is magnitude of the point charge creating the potential : If the radius of the equipotential surface of point charge is 13.5 m at a potential of 2.10 kV, what is the magnitude of the point charge creating the potential
A simple implementation of the rsa algorithm : For subsequent new connections (new sessions) the server's public and private keys should be different. For this assignment you should use TCP, and you do not have to implement non-blocking communications.
Find the maximum vertical height increase of the ball : a child rolls a 0.685kg basketball up a long ramp. the basketball can be considered a thin walled hollow sphere. find the maximum vertical height increase of the ball
Explain pure covalent and polar covalent and or ionic : Determine whether a bond between each of the following pairs of atoms would be pure covalent, polar covalent, or ionic. H and H N and O N and Cl
Will the electron move toward the lower potential region : An electron is released in a region where there is a varying electric potential. Will the electron move toward the lower potential region or the higher potential region
What is the mean response time of centralized system : The assignment must be submitted in soft (electronic) copy in Moodle within the due date which will be checked by turnitin. Assignment will be marked on Moodle.

Reviews

Write a Review

Computer Networking Questions & Answers

  What is security forensic

What is security Forensic? How can an organization ensure that personnel does not become part of the security problem.

  Design network to integrate wireless-existing wired network

Design a network that will integrate a wireless network into an existing wired network. The wired network consists of five departments in a two-story building.

  A network emulator to perform network analysis

Present the e-learning platform IREEL which is going to be used in this lab and provides some information regarding the tools used in this lab.

  Explain stop-and-wait error control

Explain Stop-and-Wait Error Control and Sliding Window Error Control techniques.

  Attack can be detected and mitigated by stateless firewall

For each of the following attacks, say whether the attack can be detected and mitigated (to a significant degree) by a stateless or stateful firewall. Explain briefly.

  Explain networking concepts by using osi model as framework

Explain networking concepts by using OSI Model as framework. Explain protocols at different layers of the OSI model and describe their functionality.

  Comparison of pptp, l2tp and sstp

Provide a brief comparison of PPTP, L2TP and SSTP, outlining the advantages and disadvantages of each. Which organizations might choose to implement a VPN service hosted on a Windows Server 2012 system?

  Role of project managers and telecommunications managers

Describe in scholarly detail "technical jargon" and describe the role of project managers and telecommunications managers.

  A certain area is covered by a cellular radio

A certain area is covered by a cellular radio system with 84 cells and a cluster size of N. 300 voice channels are available in the system. Users are uniformly distributed over the area covered by the cellular system

  Explain a tcp connection between host a and host b

Is it possible for an application to enjoy reliable data transfer even when the application runs over UDP? If so, please be specific in your answer of how this takes place.

  Produce a test plan for the new inventory system

Produce a report detailing how you will manage the transition to the new platform so as to assure the quality of the process and hence the outcome.

  Explain benefits of providing synchronization tool

Using a FIFO policy, slim reader-writer locks favor neither readers nor writers, nor are waiting threads ordered in a FIFO queue. Explain the benefits of providing such a synchronization tool.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd