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

  Networking and types of networking

This assignment explains the networking features, different kinds of networks and also how they are arranged.

  National and Global economic environment and ICICI Bank

While working in an economy, it has a separate identity but cannot operate insolently.

  Ssh or openssh server services

Write about SSH or OpenSSH server services discussion questions

  Network simulation

Network simulation on Hierarchical Network Rerouting against wormhole attacks

  Small internet works

Prepare a network simulation

  Solidify the concepts of client/server computing

One-way to solidify the concepts of client/server computing and interprocess communication is to develop the requirements for a computer game which plays "Rock, Paper, Scissors" using these techniques.

  Identify the various costs associated with the deployment

Identify the various costs associated with the deployment, operation and maintenance of a mobile-access system. Identify the benefits to the various categories of user, arising from the addition of a mobile-access facility.

  Describe how the modern view of customer service

Describe how the greater reach of telecommunication networks today affects the security of resources which an organisation provides for its employees and customers.

  Technology in improving the relationship building process

Discuss the role of Technology in improving the relationship building process Do you think that the setting of a PR department may be helpful for the ISP provider? Why?

  Remote access networks and vpns

safekeeping posture of enterprise (venture) wired and wireless LANs (WLANs), steps listed in OWASP, Securing User Services, IPV4 ip address, IPV6 address format, V4 address, VPN, Deploying Voice over IP, Remote Management of Applications and Ser..

  Dns

problems of IPV, DNS server software, TCP SYN attack, Ping of Death, Land attack, Teardrop attack, Smurf attack, Fraggle attack

  Outline the difference between an intranet and an extranet

Outline the difference between an intranet and an extranet A programmer is trying to produce an applet with the display shown in Figure 1 below such that whenever one of the checkboxes is selected the label changes to indicate correctly what has..

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