Protecting the software of AI and ML solutions
Encrypt Python scripts
Until now, Python scripts could only be protected against theft or manipulation by pre-compiling them. A new tool automatically encrypts the code and guarantees its security. It also enables licensing, among other things.
Due to its simple syntax, clarity, available resources and high flexibility, the Python programming language is mostly used in the fields of artificial intelligence (AI) and machine learning (ML), resulting in software solutions for healthcare, manufacturing, business, education, finance and the legal sector, for example. The "State of the developer nation" survey by analyst Slash Data underlines the importance of Python. Over 19,000 developers gave their feedback on their favorite programming languages in this survey in the first quarter of 2021. The result is second place for Python. The main uses of Python include data science, machine learning and applications for IoT.
The popularity of Python means that attackers are also using this programming language, for example to search for vulnerabilities. They also try to copy the innovations of manufacturers and profit from them with little effort. The crux of the matter is that attackers can easily access the Python source code for Python, a scripting language, because it is delivered as a text file and can be read in plain text. This means that the source code is open and can be changed, manipulated, copied and the idea behind it recreated (reverse engineering), whether intentionally or unintentionally.
In order to offer manufacturers of AI and ML applications both protection and licensing for their software written in Python, the Karlsruhe-based manufacturer Wibu-Systems has expanded its CodeMeter solution specifically for this purpose. The new "AxProtector Python" tool enables the automatic encryption of Python software. Previously, Python software could be protected by precompiling the exe file using the Cython compiler. The new tool, which is an extension of the CodeMeter Protection Suite, is much more convenient and allows direct and automatic encryption of Python software. The various AxProtector variants are based on encryption and licensing, i.e. the manufacturers first encrypt their software and then supply the corresponding license key to the user at the time of purchase. The license key, which can also be updated at a later date, defines the purchaser's authorizations. The license key can be stored in different ways: in the protective hardware CmDongle, the software-based activation file CmActLicense or in the CmCloudContainer, which is located in the cloud.
The precompilation method
Until now, manufacturers have been able to protect their Python software in two steps: via precompilation and encryption. The Cython compiler is used to convert the Python software into an executable file (exe) written in C, which is then encrypted in the next step using the AxProtector tool. With this classic approach, the manufacturer has to create and deliver the corresponding executable file for each individual platform, which only works if they have the appropriate technical knowledge.
The various encryption tools allow manufacturers to protect and license their software and therefore their intellectual property. Thanks to granular licensing, software monetization models can be created and used, which generates additional revenue. Manufacturers can automatically implement various licensing models, such as single user licenses, floating licenses within a network or a time-based model. The data that is important for the Python software can also be encrypted and signed via the Code Meter Core API.
The minimum requirements for using AxProtector Python are Python 3 and CodeMeter 7.30. Without the step of precompiling via Python, AxProtector Python encrypts the script directly and no native code is generated. The strength of the new tool lies in its platform independence, as it is only executed once to generate a single executable file that runs on the different platforms Windows, Linux or macOS. This means that the Python software is only encrypted once and the manufacturer can use the protection level of CodeMeter technology as usual. Only the part that is currently required is decrypted at runtime, so that the majority of the software remains encrypted. Manufacturers can create modular licenses, as each function of the Python software can be encrypted individually. The encrypted software and the license keys are delivered exactly as the user purchased them. Users can easily purchase additional software functions and the corresponding license keys at a later date. If certain functions and files are to remain unencrypted, the manufacturer can set annotations and control this via entries in the protection definition. As the precompilation step is no longer necessary, integration via AxProtector Python is simple.
The CodeMeter Protection Suite
Manufacturers can use the various encryption tools to encrypt the entire software or parts of it. The corresponding AxProtector variants are optimized for the various programming languages. They are used to protect an executable file. There is also AxProtector for encrypting individual functions and IP Protection to protect software from reverse engineering. The AxProtector Python supplements the existing variants.
If the popularity of Python continues, which can be assumed due to the growth potential of AI and ML, manufacturers will have to deal even more intensively with suitable protection and licensing concepts. Wibu-Systems expanded its CodeMeter technology early on to enable manufacturers to easily protect and license their Python software.
Rüdiger Kügler, VP Sales & Security Expert, Wibu-Systems










