Download Encoder User Guide PDF
Transcript
EXTERNAL AND DYNAMIC KEYS
• Function expressions cannot be method calls or calls to variables that have function
variables. So for example, the following expressions would be disallowed by the Encoder:
// Attempt to use a static method will be disallowed.
// @ioncube.dk MyClass::StaticMethod("a") -> "my static res"
// Attempt to use an instance method will be disallowed.
// @ioncube.dk $obj->mymethod("arg1","arg2") -> "obj res"
// Cannot use variables for function calls.
// @ioncube.dk $f("pear") -> "apples and pears"
• Any variables passed to a function used to get a decoding key must all be string constants,
not containing any variables. So the following would be disallowed by the Encoder:
// Attempt to use variables as arguments will be disallowed.
// @ioncube.dk decodefn($v) -> "my string"
// Cannot use function calls in arguments.
// @ioncube.dk myfn(ucfirst("my str")) -> "res"
4.3.3
Available Encryption Methods
The following encryption methods may be used when encrypting the compiled byte code of a
function. When included at the end of a dynamic key annotation they will be recognised in a
case-insensitive way. So “random”, “RANDOM” and “Random” will all be recognised as the
random method.
• Random - A random method is chosen from a set of strong encryption methods when
encoding.
• Basic - This is a non-cryptographic byte code obfuscation method that may be used if
more application speed is required.
If neither Random nor Basic is stipulated then a default internal encryption algorithm will be
used. The default encryption method will not vary between encodings, unlike Random. This
may give slightly better performance than a random choice.
4.3.4
Dynamic Keys for Whole Scripts
We have seen above how dynamic keys can be used to encrypt the byte code of functions.
Dynamic keys can also be used for entire scripts. A dynamic key specifier will apply to the
entire script if it occurs before all other key specifiers in the script and, in addition, another
dynamic key specifier occurs before the first function. It must occur also in the body of the
script and not in any class. Below is an example:
<?php
// The dynamic key specifier immediately below will apply
// to the script as there is another specifier before
// the first function.
// @ioncube.dk https://www.example.com/special ->
"ghjvbbn444646"
$x = 'original text';
$x .= ' here';
October 2015
ionCube Encoder 9.0 User Guide
57