开发者

How to make html file encrypted?

开发者 https://www.devze.com 2022-12-30 19:53 出处:网络
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开发者_如何学C understand the code?I don\'t remember how I did it, but I was just read

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开发者_如何学C 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.


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.


This might be good: http://www.iwebtool.com/html_encrypter it's free and online makes your code into unicode hope less to copy and edit!


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.


I've written a tool to encrypt HTML files called PageCrypt. The tool asks for a password at the time of encryption, then spits out an encrypted HTML file. Then, when a user views the encrypted file, they need to input the set password to be able to unscramble and view it.

The tool is hosted here:

https://www.maxlaumeister.com/pagecrypt/

with source code available here:

https://github.com/MaxLaumeister/pagecrypt


Description of the project, from the project page:

PageCrypt - Password Protect HTML

This tool lets you securely password-protect an HTML file. Unlike other password-protection tools, this tool:

  1. Has no server-side components (this tool and its password-protected pages run entirely in javascript).

  2. Uses strong encryption, so the password-protection cannot be bypassed.

All you need to do is choose an HTML file and a password, and your page will be password-protected.


You can try DRM-X 4.0, it supports protect HTML JS CSS and Images. it also supports protect Dynamic Website. https://www.haihaisoft.com/HTML-Encryption.aspx https://www.haihaisoft.com/Dynamic-Website-DRM-Protection.aspx

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号