DEV Community

Discussion on: How to Encrypt JavaScript Code for Web Security

Collapse
 
gentritbiba profile image
Gentrit Biba • Edited

Obfuscation is definitely a great tool developers can use to make their public code harder for others to understand.
However, it's important to remember that obfuscation and encryption are two different things. Encryption transforms data into a secret code that can only be deciphered with the correct key, while obfuscation cannot be reversed to the original code, but it can be reversed engineered.

Collapse
 
christopherzhong profile image
Christopher Zhong

I agree. It is a costly mistake to confuse obfuscation as a form of encryption. In addition, if you have an IP that you want to protect, then it should not be in the frontend code, even in the obfuscated form.