in Smart Grids Philipp Jovanovic1 (@daeinar) Samuel Neves2 (@sevenps) 1University of Passau, Germany 2University of Coimbra, Portugal Fast Software Encryption 2015 Istanbul, Turkey
modernized electrical grid that uses analog or digital information and communications technology to gather and act on information [...] in an automated fashion to improve the efficiency, reliability, economics, and sustainability of the production and distribution of electricity.” Fast-growing technology. Critical infrastructure: communication needs protection. 1
smart grids. Developed by the Energy Service Network Association (ESNA) around 2010. Standardised by the European Telecommunications Standards Institute (ETSI) in 2012. Used in devices sold by OSGP Alliance/Networked Energy Services (NES). 2
using: 1. Differentials. 2. Bruteforce. 3. Differential-based forgeries. Based on publicly available documents. No experiments on actual (proprietary) OSGP hardware. Disclosed to OSGP Alliance/NES in November 2014. 5
By K. Kursawe and C. Peters (European Network for Cyber Security, the Netherlands). Overview article on security in OSGP. Presents basic attacks. Published on the IACR Cryptology ePrint Archive: Report 2015/088. Disclosed to OSGP Alliance/NES in early 2014. Cryptanalysis of RC4 in OSGP By L. Feiten and M. Sauer (University of Freiburg, Germany). Transfers WEP attack on RC4 to the case of OSGP. Under submission. Draft shared privately. Disclosed to OSGP Alliance/NES in November 2014. 6
By K. Kursawe and C. Peters (European Network for Cyber Security, the Netherlands). Overview article on security in OSGP. Presents basic attacks. Published on the IACR Cryptology ePrint Archive: Report 2015/088. Disclosed to OSGP Alliance/NES in early 2014. Cryptanalysis of RC4 in OSGP By L. Feiten and M. Sauer (University of Freiburg, Germany). Transfers WEP attack on RC4 to the case of OSGP. Under submission. Draft shared privately. Disclosed to OSGP Alliance/NES in November 2014. 6
0, 0, 0) m ← m 0−|m| mod 144 foreach 144-byte block b of m do for i ← 0 to 17 do for j ← 7 to 0 do if ki mod 12,7−j = 1 then aj ← a(j+1) mod 8 + b8i+(7−j) + (¬(aj + j)) ≪ 1 else aj ← a(j+1) mod 8 + b8i+(7−j) − (¬(aj + j)) ≫ 1 end end end return a Observations 64-bit state a. Message is zero-padded: m → m 0−|m| mod 144. Key extension: k0 · · · k11 → k0 · · · k11 k0 · · · k5 . Processing of a message byte depends exactly on one key bit. State update is almost linear. Algorithm is fully reversible. 10
a7 fk i,7 ,0 fk i,6 ,1 fk i,5 ,2 fk i,4 ,3 fk i,3 ,4 fk i,2 ,5 fk i,1 ,6 fk i,0 ,7 m8i+7 m8i+6 m8i+5 m8i+4 m8i+3 m8i+2 m8i+1 m8i data flow The non-linear update function f : fk,c (x, y, m) = y + m + (¬(x + c)) ≪ 1 if k = 1 y + m − (¬(x + c)) ≪ 7 otherwise. Note: i = 0, . . . , 17 and i = i mod 12. 11
∆a2 ∆a3 ∆a4 ∆a5 ∆a6 80 fk i,7 ,0 fk i,6 ,1 fk i,5 ,2 fk i,4 ,3 fk i,3 ,4 fk i,2 ,5 fk i,1 ,6 fk i,0 ,7 00 00 00 00 00 00 00 80 data flow The non-linear update function f : fk,c (x, y, m) = y + m + (¬(x + c)) ≪ 1 if k = 1 y + m − (¬(x + c)) ≪ 7 otherwise. Note: i = 0, . . . , 17 and i = i mod 12. 13
. . , m8i+7 : 80 80 80 80 80 80 80 80 fk i,7 ,0 fk i,6 ,1 fk i,5 ,2 fk i,4 ,3 fk i,3 ,4 fk i,2 ,5 fk i,1 ,6 fk i,0 ,7 00 00 00 00 00 00 00 80 data flow The non-linear update function f : fk,c (x, y, m) = y + m + (¬(x + c)) ≪ 1 if k = 1 y + m − (¬(x + c)) ≪ 7 otherwise. Difference propagates with probability 1 to the full state! 14
. . , m8i+7 , m8i+8 : 80 80 80 80 80 80 80 ∆a7 fk i,7 ,0 fk i,6 ,1 fk i,5 ,2 fk i,4 ,3 fk i,3 ,4 fk i,2 ,5 fk i,1 ,6 fk i,0 ,7 00 00 00 00 00 00 00 00 data flow Possible output differences for the XOR-linearisation of f : ∆a7 = 81 = 80 ⊕ 01 = 80 ⊕ (80 ≪ 1) if k i,0 = 1 C0 = 80 ⊕ 40 = 80 ⊕ (80 ≪ 7) if k i,0 = 0 Equal behaviour of lsb for ⊕ and +: lsb(k i ) = k i,0 = lsb(∆a7 ). 15
i,0 = lsb(∆a7 ) k i,4 = lsb(∆a3 ) ⊕ k i,3 k i,1 = lsb(∆a6 ) ⊕ k i,0 k i,5 = lsb(∆a2 ) ⊕ k i,4 k i,2 = lsb(∆a5 ) ⊕ k i,1 k i,6 = lsb(∆a1 ) ⊕ k i,5 k i,3 = lsb(∆a4 ) ⊕ k i,2 k i,7 = lsb(∆a0 ) ⊕ k i,6 for all i = 17, . . . , 6 and i = i mod 12. Conclusion: Setting ∆m8i−8 = 80 leaks complete key byte k i . 19
i,0 = lsb(∆a7 ) k i,4 = lsb(∆a3 ) ⊕ k i,3 k i,1 = lsb(∆a6 ) ⊕ k i,0 k i,5 = lsb(∆a2 ) ⊕ k i,4 k i,2 = lsb(∆a5 ) ⊕ k i,1 k i,6 = lsb(∆a1 ) ⊕ k i,5 k i,3 = lsb(∆a4 ) ⊕ k i,2 k i,7 = lsb(∆a0 ) ⊕ k i,6 for all i = 17, . . . , 6 and i = i mod 12. Conclusion: Setting ∆m8i−8 = 80 leaks complete key byte k i . 19
y and m = x y with |y| = |y | = r bytes and y = y . Corresponding digests a = O(m) and a = O(m ) with O being an oracle for the OMADigest using the key k. 22
. . . . i = 0 i = 1 k5 k5 k4 k4 k3 k3 m136 , . . . , m143 m136 , . . . , m143 m128 , . . . , m135 m128 , . . . , m135 m120 , . . . , m127 m120 , . . . , m127 OMABackward OMAForward For i = 0, . . . , 11, set r = 8i + 16, guess k17−i mod 12 , and fix k16−i mod 12 = 00 (note: key byte has no effect on processing of m). Compute: b = OMAForward(OMABackward(a, m, k, r), m , k, r). Check: b = a . If so, guess for k17−i mod 12 is saved as a candidate. 23
80 ∆a0 ∆a1 ∆a2 ∆a3 ∆a4 ∆a5 00 80 fk i,7 ,0 fk i,6 ,1 fk i,5 ,2 fk i,4 ,3 fk i,3 ,4 fk i,2 ,5 fk i,1 ,6 fk i,0 ,7 00 00 00 00 00 00 80 80 data flow for i = 0, . . . , 17, i = i mod 12, and j = 0, . . . , 7 (here: j = 0). The non-linear update function f : fk,c (x, y, m) = y + m + (¬(x + c)) ≪ 1 if k = 1 y + m − (¬(x + c)) ≪ 7 otherwise. 26
. , m8i+j+7 : 00 00 00 00 00 00 00 80 fk i,7 ,0 fk i,6 ,1 fk i,5 ,2 fk i,4 ,3 fk i,3 ,4 fk i,2 ,5 fk i,1 ,6 fk i,0 ,7 00 00 00 00 00 00 80 80 data flow No further propagation, stationary difference ∆a7 = 80. 27
(on average). Works with chosen-plaintexts and with chosen-ciphertexts. (due to stream cipher encryption) Key bits can be recovered in arbitrary order. (unlike as in attacks #1 and #2) No restrictions on the message size. 31
(on average). Works with chosen-plaintexts and with chosen-ciphertexts. (due to stream cipher encryption) Key bits can be recovered in arbitrary order. (unlike as in attacks #1 and #2) No restrictions on the message size. 31
(on average). Works with chosen-plaintexts and with chosen-ciphertexts. (due to stream cipher encryption) Key bits can be recovered in arbitrary order. (unlike as in attacks #1 and #2) No restrictions on the message size. 31
(on average). Works with chosen-plaintexts and with chosen-ciphertexts. (due to stream cipher encryption) Key bits can be recovered in arbitrary order. (unlike as in attacks #1 and #2) No restrictions on the message size. 31
(assuming it is implemented as in the specification) Secure communication in OSGP highly doubtful as long as any of RC4, EN14908 or OMADigest is used. Thank you! 34
(assuming it is implemented as in the specification) Secure communication in OSGP highly doubtful as long as any of RC4, EN14908 or OMADigest is used. Thank you! 34