Html password protection,hide source,encrypt html code - the basics [Home]

Image Protection - how to use Image Guardian

FAQ - protect html , scripts, PHP, ASP

FAQ - protect images

General settings

Profiles and advanced settings

Encrypt ASP files

Ultra - Strong HTML password protection

Encrypt PHP files

Protect css files [Style Sheets]

File List Manager and Command line reference

Site Manager

Known issues & Troubleshooting

HTML protection - troubleshooting

Quick Troubleshooter:

If you have problems with

html protect

ion, see if they match some of the problems described below. If yes, apply the suggested solution to fix the problem.

     - In 99 % of the cases, the reason for the problem is the incorrect html syntax of the file to be protected. Read about syntax requirements here. The best way to find html protection syntax problems is to use some html code validation tool. It will quickly find most errors, like unclosed and overlapping tags, useless tags, missing tags etc.
HTML Guardian will inform you if it detects an incorrect html syntax in the files to be encrypted, but it can not detect the incorrect syntax in all cases.

      - Change the Code Compression level and re-protect the file. You can do this from the General Settings window, or with CTRL+ALT+H (High compression) and CTRL+ALT+L (Low compression) shortcuts.

      - Press F10 to load a blank html protect profile and encrypt the file again.

      - If you have problems with files encrypted for All browsers, change the All browsers encryption type and re-encrypt the file. You can change the All browsers encryption type permanently from the General Settings window, or use ALT+1, ALT+2 or ALT+3 shortcuts to apply encryption Type I, II or III respectively. If the "Automatically select encryption type" box is checked, you'll have to uncheck it first.

      - If you have problems with files encrypted for IE 5+ and the Extensive Debugging option is turned Off, press F8 to turn it On and encrypt the file again(press F4 at any time to see the current status of the most important settings). You can also change this from the Advanced Settings window.

      - If you see a blank browser window when testing the encrypted file on your PC, the reason is most likely you encrypted it with "Don't allow offline use" and / or "Add referrer check" options - files encrypted with any of those options will not work offline. They will only work when uploaded to a web server.

      - For non - English websites, make sure you have the appropriate META tag that defines the character set to be used. It usually looks like
<meta http-equiv="Content-Type" content="text/html; charset=xxxxx">
where xxxxx defines the character set (encoding) needed.
Make sure such META tag is included in the HEAD section of your pages, preferably immediately after the <HEAD> tag.


      View the HTML protect Error Log. The most common problems HTML Guardian detects ( not all ) will be listed there. To view the error log click Tools --> View Error Log or press Ctrl + E - if nothing happens, Error Log is empty.
Each Error Log entry has the following structure:

Date & Time : Error status : File : Description

- Error status could be Problem or ERROR, depending on the severity of the error detected. Even if the status is ERROR, in many cases the file will work. However you should test all the files listed in the error log to see if the encrypted version of the file works as expected.
- File - the file where a problem was detected. Here you can see either the location of the original, unencrypted file, or the location of the encrypted file - check the encrypted file and fix the original if needed.
- Description - a short description of the problem detected.

html protect-password encryption
Known issues:

Problems with folder encryption:

If you experience problems when you encrypt a folder ( with the 'Select Folder' button ), check the names of all files and folders inside the selected folder. If there are folder or file names which contain non-English characters or some characters that are unusual for folder/file names like = & . , ( ) [ ] { } , rename them.
In general, we recommend that you use only English letters (upper and lower - case letters are acceptable), numbers, and underscores for folder and file names.

Problems with files which contain code that automatically redirects the browser:

There could be problems with html files which contain scripts that automatically redirect the browser to another location. For example, let's say you have a file test.htm that contains this script:
<script>document.location="new_test.htm"</script>
In this case the browser will be automatically redirected to new_test.htm, without fully loading or displaying test.htm
Another example - forcing files to load in frames, like:
<script language='javascript' >
if (parent.location.href == self.location.href){
self.location.href = 'Frameset.htm'
}
</script>

Actually this situation is the same as the above - the browser is automatically redirected to Frameset.htm.
It is not a problem at all to display the files in frames or to redirect the browser after the page was loaded(like when a button is clicked etc.). A problem may appear only if the browser is automatically redirected before the file was fully loaded.
Solution: In most cases HTML Guardian will handle such situations. But if you have problems with files that automatically redirect the browser, you should remove the redirection code, encrypt the file and then insert the redirection code back into the encrypted file (just after the <HEAD> tag).

Encrypted file does not work online:

