简体   繁体   English

如何加密html文件?

[英]How to make html file encrypted?

I want to know, how to make my html file code to encrypted? 我想知道,如何使我的html文件代码加密?
So that if normal user see the code, then they don't understand the code? 那么如果普通用户看到代码,那么他们不了解代码?

I don't remember how I did it, but I was just reading some of my own code recently and I couldn't even understand it. 我不记得我是怎么做到的,但我最近只是阅读了一些我自己的代码,我甚至无法理解它。 A normal user would not have a chance. 普通用户没有机会。 I don't thing encryption was involved however. 然而,我并不涉及加密。

You can't. 你不能。 If the user can't see it, the browser wouldn't be able to either! 如果用户看不到它,浏览器也无法看到它!

This is called obfuscation, but it's pointless. 这称为混淆,但它毫无意义。 People can still view your complete DOM tree in DOM Inspector or Firebug. 人们仍然可以在DOM Inspector或Firebug中查看完整的DOM树。 As this Yahoo blog entry says, "If you don't want people to see your programs, unplug your server." 正如这篇雅虎博客文章所说:“如果你不希望别人看到你的程序,请拔掉你的服务器。” This applies equally to HTML. 这同样适用于HTML。

这可能是好的: http//www.iwebtool.com/html_encrypter它是免费的和在线使您的代码成为unicode希望减少复制和编辑!

Don't bother. 不要打扰。 All encryption will do for you is slow down your site. 所有加密都会对您造成影响,这会降低您的网站速度。 It's not worth 'hiding' it. 它不值得“隐藏”它。 Any moron can just open up Firebug and see everything without even having to decrypt the source code anyways. 任何白痴都可以打开Firebug并查看所有内容,甚至无需解密源代码。

You may try disable the mouse right click. 您可以尝试禁用鼠标右键单击。 JS (jQuery): JS(jQuery):

$(document).bind('contextmenu',function(){return false;});

Again as shown in other posts this is actually meaningless because if someone want to view the source they can just press F12 to open the console and view all the codes. 再次如其他帖子所示,这实际上毫无意义,因为如果有人想要查看源,他们只需按F12即可打开控制台并查看所有代码。

Also, I don't think a normal user will want to see this kind of things. 此外,我认为普通用户不希望看到这种事情。 If they see that, they just think they're pressing the wrong button and close it. 如果他们看到了,他们只是认为他们按错了按钮并将其关闭。

You can use StatiCrypt to encrypt your HTML file using AES-256 encryption. 您可以使用StatiCrypt使用AES-256加密来加密HTML文件。 You then get a simple HTML page with a password prompt, see example . 然后,您将获得一个带有密码提示的简单HTML页面, 请参阅示例

Two cautionary notes from the project's repository: 项目存储库中的两条警示说明:

Disclaimer if you have extra sensitive banking data you should probably use something else! 免责声明如果您有额外敏感的银行数据,您应该使用别的东西!

... ...

AES-256 is state of the art but brute-force/dictionary attacks would be trivial to do at a really fast pace: use a long, unusual passphrase . AES-256是最先进的技术,但是蛮力/字典攻击在很快的速度下完成是非常简单的: 使用长而不寻常的密码短语

A similar tool is clientside-html-password . 类似的工具是clientside-html-password There might be others as well, but the bottom line is that you can make an HTML file encrypted. 可能还有其他人,但最重要的是你可以加密HTML文件。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM