如何加密JavaScript代码,使其不可解密? [英] How can I encrypt JavaScript code so that it's not decryptable?

查看:94
本文介绍了如何加密JavaScript代码,使其不可解密?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一些我需要加密的JavaScript代码,但我想确保没有人可以解密它。



我可以使用哪些工具来做? / p>

- 修改 -



我还想运行我的代码网站,我只想确保没有人可以解密代码。

解决方案

Javascript代码在浏览器中执行,即在客户端,这意味着它必须在客户端没有加密。



你可以做的最好的做法可能是将它缩小,使其更难理解 - 而且混淆也可能会 - 即使有人真正有动力仍然可以读取。



参见例如 YUI Compressor ,它可以缩小和模糊JS代码。


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.

解决方案

The Javascript code is executed in the browser, i.e. on the client side, which means it must be available not-encrypted on the client side.

The "best" you can do is probably to minify it, which will make it harder to understand it -- and a bit of obfuscation might do too -- even if someone really motivated will still be able to read it.

See for instance the YUI Compressor, which can both minify and obfuscate JS code.

这篇关于如何加密JavaScript代码,使其不可解密?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