Private Key Algorithms Feistel Networks AES

Slides:



Advertisements
Similar presentations
Origins  clear a replacement for DES was needed Key size is too small Key size is too small The variants are just patches The variants are just patches.
Advertisements

Chap. 5: Advanced Encryption Standard (AES) Jen-Chang Liu, 2005 Adapted from lecture slides by Lawrie Brown.
1 CIS 5371 Cryptography 5b. Pseudorandom Objects in Practice Block Ciphers.
Cryptography and Network Security Chapter 5 Fifth Edition by William Stallings Lecture slides by Lawrie Brown.
Cryptography and Network Security Chapter 5
Computer Science CSC 405By Dr. Peng Ning1 CSC 405 Introduction to Computer Security Topic 2. Basic Cryptography (Part II)
Announcements: Quiz grades entered Quiz grades entered Homework 4 updated with more details. Homework 4 updated with more details. Discussion forum is.
Cryptography and Network Security
1 The AES block cipher Niels Ferguson. 2 What is it? Block cipher: encrypts fixed-size blocks. Design by two Belgians. Chosen from 15 entries in a competition.
Algorithm Scheme. AddRoundKey Each round uses four different words from the expanded key array. Each column in the state matrix is XORed with a different.
Announcements: Ch 3 quiz next week (tentatively Friday). Will include fields (today) Ch 3 quiz next week (tentatively Friday). Will include fields (today)Today:
Windows Core Security1© 2006 Microsoft Corp Cryptography: Helping Number Theorists Bring Home the Bacon Since 1977 Dan Shumow SDE Windows Core Security.
AES clear a replacement for DES was needed
Cryptography and Network Security (AES) Dr. Monther Aldwairi New York Institute of Technology- Amman Campus 10/18/2009 INCS 741: Cryptography 10/18/20091Dr.
RIJNDAEL Arta Doci University Of Colorado.
Introduction to Modern Cryptography Lecture 3 (1) Finite Groups, Rings and Fields (2) AES - Advanced Encryption Standard.
Cryptography and Network Security Chapter 5. Chapter 5 –Advanced Encryption Standard "It seems very simple." "It is very simple. But if you don't know.
Cryptography and Network Security Chapter 5 Fourth Edition by William Stallings.
15-853:Algorithms in the Real World
Announcements: Quizzes graded, but not in gradebook. (Current grade gives 0 on the parts you shouldn’t have done .) Quizzes graded, but not in gradebook.
ECE454/CS594 Computer and Network Security Dr. Jinyuan (Stella) Sun Dept. of Electrical Engineering and Computer Science University of Tennessee Fall 2011.
Chapter 12 Cryptography (slides edited by Erin Chambers)
296.3:Algorithms in the Real World
Cryptography and Network Security
Number Theory and Advanced Cryptography 1. Finite Fields and AES
Cryptography and Network Security
Chapter 5 –Advanced Encryption Standard "It seems very simple." "It is very simple. But if you don't know what the key is it's virtually indecipherable."
Private Key Algorithms RSA SSL
9/17/15UB Fall 2015 CSE565: S. Upadhyaya Lec 6.1 CSE565: Computer Security Lecture 6 Advanced Encryption Standard Shambhu Upadhyaya Computer Science &
Advance Encryption Standard. Topics  Origin of AES  Basic AES  Inside Algorithm  Final Notes.
AES Background and Mathematics CSCI 5857: Encoding and Encryption.
Information Security Lab. Dept. of Computer Engineering 122/151 PART I Symmetric Ciphers CHAPTER 5 Advanced Encryption Standard 5.1 Evaluation Criteria.
Data Security and Encryption (CSE348) 1. Lecture # 12 2.
15-499Page :Algorithms and Applications Cryptography I – Introduction – Terminology – Some primitives – Some protocols.
Information Security Lab. Dept. of Computer Engineering 87/121 PART I Symmetric Ciphers CHAPTER 4 Finite Fields 4.1 Groups, Rings, and Fields 4.2 Modular.
Cryptography Lecture 17: Advanced Encryption Standard (AES) Piotr Faliszewski.
Fifth Edition by William Stallings
DATA & COMPUTER SECURITY (CSNB414) MODULE 3 MODERN SYMMETRIC ENCRYPTION.
15-853Page :Algorithms in the Real World Cryptography.
15-499Page :Algorithms and Applications Cryptography II – Number theory (groups and fields)
Block Ciphers and the Data Encryption Standard. Modern Block Ciphers  One of the most widely used types of cryptographic algorithms  Used in symmetric.
Understanding Cryptography by Christof Paar and Jan Pelzl Chapter 4 – The Advanced Encryption Standard (AES) ver. October 28, 2009.
CSCE 715: Network Systems Security Chin-Tser Huang University of South Carolina.
CSCE 715: Network Systems Security Chin-Tser Huang University of South Carolina.
Practical Aspects of Modern Cryptography Josh Benaloh & Brian LaMacchia.
Cryptography Page Page 2 Cryptography Outline Introduction: terminology, cryptanalysis, security Primitives: one-way functions, trapdoors, …
Chapter3: Block Ciphers and the Data Encryption Standard
School of Computer Science and Engineering Pusan National University
6b. Practical Constructions of Symmetric-Key Primitives.
Introduction to Modern Symmetric-key Ciphers
Private Key Algorithms Key Exchange Protocols SSL
مروري برالگوريتمهاي رمز متقارن(كليد پنهان)
AES Objectives ❏ To review a short history of AES
Some of this slide set is from Section 2,
Fifth Edition by William Stallings
Introduction to Modern Symmetric-key Ciphers
15-853:Algorithms in the Real World
ADVANCED ENCRYPTION STANDARDADVANCED ENCRYPTION STANDARD
DTTF/NB479: Dszquphsbqiz Day 17
Block Ciphers: DES and AES
Introduction to Elliptic Curve Cryptography
Private Key Algorithms Feistel Networks AES
Introduction to Modern Cryptography
Cryptography and Network Security Chapter 5 Fifth Edition by William Stallings Lecture slides by Lawrie Brown.
Private Key Algorithms Feistel Networks AES
296.3:Algorithms in the Real World
Florida State University
Introduction to Modern Cryptography
Presentation transcript:

