440 likes | 561 Views
This lecture focuses on the foundational aspects ofcryptographic systems, primarily the Data Encryption Standard (DES) and the Advanced Encryption Standard (AES). Topics include the necessity for transitioning from DES to AES, evaluation criteria for encryption algorithms, and a summary of major cryptographic hash functions and their applications. The session encourages student presentations, emphasizing practical exercises on key generation, block cipher operations, and enhancing understanding of encryption methodologies. Discussions also cover cryptographic hash functions and message authentication codes (MACs).
E N D
Computer System SecurityCSE 5339/7339 Lecture 10 September 21, 2004
Contents • DES assignment • More Student Presentations • Advanced Encryption Standard (AES) • Cryptographic Hash • Mehmet’s Presentation
DES Group Exercise What would be the 64-bit output of round 1 be using the plaintext and key given below (in hexadecimal format): P = 2D 75 F4 DB A3 3E 3F 89 K = D4 3C B1 9A E4 90 D7 C6
Student presentations • 9/21 Mehmet • 9/23 Padmaraj • 9/28 • 9/30 • 10/5
Advanced Encryption Standard (ASE) • By mid 1990s, virtually all cryptologists agreed that DES needed to be replaced by an advanced encryption standard for the 21st century • In 1997, NIST issued a request for candidate AES algorithms.
The minimum requirements for a proposed algorithm: • A symmetric-key cryptosystem • A block cipher • Capable of supporting a block size of 128 bits • Capable of supporting key length of 128, 192, and 256 bits • Available on a worldwide, non-exclusive, royalty-free basis
Criteria for Evaluation • Security • Soundness of the mathematical basis for an algorithm’s claimed strength • Research community search for flaws • Computational Efficiency • Memory Requirements • Flexibility • Simplicity
Advanced Encryption Standard (ASE) • NIST chose 15 algorithms for evaluation in the first round, 9 of them were descendants of DES • One was selected out of five made it to the second round • Rijndael (Rine dahl) Vincent Rijmen & Joam Daemen • In 2001, it was formally adopted by US
ASE (cont) • Regular Rounds (9, 11, 13) • Additional final Round is different (10th, 12th, 14th) • Each regular round consists of 4 steps • Byte substitution (BSB) • Shift row (SR) • Mix column (MC) • Add Round key (ARK)
ASE Overview Plaintext (128) ARK Subkey0 9 rounds BSB SR Ciphertext (128) ARK Subkey10
Round i BSB SR CM ARK Subkeyi
State • 128-bit block 4 x 4 matrix • 128 bits 16 bytes b0, b1, b2, .., b15
Key • 128-bit key 4 x 4 matrix • 128 bits 16 bytes k0, k1, k2, .., k15
4 Operations 1. s[i,j] s’[i,j] (predefined substitution table, Table 10-11 page 663) 2. Rows – left circular shift 3. The 4 elements in each column are multiplied by a polynomial 4. Key is derived and added to each column
Exercise Using the table, Find the substitution of 6b, ff, 6e, 09
Byte Representation as polynomial One byte 8 bits B7, B6, B5, B4, B3, B2, B1, B0 B7x7 + B6 x6 + B5 x5 + B4 x4 + B3 x3 + B2 x2 + B1 x + B0 Example: E5 (hex) = 1110 0101 (binary) = x7 + x6 + x5 + x2 + 1 (poly)
Mix Column = * Multiplying by 1 no change Multiplying by 2 shift left one bit Multiplying by 3 shift left one bit and XOR with original value More than 8 bits 100011011 is subtracted
Exercise = *
Add Key kx = b’x bx XOR
Example k = 1f 34 0c da 5a 29 bb 71 6e a3 90 f1 47 d6 8b 12 B = e5 a8 6f 33 0a 52 31 9c c2 75 f8 1e b0 46 de 3a B’ = fa 9c 63 9e 50 7b 8a ed ac d6 68 ef f7 90 55 28
4 bytes 4 bytes 4 bytes 4 bytes 4 bytes 4 bytes 4 bytes 4 bytes Key Generation Circular left shift 1byte S-box X-OR Round constant X-OR
Group Exercise k = 1f 34 0c da 5a 29 bb 71 6e a3 90 f147 d6 8b 12 Final 4 bytes = 47 d6 8b 12 After shift = d6 8b 12 47 Find the next sub key
Cryptographic Hash Functions (take notes) • Message Digest Functions • Protect integrity • Users create a message digest or fingerprint of a digital document • Message Authentication Codes (MACs) • Protect both integrity and authenticity • MACs produce fingerprints based on both a given document and a secret key
Message Digest Functions • Checksums fingerprint of a message • If the message changes, the checksum will not match • Most checksums are good in detecting accidental changes made to a message • They are not designed to prevent an adversary from intentionally changing a message resulting a message with the same checksum • Message digests are designed to protect against this possibility
One-Way Hash Functions M H H(M) = h Example M = “Elvis” H(M) = (“E” + “L” + “V” + “I” + “S”) mod 26 H(M) = (5 + 12 + 22 + 9 + 19) mod 26 H(M) = 67 mod 26 H(M) = 15
Collision x H H(x) = Example x = “Viva” Y = “Vegas” H(x) = H(y) = 2 y H H(y)
Collision-resistant, One-way hash functions • Given M, it is easy to compute h • Given any h, it is hard to find any M such that H(M) = h • Given M1, it is difficult to find M2 (not identical to M1) such that H(M1) = H(M2) Functions that satisfy these criteria are called message digest. They produce a fixed-length digest (fingerprint)
The Secure Hash Algorithm (SHA-1) SHA-1 160-bit message digest A message composed of b bits
Step 1-- Padding • Padding the total length of a padded message is multiple of 512 • Every message is padded even if its length is already a multiple of 512 • Padding is done by appending to the input: • A single bit, 1 • Enough additional bits, all 0, to make the final 512 block exactly 448 bits long • A 64-bit integer representing the length of the original message in bits
Example • M = 01100010 110010101001 (20 bits) • Padding is done by appending to the input: • A single bit, 1 • 427 0s • A 64-bit integer representing 20 • Pad(M) = 01100010 1100101010011000 … 00010100
Example • Length of M = 500 bits • Padding is done by appending to the input: • A single bit, 1 • 459 0s • A 64-bit integer representing 500 • Length of Pad(M) = 1024 bits
Initialize 85 32-bit words (Hexa) • H0 = 67452301 • H1 = EFCDAB89 • H2 = 98BADCFE • H3 = 10325476 • H4 = C3D2E1F0 • K0 – K19 = 5A827999 • K20 – K39 = 6ED9EBA1 • K40 – K59 = 8F1BBCDC • K60 – K79 = CA62C1D6
Step 2-- Dividing Pad(M) • Pad (M) = B1, B2, B3, …, Bn • Each Bi denote a 512-bit block • Each Bi is divided into 16 32-bit words W0, W1, …, W15
Step 3– Use W0 - W15 to compute W16 – W79 • To Compute word Wj (16<=j<=79): • Wj-3, Wj-8, Wj-14 , Wj-16 are XORed • The result is circularly left shifted one bit
Step 4– Copy H0 – H4 into A,B,C,D,E • A = H0 • B = H1 • C = H2 • D = H3 • D = H4
Step 5– Four functions • For j = 0, 19 fj(B,C,D) = (B AND C) OR ( B AND D) OR (C AND D) • For j = 20, 39 fj(B,C,D) = (B XOR C XOR D) • For j = 40, 59 fj(B,C,D) = (B AND C) OR ((NOT B) AND D) • For j = 60, 79 fj(B,C,D) = (B XOR C XOR D)
Step 6– Loop For j = 0 to 79 Do TEMP = Circular_left_shift_5 (A) + fj(B,C,D) + E + Wj + Kj E = D; D = C; C = Circular_left_shift_30(B); B = A; A = TEMP Done + addition (ignore overflow)
Step 7– Final H0 = H0 + A H1 = H1 + B H2 = H2 + C H3 = H3 + D H4 = H4 + E
Done Once these steps have been performed on each 512-bit block (B1, B2, …, Bn) of the padded message in turn, the 160-bit message digest is given by H0 H1 H2 H3 H4
Message Authentication Codes (MACs) • A message authentication code (MAC) is a key-dependent message digest function: MAC(M,K) = h
A MAC Based on a Block Cipher M1 M1 M1 XOR XOR Encrypt … Encrypt Encrypt MAC K K K