Show Bid Request
Arrays, Strings, and Pointers
Bid Request Id: 50519
|
|
|
Posted by: |
Sisi (0 ratings)
|
Non-action Ratio: |
Very Good - 0.00%
|
Buyer Security Verifications: |
Good
|
Approved on: |
Feb 28, 2003 9:30:28 AM EDT
|
Bidding Closes: |
Mar 14, 2003 2:47:46 AM EDT
|
Viewed (by coders): |
179 times
|
|
|
|
Description:
Write a C program that breaks a code and decrypts a text message. Suppose we want to encrypt the 7 symbols A,B,C,D,E,F,and G. We map these symbols into the integers 0,1,2,3,4,5,and 6, respectively. The public key U is a positive integer less than 7. The offset F is a positive integer less than 7. To encrypt the symbol represented by integer i, we use this formula: (i * U + F)%7 To decrypt the message, we need to know the private key V. With V, we can use this formula to decrypt the letter i: ((7 + i - F)*V)%7 Private key V is the unique positive integer less than 7 for which U*V%7 = 1. If U=3, then V=5, since 3*5=15, and 15%7=1.Your program should open file "key.txt" and read from it two integers. The first integer is the public key U. The second integer is the offset F. It should break the code by finding the value of the private key V. V is an integer between 1 and 94 such that U*V % 95 = 1. It should open file "secret.txt" containing the encrypted message. The program should read a line of text from the file, decrypt the entire line, print the decrypted line to standard output, and repeat until the end of the file is reached. Your program must decyrpt the message line-by-line, rather than character-by-character. Your program should use functions where appropriate. For extra credit, your program should store the entire body of the message in a two-dimensional array of characters. After printing the decrypted message, your program should use the public key to encrypt the message again and print the encrypted message on the screen. The encrypted message your program computes will be identical to the encrypted message stored in file "secret.txt". However, you will not receive credit for simply echoing the contents of file "secret.txt". Your program must actually encrypt the plain text message
Deliverables: 1) Complete and fully-functional working program(s) in executable form as well as complete source code of all work done.
2) Installation package that will install the software (in ready-to-run condition) on the platform(s) specified in this bid request.
3) Complete ownership and distribution copyrights to all work purchased.
4) Complete and executable source file (.c file) and project file (.mcp file).
Platform:
Codewarrior Version 6.1
Remember that contacting the other party outside of the site (by email, phone, etc.) on all business projects < $500 (before the buyer's money is escrowed) is a violation of both the software buyer and seller agreements.
We monitor all site activity for such violations and can instantly expel transgressers on the spot, so we thank you in advance for your cooperation.
If you notice a violation please help out the site and report it. Thanks for your help.
|
|
Bidding/Comments:
|
All monetary amounts on the site are in United States dollars.
Rent a Coder is a closed auction, so coders can only see their own bids and comments. Buyers can view every posting made on their bid requests. |
See all rejected bids (and all comments)
Name |
Bid Amount |
Date |
Coder Rating |
|
|
|
This bid was accepted by the buyer!
|
$20 (USD)
|
Feb 28, 2003 6:47:24 PM EDT
|
10
(Excellent)
|
|
|
Hello I can do it for you with formatting of the output and will provide support until your stiafaction. I will also code to get you EXTRA credits.
Looking forward to you.
Amit Kumar Agarwal,
Software Architect
|
|
|
|
|
|
|