Download presentation
Presentation is loading. Please wait.
Published bySusan Martin Modified over 9 years ago
1
AES Background and Mathematics CSCI 5857: Encoding and Encryption
2
Outline AES goals and history Modular multiplicative inverses Galois Field mathematics Galois Field inverses Uses in AES
3
AES History 1997: NIST calls for proposals for DES replacement –56-bit DES key not computationally secure –Triple DES very slow –DES S-Boxes poorly understood 1999: Several algorithms chosen as finalists –Rijndael (selected) –Twofish, Serpent, etc. (still used by some systems) 2001: Rijndael published by NIST as Advanced Encryption Standard
4
Goals of AES Security –Minimum key size: 128 bits (computationally secure now) –Expandable to 192 or 256 bits (will still be computationally secure in future) –Block size: 128 bits (more possible mappings) –Designed for resistance to differential and linear cryptanalysis Cost –Structure optimized for efficiency
5
Mathematical Goals S-Boxes and other transformations should have mathematical basis –Can insure useful properties (nonlinearity, etc.) –Can re-derive as needed for larger keys –Mapping should appear “random” (no simple patterns between inputs and outputs)
6
Modular Multiplication a b mod m = remainder left after (a b)/m Example: multiplication table mod 7
7
b is inverse of a mod m if ab mod m = 1 (b = a -1 mod m) Example: 5 = 3 -1 mod 7 since 3 x 5 = 15 = 1 mod 7 Creates nonlinear “pseudorandom” mappings Modular Multiplicative Inverses aa -1 0none 11 24 35 42 53 66
8
Modular Multiplicative Inverses Problem: Only works if m is a prime number Otherwise, some numbers have no inverse Example: modular inverses mod 8 aa -1 0none 11 2 33 4 55 6 77
9
Modular Multiplicative Inverses Goal: use this idea in cases where m = 2 n (that is, m is the size of a typical block) Galois Fields –Represent byte to transform as a polynomial –Compute inverse of that polynomial mod some other “prime” polynomial –Galois Field with m = 2 8 used to create S-Boxes for AES, mapping 256 possible byte inputs to 256 possible byte outputs
10
Galois Field Mathematics Step 1: Represent binary numbers with n bits as polynomial of degree n Example: n = 3 GF(2 3 ) 000 0x 2 + 0x + 00 001 0x 2 + 0x + 11 010 0x 2 + 1x + 0x 011 0x 2 + 1x + 1x + 1 100 1x 2 + 0x + 0x2x2 101 1x 2 + 0x + 1x 2 + 1 110 1x 2 + 1x + 0x 2 + x 111 1x 2 + 1x + 1x 2 + x + 1
11
Galois Field Mathematics x 2 + x + 1 + x + 1 x 2 + 2x + 2 = x 2 + 0x + 0 = x 2 since 2 mod 2 = 0 x2x2 - (x + 1) x 2 - x – 1 = x 2 + x + 1 since -1 mod 2 = 1 All coefficients are binary (1 or 0) Addition/subtraction in mod 2 = XOR function Examples:
12
Galois Field Mathematics Step 2: Find a “prime” polynomial P n of degree n –Not a multiple of any two other polynomials (other than 1 and itself) Example for GF(2 3 ): P 3 = x 3 + x + 1 Used in AES for GF(2 8 ): P 8 = x 8 + x 4 + x 3 + x + 1
13
Galois Field Mathematics Step 3: Compute multiplication table for all pairs of polynomials P i x P j mod P n –Will need to compute mod if order of P i x P j is k n –Simple (inefficient) way: compute P i x P j – x k-n P n Example for GF(2 3 ):
14
Galois Field Example Example: Multiplying 110 and 101 110 x 2 + x 011 x + 1 (x 2 + x)(x + 1) = x 3 + 2x 2 + x = x 3 + x 2 mod 2 = 0 (x 3 + x) mod (x 3 + x + 1) = x 3 + x - x 3 + x + 1 - 1 = 1 -1 mod 2 = 1
15
Galois Field Inverses Inverse b -1 of a binary number b in GF(2 n ) b -1 x b = 1 in GF(2 n ) Example: GF(2 3 ) b000001010011100101110111 b -1 none001101110111010011100
16
Galois Fields in AES AES mathematics based on GF(2 8 ) Prime polynomial = x 8 + x 4 + x 3 + x + 1 SubBytes stage –Basis of S-Boxes MixColumns Stage –Uses matrix multiplication in GF(2 8 ) Round Key Generation –Adds extra “random” bits to each round key
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.