Sie sind auf Seite 1von 3

CMPSCI 177 - Computer Security Fall 2012 Third Homework - DES, Public Key, and Key Management Solution

Set Part I: DES 1. Consider the following 64 bit key: 1011010111001001001001011010101100101101001110001010101000101101 What is the value of the key used for the fourth round of the DES encryption algorithm? The 64 bit key is permuted using PC1, stripping the parity bits and rearranging the remaining 56 bits. These are split into two 28 bit halves, which are rotated a total of 6 positions for the fourth round. The rotated halves are permuted through PC2, resulting the 48 bit key: 101110001010001000101011111001010100001010011100

2. Consider the following 48 bit string: 100111010010111010010011011101001011000101001101 If this string is input to the s boxes in the DES encryption algorithm, what string is output from the s boxes? Example: Look up 100111 in S1: Row 100111, Column 100111 results in value 2: 0010 0010 0111 1010 0111 1000 1100 1011 0111

Part II: Public Key 1. What is the totient of 52? Defend your answer. The totient of 52 is 24. This is evident because there are 24 totatives, numbers less than 52 which are relatively prime to 52. The 24 totatives are 3, 5, 7, 9, 11, 15, 17, 19, 21, 23, 25, 27, 29, 31, 33, 35, 37, 39, 41, 43, 45, 47, 49, and 51. 2. Use the superincreasing sequence S=[2,5,8,17,36,73,142], modulus n=317, and multiplier w=17 to generate a public key sequence H for Merkle-Hellman. H[i] = S[i] * w mod n, where i goes from 1 to 7. H = [34,85,136,289,295,290,195] 3. Assume that you received the ciphertext C=813 from someone using the public key generated in exercise 2. You are to decipher C and determine the message M that was used to generate C.

To get M compute: w-1 = 56 C * w-1 % n = [number to decompose] Plugging in n, w, and C, we get: 813 * (56) % 317 = 197 Moving from right to left in S, we can decompose 197: 197 - 142 = 55 (1) 55 < 73 (0) 55 - 36 = 19 (1) 19 - 17 = 2 (1) 2 < 8 (0) 2 < 5 (0) 2 - 2 = 0 (1) M = 1001101 or 77 4. Alice has chosen primes p=7927 and q=6997 and exponent e=5 to use with the RSA algorithm. What does Alice publish as her public key? Alice will use e and n as her public key. e is 5, n is p*q = 55465219. So alice sends (5, 55465219). 5. Suppose Alice receives the following message from Bob, who used the public key from exercise 4 to encrypt it: 31229978. Determine the plaintext that Alice obtains from this ciphertext. d = e-1 mod (p-1)*(q-1) = 5-1 mod 55450296 = 44360237 M = Cd mod n = 30729435 Part III: Key Management 1. Generate a set of GnuPG private/public keys for yourself and add your picture to the public key (man gpg to nd out how). The picture will be included with your public key, so make it very small in terms ofle size! I suggest a 128x128 greyscale JPG image. gpg --gen-key gpg --edit-key <your key id> > addphoto 2. Upload your public key to the MIT pgp keyserver, pgp.mit.edu gpg --keyserver pgp.mit.edu --send-key [your key ID]

3. Get at least two classmates to sign your public key, and sign at least two classmates public keys. Ensure they upload the signed key to the MIT keyserver. For each key you signed, explain the process you used to obtain, verify, and sign the key. You should have downloaded a public key of a classmate from the MIT keyserver, then verify it by either checking that its been signed by a key you already trust, or verifying with the owner of the key that the fingerprint matches. gpg --keyserver pgp.mit.edu --recv-key [classmates keyID] gpg --fingerprint <Key_ID> gpg --list-keys gpg --list-sigs gpg --sign-key <Key_ID> 4. Create a 4 line le that contains: Your CS user name Your email address as provided in your key Your Key ID A random fact about yourself 5. Sign this message in clear text, using your secret key. Submit your clearsigned message through the online submission form. What benets does this clearsigning provide? What properties of security does this guarantee? A user can use gpg --verify on a clearsigned message to verify two properties of security: Data Integrity and Origin Integrity. Anyone with the public key of the sender can check that the message was sent by the claimed sender, and that the message has not been modified since it was signed. 6. Encrypt the message above using the graders public key (obtain from the MIT keyserver using Key ID DD266DEE). ASCII armor the output, and email your encrypted, ASCII armored message to cs177@dannyiland.com. Ensure your ASCII armored message is the only contents of the body of the email, so dont include signatures or greetings. Make the subject line of the email match EXACTLY the following format: CS177 HW3 [YOUR EMAIL] [YOUR KEY ID], i.e. CS177 HW3 iland@cs.ucsb.edu B626097A Encrypt and armor the file, with the grading public key set as the recipient. gpg --keyserver pgp.mit.edu --recv-keys DD266DEE gpg -ea -r DD266DEE previous_message.txt

Das könnte Ihnen auch gefallen