Protect the Python application with Virbox Protector

Python, as one of high level, interpreted script program language, are widely and popular be used to develop different kind of application and projects by software developers.

As a interpreted language, the python application contains 2 kinds of python file: python.exe, the interpreter and py file: py, pyc, or pyd file, which is source code, bytecode file which will be called/interpreted by pyhton.exe when python application executed.

1. The Mechanism to protect the python application

1). Using Virbox Protector, to encrypt the python.exe, the python interpreter;

2). Use the DS Protector, a plug in unit, to protect relevant python source code: py/pyc file;

3). Deployment: Use the protected (encrypted) python.exe and encrypted py/pyc file to replace original python.exe and py/pyc when executed.

Virbox Supports to protect the python application in following scenarios:

Scenario

Support or Not

Anconda2/Anconda3

yes

Call python module from C++/C Projects

Yes

Call C++/C from py file

Yes

Using pyinstall/py2exe to pack a py file to exe file

Yes

Convert to pyd/so/executable file by py file

yes

Tips: For the pyd/so or executable file which converted by use of pyinstall/py2exe to pack the py file, pls refer the protection process for Native projects.

2. Prerequisites

  1. Apply trial license & download and install Virbox Protector;

  2. Python application for test/evaluation is ready;

  3. Above pre-requisition is for test/evaluation Virbox Protector only. To protect formal and commercial release software, pls purchase and get the related Virbox Protector license.

3. Protection Process

3.1. Protect the python.exe

3.1.1 Open Virbox Protector GUI tool: virboxprotector.exe, login Virbox Protector with your account and password;

3.1.2 Find the Python.exe location: Execute python application, and use the windows's task manager to find the python.exe location.

3.1.3 Drag the python.exe into the Virbox Protector GUI tool, Virbox Protector will parse the python.exe automatically. see snapshot attached below:

3.1.4 Protect the function's via "Function Option" tab

Protect the selected functions in "Function Option" tab, in this section, you may select the functions which you want to protect in the "Function Option" tab to protect the specified functions, with several encryption option to encrypt the functions: "Encryption", "No protect", "Obfuscation", "Virtualization" etc.

3.1.5 Protect python.exe in general, via "Protection Option" tab

In "Protection Option" you may:

  1. Set output path for protected file (python.exe);

  2. select and set protection option to the protected file (python.exe) in general level: Click and select the options listed:

    Import table:

    Compression:

    Memory Check:

    Resource Section Encryption:

  3. Switch on (Enable) DS Protector button and set password for the py/pyc file (if you don't set the password for py/pyc which DS protector used, Virbox Protector will use a password random generated

3. 1.6 Protect the python.exe

Click "Protect Selected Projects" in the menu, it will generated 2 new files as shown below:

python.ssp.exe: This file is python.exe after protection (we will rename the file name and use it later)

python.exe.ssp: this file is configuration file for protected python file;

Pls backup and save the original python.exe file to another sub directory, and change the file name: python.ssp.exe to original file name: python.exe.

3.2 Protect the py/pyc file

3.2.1 Open DS Protector

Open DS protector via Virbox Protector GUI: switch on ds Button (green)

or, Open DS Protector from the virbox protector directory:

you can find the dsprotector.exe in \virboxprotector\bin, and open it.

3.2.2 Protect the py/pyc file by DS Protector

Add the py/pyc which you want to protect by DS Protector GUI and click the "Protect" button on the right bottom corner, as shown in below:

when protection success, the DS Protector will show following information:

2 files can be found in the output directory:

py.py, this is new py file which protected successful by DS Protector; this new py file will be used together with protected python.exe later.

py.py.bak, this is your original py file, pls backup and save it.

Till now, you have complete all protection process to protect python application;

Use the new and protected python.exe (don't forget to change name) and protected py.py to execute your python application.

Any questions for testing, implementation to protect python applications,

pls contact Virbox support team at:

email:

support@senselock.com

info@senselock.com

Skype: virbox_help@outlook.com

Last updated