Skip to main content

MILP-Based Cube Attack on the Reduced-Round WG-5 Lightweight Stream Cipher

  • Conference paper
  • First Online:
Cryptography and Coding (IMACC 2017)

Part of the book series: Lecture Notes in Computer Science ((LNSC,volume 10655))

Included in the following conference series:

Abstract

The cube attack is a powerful cryptanalytic tool for the analysis of stream ciphers, which until recently were investigated in a blackbox scenario with a minimal consideration to their internal and polynomial structures. In this paper, we analyze the lightweight stream cipher WG-5, which offers 80-bit security, using cube attacks in a non-blackbox polynomial setting employing the division property. WG-5 is a lightweight instantiation of the eSTREAM submission Welch-Gong stream cipher which provides mathematically proven random properties for its generated keystream. Our cube attack is automated using Mixed Integer Linear Programming models to theoretically bound the complexity of the superpoly recovery. The results of such an attack enable us to recover the secret key of WG-5 after 24 rounds of initialization utilizing \(2^{6.32}\) keystream bits in \(2^{76.81}\) time. Our attack on WG-5 has significantly lower data complexity than the algebraic attacks presented in the literature, albeit higher in computational complexity, it fits a more realistic scenario where large amount of data is hard to collect in lightweight constrained applications. Moreover, our attack is the first one to investigate the nonlinear feedback-based initialization phase of WG-5. Hence, such results are considered the best cryptanalytic ones in the case that the cipher runs a nonlinear key generation phase. Finally, our results are interesting in the sense that they enable us to argue how the design choices of WG-5 hinder the extension of cube attacks to more rounds in contrast to Grain 128a and Trivium, where such attacks can cover more than half of the number of initialization rounds.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 39.99
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 54.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Notes

  1. 1.

    “unknown” in Definition 1 means the xor sum can be 0 or 1 with probability \(p\ne 1\).

  2. 2.

    We use decimation 3 as the degree of each of the component functions for WGP is 4, whereas it is 3 for decimation 1.

  3. 3.

    \(f:\mathbb {F}_2^n\rightarrow \mathbb {F}_2\) is almost balanced if \(f=0\) for \(\approx 2^{n-1}\) values and \(f=1\) for the remaining values.

  4. 4.

    Step 1.2 is computationally feasible because of MILP.

