Skip to main content

NeuroGIFT: Using a Machine Learning Based Sat Solver for Cryptanalysis

  • Conference paper
  • First Online:
Cyber Security Cryptography and Machine Learning (CSCML 2020)

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

Abstract

A recent trend in machine learning is the implementation of machine learning based solvers, such as the sat solver NeuroSat. The main limitation of NeuroSat is its scaling to large problems. We conjecture that this lack of scaling is due to learning an all-purpose SAT solver, and that learning to solve specialized SAT problems instead should yield better results. In this article, we evaluate our hypothesis by training and testing NeuroSat on SAT problems for differential cryptanalysis on the block cipher GIFT, and present the resulting classifier NeuroGift. We show that on these highly structured problems, our models are able to perform orders of magnitude better than the original NeuroSat, potentially paving the way for the use of specialized solvers for cryptanalysis problems.

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.

    http://sontrak.com/.

  2. 2.

    https://github.com/msoos/cryptominisat.

  3. 3.

    The probability that any nibble of a random number equals 0x0 is 1/16.

  4. 4.

    Since the solver has limited computation power, we cannot obtain all solutions. However, with the observation on the outputs, we think these solutions are enough to ensure the versatile of the sample space.

References

  1. Amizadeh, S., Matusevych, S., Weimer, M.: Learning to solve circuit-SAT: an unsupervised differentiable approach (2018)

    Google Scholar 

  2. Amizadeh, S., Matusevych, S., Weimer, M.: PDP: a general neural framework for learning constraint satisfaction solvers. arXiv preprint arXiv:1903.01969 (2019)

  3. Bogdanov, A., et al.: PRESENT: an ultra-lightweight block cipher. In: Paillier, P., Verbauwhede, I. (eds.) CHES 2007. LNCS, vol. 4727, pp. 450–466. Springer, Heidelberg (2007). https://doi.org/10.1007/978-3-540-74735-2_31

    Chapter  Google Scholar 

  4. Banik, S., Pandey, S.K., Peyrin, T., Sasaki, Y., Sim, S.M., Todo, Y.: GIFT: a small present. In: Fischer, W., Homma, N. (eds.) CHES 2017. LNCS, vol. 10529, pp. 321–345. Springer, Cham (2017). https://doi.org/10.1007/978-3-319-66787-4_16

    Chapter  Google Scholar 

  5. Biham, E., Shamir, A.: Differential cryptanalysis of DES-like cryptosystems. In: Menezes, A.J., Vanstone, S.A. (eds.) CRYPTO 1990. LNCS, vol. 537, pp. 2–21. Springer, Heidelberg (1991). https://doi.org/10.1007/3-540-38424-3_1

    Chapter  Google Scholar 

  6. Cook, S.A.: The complexity of theorem-proving procedures. In: Proceedings of the Third Annual ACM Symposium on Theory of Computing, pp. 151–158. ACM (1971)

    Google Scholar 

  7. Gerault, D., Minier, M., Solnon, C.: Constraint programming models for chosen key differential cryptanalysis. In: Rueher, M. (ed.) CP 2016. LNCS, vol. 9892, pp. 584–601. Springer, Cham (2016). https://doi.org/10.1007/978-3-319-44953-1_37

    Chapter  Google Scholar 

  8. Gilmer, J., Schoenholz, S.S., Riley, P.F., Vinyals, O., Dahl, G.E.: Neural message passing for quantum chemistry. arXiv preprint arXiv:1704.01212 (2017)

  9. Kölbl, S., Leander, G., Tiessen, T.: Observations on the SIMON block cipher family. In: Gennaro, R., Robshaw, M. (eds.) CRYPTO 2015. LNCS, vol. 9215, pp. 161–185. Springer, Heidelberg (2015). https://doi.org/10.1007/978-3-662-47989-6_8

    Chapter  Google Scholar 

  10. Mezard, M., Mezard, M., Montanari, A.: Information, Physics, and Computation. Oxford University Press, Oxford (2009)

    Book  Google Scholar 

  11. Mouha, N., Preneel, B.: Towards finding optimal differential characteristics for ARX: application to Salsa20. Cryptology ePrint Archive, Report 2013/328 (2013)

    Google Scholar 

  12. Mouha, N., Wang, Q., Gu, D., Preneel, B.: Differential and linear cryptanalysis using mixed-integer linear programming. In: Wu, C.-K., Yung, M., Lin, D. (eds.) Inscrypt 2011. LNCS, vol. 7537, pp. 57–76. Springer, Heidelberg (2012). https://doi.org/10.1007/978-3-642-34704-7_5

    Chapter  MATH  Google Scholar 

  13. Selsam, D., Bjørner, N.: Neurocore: guiding high-performance SAT solvers with unsat-core predictions. CoRR, abs/1903.04671 (2019)

    Google Scholar 

  14. Sinz, C.: Towards an optimal CNF encoding of boolean cardinality constraints. In: van Beek, P. (ed.) CP 2005. LNCS, vol. 3709, pp. 827–831. Springer, Heidelberg (2005). https://doi.org/10.1007/11564751_73

    Chapter  MATH  Google Scholar 

  15. Selsam, D., Lamm, M., Bunz, B., Liang, P., de Moura, L., Dill, D.L.: Learning a sat solver from single-bit supervision. arXiv preprint arXiv:1802.03685 (2018)

  16. Soos, M., Nohl, K., Castelluccia, C.: Extending SAT solvers to cryptographic problems. In: Kullmann, O. (ed.) SAT 2009. LNCS, vol. 5584, pp. 244–257. Springer, Heidelberg (2009). https://doi.org/10.1007/978-3-642-02777-2_24

    Chapter  Google Scholar 

  17. Sun, L., Wang, W., Wang, M.: More accurate differential properties of LED64 and Midori64. IACR Trans. Symmetric Cryptol. 2018(3), 93–123 (2018)

    Google Scholar 

  18. Van Harmelen, F., Lifschitz, V., Porter, B.: Handbook of Knowledge Representation. Elsevier, Amsterdam (2008)

    MATH  Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to David Gerault .

