GhastLess than 1 minute

Number Encryption

The number encryption transformer encrypts any integer-based numeral to be hidden. This is perfect for uglifying the code in general and making it more of a hardship for reverse-engineers to obtain a clean source code. This furthermore reinforces any boolean-based conditionals.

The number encryption relies on the GEN3 flow obfuscation and may, in decompiled output, show as follows

Lets assume the following scenario:

  • xx is the number we wish to encrypt
  • nn is the "seed" of the block
  • dd is the encryped number

According to simple xor mechanics: xnn=xx\oplus n\oplus n=x

So, by definition, if nn is our seed, at runtime we must compute dd such as d=xnd = x\oplus n. Then, we must modify the bytecode instruction such as:

int value = x;

becomes

int value = d ^ n;

Where dd is the value computed ahead of time in the form of a constant and nn the opaque predicate. Eg:

int value = 5;

becomes

int predicate = 0x100;
int value = 105 ^ predicate;

Config

Currently, there is only one mode of Number Encryption, STANDARD

numberEncryption {
    enabled: true
    exempt: []
}

Examples

Unobfuscated

int var = 1000;
System.out.println(var + 1 + 2 + 3);

Obfuscated

int var = 0xA0290233 ^ n;
System.out.println(var + 0x92083838 ^ n + 0x92083839 ^ n + 0x92083840 ^ n);