References

  1. Gurobi: MILP optimizer. http://www.gurobi.com/

  2. SageMath. http://www.sagemath.org/

  3. eSTREAM: the ECRYPT stream cipher project (2008)

    Google Scholar 

  4. Aagaard, M.D., Gong, G., Mota, R.K.: Hardware implementations of the WG-5 cipher for passive rfid tags. In: 2013 IEEE International Symposium on Hardware-Oriented Security and Trust (HOST), pp. 29–34 (2013)

    Google Scholar 

  5. Armknecht, F., Mikhalev, V.: On lightweight stream ciphers with shorter internal states. In: Leander, G. (ed.) FSE 2015. LNCS, vol. 9054, pp. 451–470. Springer, Heidelberg (2015). https://doi.org/10.1007/978-3-662-48116-5_22

    Chapter  Google Scholar 

  6. Aumasson, J.-P., Dinur, I., Meier, W., Shamir, A.: Cube testers and key recovery attacks on reduced-round MD6 and trivium. In: Dunkelman, O. (ed.) FSE 2009. LNCS, vol. 5665, pp. 1–22. Springer, Heidelberg (2009). https://doi.org/10.1007/978-3-642-03317-9_1

    Chapter  Google Scholar 

  7. Babbage, S., Dodd, M.: The MICKEY stream ciphers. In: Robshaw, M., Billet, O. (eds.) New Stream Cipher Designs. LNCS, vol. 4986, pp. 191–209. Springer, Heidelberg (2008). https://doi.org/10.1007/978-3-540-68351-3_15

    Chapter  Google Scholar 

  8. De Cannière, C.: Trivium: a stream cipher construction inspired by block cipher design principles. In: Katsikas, S.K., López, J., Backes, M., Gritzalis, S., Preneel, B. (eds.) ISC 2006. LNCS, vol. 4176, pp. 171–186. Springer, Heidelberg (2006). https://doi.org/10.1007/11836810_13

    Chapter  Google Scholar 

  9. Dinur, I., Shamir, A.: Cube attacks on tweakable blackbox polynomials. In: Joux, A. (ed.) EUROCRYPT 2009. LNCS, vol. 5479, pp. 278–299. Springer, Heidelberg (2009)

    Chapter  Google Scholar 

  10. Dinur, I., Shamir, A.: Breaking Grain-128 with dynamic cube attacks. In: Joux, A. (ed.) FSE 2011. LNCS, vol. 6733, pp. 167–187. Springer, Heidelberg (2011). https://doi.org/10.1007/978-3-642-21702-9_10

    Chapter  Google Scholar 

  11. Fouque, P.-A., Vannet, T.: Improving key recovery to 784 and 799 rounds of trivium using optimized cube attacks. In: Moriai, S. (ed.) FSE 2013. LNCS, vol. 8424, pp. 502–517. Springer, Heidelberg (2014). https://doi.org/10.1007/978-3-662-43933-3_26

    Google Scholar 

  12. Gong, G., Youssef, A.M.: Cryptographic properties of the Welch-Gong transformation sequence generators. IEEE Trans. Inf. Theor. 48(11), 2837–2846 (2002)

    Article  MathSciNet  MATH  Google Scholar 

  13. Hamann, M., Krause, M., Meier, W.: Lizard: a lightweight stream cipher for power-constrained devices. IACR Trans. Symmetric Crypt. 2017(1), 45–79 (2017)

    Google Scholar 

  14. Hell, M., Johansson, T., Maximov, A., Meier, W.: A stream cipher proposal: Grain-128. In: IEEE International Symposium on Information Theory, pp. 1614–1618 (2006)

    Google Scholar 

  15. Knudsen, L., Wagner, D.: Integral cryptanalysis. In: Daemen, J., Rijmen, V. (eds.) FSE 2002. LNCS, vol. 2365, pp. 112–127. Springer, Heidelberg (2002). https://doi.org/10.1007/3-540-45661-9_9

    Chapter  Google Scholar 

  16. Lai, X.: Higher order derivatives and differential cryptanalysis. In: Blahut, R.E., Costello, D.J., Maurer, U., Mittelholzer, T. (eds.) Communications and Cryptography 1994. LNCS, vol. 276, pp. 227–233. Springer, MA (1994). https://doi.org/10.1007/978-1-4615-2694-0_23

    Google Scholar 

  17. McKay, K., Bassham, L., Sönmez Turan, M., Mouha, N.: Report on lightweight cryptography (NISTIR8114) (2017)

    Google Scholar 

  18. Méaux, P., Journault, A., Standaert, F.-X., Carlet, C.: Towards stream ciphers for efficient FHE with low-noise ciphertexts. In: Fischlin, M., Coron, J.-S. (eds.) EUROCRYPT 2016, Part I. LNCS, vol. 9665, pp. 311–343. Springer, Heidelberg (2016). https://doi.org/10.1007/978-3-662-49890-3_13

    Chapter  Google Scholar 

  19. Mikhalev, V., Armknecht, F., Müller, C.: On ciphers that continuously access the non-volatile key. IACR Trans. Symmetric Crypt. 2017(2), 52–79 (2017)

    Google Scholar 

  20. Nawaz, Y., Gong, G.: Wg: a family of stream ciphers with designed randomness properties. Inf. Sci. 178(7), 1903–1916 (2008)

    Article  MathSciNet  MATH  Google Scholar 

  21. Orumiehchiha, M.A., Pieprzyk, J., Steinfeld, R.: Cryptanalysis of WG-7: a lightweight stream cipher. Crypt. Commun. 4(3–4), 277–285 (2012)

    Article  MathSciNet  MATH  Google Scholar 

  22. Rohit, R., AlTawy, R., Gong, G.: MILP-based cube attack on the reduced-round WG-5 lightweight stream sipher. The University of Waterloo CACR Archive, Technical report CACR 2017-06 (2017). http://cacr.uwaterloo.ca/techreports/2017/cacr2017-06.pdf

  23. Rønjom, S.: Improving algebraic attacks on stream ciphers based on linear feedback shift register over \(\mathbb{F}_{2^K}\). Des. Codes Crypt. 82(1–2), 27–41 (2017)

    Article  MATH  Google Scholar 

  24. Todo, Y.: Structural evaluation by generalized integral property. In: Oswald, E., Fischlin, M. (eds.) EUROCRYPT 2015, Part I. LNCS, vol. 9056, pp. 287–314. Springer, Heidelberg (2015). https://doi.org/10.1007/978-3-662-46800-5_12

    Google Scholar 

  25. Todo, Y., Isobe, T., Hao, Y., Meier, W.: Cube attacks on non-blackbox polynomials based on division property. In: Katz, J., Shacham, H. (eds.) CRYPTO 2017, Part III. LNCS, vol. 10403, pp. 250–279. Springer, Cham (2017). https://doi.org/10.1007/978-3-319-63697-9_9

    Chapter  Google Scholar 

  26. Todo, Y., Morii, M.: Bit-based division property and application to Simon family. In: Peyrin, T. (ed.) FSE 2016. LNCS, vol. 9783, pp. 357–377. Springer, Heidelberg (2016). https://doi.org/10.1007/978-3-662-52993-5_18

    Chapter  Google Scholar 

  27. Vahid Amin Ghafari, H.H., Chen, Y.: Fruit: Ultra-lightweight stream cipher with shorter internal state. Cryptology ePrint Archive, Report 2016/355 (2016). http://eprint.iacr.org/2016/355

  28. Xiang, Z., Zhang, W., Bao, Z., Lin, D.: Applying MILP method to searching integral distinguishers based on division property for 6 lightweight block ciphers. In: Cheon, J.H., Takagi, T. (eds.) ASIACRYPT 2016, Part I. LNCS, vol. 10031, pp. 648–678. Springer, Heidelberg (2016). https://doi.org/10.1007/978-3-662-53887-6_24

    Chapter  Google Scholar 

