Obfuscated code is a source code that has been modified to be difficult to be understood. It is a code whose logic is intentionally difficult to follow and whose syntax is intentionally unclear. There are several reasons for producing obfuscated code. These include intellectual property protection, program security or recreational challenge.
The following obfuscated code is a simple obfuscation based on macro definitions.
This source code, written in C, prints "Hello world!" on the screen.
#include "stdio.h" Obfuscation based on macro definitions can be reversed by executing the C preprocessor. After executing the preprocessor you will have a more understandable code, usually it won't be a fully understandable code but it will be easier to read.
Taking out the macro definitions and organising the code above we will get the following source code.
#include "stdio.h"
Another technique to obfuscate your code is to use meaningless and confusing names besides using a confusing and unreadable syntax.
The following obfuscated code makes use of this technique.
This source code, written in C, prints "Hello world!" on the screen.
#include "stdio.h" If we write the obfuscated code above using meaningful names and an organised syntax we get the following source code.
#include "stdio.h" For a more obfuscated code we can use both obfuscation techniques and some other approaches.
by rcor |

