Top Banner

of 23

Cryptanalysis of Hummingbird-1

Jun 03, 2018

Download

Documents

Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
  • 8/12/2019 Cryptanalysis of Hummingbird-1

    1/23

    Cryptanalysis of Hummingbird-1

    Markku-Juhani O. [email protected]

    16 February 2011

    Fast Software Encryption 2011

  • 8/12/2019 Cryptanalysis of Hummingbird-1

    2/23

  • 8/12/2019 Cryptanalysis of Hummingbird-1

    3/23

    M.-J. O. Saarinen 16-Feb-11

    Publication info:

    D. ENGELS, X. FAN , G. GON G, H. HU AND E. M. SMITH. Ultra-Lightweight Cryptography

    for Low-Cost RFID Tags: Hummingbird Algorithm and Protocol. Centre for Applied

    Cryptographic Research (CACR) Technical Reports, CACR-2009-29.

    X. FAN , H . HU, G. GON G, E . M . SMITH AND D. ENGELS. Lightweight Implementationof Hummingbird Cryptographic Algorithm on 4-Bit Microcontroller. The 1st International

    Workshop on RFID Security and Cryptography 2009 (RISC09), pp. 838 844, 2009.

    D. ENGELS, X. FAN , G. GON G, H. HU AND E. M. SMITH. Hummingbird: Ultra-Lightweight

    Cryptography for Resource-Constrained Devices. 1st International Workshop on Lightweight

    Cryptography for Resource-Constrained Devices (WLC2010). Tenerife, Canary Islands,

    Spain, January 2010

    Fast Software Encryption 2011 2

  • 8/12/2019 Cryptanalysis of Hummingbird-1

    4/23

    M.-J. O. Saarinen 16-Feb-11

    Building blocks

    Hummingbird-1 has a 64 + 16 - bit state consisting of four 16-bit registersR1,R2,R3,R4and a 16-bit LFSRL.

    The cipher is initialized by setting the 64-bit nonce in the registers andrunning an initialization function for four rounds.

    Each round updates the four registers and the LFSR and processes one16-bit word of plaintext into ciphertext.

    Nonlinearity is derived the E Box and from mixing the XOR operation andmodular addition.

    Fast Software Encryption 2011 3

  • 8/12/2019 Cryptanalysis of Hummingbird-1

    5/23

    M.-J. O. Saarinen 16-Feb-11

    The E Box

    The cipher has a 16-bit E-Box that utilizes a 64-bit subkey. The design ofthe E-Box is irrelevant to the attack presented here (as long as it does notuse more than 64 bits of keying material).

    The E-Box is built from five invocations of 4x4 S-Boxes and a linear mixingfunctionL.

    Fast Software Encryption 2011 4

  • 8/12/2019 Cryptanalysis of Hummingbird-1

    6/23

    M.-J. O. Saarinen 16-Feb-11

    Hummingbird-1 Round

    Fast Software Encryption 2011 5

  • 8/12/2019 Cryptanalysis of Hummingbird-1

    7/23

    M.-J. O. Saarinen 16-Feb-11

    The Key

    The 256-bit secret keyKis split into four 64-bit subkeysK(1),K(2),K(3) andK(4) without any mixing.

    We index each one of the 64-bit subkeys as 16-bit words K(i)j as follows:

    K= (K(1),K(2),K(3),K(4))

    K(1) = (K(1)1 , K

    (1)2 , K

    (1)3 , K

    (1)4 )

    K(2) = (K(2)1 , K

    (2)2 , K

    (2)3 , K

    (2)4 )

    K(3)

    = (K(3)

    1 , K(3)

    2 , K(3)

    3 , K(3)

    4 )K(4) = (K

    (4)1 , K

    (4)2 , K

    (4)3 , K

    (4)4 ).

    Fast Software Encryption 2011 6

  • 8/12/2019 Cryptanalysis of Hummingbird-1

    8/23

    M.-J. O. Saarinen 16-Feb-11

    Attack outline

    We will describe the following attack (which can be improved!):

    A chosen plaintext and ciphertext attack that requires about 220 queriesusing two distinct IVs.

    The attack is made possible by a flaw in the initialization function.

    Uses high-bit additional differentials only, the structure of the E box is notrelevant.

    Uses a divide-and-conquer strategy to attack each 64-bit subkeyindividually. The attack complexity is therefore bound by266 but can beimproved by differential attacks on E.

    Fast Software Encryption 2011 7

  • 8/12/2019 Cryptanalysis of Hummingbird-1

    9/23

    M.-J. O. Saarinen 16-Feb-11

    Flaw in the IV setup

    Observation 1. The Hummingbird-1 initialization function has a high-bitXOR differential that holds with probability 1:

    (IV1, IV2, IV3, IV4) = (8000, 0000, 0000, 0000)

    (RS10,RS20,RS30,RS40,LFSR0) = (8000, 0000, 0000, 0000, 0000).

    Fast Software Encryption 2011 8

  • 8/12/2019 Cryptanalysis of Hummingbird-1

    10/23

    M.-J. O. Saarinen 16-Feb-11

    Hummingbird-1 Initialization

    Fast Software Encryption 2011 9

  • 8/12/2019 Cryptanalysis of Hummingbird-1

    11/23

    M.-J. O. Saarinen 16-Feb-11

    Fast Software Encryption 2011 10

  • 8/12/2019 Cryptanalysis of Hummingbird-1

    12/23

    M.-J. O. Saarinen 16-Feb-11

    First Round

    Observation 2. There is a Chosen-IV distinguisher for Hummingbird thatworks with probabilityP = 65535/65536 and has data complexity of 1 word.One can use the high-bit differential of Observation 1 and the followingdifferential for the first round:

    (P0,RS10,RS20,RS30,RS40,LFSR0) = (8000, 8000, 0000, 0000, 0000, 0000)

    (C0,RS11,RS21,RS31,RS41,LFSR1) = (0000, 8000, 8000, 0000, 8000, 0000)

    Fast Software Encryption 2011 11

  • 8/12/2019 Cryptanalysis of Hummingbird-1

    13/23

    M.-J. O. Saarinen 16-Feb-11

    Fast Software Encryption 2011 12

  • 8/12/2019 Cryptanalysis of Hummingbird-1

    14/23

    M.-J. O. Saarinen 16-Feb-11

    An Iterated Differential

    Observation 3. There is a one-round iterated differential that works if acollision occurs inside the cipher as follows:

    v12t

    = 8000, v23t

    = 0000, v34t

    = 0000

    (RS1t,RS2t,RS3t,RS4t,LFSRt) = (8000, 8000, 0000, 8000, 0000)

    (RS1t+1,RS2t+1,RS3t+1,RS4t+1,LFSRt+1) = (8000, 8000, 0000, 8000, 0000).

    The initial condition fort = 5can be satisfied using the initialization and first-round encryption differentials given in Observations 1 and 2.

    Fast Software Encryption 2011 13

  • 8/12/2019 Cryptanalysis of Hummingbird-1

    15/23

    M.-J. O. Saarinen 16-Feb-11

    Attack on K1

    Work on two IVs, 0000 0000 0000 0000 and 8000 0000 0000 0000.

    Try to find a pair of ciphertexts 0000 aaaa aaaa .. and 0000 bbbb bbbb ..

    so that the range of the absolute difference of plaintext words is around215(1 1

    e) 20713.3rather than the random215 = 32768.

    When such a right pair is found, we may do a search on the first 64-bitsubkey by eliminating impossible keys.

    Note that we dont care about various weaknesses of theEbox. This stepmay be sped up significantly.

    Fast Software Encryption 2011 14

  • 8/12/2019 Cryptanalysis of Hummingbird-1

    16/23

    M.-J. O. Saarinen 16-Feb-11

    Fast Software Encryption 2011 15

  • 8/12/2019 Cryptanalysis of Hummingbird-1

    17/23

    M.-J. O. Saarinen 16-Feb-11

    Attack on K2-K4 (abridged.. details in the paper)

    Attack proceeds by attacking K4, then K3 and finally K2.

    These attacks use a bit more complicated math to discard impossible

    subkeys.

    A four-round differential is used. Each sub-attack requires knowledgepreviously gathered key bits.

    The additive differentials use 2 highest bits (bit 14 and 15).

    The data complexity is smaller than in the first step.

    Fast Software Encryption 2011 16

  • 8/12/2019 Cryptanalysis of Hummingbird-1

    18/23

    M.-J. O. Saarinen 16-Feb-11

    Fast Software Encryption 2011 17

  • 8/12/2019 Cryptanalysis of Hummingbird-1

    19/23

    M.-J. O. Saarinen 16-Feb-11

    Fast Software Encryption 2011 18

  • 8/12/2019 Cryptanalysis of Hummingbird-1

    20/23

    M.-J. O. Saarinen 16-Feb-11

    Fast Software Encryption 2011 19

  • 8/12/2019 Cryptanalysis of Hummingbird-1

    21/23

    M.-J. O. Saarinen 16-Feb-11

    Demo attacking a 4 * 24 = 96 bit key

    Source code is available: http://www.mjos.fi/dist/hb1an.tgz

    ~/ hb1an$ . / hb1an

    rand seed = 1297763753

    s e l f t e st passed .

    tr u_ ke y [ ] = 0000000000EA178D0000000000AAB48A00000000009387CD0000000000676B51

    h b1 _b re ak ( ) s t a r t e d on Tue Feb 15 1 1 : 5 5 : 53 2 01 1dec ry pti ng . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

    r i g h t pa ir . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

    p ai r ed a / b . . 00D1 / 0138 . . c = 20757

    EK1 searc h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 0000000000EA178D

    t ab u la ti ng 923D D79C D6D3 A86D 9D60 09B0 7FF6 DAD2 07C8 34E6 BB2D 407B 91CD

    EK4 search . . . . . . . . . . . . 0000000000676B51

    t a bu l at i ng . . max s l o t = 8 . . q ua rt et s = 32

    EK3 search . . . . . . . . . . . . . . . . . . 00000000009387CD (d = 6)

    EK2 searc h . . . . . . . . . . . . . . . . . . . . . 0000000000AAB48A

    h b1 _b re ak ( ) f i n i s h e d o n T ue Feb 15 1 1 : 5 6 : 20 20 11r u n ni n g t i m e : 27 w a l lcloc k seconds

    cr k_ ke y [ ] = 0000000000EA178D0000000000AAB48A00000000009387CD0000000000676B51

    ~/hb1an$

    Fast Software Encryption 2011 20

  • 8/12/2019 Cryptanalysis of Hummingbird-1

    22/23

    M.-J. O. Saarinen 16-Feb-11

    Hummingbird-2

    The key size has been set to 128 bits to be commensurable with the actualsecurity of the cipher.

    The state size of the cipher has been increased from 80 bits to 128 bitsand the LFSR has been eliminated.

    The keyed E Box now only has four invocations of the S-Boxes, comparedto five in Hummingbird-1. This increases the encryption speed of thecipher.

    The authentication mechanism has been improved due to thwart amessage extension attack (unpublished but trivial).

    Fast Software Encryption 2011 21

  • 8/12/2019 Cryptanalysis of Hummingbird-1

    23/23

    M.-J. O. Saarinen 16-Feb-11

    Conclusions

    We describe a very effective attack found that will break full Hummingbird-1in reasonable time.

    The attack code is about 500 lines without the actual Hummingbird-1implementation.

    The presented attack depends on a flaw in the key setup procedure, butcan be adopted to slight modifications in the cipher structure (this becameapparent during the design of Hummingbird-2).

    Colored highlighting pens can be very useful in cryptanalysis!

    Fast Software Encryption 2011 22