Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I encrypt JavaScript code so that it's not decryptable?

I have some JavaScript code I need to encrypt, but I want to be sure no one can decrypt it.

What tools can I use to do this?

-- Edit --

I still want to run the code on my site, I just want to make sure no one else can decrypt the code.

like image 585
James Skidmore Avatar asked Jan 13 '10 23:01

James Skidmore


2 Answers

If you truly want to encrypt it so that no one else can decrypt it, you could use one of any number of encryptions. For instance, to do it manually, you could use TrueCrypt; or to do it programatically, use the encryption libraries available in most languages.

If what you are really asking, though, is how to obfuscate the code so that no one can reverse-engineer it, the answer is: you can't, not in Javascript or any other language. The best you can do is make it more difficult on the reverse-engineers by making it hard to read; for that, there are any number of tools:

  • javascriptobfuscator.com
  • javascript obfuscator
  • ObfuscateJS
like image 153
BlueRaja - Danny Pflughoeft Avatar answered Oct 07 '22 23:10

BlueRaja - Danny Pflughoeft


use this tool: Javascript Obfuscator https://javascriptobfuscator.com/Javascript-Obfuscator.aspx

like image 21
Do Nhu Vy Avatar answered Oct 08 '22 00:10

Do Nhu Vy