Editor information

Editors and Affiliations

Appendices

Appendix

A Clauses for the S-Box of GIFT

The 36 clauses are provided as follows

$$\begin{aligned} \left\{ \begin{array}{l} \overline{x_{0}} \vee \overline{x_{1}} \vee \overline{x_{2}} \vee x_{3} \vee \overline{y_{2}} = 1\\ x_{0} \vee \overline{x_{1}} \vee \overline{x_{2}} \vee \overline{x_{3}} \vee \overline{y_{1}} \vee \overline{y_{2}} = 1\\ x_{0} \vee \overline{x_{1}} \vee x_{2} \vee \overline{y_{0}} \vee y_{1} \vee \overline{y_{2}} = 1\\ x_{1} \vee x_{2} \vee \overline{y_{0}} \vee \overline{y_{1}} \vee \overline{y_{2}} \vee y_{3} = 1\\ x_{1} \vee \overline{x_{2}} \vee \overline{x_{3}} \vee y_{1} \vee \overline{y_{2}} \vee y_{3} = 1\\ x_{0} \vee x_{1} \vee x_{2} \vee \overline{y_{0}} \vee \overline{y_{1}} \vee y_{2} \vee \overline{y_{3}} = 1\\ x_{0} \vee x_{1} \vee \overline{x_{2}} \vee \overline{x_{3}} \vee y_{1} \vee y_{2} \vee \overline{y_{3}} = 1\\ \overline{y_{0}} \vee w = 1\\ \overline{y_{1}} \vee w = 1\\ \overline{y_{2}} \vee w = 1\\ \overline{y_{3}} \vee w = 1\\ x_{0} \vee \overline{x_{1}} \vee \overline{x_{2}} \vee x_{3} \vee y_{2} = 1\\ x_{1} \vee \overline{x_{2}} \vee x_{3} \vee \overline{y_{2}} \vee \overline{y_{3}} = 1\\ \overline{x_{1}} \vee x_{3} \vee \overline{y_{0}} \vee \overline{y_{2}} \vee \overline{y_{3}} = 1\\ \overline{x_{0}} \vee \overline{x_{1}} \vee y_{0} \vee \overline{y_{2}} \vee \overline{y_{3}} = 1\\ x_{0} \vee \overline{x_{3}} \vee y_{0} \vee \overline{y_{2}} \vee \overline{y_{3}} = 1\\ \overline{x_{0}} \vee x_{2} \vee x_{3} \vee y_{2} \vee \overline{y_{3}} = 1\\ \overline{x_{0}} \vee y_{0} \vee \overline{y_{1}} \vee y_{2} \vee \overline{y_{3}} = 1\\ x_{0} \vee \overline{x_{1}} \vee x_{2} \vee x_{3} \vee y_{3} = 1\\ \overline{x_{0}} \vee x_{1} \vee x_{2} \vee x_{3} \vee y_{3} = 1\\ \overline{x_{1}} \vee y_{0} \vee \overline{y_{1}} \vee \overline{y_{2}} \vee y_{3} = 1\\ x_{1} \vee \overline{x_{2}} \vee x_{3} \vee y_{2} \vee y_{3} = 1\\ x_{1} \vee \overline{x_{3}} \vee y_{0} \vee y_{2} \vee y_{3} = 1\\ x_{0} \vee y_{0} \vee \overline{y_{1}} \vee y_{2} \vee y_{3} = 1\\ \overline{x_{1}} \vee y_{0} \vee y_{1} \vee y_{2} \vee y_{3} = 1\\ x_{0} \vee x_{1} \vee x_{2} \vee x_{3} \vee \overline{w} = 1\\ x_{0} \vee y_{0} \vee y_{1} \vee y_{2} \vee \overline{w} = 1\\ x_{1} \vee y_{0} \vee y_{1} \vee y_{3} \vee \overline{w} = 1\\ x_{0} \vee \overline{x_{1}} \vee x_{2} \vee \overline{x_{3}} \vee y_{1} \vee \overline{y_{3}} = 1\\ \overline{x_{0}} \vee x_{1} \vee \overline{x_{3}} \vee \overline{y_{0}} \vee \overline{y_{2}} \vee \overline{y_{3}} = 1\\ \overline{x_{0}} \vee x_{2} \vee \overline{y_{0}} \vee y_{1} \vee y_{2} \vee \overline{y_{3}} = 1\\ \overline{x_{0}} \vee \overline{x_{1}} \vee \overline{x_{3}} \vee \overline{y_{0}} \vee y_{2} \vee y_{3} = 1\\ \overline{x_{0}} \vee x_{1} \vee \overline{x_{2}} \vee \overline{x_{3}} \vee \overline{y_{0}} \vee \overline{y_{1}} \vee \overline{y_{3}} = 1\\ \overline{x_{1}} \vee \overline{x_{2}} \vee \overline{x_{3}} \vee \overline{y_{0}} \vee \overline{y_{1}} \vee y_{2} \vee \overline{y_{3}} = 1\\ \overline{x_{0}} \vee \overline{x_{1}} \vee x_{2} \vee \overline{x_{3}} \vee \overline{y_{0}} \vee \overline{y_{1}} \vee y_{3} = 1\\ \overline{x_{0}} \vee \overline{x_{1}} \vee \overline{x_{2}} \vee \overline{x_{3}} \vee \overline{y_{0}} \vee y_{1} \vee y_{3} = 1 \end{array} \right. . \end{aligned}$$
Fig. 8.
figure 8

Confidence for 6-round Samples. The horizontal axis corresponds to the number of iterations, and the vertical axis is the value of \(y^{(T)}\). The circles show a characteristic feature of the UNSAT samples.

B Impact of the Samples with Low Hamming Weight

In order to evaluate the impact of samples where the difference has low hamming weight, we plot the confidence of the network after each message passing iteration during the test phase of NeuroGift-V1, while keeping track of the structure of the input and output difference. Figure 8 illustrates the confidence of the network for 6-rounds samples. We can observe that the curves for all SAT samples of the same length are similar. But the curves of the UNSAT samples are different. We think that two parameters result in the difference. One reason is the Hamming weight of the input/output differences. Another one is the differential effect. We analyse the 60 pairs of samples in the test set. The Hamming weight of the UNSAT samples are provided in the figures. The samples with the same Hamming weight are illustrated with same color. It can be found that the curves with same color are similar. An interesting example is the UNSAT sample of the 20-th pair of 6-round samples, this is the unique sample that is wrongfully classified by the network. Firstly, the Hamming weight of the input/output differences of this sample is 4, which is even smaller than the value of the optimal trail. Another fact is that the corresponding differential only have one trail with 16 active S-boxes. Since NeuroGift-V1 is designed to identify the topology structure of the figure, the dominant trail property causes the network to make the wrong decision.

Rights and permissions

Reprints and permissions

Copyright information

© 2020 Springer Nature Switzerland AG

About this paper

Check for updates. Verify currency and authenticity via CrossMark

Cite this paper

Sun, L., Gerault, D., Benamira, A., Peyrin, T. (2020). NeuroGIFT: Using a Machine Learning Based Sat Solver for Cryptanalysis. In: Dolev, S., Kolesnikov, V., Lodha, S., Weiss, G. (eds) Cyber Security Cryptography and Machine Learning. CSCML 2020. Lecture Notes in Computer Science(), vol 12161. Springer, Cham. https://doi.org/10.1007/978-3-030-49785-9_5

Download citation

  • DOI: https://doi.org/10.1007/978-3-030-49785-9_5

  • Published:

  • Publisher Name: Springer, Cham

  • Print ISBN: 978-3-030-49784-2

  • Online ISBN: 978-3-030-49785-9

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics