Computer and Network Security

advertisement
Computer and Network Security
RC5 Project
Dr. Ron Rymon
Purpose: Hands-on experience implementing an encryption algorithm.
Statement of Work: Follow the RC5 CBC specification to implement a fully-functional
utility for encrypting and decrypting messages. The implementation shall have
configurable number of rounds, block size, and key size, and shall work in CBC mode.
You can use either Java, C#, or C++. The exercise shall be submitted by pairs. However,
I highly recommend that each student implement the main functions on his/her own. The
due date is December 27. Submissions by December 20 will receive a 5% bonus. Late
submissions will be penalized 2 points per day.
Inputs:
 a plaintext file p.txt with the message in ASCII format
 a ciphertext file c.txt, in a Radix-64 format;
 a key file k.txt, with the key in Hexadecimal format.
 A configuration file that includes in text format the following parameters: Block
size (default=64 bits); Key size (default=128 bits); Number of rounds
(default=16)
Process:
 Provided with a configuration file and a plaintext file, the program shall produce
an encrypted ciphertext file;
 Provided with a configuration file and a ciphertext file, the program shall produce
the decrypted plaintext file;
 Provided with a configuration file and both plaintext and ciphertext files, the
program shall check whether the two match.
Submission: Please submit the following electronically (compressed!) to ilan dot atias at
gmail dot com:
 executable version of the software, with one or more examples in separate folders;
 the source code for the software, including a brief programmer documentation,
indicating the main classes, functions and interfaces;
 Please submit a hardcopy of the source code + docs in class on December 27.
Resources: You can find the exact specification of RC5 in Schneier’s book “Applied
Cryptography” (Chapter 12). See also the attached RFC.
Good Luck!
Values of P and Q
#define P16 0xb7e1
#define Q16 0x9e37
#define P32 0xb7e15163
#define Q32 0x9e3779b9
#define P64 0xb7e151628aed2a6b
#define Q64 0x9e3779b97f4a7c15
Examples of Plaintext and Ciphertext (from the RC5 RFC)
RC5_CBC R = 8
Key = 01020304 IV = 0000000000000000
P = ffffffffffffffff C = 8285e7c1b5bc7402
RC5_CBC R = 12
Key = 01020304 IV = 0000000000000000
P = ffffffffffffffff C = fc586f92f7080934
RC5_CBC R = 16
Key = 01020304 IV = 0000000000000000
P = ffffffffffffffff C = cf270ef9717ff7c4
Download