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

  Question about memory effectiveness

The following memory partitions of 100 kb, 500 kb, 200 kb, 300 kb, and 600 kb, how would each of the 1st-fit, best-fit, and worst-fit algorithms place processes of 212 kb, 417 kb, 112 kb, and 426 kb?

  Determine the maximum sustainable data rate

New token is put into bucket every 5 μsec. Each token is good for one cell, which comprises 48 bytes of data. Determine the maximum sustainable data rate?

  A rural medical centre in australia

A rural medical centre in Australia plans to improve its services to the community by providing telemedicine and healthcare. The centre has 4 doctors working at a given time and some patients travel over 100km to see a doctor.

  Explain system enforces both blp and biba properties

Integrity SL = security clearance for level L = integrity clearance for level L SC = security category set for cat. C = integrity category set for cat C. Prove that in this system subject can only read and write at his own level.

  Provide the network diagrams

list the assumptions made. - Note: The assumptions are not the requirements that are provided in the task. They are the additional requirements that you need for your design.

  Design application-layer protocol for streaming video

Suppose you are designing the application-layer protocol for streaming video. How would you deal with unreliability of Internet Protocol?

  Pros and cons of long distances agreements

The telephone communication systems and long distances agreements are managed by a telecommunications department in the headquarters that reports to the vice president of finance. Outline pros and cons of both alternatives.

  Draw a diagram showing the sliding window and pointer

After b. the source receives acknowledgment of receipt of byte 300 and an announcement of a new window size of 300 bytes. Draw a diagram showing the sliding window and pointer at the source.

  Distinguish traffic in current isp backbones-manage quality

Based on reading, is there pressing require to distinguish traffic in current ISP backbones to manage quality of service? Explain why or why not.

  What are advantages and disadvantages of networked computers

What are some advantages and disadvantages of networked computers? Explain some similar characterisitcs between a network and the internet.

  What allows the ip layer to determine where to send a packet

what allows the IP layer to determine where to send a packet next? What settings are used to make that decision?

  Compute theoretical maximum channel capacity-telephone lines

Given the narrow (usable) audio bandwidth of the telephone transmission facility, nominal SNR of 56 dB (400,000), and a distortion level of

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