Claude Shannon: Informaatiosta Helsingin Sanomat 7.3.2001: "Shannon julkaisi 1948 mullistavan kirjoituksen, jonka nimi on [A Mathematical Theory of Communication (1948), ja] vapaasti suomennettuna: Viestinnän matemaattinen teoria. Kirjoituksessaan Shannon laski informaatiolle, löysässä puhekielessä tiedolle, matemaattisia arvoja. Hän kuvaili tarkkaan miten informaatio liikkuu eri kanavissa nollien ja ykkösten virtana. Shannonin kantava idea on, että informaatio on missä muodossaan hyvänsä epävarmuuden vähentämistä. Informaation määrää voi laskea bitteinä sekuntia kohti. Shannon kutsui sitä kanavan kapasiteetiksi. Shannon laski kaavoina, kuinka informaatio säilyy matkalla ja kuinka informaatioon liittyy aina häriötä, kohinaa. Kun ykkösten ja nollien muodostamassa bittijonossa on kohinaa, kanavan viestien epävarmuus lisääntyy, ja sitä pitää informaation nimissä poistaa joko vahvistamalla tai korjaamalla bittivirtaa." 1 NOKIA Vuonna 1949 Shannon julkaisi kirjoituksen "Communications Theory of Secrecy Systems" eli Viestinnän teoria ja salausmenetelmät. x selväkieli Salausmenetelmä on kuvaus: y salakieli K salausavain ( x, K) y Shannon esitti salausmenetelmän yleisen informaatioteoreettisen mallin, jossa selväkieli X, avaink ja salakieli Y ovat satunnaismuuttujia, joilla on tietyt aprioritodennäköisyysjakaumat. Shannon määritteli: Salaus on täydellinen, jos selväkielen todennäköisyysjakauma ei muutu alkuperäisestä, vaikka sitä vastaava salakieli olisi tunnettu, ts. kaikilla selväkielillä x ja salakielillä y P(X = x Y= y )=P(X = x ) Shannon esitti "pessimistisen tuloksen": Salaus on täydellinen vain jos käytetty avain on yhtä pitkä kun salattava selväkieli. 2 NOKIA Claude Shannon: Salauksesta
Secrecy Systems Claude Shannon: Communications Theory of Secrecy Systems (1949) x plaintext Encryption e K : x y y ciphertext Decryption d K :d K (e K (x)) = x K key Information theoretic model: plaintext P, keyk are random variables with certain apriori probability distributions, and C =e K (P). Definition: Secrecy system has perfect secrecy if plaintext is independent of ciphertext (as random variables), that is, Pr(P =x C= y)=pr(p =x), for all plaintext x and ciphertext y. 3 NOKIA Pessimistic theorem Theorem (Shannon s pessimistic theorem): If a secrecy system is perfect, then the entropy of the key needs to be at least as large as the entropy of the plaintext, that is, H( P ) H( K ) Proof: or all secrecy systems, we have H( P C )= H(P e K (P) ) H( K ). or perfect secrecy systems, we have H( P C )= H(P ). Cryptography fights against this natural law: short key is used to encrypt a much larger amount of plaintext! 4 NOKIA
Entropy vs. Computational Complexity plaintext entropy key entropy logarithmic complexity length of ciphertext 5 NOKIA Epävarmuus ja vaativuus Edelleen Shannon osoitti, että kun avaimen pituus on rajoitettu, niin epävarmuus selväkielestä vähenee mitä kauemmin samaa avainta käytetään ja salakielen määrä kasvaa. Kuitenkin: vaikka riittävästi salakieltä olisikin käytettävissä avaimen selvittämiseksi, tarvitaan myös työtä [= laskentaa] käyt. vaadittu työ teor. epävarmuus salakielen pituus 6 NOKIA
Kanavakoodaus vs. Salaustekniikka Kanavakoodausmenetelmät Kompressointi: turhan ja hyödyttömän (luonnollisen) redundanssin poistaminen Virheenkorjaus-menetelmät: Tehokkaan ja hyödyllisen redundanssin lisääminen Salausmenetelmät tulos hyvin satunnaisen näköistä, vaikea kompressoida turvallisuus kasvaa mitä vähemmän selväkielessä on turhaa KOMPRESSOINTI SALAUS VIRHEENKORJAUS 7 NOKIA Diffuusio ja konfuusio Shannon esitti miten vahva, vaikeasti purettava, salausmenetelmä voidaan rakentaa toistamalla yksinkertaisia muunnoksia oikeassa järjestyksessä tarpeeksi monta kertaa. Käytettävien muunnosten tulee suorittaa kahta tehtävää: diffuusiota eli hajoittamista konfuusiota eli sekoittamista diffuusio konfuusioita 8 NOKIA
Rijndael - Shift Row DIUUSIO (I) No shift a 1,0 a 1,1 a 1,2 a 1,3 Cyclic left shift by 1 a 1,1 a 1,2 a 1,3 a 1,0 a 2,0 a 2,1 a 2,2 a 2,3 Cyclic left shift by 2 a 2,2 a 2,3 a 2,0 a 2,1 a 3,0 a 3,1 a 3,2 a 3,3 Cyclic left shift by 3 a 3,3 a 3,0 a 3,1 a 3,2 9 NOKIA Rijndael - Mix Column DIUUSIO (II) a 0,j a 1,j a 1,0 a 1,1 a 1,2 a 1,3 Mix Column b 0,j b 0,0 b 0,1 b 0,2 b 0,3 b 1,j b 1,0 b 1,1 b 1,2 b 1,3 a 2,j a 2,0 a 2,1 a 2,2 a 2,3 b 2,j b 2,0 b 2,1 b 2,2 b 2,3 a 3,0 a 3,1 a 3,2 a 3,3 a 3,j b 3,0 b 3,1 b 3,2 b 3,3 b 3,j 10 NOKIA
Rijndael - Byte Substitution KONUUSIO a 1,0 a 1,1 a 1,2 a 1,3 a i,j a 2,0 a 2,1 a 2,2 a 2,3 S-box b 0,0 b 0,1 b 0,2 b 0,3 b 1,0 b 1,1 b 1,2 b 1,3 b i,j b 2,0 b 2,1 b 2,2 b 2,3 a 3,0 a 3,1 a 3,2 a 3,3 b 3,0 b 3,1 b 3,2 b 3,3 11 NOKIA Differentiaalinen Kryptoanalyysi eistel salaaja; kierrosavain yhdistetään dataan xor-operaatiolla biteittäin; esimerkki DES algoritmi. Kierrosfunktio: f(x ; K) = (X K) missä : Z 2m Z 2m, X data-input, K kierrosavain. Kaksi kierrosta: K 1 R i =L i-1 (R i-1 K i ) L 1 R 1 L i =R i-1 K 2 L 2 R 2 12 NOKIA
Differentiaalinen kryptoanalyysi Differentiaalinen kryptoanalyysi on valitun selväkielen menetelmä. Valitaan kiinteä erotuslohko. Kutakin selväkieli-datalohkoa tutkitaan yhdessä sen parin kanssa. Pari muodostetaan lisäämällä lohkoon kiinteä erotuslohko. Kysymys: Voidaanko ennustaa miten datalohkon ja sen parin välinen erotus muuttuu salausoperaatiossa? Jos voidaan, niin salausalgoritmi on heikko differentiaalista kryptoanalyysia vastaan. Esimerkki: Lineaarisessa operaatiossa erotus voidaan ennustaa todennäköisyydellä 1: (X a) =(X) (a) Tärkeää: Erotuksen muuttuminen ei riipu käytetystä avaimesta. 13 NOKIA eistel salaajan differentiaalinen kryptoanalyysi L o =a 2 b 1 R o =a 1 b 1 a 1 L 1 R 1 b 2 a 2 L 2 =a 2 R 2 =a 1 b 2 Todennäköisyys p(a 1,b 1 )p(a 2,b 2 ), Tällainen todennäköinen relaatio on differentiaalinen karakteristika. 14 NOKIA
Erityinen differentiaalinen karakteristika α L 0 α α R α L α R Todennäköisyys: p (α,0) Tätä voidaan käyttää kun kierrosfunktio ei ole injektiivinen. Toisaalta, tiedetään että että se on mahdoton, jos kierrosfunktio on injektio. Myös tätä mahdottomuutta voidaan käyttää hyväksi analyysissä! 15 NOKIA eistel salaaja Bijektiivinen kierrosfunktio: Viiden kierroksen mahdoton differentiaalinen karakteristika bijektio 0 α α 0 β γ β 0 γ 0 0 α 16 NOKIA
5 round eistel network with bijective bijection α 0 0 α β γ β 0 γ 0 0 α 17 NOKIA Linear cryptanalysis of iterated block ciphers The ENCRYPTION TRANSORMATION is defined iteratively: a fixed round function is iterated r rounds X i +1 = ( X i K i+1 ),i =0,1,,r -1 where X 0 plaintext, X r ciphertext and K i round key. One searches for r correlations between the input and output of : corr(a i +1 X i +1, a i X i a i K i +1 )= ρ i, i =0,1,,r -1 These are combined by chaining them over the entire encryption transformation corr(a r X r, a 0 X 0 a 0 K 1 a 1 K 2... a r-1 K r )=ρ 0 ρ 1 ρ r-1 = ρ One obtains a linear approximative relation a r X r a 0 X 0 a 0 K 1 a 1 K 2... a r-1 K r =0 which holds with probability 1/2 (1+ ρ). rom this one can derive one bit B = a 0 K 1 a 1 K 2... a r-1 K r information about the key with sufficient certainty if O (ρ -2 ) plaintext ciphertext pairs (X 0,X r ) available to the cryptanalyst. K 1 K 2 K 3 K r 18 NOKIA
Rijndael - Wide Trail Strategy Valitaan S-box missä suurin erotuksen kertautumistodennäköisyys, ja suurin input-output korrelaatio ovat mahdollisimman pieniä. Valitaan lineaariset operaatiot (shift-row ja mix-column) siten että ei synny merkittäviä korrelaatio- tai erotusten kertautumispolkuja joissa on mukana vain pieni osa S- boxeista. Haarautumisarvo (f) = min a 0 ( weight (a) + weight (f(a)) Mix Column muunnoksen haarautumisarvo on 5 19 NOKIA Wide Trail Strategy Choose an S-box where the maximum difference propagation probability and the maximum input-output correlation are as small as possible Choose the linear part in such a way that there are no trails with only a small number of active S-boxes Branch number B(f) = min a 0 ( weight (a) + weight (f(a)) The Mix Column Transformation has branch number 5 20 NOKIA
Rijndael - Internal Structure Rijndael is an iterated block cipher with variable length block and variable key size. The number of rounds is defined by the table: Nb = 4 Nb = 6 Nb = 8 Nk = 4 10 12 14 Nk = 6 12 12 14 Nk = 8 14 14 14 Nb = length of data block in 32-bit words Nk = length of key in 32-bit words 21 NOKIA Rijndael - Internal Structure irst Initial Round Key Addition 9 rounds, numbered 1-9, each consisting of Byte Substitution transformation Shift Row transformation Mix Column transformation Round Key Addition A final round (round 10) consisting of Byte Substitution transformation Shift Row transformation inal Round Key Addition 22 NOKIA
Rijndael - Inverse Structure ENCRYPT (2 rounds) DECRYPT (2 rounds) INV ENCRYPT (2 rounds) Initial Round Key Add inal Round Key Add Inv Initial Round Key Add Byte Substitution Inv Shift Row Inv Byte Substitution Shift Row Inv Byte Substitution Inv Shift Row Mix Column Round Key Addition Inv Mix Column Round Key Addition Inv Mix Column Inv Round Key Addition Byte Substitution Inv Shift Row Inv Byte Substitution Shift Row Inv Byte Substitution Inv Shift Row inal Round Key Add Initial Round Key Add Inv inal Round Key Add 23 NOKIA Rijndael-128 State and 128 Cipher Key k 0,0 k 0,1 k 0,2 k 0,3 a 1,0 a 1,1 a 1,2 a 1,3 k 1,0 k 1,1 k 1,2 k 1,3 a 2,0 a 2,1 a 2,2 a 2,3 k 2,0 k 2,1 k 2,2 k 2,3 a 3,0 a 3,1 a 3,2 a 3,3 k 3,0 k 3,1 k 3,2 k 3,3 24 NOKIA
Byte Substitution a 1,0 a 1,1 a 1,2 a 1,3 a i,j a 2,0 a 2,1 a 2,2 a 2,3 S-box b 0,0 b 0,1 b 0,2 b 0,3 b 1,0 b 1,1 b 1,2 b 1,3 b i,j b 2,0 b 2,1 b 2,2 b 2,3 a 3,0 a 3,1 a 3,2 a 3,3 b 3,0 b 3,1 b 3,2 b 3,3 25 NOKIA Rijndael S-box Sbox[256] = { 99,124,119,123,242,107,111,197, 48, 1,103, 43,254,215,171,118, 202,130,201,125,250, 89, 71,240,173,212,162,175,156,164,114,192, 183,253,147, 38, 54, 63,247,204, 52,165,229,241,113,216, 49, 21, 4,199, 35,195, 24,150, 5,154, 7, 18,128,226,235, 39,178,117, 9,131, 44, 26, 27,110, 90,160, 82, 59,214,179, 41,227, 47,132, 83,209, 0,237, 32,252,177, 91,106,203,190, 57, 74, 76, 88,207, 208,239,170,251, 67, 77, 51,133, 69,249, 2,127, 80, 60,159,168, 81,163, 64,143,146,157, 56,245,188,182,218, 33, 16,255,243,210, 96,129, 79,220, 34, 42,144,136, 70,238,184, 20,222, 94, 11,219, 224, 50, 58, 10, 73, 6, 36, 92,194,211,172, 98,145,149,228,121, 231,200, 55,109,141,213, 78,169,108, 86,244,234,101,122,174, 8, 186,120, 37, 46, 28,166,180,198,232,221,116, 31, 75,189,139,138, 112, 62,181,102, 72, 3,246, 14, 97, 53, 87,185,134,193, 29,158, 225,248,152, 17,105,217,142,148,155, 30,135,233,206, 85, 40,223, 140,161,137, 13,191,230, 66,104, 65,153, 45, 15,176, 84,187, 22}; 26 NOKIA
Rijndael S-box Design View Galois field G(2 8 ) with polynomial m(x) = x 8 + x 4 + x 3 + x + 1 The Rijndael S-box is the composition f g where Inv (f g ) = g(x) = x -1, x G(2 8 ), x 0, and g (Inv f) g(0) = 0 and f is the affine transformation defined by y = f(x) y o 1 0 0 0 1 1 1 1 x 0 1 y 1 1 1 0 0 0 1 1 1 x 1 1 y 2 1 1 1 0 0 0 1 1 x 2 0 y 3 1 1 1 1 0 0 0 1 x 3 0 y = 4 1 1 1 1 1 0 0 0 x + 4 0 y 5 0 1 1 1 1 1 0 0 x 5 1 y 6 0 0 1 1 1 1 1 0 x 6 1 y 7 0 0 0 1 1 1 1 1 x 7 0 27 NOKIA Kasumi substitution boxes The approach proposed by Nyberg-Knudsen (1993) is to select the small initial functions to have optimal linearity and differential properties. Kasumi functions are x x 5 in G(2 9 ) x x -1 in G(2 8 ) x x 81 in G(2 7 ) Note: The same approach was adopted in the design of the new AES encryption standard (Rijndael) which has eight small substitution transformations defined as 28 NOKIA
Shift Row No shift a 1,0 a 1,1 a 1,2 a 1,3 Cyclic left shift by 1 a 1,1 a 1,2 a 1,3 a 1,0 a 2,0 a 2,1 a 2,2 a 2,3 Cyclic left shift by 2 a 2,2 a 2,3 a 2,0 a 2,1 a 3,0 a 3,1 a 3,2 a 3,3 Cyclic left shift by 3 a 3,3 a 3,0 a 3,1 a 3,2 29 NOKIA Mix Column a 0,j a 1,j a 1,0 a 1,1 a 1,2 a 1,3 Mix Column b 0,j b 0,0 b 0,1 b 0,2 b 0,3 b 1,j b 1,0 b 1,1 b 1,2 b 1,3 a 2,j a 2,0 a 2,1 a 2,2 a 2,3 b 2,j b 2,0 b 2,1 b 2,2 b 2,3 a 3,0 a 3,1 a 3,2 a 3,3 a 3,j b 3,0 b 3,1 b 3,2 b 3,3 b 3,j 30 NOKIA
Mix Column - Implemented The mix column transformation mixes one column of the state at atime. Column j: b 0,j = T 2 (a 0,j ) T 3 (a 1,j ) a 2,j a 3,j b 1,j = a 0,j T 2 (a 1,j ) T 3 (a 2,j ) a 3,j b 2,j = a 0,j a 1,j T 2 (a 2,j ) T 3 (a 3,j ) b 3,j = T 3 (a 0,j ) a 1,j a 2,j T 2 (a 3,j ) where: T 2 (a) = 2*a if a < 128 T 2 (a) = (2*a) 283 if a 128 T 3 (a) = T 2 (a) a. 31 NOKIA Mix Column - Design view The columns of the State are considered as polynomials over G(2 8 ). They are multiplied by a fixed polynomial c(x) given by c(x) = 03 x 3 + 01 x 2 + 01 x+ 02 The product is reduced modulo x 4 + 01. Matrix form b 0,j 02 03 01 01 a 0,j b 1,j = 01 02 03 01 a 1,j b 2,j 01 01 02 03 a 2,j b 3,j 03 01 01 02 a 3,j The Inverse Mix Column polynomial is c(x) -1 mod ( x 4 + 01 ) =d(x) given by d(x) = 0B x 3 + 0D x 2 + 09 x+ 0E 32 NOKIA
Round Key Addition rk 0,0 rk 0,1 rk 0,2 rk 0,3 b 0,0 b 0,1 b 0,2 b 0,3 a 1,0 a 1,1 a 1,2 a 1,3 a 2,0 a 2,1 a 2,2 a 2,3 rk 1,0 rk 1,1 rk 1,2 rk 1,3 = rk 2,0 rk 2,1 rk 2,2 rk 2,3 b 1,0 b 1,1 b 1,2 b 1,3 b 2,0 b 2,1 b 2,2 b 2,3 a 3,0 a 3,1 a 3,2 a 3,3 rk 3,0 rk 3,1 rk 3,2 rk 3,3 b 3,0 b 3,1 b 3,2 b 3,3 33 NOKIA round constant k 0,0 k 0,1 k 0,2 k 0,3 k 1,0 k 1,1 k 1,2 k 1,3 k 2,0 k 2,1 k 2,2 k 2,3 S- boxes k 3,0 k 3,1 k 3,2 k 3,3 k 0,0 k 0,1 k 0,2 k 0,3 k 1,0 k 1,1 k 1,2 k 1,3 Round Key Derivation (128 bits) k 2,0 k 2,1 k 2,2 k 2,3 k 3,0 k 3,1 k 3,2 k 3,3 34 NOKIA