Private Key Algorithms Feistel Networks AES Computer Security Private Key Algorithms Feistel Networks AES

Symmetric/Private Key Algorithms Encryption Decryption Key1 Cyphertext C = Ek(M) M = Dk(C) Original Plaintext Plaintext

Private Key Exchange Private Key method Trent Eka(k) Ekb(k) Generates k Alice Bob Trusted third party Trent has already exchanged private keys ka and kb with Alice and Bob, respectively. Used by Kerberos. Public Key method Ek1(k) Alice Bob Generates k k1 = Bob’s public key Used by HTTPS/TLS/SSL

Diffie-Hellman Key Exchange A group (G,*) and a primitive element (generator) g is made public. Alice picks a, and sends ga to Bob Bob picks b and sends gb to Alice The shared key is gab Note this is easy for Alice or Bob to compute, but assuming discrete logs are hard is hard for anyone else to compute. Can someone see a problem with this protocol?

Person-in-the-middle attack Alice Bob Mallory ga gb gd gc Key1 = gad Key1 = gcb Mallory gets to listen to everything.

Private Key Algorithms Block Ciphers: blocks of bits at a time DES (Data Encryption Standard) Banks, linux passwords (almost), SSL, kerberos, … Blowfish (SSL as option) IDEA (used in PGP, SSL as option) AES Stream Ciphers: one bit (or a few bits) at a time RC4 (SSL as option) PKZip Sober, Leviathan, Panama, …

Private Key: Block Ciphers Encrypt one block at a time (e.g., 64 bits) ci = f(k,mi) mi = f’(k,ci) Keys and blocks are often about the same size. Equal message blocks will encrypt to equal codeblocks Why is this a problem? Various ways to avoid this: E.g. ci = f(k,ci-1  mi) “Cipher block chaining” (CBC) Why could this still be a problem? Solution: attach random block to the front of the message

Iterated Block Ciphers m key Consists of n rounds - DES: 16 rounds - AES: 10-14 rounds depending on key size R = the “round” function si = state after round i ki = the ith round key k1 R s1 k2 R s2 . . kn R c

Iterated Block Ciphers: Decryption m key Run the rounds in reverse. Requires that R has an inverse. k1 R-1 s1 k2 R-1 s2 . . kn R-1 c

Feistel Networks Even if function F is not invertible, rounds can still be made invertible. Requires 2 rounds to mix all bits. high-order bits low-order bits R-1 R ki ki F F XOR XOR Forwards Backwards Used by DES (the Data Encryption Standard)

Product Ciphers Each round has two components: Substitution on smaller blocks Decorrelate input and output: “confusion” Permutation across the smaller blocks Mix the bits: “diffusion” Substitution-Permutation Product Cipher Avalanche Effect: 1 bit of input should affect all output bits, ideally evenly, and for all settings of other bits

AES Selected by NIST as the new private-key encryption standard. Based on an open “competition”. Competition started Sept. 1997. Narrowed to 5 Sept. 1999 MARS by IBM, RC6 by RSA, Twofish by Counterplane, Serpent, and Rijndael Rijndael selected Oct. 2000. Official Oct. 2001? (AES page on Rijndael) Designed by Rijmen and Daemen (Dutch) The competition of 5 included an RSA entry.

AES Example http://aes.online-domain-tools.com/

Group A group consists of a set S and a binary operator  on S with the following properties: Closure: for all a,b  S, a  b  S Associativity: for all a,b,c  S, (a  b)  c = a  (b  c) Identity element: there exists an element e such that for each a  S, e  a = a  e = a Inverses: for each a  S there exists an element b such at a  b = b  a = e Examples: integers and addition {1,2,3,4} and multiplication mod 5 non-zero rational numbers and multiplication

Abelian Group A group is abelian or commutative if for every a and b, a  b = b  a

