Problem

For the following exercises, use the incremental development methodology to implement th...

For the following exercises, use the incremental development methodology to implement the program. For each exercise, identify the program tasks, create a design document with class descriptions, and draw the program diagram. Map out the development steps at the start. Present any design alternatives and justify your selection. Be sure to perform adequate testing at the end of each development step.

A public-key cryptography allows anyone to encode messages while only people with a secret key can decipher them. In 1977, Ronald Rivest, Adi Shamir, and Leonard Adleman developed a form of public-key cryptography called the RSA system.

To encode a message using the RSA system, one needs n and e. The value n is a product of any two prime numbers p and q. The value e is any number less than n that cannot be evenly divided into y (that is, y e would have a remainder), where y = (p - 1) × (q - 1). The values n and e can be published in a newspaper or posted on the Internet, so anybody can encrypt messages. The original character is encoded to a numerical value c by using the formula

c = me mod n

where m is a numerical representation of the original character (for example, 1 for A, 2 for B, and so forth).

Now, to decode a message, one needs d. The value d is a number that satisfies the formula

e ·d mod y = 1

where e and y are the values defined in the encoding step. The original character m can be derived from the encrypted character c by using the formula

m = cd mod n

Write a program that encodes and decodes messages using the RSA system. Use large prime numbers for p and q in computing the value for n, because when p and q are small, it is not that difficult to find the value of d. When p and q are very large, however, it becomes practically impossible to determine the value of d. Use the ASCII values as appropriate for the numerical representation of characters. Visit http://www.rsasecurity.com for more information on how the RSA system is applied in the real world.

Step-by-Step Solution

Request Professional Solution

Request Solution!

We need at least 10 more requests to produce the solution.

0 / 10 have requested this problem solution

The more requests, the faster the answer.

Request! (Login Required)


All students who have requested the solution will be notified once they are available.
Add your Solution
Textbook Solutions and Answers Search
Solutions For Problems in Chapter 9