Table of contents
What are the main advantages and disadvantages of code obfuscation? And what does code obfuscation really mean? Code obfuscation is the process of encoding information so that it cannot be read by potentially malicious actors. It is used for the purposes of data protection, security, and privacy. If your code is unreadable to potential attackers, you can keep your algorithms safe from theft or misuse.
Usually, the obfuscation does not have any effect on the actual function of the code. It is performed in order to protect it from unauthorized access and modification. Any kind of data protection has its advantages and disadvantages. However, using code obfuscation has several advantages over other types of protection, such as encryption or hashing.
Advantages and disadvantages of code obfuscation
Advantages of code obfuscation👍
1) Doesn’t change the functionality of the code
The most important advantage is that it doesn’t change the functionality of the code while keeping it safe. An encrypted string will not be readable by anyone and you have to decrypt it before use, but encoded strings can be used right away and decoded during runtime if needed. Hashed strings also cannot be used straight away as they contain only data about the original value.
2) Protection against hackers and untrustworthy people
Almost all computer users who have some experience with computers are capable of hacking a website or an application. There is no such thing as 100% secure software, but if the code is not readable by humans, it’s significantly harder to break.
Another important thing to mention is that both malicious hackers and companies can be your potential rivals during development and after releasing your app. Malicious hackers can try to steal your algorithm for their purposes, for example, putting in viruses that steal credit card information by stealing the users’ data from certain websites, or just simply stealing money from you through illegal purchasing on Apple’s App Store or Google Play.
3) Makes it hard to copy-paste the original codebase
When you want to protect your code from being copied, you can use a variety of methods. One example is encryption. When the code is encrypted, no one can just copy-paste it and think that it will work in another project. Another option is hashing. In this case, you can use a unique global key to calculate a unique value that represents your algorithm. The client then stores the calculated value instead of the algorithm itself which makes it much harder for an outsider to get it (if not impossible).
It’s worth mentioning that it’s much harder for a regular user to get access to your source code as he or she would have to learn computer programming of some kind in order to do so. It’s not a matter of just copying the text from one place and pasting it to another.
Now, let’s have a look at the disadvantages!
Disadvantages of code obfuscation👎
1) Possibility of slowing down your application
No matter how powerful your computer is, a code obfuscator will always reduce the performance of your code while it performs its tricks. You can get a certain speed penalty by using some specific algorithms that are known for their slower performance. However, it’s still worth checking the reports on each code obfuscator and see how much time it can save you in your case.
2) Possible product updates incompatibility ⏫
Code obfuscation has changed a lot over the years and many new techniques appeared while some old ones became redundant. If you want to create an app that works on almost all platforms, you should be aware of this issue as well. It’s relatively easy to find all the platforms you need to support and see what kind of changes need to be implemented in order for your code to work for them.
3) May contain bugs that prevent it from working properly 🐛
Even though some code obfuscators have been improved by experts over the years, they still don’t provide 100% protection against bugs. So if the algorithms you’re using are buggy, then the code that they’ll produce might not be correct as well. You should be careful and read the reviews as well to see how good the code obfuscator is on your platform and with the algorithms you need.
Code obfuscation is an important step in the process of protecting a piece of software. One thing is for sure – it will always slow down your work, but at least it’s hard to steal your algorithms by using them on another project or buy malicious software that steals credit card information from certain websites, which is the main idea behind code obfuscation.
No one can be 100% sure that their project is protected from hackers, but the only thing you can do is to try to prevent them from getting access to your code as much as possible✅.
Read about why code reviews are important here.