简体   繁体   中英

How to make html file encrypted?

I want to know, how to make my html file code to encrypted?
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. As this Yahoo blog entry says, "If you don't want people to see your programs, unplug your server." This applies equally to 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.

You may try disable the mouse right click. 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.

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. You then get a simple HTML page with a password prompt, see example .

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 .

A similar tool is clientside-html-password . There might be others as well, but the bottom line is that you can make an HTML file encrypted.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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