Download references

Acknowledgment

We would like to thank the reviewers of IMACC 2017 for their valuable comments that helped improve the quality of the paper. This work is supported by the National Institute of Standards and Technology (NIST) and Natural Sciences and Engineering Research Council of Canada (NSERC).

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Raghvendra Rohit .

Editor information

Editors and Affiliations

Appendices

A MILP Models for WG-5 Components

figure b
figure c
figure d
figure e

B A Generic Algorithm for the Evaluation of the Involved Secret Variables in a Superpoly [25]

figure f

C Description of Grain128a and Trivium

Grain128a is a NLFSR based stream cipher of Grain family with two 128-bit states represented by \((b_0, b_1, \ldots , b_{127})\) and \((s_0, s_1, \ldots , s_{127})\). The state is loaded with 128-bit key and 96-bit IV as follows \((b_0, b_1, \ldots , b_{127}) = (k_0, k_1, \ldots , k_{127})\) and \((s_0, s_1, \ldots , s_{127}) = (iv_0, iv_1, \ldots , iv_{95}, 1,\ldots , 1, 0)\). The initialization phase runs for 256 rounds with the state update function given by

$$\begin{aligned} \begin{aligned}&g \leftarrow {} b_0 + b_{26} + b_{56} + b_{91} + b_{96} + b_3b_{67} + b_{11}b_{13} \\&\quad + b_{17}b_{18} + b_{27}b_{59} + b_{40}b_{48} + b_{61}b_{65} + b_{68}b_{84} \\&\quad +b_{88}b_{92}b_{93}b_{95} + b_{22}b_{24}b_{25} + b_{70}b_{78}b_{82} \\&f \leftarrow {} s_0 + s_{7} + s_{38} + s_{70} + s_{81} + s_{96} \\&h \leftarrow {}b_{12}s_8 + s_{13}s_{20} + b_{95}s_{42} + s_{60}s_{79} + b_{12}b_{95}s_{94} \\&z \leftarrow {}h + s_{93} + b_2 + b_{15} + b_{36} + b_{45} + b_{64} + b_{73} + b_{89} \\&(b_0, b_1, \ldots , b_{127})\leftarrow (b_1, b_2, \ldots , b_{127}, g+s_0+z) \\&(s_0, s_1, \ldots , s_{127})\leftarrow (s_1, s_2, \ldots , s_{127}, f+z). \end{aligned} \end{aligned}$$

During the KSG phase, z is not feedback to the state and directly used as the keystream bit.

Trivium is also an NLFSR based stream cipher with state size 288. The 80-bit key and 80-bit IV are loaded into the state as follows \((s_0, s_1, \ldots , s_{92}) = (k_0, k_1, \ldots , k_{79},0,\ldots ,0)\), \((s_{93}, s_{94}, \ldots , s_{176}) = (iv_0, iv_1, \ldots , iv_{79}, 0,\ldots , 0)\) and \((s_{177}, s_{178}, \ldots , s_{287}) =(0,0,\ldots ,0, 1,1,1)\). The state update function of Trivium is given by

$$\begin{aligned} \begin{aligned}&t_1 \leftarrow s_{65} + s_{92} \\&t_2 \leftarrow s_{161} + s_{176} \\&t_3 \leftarrow s_{242} + s_{287} \\&z \leftarrow t_1 + t_2 + t_3\ \\&t_1 \leftarrow t_1 + s_{90}s_{91} + s_{170} \\&t_2 \leftarrow t_2 + s_{174}s_{175} + s_{263} \\&t_3 \leftarrow t_3 + s_{285}s_{286} + s_{68} \\&(s_0, s_1, \ldots , s_{92}) \leftarrow (t_3, s_0, \ldots , s_{91})\\&(s_{93}, s_1, \ldots , s_{176}) \leftarrow (t_1, s_{93}, \ldots , s_{175})\\&(s_{177}, s_1, \ldots , s_{287}) \leftarrow (t_2, s_{177}, \ldots , s_{286}). \end{aligned} \end{aligned}$$

The initialization phase runs for 1152 rounds without producing an output while z is used as the keystream bit during KSG phase.

Rights and permissions

Reprints and permissions

Copyright information

© 2017 Springer International Publishing AG

About this paper

Check for updates. Verify currency and authenticity via CrossMark

Cite this paper

Rohit, R., AlTawy, R., Gong, G. (2017). MILP-Based Cube Attack on the Reduced-Round WG-5 Lightweight Stream Cipher. In: O'Neill, M. (eds) Cryptography and Coding. IMACC 2017. Lecture Notes in Computer Science(), vol 10655. Springer, Cham. https://doi.org/10.1007/978-3-319-71045-7_17

Download citation

  • DOI: https://doi.org/10.1007/978-3-319-71045-7_17

  • Published:

  • Publisher Name: Springer, Cham

  • Print ISBN: 978-3-319-71044-0

  • Online ISBN: 978-3-319-71045-7

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics