Guides
Protection settings
The torzen.json format shared by the panel and the API: protection levels, function name patterns, data protection, integrity checks and profiles.
The settings for one protection are a JSON file. The panel stores your choices from the function list in it, and the API takes it in the settings field. You can download the file from the panel, keep it in your repository next to the code and upload it for later releases.
Example
{
"default": "none",
"functions": [
{ "name": "LicenseManager::validate", "level": "virtualization" },
{ "name": "net::*", "level": "mutation" }
],
"markers": [{ "name": "license-check", "level": "virtualization" }],
"strings": "encrypt",
"resources": "keep",
"imports": "protect",
"integrityChecks": true
}Fields
| Field | Values | Default |
|---|---|---|
default |
level for functions not listed | none |
functions |
names or patterns with a level | empty |
markers |
markers with a level | empty |
strings |
encrypt, keep |
keep |
resources |
encrypt, keep |
keep |
imports |
protect, keep |
keep |
integrityChecks |
true, false |
false |
profile |
name of a profile saved in the panel | none |
An unknown field or invalid value stops the job before processing. The message points to the field, for example functions[1].level, and no protection is used.
Protection levels
none: the function is left unchanged.mutation: the code is rewritten into equivalent instruction sequences that are harder to analyze. The performance cost is small, so this level suits frequently called functions.virtualization: the code is translated into instructions for a virtual machine embedded in the file. It is the strongest level and the most expensive at run time. Use it for functions that run rarely, such as license checks.
Always measure the performance impact on your own program, for example with benchmarks run against the protected file.
Name patterns
An asterisk matches any run of characters within a name: net::* covers every function in the net namespace. When a function matches several entries, the first matching entry in the list wins, so put exact names before patterns.
Profiles
A profile is a named set of settings saved in the panel. The profile field loads it, and the other fields in the file override its values. Shared settings live in one place, and the file only changes what is specific to a release.