Does JUCE have a built in Obfuscator?

Just curious as to whether JUCE has a built in code obfuscator for added security.

I would like to copy my working project as a new market product and have the new project use an obfuscator

No. And code obsfuscation doesn’t make sense in c++, as it is a compiled language.

1 Like

Ah, thanks for the answer cpr :+1:

Actually juce has an obfuscator:

 Projucer --obfuscated-string-code string_to_obfuscate
    Generates a C++ function which returns the given string, but in an obfuscated way.

The string will be scrambled in memory and only at runtime put into its original form.
This is because in binaries you still find string literals and you can try them for reverse engineering e.g. some encryption.

âžś  ~ Projucer --obfuscated-string-code "JUCE has everything"
String createString()
    String s4;  s4 << 'y' << 't' << 'h' << 'i' << 'n' << 'g';
    String s1;  s1 << 'C' << 'E' << ' ' << 'h' << 'a' << 's';
    String s3;  s3 << 'r';
    String s0;  s0 << 'J' << 'U';
    String s2;  s2 << ' ' << 'e' << 'v' << 'e';

    String result = (s0 + (s1 + (s2 + (s3 + s4))));

    jassert (result == "JUCE has everything");
    return result;

N.B. I wouldn’t trust that code is really obfuscated in an optimised build…


Always good to check. On a Mac, it seems to have maintained obfuscation in a release build (with standard Projucer optimization settings). E.g., I was not able to find the "JUCE has everything" string when searching a compiled binary using a hex editor (whereas other string literals in the code do show up).

This isn’t my best area, though, so if there are other better ways to verify that obfuscation was maintained, I’d love to hear more.