Double-DES? could use 2 DES encrypts on each block C = EK2(EK1(P)) issue of reduction to 1-DES; “is DES a group?” Campbell, Wiener in 1992: NO! “meet-in-the-middle” attack works whenever use a cipher twice since X = EK1(P) = DK2(C) attack by encrypting P with all keys and store then decrypt C with keys and match X value Basic round of the attack takes 2 * 256 encryptions/decryptions; we may have to repeat it a few times. Show on board

NESTED FUNCTIONS The main function is not the only function that can call other functions. Any function can be set //////////////////////////////////////////////////////////////// up to do so! // This program queries the user for the coefficients of a // // cubic polynomial and then uses ASCII characters to graph // // the polynomial in a user-specified range of the x-y plane. // //////////////////////////////////////////////////////////////// #include #include using namespace std; void queryUserForCoefficients(double &coeff3, double &coeff2, double &coeff1, double &coeff0); double queryUserForCoefficient(int exponent); void queryUserForRange(char axisLabel, int &rangeMin, int &rangeMax); void graphCubic(int xMin, int xMax, int yMin, int yMax, double coeff3, double coeff2, double coeff1, double coeff0); void outputLabel(double coeff3, double coeff2, double coeff1, double coeff0); void outputCubicTerm(double coeff3); void outputQuadraticTerm(double coeff3, double coeff2); void outputLinearTerm(double coeff3, double coeff2, double coeff1); void outputConstantTerm(double coeff3, double coeff2, double coeff1, double coeff0); void outputStrip(int yVal, int xMin, int xMax, double coeff3, double coeff2, double coeff1, double coeff0); bool closePoint(int xVal, int yVal, double coeff3, double coeff2, double coeff1, double coeff0); CHAPTER 5 – User-Defined Functions 8

Example Contd. SALES Model Year Color Chevy 1990 red Chevy 1990 white Chevy 1990 blue Chevy 1991 red Chevy 1991 white Chevy 1991 blue Chevy 1992 red Chevy 1992 white Chevy 1992 blue Ford 1990 red Ford 1990 white Ford 1990 blue Ford 1991 red Ford 1991 white Ford 1991 blue Ford 1992 red Ford 1992 white Ford 1992 blue Madhavi Sales 5 87 62 54 95 49 31 54 71 64 62 63 52 9 55 27 62 39 CUBE Data Cube and OLAP Server DATA CUBE Model Year Color ALL ALL ALL chevy ALL ALL ford ALL ALL ALL 1990 ALL ALL 1991 ALL ALL 1992 ALL ALL ALL red ALL ALL white ALL ALL blue chevy 1990 ALL chevy 1991 ALL chevy 1992 ALL ford 1990 ALL ford 1991 ALL ford 1992 ALL chevy ALL red chevy ALL white chevy ALL blue ford ALL red ford ALL white ford ALL blue ALL 1990 red ALL 1990 white ALL 1990 blue ALL 1991 red ALL 1991 white ALL 1991 blue ALL 1992 red ALL 1992 white ALL 1992 blue Sales 942 510 432 343 314 285 165 273 339 154 199 157 189 116 128 91 236 183 144 133 156 69 149 125 107 104 104 59 116 110 17

Double DES? Using two encryption stages and two keys C=Ek2(Ek1(P)) P=Dk1(Dk2(C)) It is proved that there is no key k3 such that C=Ek2(Ek1(P))=Ek3(P) But Meet-in-the-middle attack Cryptography and Network Security 151

Transparent Scalability Hardware is free to assign blocks to any processor at any time A kernel scales across any number of parallel processors Device Device Kernel grid Block 0 Block 1 Block 2 Block 3 Block 0 Block 2 Block 1 Block 3 Block 4 Block 5 Block 6 Block 7 Block 4 Block 5 Block 6 Block 7 time Block 0 Block 1 Block 2 Block 3 Block 4 Block 5 Block 6 Block 7 Each block can execute in any CUDA Tools and Threads – Slide order relative 69

Transparent Scalability Hardware is free to assign blocks to any SM (processor) A kernel scales across any number of parallel processors Device Kernel grid Device Block 0 Block 1 Block 2 Block 3 Block 0 Block 1 Block 4 Block 5 Block 6 Block 7 Block 2 Block 3 Block 4 Block 5 Block 6 Block 7 26 time Block 0 Block 1 Block 2 Block 3 Block 4 Block 5 Block 6 Block 7 Each block can execute in any order relative to other blocks.

Triple-DES with Two-Keys hence must use 3 encryptions would seem to need 3 distinct keys but can use 2 keys with E-D-E sequence C = EK1(DK2(EK1(P))) because encrypt & decrypt equivalent in security if K1=K2 then can work with single DES standardized in ANSI X9.17 & ISO8732 no current known practical attacks

Substitution Cryptosystems How many possible keys does an affine cipher on have? 7. Encrypt using a rotation cipher over with . 8. Encrypt using an affine cipher over with 9. Cipher X consists of a rotation, and then an affine cipher. What type of cipher is X? 10. Cipher Y is a substitution cipher over . Cipher consists of applying Y twenty-four times. What type of cipher is X? Be as specific as possible. 6.