Evaluation of Obfuscation Strategies for Python Source Codes

João Pedro Vital Brasil Wieland, Flávio Luis de Mello

Abstract


This work presents a comparative analysis of the impact of different obfuscation techniques and tools on Python code performance. Five main obfuscation approaches were evaluated: PyArmor, Pyminifier, Cython, PyInstaller, and PyObfuscate, analyzing their impact on metrics such as execution time, memory usage, code size, and startup time. The methodology was based on an automated benchmarking tool, developed specifically for this study, capable of applying different obfuscation techniques to Python code and objectively measuring its performance. The results demonstrated that it is possible to effectively protect real-time Python applications with low performance impact, especially using approaches such as PyArmor or Cython. The work concludes that the appropriate selection of obfuscation tools should consider the specific context of the application, evaluating trade-offs between protection, performance, and ease of distribution, especially for critical real-time systems. Therefore, using a benchmark generation tool can be valuable in deciding the best strategy to implement in each project.

Keywords


Benchmark, Code Obfuscation, Python, Information Security

Full Text:

PDF

References


MELLO, Flávio Luis de. A Survey on Machine Learning Adversarial Attacks. Enigma : Journal of Information Security and cryptography, Brasília, v. 7, n. , p. 1-7, Dec. 2020. doi: doi.org/10.17648/jisc.v7i1.76

BALAKRISHNAN, Arini; SCHULZE, Chloe. Code Obfuscation Literature Survey. 2005. Available at: https://pages.cs.wisc.edu/~arinib/writeup.pdf. Accessed on: December 19, 2005.

COLLBERG, Christian S.; THOMBORSON, Clark. Watermarking, Tamper-Proofing, and Obfuscation - Tools for Software Protection: tools for software protection. IEEE Transactions on Software Engineering , [ s. l ], v. 28, no. 8, p. 735-746, Aug. 2002. doi: 10.1109/TSE.2002.1027797

HOSSEINZADEH, Shohreh et al . Diversification and obfuscation techniques for software security: A systematic literature review. Elsevier: Information and software Technology. Turku, Finland, p. 72-93. jul. 2017. doi: 10.1016/j.infsof.2018.07.007

SKOLKA, Philippe. Anything to Hide? Studying Minified and Obfuscated Code in the Web. In: WWW '19: THE WORLD WIDE WEB CONFERENCE, 1., 2019, San Francisco. Proceedings of International World Wide Web Conference 2019. New York: Acm, 2019. p. 1735-1746. doi: 10.1145/3308558.3313752.

UCHIDA, Yusuke et al . Embedding Watermarks into Deep Neural Networks. In: International Conference on Multimedia Retrieval, 1., 2017, Bucharest. New York: ACM, 2017. p. 269-277. doi: 10.1145/3078971.3078974.

DONG, S. et al. (2018). Understanding Android Obfuscation Techniques: A Large-Scale Investigation in the Wild. In: Beyah, R., Chang, B., Li, Y., Zhu, S. (eds) Security and Privacy in Communication Networks. SecureComm 2018. Lecture Notes of the Institute for Computer Sciences, Social Informatics and Telecommunications Engineering, vol 254. Springer, Cham. doi: 10.1007/978-3-030-01701-9_10 . Accessed on: October 15, 2022.

SK UDUPA, SK Debray and M. Madou, "Deobfuscation: reverse engineering obfuscated code," 12th Working Conference on Reverse Engineering (WCRE'05) , 2005, pp. 10 pp.-54, doi: 10.1109/WCRE.2005.13.

KHOLIA, Dhiru. Looking Inside the (Drop) Box. In: Workshop on Offensive Technologies, 7., 2013, Washington, Dc. Proceedings of 7th USENIX Workshop on Offensive Technologies. New York: Usenix, 2013. p. 1-7. Available at: https://www.usenix.org/conference/woot13/workshop-program/presentation/kholia. Accessed on: October 16, 2022.

ZHAO, Jondy. PyArmor's Documentation . 2020. Available at: https://pyarmor.readthedocs.io/en/latest/. Accessed on: October 20, 2022.

MCDOUGALL, Dan. Pyminifier - Minify, obfuscate, and compress Python code . 2014. Available at: https://liftoff.github.io/pyminifier/. Accessed on: November 12, 2022.

Behnel, Stefan; Bradshaw, Robert ; Seljebotn, Dag Sverre; Ewing, Greg; Stein, William; Gellner, Gabriel. Welcome to Cython’s Documentation. 2025. Available at: https://cython.readthedocs.io/en/latest/. Accessed on: May 21, 2025.

Cortesi, David; Bajo, Giovanni; Caban, William. PyInstaller Manual. 2025. Available at: https://pyinstaller.org/en/stable/ . Accessed on: May 21, 2025.

______. PyObfuscate. 2023. Available at: https://pyobfuscate.com/ . Accessed on, May 21, 2025

Wieland, João Pedro Vital Brasil. Benchmarks of Obfuscation Strategies from Python Codes. Undergraduate on Computer and Information Engineering, Politechnique School, Federal University of Rio de Janeiro, 2024.




DOI: https://doi.org/10.17648/jisc.v12i1.92

Refbacks

  • There are currently no refbacks.


Creative Commons License
This work is licensed under a Creative Commons Attribution 4.0 International License.

Licença Creative Commons
This site is licensed with the Creative Commons Atribuição-NãoComercial-SemDerivações 4.0 Internacional

RENASIC Logo1 Logo2 Logo3