Problem: Some encrypted files work fine offline but show errors when viewed online.
Solution: If the encrypted file works OK when you test it on your PC but it does not work when you try to open it from your web site, the reason could be this file was not fully uploaded.
Compare the file you have on your PC with the uploaded file you have on your server - there could be a difference(if all is OK, the size of both files [in bytes] should be the same, if not it will be different).
Some badly written ftp programs do not fully upload some files - for example some versions of Cute FTP(Pro). If you see that the file size of the uploaded file(on your server) is different from the file size of the locally stored file, try to upload the file again with another ftp program.

ASP files encryption:

Please read the "Protecting ASP files" section of the Help file for a detailed information about asp encryption.

Encryption of files which contain html / script code examples :

Problem: There may be errors in encrypted files which contain sample html and/or script code.
Solution: The best way to avoid such errors is to replace the html tag delimiters < and > with the corresponding html entities.
When creating pages with html/script code examples, always replace the html tag delimiters from the sample code with the corresponding html entities - do not use < or > - replace them with &lt; or &gt; in your source code.
In most cases HTML Guardian's Code Analyzer ™ engine will solve these problems even if you do not replace the tag delimiters in the sample code.
If however the pages are not displayed properly and you don't want to alter them, just increase the Code Analyzer's Heuristics Sensitivity Level from the advanced configuration settings window.
Heuristics Sensitivity Level should be set to 80 - 90 when you html protect files which contain html/script code examples.

Web counters:

Problem: Some web counters may become invisible after the page is encrypted.
Solution: There could be several reasons for that. One solution that will always solve this problem is to exclude the counter code from encryption (using the partial encryption option).
Calling javascript functions from external .js files:

Problem: If you call a javascript function stored in a .js file from an encrypted html file, the function may not be executed.
Solution: A javascript function stored in a .js file may not work if called from encrypted html file, in case the function is called before the onLoad event fires for the encrypted html file that calls the function.
For example, let's see a simple html file named test.html that calls a simple .js file named myScript.js.
test.html file looks like:


<html>
<head>
<script language = 'javascript' src = 'myScript.js'>
//here we include the external .js file
</script>
<script language = 'javascript'>
myAlert = 'Hi there';
//here we call a function from the .js file
showalert(myAlert);
</script>
</head>
<body>
A simple test page
</body>
</html>


And myScript.js file looks like this:

function showalert(alert_to_show){
alert(alert_to_show);
};


In this simple example, the red line of code calls the showalert function before the test.html file is fully loaded. As a result, if you encrypt test.html (no matter if myScript.js is encrypted or not), no alert will be displayed. Instead, a javascript error may be reported by the browser.

There are several ways to fix this:

1. If the function is called after the onLoad event fires for test.html, like when a button is clicked, this problem will not appear.

In this case, test.html may will look like

<html>
<head>
<script language = 'javascript' src = 'myScript.js'>
//here we include the external .js file
</script>
<script language = 'javascript'>
myAlert = 'Hi there';
</script>
</head>
<body>
A simple test page
<form>
<input type="button" name="Button" value="ShowAlert" onClick=showalert(myAlert)>
</form>
</body>
</html>

2. You may include the .js file code in the .html file and not use an external .js file

In this case test.html with the .js file included in it will look like this:

<html>
<head>
<script language = 'javascript'>
function showalert(alert_to_show){
alert(alert_to_show);
};
</script>
<script language = 'javascript'>
myAlert = 'Hi there';
//here we call the function
showalert(myAlert);
</script>
</head>
<body>
A simple test page
</body>
</html>


3. You may use the partial encryption option(recommended).
Solution 1 may not be applicable in some cases. Solution 2 will work always, but if the .js file is big and is used from many .html files, it is not suitable.
You may also use HTML Guardian's powerful partial encryption capabilities and exclude the script tag that refers to the external .js file from encryption. In this case, the test.html file will look like:

<html>
<head>
<!--htmlgskipstart -->
<script language = 'javascript' src = 'myScript.js'>
//here we include the external .js file
//but the script tag is excluded from encryption

</script>
<!--htmlgskipstop -->
<script language = 'javascript'>
myAlert = 'Hi there';
//here we call a function from the .js file
showalert(myAlert);
</script>
</head>
<body>
A simple test page
</body>
</html>

Following those basic html protect ion rules will ensure correct encryption and html password encryption in almost all cases.

Go back Next

   © 1997-2005, ProtWare Inc. All rights reserved.