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

  Plan for setting up network managment separated by routers

At present WAN has seven networks separated by routers. Networks support 12 servers and 145 clients. Write a brief plan for setting up network managment solution for network.

  Explain personnel implication setting up wan on global basis

Explain what the personnel implications are when setting up a WAN on a global basis. What are some of the barriers involved with global teams?

  What are differences between lans and wireless lans

The latest member of the 802.11 family is 802.11n. What are some immediately noticeable differences between LANs and Wireless LANs?

  How many addresses are left

An organisation has been granted a block of addresses starting with the address 172.154.68.0/22.

  What might be preventing the two tellers from logging

What concerns would you bring up with regard to allowing customers access to their account information off the Web? How might Internet access affect the ban's internal LAN?

  Determining entropy of ciphertext message

A crypto device encrypts each message into 20 bits of ciphertext.What is the entropy of the plaintext message? What is the entropy of the ciphertext message?

  How is the adoption of an enterprise security framework

1. Identify and discuss at least three major evolutionary steps in digital computing/networking experienced in major organizations. If possible, provide such insight regarding your current or former organization.

  Explain concept of wireless access to employees

Explain the concept of providing wireless access to employees from perspective of employee benefits and effect to organization.

  Explaining registration department becoming decentralized

A consulting firm has narrowed the choice of programming language to Java and C#. Which language do you think would be more appropriate for this application and why?

  Computing successive values of congestion window

Determine successive values of congestion window in bytes?

  Equalities by induction on n

Be the sum of the first n cubes. Prove the following equalities by induction on n, to arrive at the curious conclusion

  Explain the benefits of server-side software

Explain the benefits of server-side software and how it give mobile users with access to particular kinds of communications and information.

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