Field A field consists of a set S and two operations, addition () and multiplication () with the following properties: Closure under addition and multiplication Associativity of both addition and multiplication Commutativity of both addition and multiplication Identity elements for both addition and multiplication Inverses: additive inverse for every element, multiplicative inverses for all elements except additive identity Distributivity of multiplication over addition: a  (b  c) = (a  b)  (a  c) (a  b)  c = (a  c)  (b  c)

Examples of Fields Rational numbers with addition, multiplication Real numbers with addition, multiplication Complex numbers with addition, multiplication Finite fields: Zp = {0,1,2,…,p-1} (p prime), addition and multiplication mod p Galois Fields

High-level overview of AES An iterated block cipher with 10–14 rounds, 128-256 bit blocks, and 128-256 bit keys Mathematically reasonably sophisticated

Blocks and Keys The blocks and keys are organized as matrices of bytes. For the 128-bit case, it is a 4x4 matrix. Data block Key b0, b1, …, b15 is the order of the bytes in the stream.

Galois Fields Finite fields of size Pn for P prime, any n  0. Let ZP[x] denote the set of polynomials on variable x with coefficients drawn from ZP. Then the polynomials ZP[x] mod p(x) where p(x)  ZP[x] p(x) is irreducible (cannot be factored) and deg(p(x)) = n (i.e., n+1 coefficients) form a finite field. Such a field has pn elements. (Irreducibility ensures multiplicative inverses.) These fields are called Galois Fields or GF(Pn). The special case n = 1 reduces to the fields ZP The multiplicative group of GF(Pn)/{0} is cyclic (this will be important later).

Why do we care about Galois fields? We would like to have finite fields consisting of, e.g., 256 elements. Integer arithmetic mod 256 isn’t a field: even numbers don’t have multiplicative inverses. CPS 290

Example Galois Field: GF(23) http://flylib.com/books/en/3.190.1.50/1/

Galois Fields in AES Uses GF(28) where each degree-7 polynomial (with coefficients drawn from 0 or 1) is stored in a byte. Example: z5 + z2 + z + 1 is stored as 00100111 = 0x27 The irreducible polynomial is: z8 + z4 + z3 + z + 1 Also uses degree-3 polynomials with coefficients from GF(28). I.e., each coefficient is represented as a byte. These are kept as 4 bytes (used for the columns) The polynomial used as a modulus is: M(x) = 00000001x4 + 00000001 or x4 + 1 (= x4 - 1) Not irreducible (hence no Galois field), but we only need to find inverses of polynomials that are relatively prime to it.

Round i: Keyi out in + Shift Mix bit-wise XOR Rows columns Byte 1 3 2 Shift Rows . Byte substitution Mix columns + Keyi out in bit-wise XOR To invert, run the steps and rounds backwards. Each step must be reversible!

Byte Substitution To invert the substitution: b is a byte Non linear: y = b-1 (done over GF(28)), 0 mapped to 0 Linear: z = Ay + B (done over GF(2)=Z2, i.e., binary) To invert the substitution: y = A-1(z - B) (the matrix A is nonsingular) b = y-1 (over GF(28))

Shift Rows  Cyclic shift of each row. Four 4 columns, row i is shifted left i positions, or, equivalently, shifted right 4-i positions. 

Mix Columns a0 a1 a2 a3 For each column a in data block compute b(x) = hex representation of polynomial in GF(28) compute b(x) = (a3x3+a2x2+a1x+a0)(’03’x3+’01’x2+’01’x+’02’) mod x4+1 where coefficients are taken over GF(28). b0 b1 b2 b3 New column b is where b(x)=b3x3+b2x2+b1x+b0

Implementation Using xj mod (x4 + 1) = x(j mod 4) (a3x3+a2x2+a1x+a0)(3x3+x2+x+2) mod x4+1 = (2a0+3a1+a2+a3) + (a0+2a1+3a2+a3)x + (a0+a1+2a2+3a3)x2 + (3a0+a1+a2+2a3)x3 Therefore, b = C  a M(x) is not irreducible, but 3x3+x2+x+2 and M(x) are co-prime, so the transform can be inverted.

Generating the round keys Use “key schedule” to generate round keys from cypher key. f round i round i+1 + + + + (In first round, use cypher key.) Words corresponding to columns of the key b1 b2 b3 b4 b2 b3 b4 b1 f = + consti rotate byte subst.

Linear Cryptanalysis A known plaintext attack used to extract the key im k1 km Round o1 om Consider a linear equality involving i, o, and k e.g.: k1  k6 = i2  i4  i5  o4 To be secure this should be true with p = .5 (probability over all inputs and keys) If true with p = 1, then linear and easy to break If true with p = .5 + e then you might be able to use this to help break the system

Differential Cryptanalysis A chosen plaintext attack used to extract the key I K Round O Considers fixed “differences” between inputs, DI = I1 - I2, and sees how they propagate into differences in the outputs, DO = O1 - O2. “difference” is often exclusive OR Assigns probabilities to different keys based on these differences. With enough and appropriate samples (I1, I2, O1, O2), the probability of a particular key will converge to 1.