Database Reference
In-Depth Information
Obfuscate the Naming
Let's take just one more step—although, numerous other obfuscation processes could be accomplished.
This step is merely replacing our member names with meaningless names that are difficult to read. Let's
swap names according to Table 11-1. These sequences of the number 1 (one), capital I, and lowercase l
(ell) are selected to be confusing. They all start with an alphabet character to comply with the compiler.
The greatest loss in this step of obfuscation is the loss of meaningful names for these methods and
members.
Table 11-1. Obfuscated Naming
Previous Name
Obfuscated Name
OJSCode
OJSC
encode()
x()
decode()
y()
traverse()
lI1ll()
encodeThis
I1ll1
eTBytes
lII1l
xBytes
ll1I1
oneByte
ll11I
twoI
IlIl1
GT
I11lI
After these translations, our code is barely recognizable. Only the code structure looks like Java, and
a few general method references. Listing 11-7 shows the encode() [x()] and traverse() [lI1ll()]methods.
Listing 11-7 . Obfuscated Naming
public class OJSC {
static String x( String I1ll1 ) {
byte[] lII1l = lI1ll( I1ll1 );
byte[] ll1I1 = lI1ll( null );
I1ll1 = "";
String ll11I = "*";
int IlIl1 = Integer.parseInt(
String.valueOf( Integer.toHexString(
(int)(ll11I.charAt(0))).charAt(0)));
I11lI: do {
ll11I = Integer.toHexString(
 
Search WWH ::




Custom Search