Standard solutions rely on length + "#" + string. That is trivial to reverse.
sbox utilizes a constexpr AES-128 block cipher to mutate strings into high-entropy noise.
During the Neetcode "Encode and Decode Strings" challenge, I ported the AES engine from my obfuscation project, Obfusk8.
The implementation passed in 7ms on the first submission. Cryptographic security shouldn't be a trade-off for performance.
- No Delimiters: Fixed-width headers and block mutation replace predictable separators.
- Binary Safe: Effortlessly handles raw payloads and null bytes.
- Static Stealth: Plaintext is eliminated at compile-time. Using the provided macros,
strings.exe(orstringsin linux) returns zero results.
Check the EXAMPLES folder for implementation details:
-
Multi-String Example (
sbox_test.cpp): Demonstrates how to handle avector<string>using the_OBF(str)macro for batch processing. Useful for transit-ready obfuscation. -
Single String Example (
sbox_test1.cpp): Demonstrates atomic materialization using theObfStr(str)macro. Best for single variable assignments:string s = ObfStr("ama obfuscation addicted");
7ms runtime. Proving that overkill can still be optimal.
Author: x86byte