Hello! I need to encrypt a script, however when I do this the url I'm using as the API for ajax does not work. And the most important thing would be to hide encrypt it.
Hello! I need to encrypt a script, however when I do this the url I'm using as the API for ajax does not work. And the most important thing would be to hide encrypt it.
This text was not made by me, but I found it useful to share with the staff.
Virtually every web developer has experienced this problem. Javascript is today one of the leading programming languages on the internet, and often we developers need to create more complex applications using the language. And after hours of study and dedication comes the need for PHP ... to hide our code so that nobody can copy it, since javascript allows you to copy directly through the browser. Here's a simple solution to completely obfuscate your code, making it virtually impossible to decrypt.
Well that Javascript could be like PHP ... .I already thought, and probably you web developer already thought too. Just knowing that all of our javascript work will be visible to anyone, we stop and think twice before using a client-side language. I recently had issues with a javascript application that I developed ... plagiarism. So I started researching on the subject and I came to a verdict ..
You can not hide the javascript 100% because it is processed directly in the browser ... However, you can dim it . So your code is almost impossible to understand.
Step 1: Compress your javascript
Visit link , enter your source code and click on compress. This will help your code to stay in a reduced size as this tool will strip whitespace, tabs and comments. I recommend that you keep a saved version of the original code:
Step2:CodeWaiting
Hereisthesolutiontothisproblem.The link site does something that many online tools do not do. It obfuscates your javascript code with the eval function, and leaves it totally incomprehensible to humans. There are even other obfuscating tools, but this one I found is the best of all, because it does not allow decryption ...
To use it, paste your code into the Input field, uncheck the Move Strings option and click "Obfuscate"
Afterthis,yourencryptedcodewillbegeneratedintheObfuscatedfield.
Step3:Usinga2ndencryption
Tomakeithardertoseeyourjavascriptcode,wecanuseasecondonlinetooltoencrypt/obfuscateourjavascriptcode.Justgoto link , paste your previously encrypted code, choose the form of encryption and click on "Code" . I recommend selecting the "High ASCII" encoding, leaving the "quick decoding" option checked and unchecking the "special characters"
Anyway...IrecommendtoalwayskeepabackupcopyoftheoriginalJScode,otherwiseyouwillnotbeabletounderstandyourcodeanymoreifyouchangesomethingfromit.Althoughcodeobfuscationmakesitverydifficultforsomesmartguytocopyhiscode,itisstillpossibletodecode.However,thepersonhastohavealotofpatience,hoursandhoursavailableandthefundamentalone,hastobemuch,muchmoremuuuuiiitogoodinprogrammingandreverseengineering.Thatis,99.9%ofusersandprogrammerswillgiveupwhentheyseetheencryptedcode.
Font: Blog Lucas Peperaio