Obfuscation Algorithms Based on Congruence Equation and Knapsack Problem

  • Da XiaoEmail author
  • Shouying BaiEmail author
  • Qian Wu
  • Baojiang Cui
Conference paper
Part of the Lecture Notes on Data Engineering and Communications Technologies book series (LNDECT, volume 29)


This paper proposes an obfuscation algorithm based on congruence equation and knapsack problem, for the problem of generating opaque predicate in control flow obfuscation. We binarize the state of the solution of the congruence equation, and then combine the knapsack problem to achieve the binary output of opaque predicate. Compared with the existing chaotic opaque predicate design algorithm, the experimental comparison shows that this paper generates the probability of opaque predicate binary results is nearly 50%, and the time overhead is controlled within 1 s. The experimental results show that the proposed algorithm has better performance in randomness, stability and time overhead, which can effectively resist code reverse analysis.



This work was supported by National Natural Science Foundation of China (No. U1536122).


  1. 1.
    Yuan, Z., Wen, Q., Mao, M.: Constructing opaque predicates for java programs. In: 2006 International Conference on Computational Intelligence and Security, pp. 895–898 (2006)Google Scholar
  2. 2.
    Schulz, P.: Code Protection in Android. Insititute of Computer Science, Rheinische Friedrich-Wilhelms-Universitgt Bonn, Germany, vol. 110 (2012)Google Scholar
  3. 3.
    Liem, C., Gu, Y.X., Johnson, H.A.: Compiler-based infrastructure for software-protection. In: The Workshop on Programming Languages & Analysis for Security, pp. 33–44 (2008)Google Scholar
  4. 4.
    Shan, L., Emmanuel, S.: Mobile agent protection with self-modifying code. J. Signal Process. Syst. 65(01), 105–116 (2011)CrossRefGoogle Scholar
  5. 5.
    Garg, S., Gentry, C., Halevi, S., et al.: Candidate indistinguishability obfuscation and functional encryption for all circuits. In: Foundations of Computer Science Annual Symposium, vol. 311, no. 02, pp. 40–49 (2013)Google Scholar
  6. 6.
    Larsen, P., Homescu, A., Brunthaler, S., et al.: SoK: automated software diversity. In: IEEE Symposium on Security & Privacy, pp. 276–291 (2014)Google Scholar
  7. 7.
    Collberg, C., Thomborson, C.: Low DA taxonomy of obfuscating transformations. University of Auckland (1997)Google Scholar
  8. 8.
    Collberg, C.S., Thomborson, C.: Watermarking, tamper-proofing, and obfuscation tools for software protection. IEEE Trans. Softw. Eng. 28(8), 735–746 (2002)CrossRefGoogle Scholar
  9. 9.
    Zhang, Y., Zhang, X., Pang, J.: A review of research on code confusion technology. J. Inf. Eng. Univ. (5), 635–640 (2017).
  10. 10.
    Zhao, Y.J., Tang, Z.Y., Wang, I.: Evaluation of code obfuscating transformation. J. Softw. 23(3), 700–711 (2012)CrossRefGoogle Scholar
  11. 11.
    Collberg, C., Thomborson, C., Low, D.: Manufacturing cheap, resilient, and stealthy opaque constructs. In: Proceedings of the 25th ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, pp. 184–196 (1998)Google Scholar
  12. 12.
    Arboit, G.: A method for watermarking Java programs via opaque predicates. In: Proceedings of International Conference on Electronic Commerce Research, pp. 124–131 (2002)Google Scholar
  13. 13.
    Su, Q., Wu, W., Li, Z., et al.: Research and application of chaos opaque predicate in code obfuscation. Comput. Sci. 40(6), 155–160 (2013)Google Scholar
  14. 14.
    Chengdong, P., Chengyu, P.: Elementary Algebraic Number Theory, pp. 112–117. Shandong University Press, Jinan (1991)Google Scholar
  15. 15.
    Wang, Y., Huang, Z.-J., Gu, N.-J.: Embedded algorithm based on congruence equation and improved flattened control flow. Comput. Appl. (6), 1803–1807 (2017).

Copyright information

© Springer Nature Switzerland AG 2019

Authors and Affiliations

  1. 1.School of Cyberspace SecurityBeijing University of Posts and TelecommunicationsBeijingChina
  2. 2.National Engineering Lab for Mobile NetworkBeijingChina
  3. 3.National Computer Network Emergency Response Technical Team/Coordination Center of ChinaBeijingChina

Personalised recommendations