How To Stop People From Pirating Your Source Codes - How to encrypt your webpage source sode

Pages: 1, 2, 3, 4, 5
free web hosting

Latest Entry: (Post #40) by [John] on Feb 19 2008, 09:59 PM. (Line Breaks Removed)
O_o javascript, clever.I have done this with base64 as well, i think the link is dead though by the way
Express your Opinion! Contribute Knowledge.

Free Web Hosting, No Ads > CONTRIBUTE > Tutorials

How To Stop People From Pirating Your Source Codes - How to encrypt your webpage source sode

e-buttler

ph34r.gif -Encryption- ph34r.gif


If your like me, you probably hate those Javascripts witch open a "Right Click Disabled" prompt. An easier way to confuse pirates from stealing your hard worked scripts or codes you can easily encrypt your html.

In this tut i will show you how to both create an html encrypting script and will show you the diffrent methods of encryption.

1. The HEX DECIMAL Encryptor. (Effectiveness 9/10)

This encryptor will turn html code like this

CODE

<html>
<body>
<p> test1 </p>
</body>
</html>


into

CODE

%3C%68%74%6D%6C%3E%0A%3C%62%6F%64%79%3E%0A%3C%70%3E%20%74%65%73%74%31%20%3C%2F%70%3E%0A%3C%2F%62%6F%64%79%3E%0A%3C%2F%68%74%6D%6C%3E


For a already made version, click here
This method is my personal favorite.

First, put this in your scripts body
CODE

<script language=Javascript>
<!--
function encode(){
if(document.forms[0].asciitext.value == ''){
 alert('Please enter some code to encrypt.');
 void(0);
}
else {
 var text= document.forms[0].asciitext.value;
 enctext= transform(text);
 document.forms[0].asciitext.value= '';
 document.forms[0].asciitext.value= (enctext);
}
}

function transform(s){
var hex=''
var i
for (i=0; i<s.length; i++)
{
 hex += '%'+hexfromdec( s.charCodeAt(i) )
}
return hex
}

function generate(){
if(document.forms[0].asciitext.value == ''){
 alert('Please encrypt something!');
 void(0);
}
else {
 var text= document.forms[0].asciitext.value;
 document.forms[0].asciitext.value="\<script\>\n//<!--\ndocument.write(unescape(\""+text+"\"));\n//-->\n\</script\>";
 }
}
function hexfromdec(num) {
if (num > 65535) { return ("err!") }
first = Math.round(num/4096 - .5);
temp1 = num - first * 4096;
second = Math.round(temp1/256 -.5);
temp2 = temp1 - second * 256;
third = Math.round(temp2/16 - .5);
fourth = temp2 - third * 16;
return (""+getletter(third)+getletter(fourth));
}

function getletter(num) {
if (num < 10) {
 return num;
}
else {
if (num == 10) { return "A" }
if (num == 11) { return "B" }
if (num == 12) { return "C" }
if (num == 13) { return "D" }
if (num == 14) { return "E" }
if (num == 15) { return "F" }
}
}
function decode(){
if (document.forms[0].asciitext.value=="") {alert('No code to decrypt!');}
else {document.forms[0].asciitext.value=unescape(document.forms[0].asciitext.value);document.forms[0].asciitext.value="Click Encrypt to encrypt the code.";}
}
function preview(){
if (document.forms[0].asciitext.value=="") {alert('Nothing to preview!');}
else {pr=open("","_blank","top=0,left=0");
pr.document.write(document.forms[0].asciitext.value);
pr.document.title='Preview';
}
}
//--></SCRIPT>


this is what makes the entire thin "tick".

Now insert this to make the text fields, buttons and phisical appearence

CODE

<FORM name=code action="" method=post>
<TABLE cellSpacing=0 cellPadding=0 bgColor=#000000 border=3 align="center">
<TBODY>
<TR>
       <TD bgColor=#6699CC> <font color="#FFFFFF">HTML Encrypter 1: </font><BR>
<TEXTAREA name=asciitext rows=10 wrap=virtual cols=69>Type the code to be encrypted here.</textarea>
</TD></TR>
<TR>
       <TD bgColor=#6699CC>
         <P>

<INPUT class=button onclick=encode() type=button value="Encrypt" name=Button2>
         </P></TD></TR></TBODY></TABLE>
</FORM>
</td>
</tr>
</table>


2. The FIGURE HEX DECIMAL Method (Effectiveness 4/10)

This Encryption will turn a code like this

CODE

<html>
<body>
<p> test1 </p>
</body>
</html>


into

CODE

<script>
<!--
document.write(unescape("%3Chtml%3E%0A%3Cbody%3E%0A%3Cp%3E%20test1%20%3C/p%3E%0A%3C/body%3E%0A%3C/html%3E"));
//-->
</script>


The problem with this is that you can make out certain words out

Ex.


<script>
<!--
document.write(unescape("%3Chtml%3E%0A%3Cbody%3E%0A%3Cp%3E%20test1%20%3C/p%3E%0A%3C/body%3E%0A%3C/html%3E"));
//-->
</script>



This by far is my least favorite method.

For a already made version, click here

If you wish to make the aplication yourself, here's the code.

CODE

<script language=JavaScript>
var i=0;
var ie=(document.all)?1:0;
var ns=(document.layers)?1:0;

function initStyleElements() /* Styles for Buttons Init */
{
var c = document.pad;
if (ie)
{
//c.text.style.backgroundColor="#DDDDDD";
c.compileIt.style.backgroundColor="#C0C0A8";
c.compileIt.style.cursor="hand";
c.select.style.backgroundColor="#C0C0A8";
c.select.style.cursor="hand";
c.view.style.backgroundColor="#C0C0A8";
c.view.style.cursor="hand";
c.retur.style.backgroundColor="#C0C0A8";
c.retur.style.cursor="hand";
c.clear.style.backgroundColor="#C0C0A8";
c.clear.style.cursor="hand";
}
else return;
}

/* Buttons Enlightment of "Compilation" panel */
function LightOn(what)
{
if (ie) what.style.backgroundColor = '#E0E0D0';
else return;
}
function FocusOn(what)
{
if (ie) what.style.backgroundColor = '#EBEBEB';
else return;
}
function LightOut(what)
{
if (ie) what.style.backgroundColor = '#C0C0A8';
else return;
}
function FocusOff(what)
{
if (ie) what.style.backgroundColor = '#DDDDDD';
else return;
}
/* Buttons Enlightment of "Compilation" panel */

function generate() /* Generation of "Compilation" */
{
code = document.pad.text.value;
if (code)
{
document.pad.text.value='Compiling...Please wait!';
setTimeout("compile()",1000);
}
else alert('First enter something to compile and then press CompileIt')
}
function compile() /* The "Compilation" */
{
document.pad.text.value='';
compilation=escape(code);
document.pad.text.value="<script>\n<!--\ndocument.write(unescape(\""+compilation+"\"));\n//-->\n<\/script>";
i++;
if (i=1) alert("Page compiled 1 time!");
else alert("Page compiled "+i+" times!");
}
function selectCode() /* Selecting "Compilation" for Copying */
{
if(document.pad.text.value.length>0)
{
document.pad.text.focus();
document.pad.text.select();
}
else alert('Nothing for be selected!')
}
function preview() /* Preview for the "Compilation" */
{
if(document.pad.text.value.length>0)
{
pr=window.open("","Preview","scrollbars=1,menubar=1,status=1,width=700,height=320,left=50,top=110");
pr.document.write(document.pad.text.value);
}
else alert('Nothing for be previewed!')
}
function uncompile() /* Decompiling a "Compilation" */
{
if (document.pad.text.value.length>0)
{
source=unescape(document.pad.text.value);
document.pad.text.value=""+source+"";
}
else alert('You need compiled code to uncompile it!')
}
// -->
</script>


This Gives it the fuctions

now insert this code to help both compilation and phisical appearence


CODE

<body bgcolor=white topmargin=0 leftmargin=0 marginheight=0 marginwidth=0 onload=initStyleElements()>
<table border=0 width=100% cellspacing=0 cellpadding=0>
<tr>
<td width=100% height="23"></td>
</tr>
<tr>
<td width=100% height=23></td>
</tr>
<tr>
<td width=100%>

<!-- Compilation Panel -->
<form method=post name=pad align=center>
       <table width="62%" border="2" bordercolor="#6699FF">
         <tr>
           <td bgcolor="#6699FF"><font color="#FFFFFF">HTML Encryption 2</font></td>
         </tr>
         <tr>
           <td bgcolor="#6699FF">
<textarea rows=11 name=text cols=58 style="background-color:#EBEBEB;width:95%"></textarea>
           </td>
         </tr>
         <tr>
           <td bgcolor="#6699FF">
             <input type=button value=Encrypt name=compileIt onClick=generate() onMouseOver=LightOn(this) onMouseOut=LightOut(this)>
           </td>
         </tr>
       </table>
       <br>
     </form>
<!-- Compilation Panel -->

</td>
</tr>
</table>


Well That's all, I hope you enjoyed my tut and found it useful.!!!!

Feel free to post or e-mail me your questions or comments

biggrin.gif biggrin.gif biggrin.gif

 

 

 


Reply

snlildude87
Nice stuff dude. The downsides I can think to this are:

1. your HTML code will probably not validate correctly, and
2. can probably be easily bypassed by disabling JavaScript in Firefox.

Reply

guangdian
i think the html code can not been pirated easily like php (zend)
and if you do that with some script tools,then there would be the problem with your pages.

- so if your html is validated with html 4.01 or xhtml that you validat it again after you pirated it.what do you found , i think it can not been validated,can not pass it.
i think there is no need to protect the html code,
for you why is it?

Reply

tigen28
Sometimes, an author of an html codes may think that after a good amount of time spending and knitting codes together, they feel that the "used time" = "rewards" for themself and don't want other to enjoy the benefits without a sweat.

I know I sometimes feel like that.

Yeah, I admit it's kind of selfish, but hey, if you want something really bad, you will be willing to work for it.

Reply

Dooga
@snli: In Firefox, if you disable Javascript it won't work

Also, there are a lot of ways to crack these methods, such as reversing the code... (I mean, add a function to have the page view the plain text instead). http://www.weblockpro.com sold similar products but I managed to get a copy of their UNENCRYPTED site (wow that person was really good at programming), http://www.htmlprotector.com use it too!

Reply

Spectre
Although not a bad post, 'encrypting' your HTML is effectively pointless. Obviously, the browser is going to need to be able to process an unencrypted form of the page - so the client-side script needs to be able to decrypt the HTML. Which means that people wanting to 'steal' your markup are going to be able to anyway by looking at the 'decryption' method. Further more, it's more obfuscation than encryption.

If you've ever heard of the SHDocVw control, this processes all JavaScript and presents the HTML with all JavaScript modifications made.

CODE
<p><script>document.write('Hi');</script></p>
Would appear as:
<p>Hi</p>
When processed with the SHDocVw control.


Apart from that, why hide your markup? It's not like the source code of a program, and as far as I'm concerned, there is no reason to hide it. There are a lot of downsides, however - search engines won't be able to read your page, and some visitors won't be able to either (whether by intentionally disabling JavaScript for security purposes or running a browser that doesn't support the scripting language), just to mention a couple.

Anyway, good post.

 

 

 


Reply

Dooga
That's a good point. Encrypting or Obfusicating an HTML site is just inviting people to decrypt it. But I really like how it compresses your HTML.

Reply

unicornrose
If you have a spectacular design or you have a competitor that is trying to steel your business encrypting your code is good business practice. Trust me I know this because it happened to a company I worked for alot. They were trying to steal our business so they stole our code and made their websites look like ours. They were cheap immitations that just lead to crappier websites but still the fact was still there that they were stealing our code so we had to find a way to hide the code from them.

Reply

Spectre
Not really. Anyone with any programming experience could very easily 'decrypt' a page which has been 'encrypted' with JavaScript.

There isn't a way to ensure no one is going to be able to rip off the markup of your page. The client obviously has to receive an uncrypted form of it at some stage, so any encryption or form of obsfucation you use is only going to work to a certain exten, and can't be of great security.

Reply

rvalkass
Is it just me, or is a source code of a page that looks like this:
CODE

%12%34%56%78%90

quite obvious? Surely any vaguely determined person can work out what you've done and easily decrypt it?

I speak from experinece, I've tried both methods and neither are effective in stopping people nicking your source code.

Reply

Latest Entries

[John]
O_o javascript, clever.

I have done this with base64 as well, i think the link is dead though by the way tongue.gif

Reply

tricky77puzzle
QUOTE(tapan @ Feb 22 2006, 08:59 PM) *
I know a lot of encrpytors out there....
But, can someone post something about Decryptors???
I got tons of stuff, that I'd like to decrpyt...
Can anyone help?
Thanks
rolleyes.gif


I don't think decrypting stuff you're not supposed to is legal.

And with this code, someone could always use a script to try to re-encode the page. I'd say use PHP for this purpose. At least no one can see that other than you.

Reply

redpenguin90
thats a great code. Cause it only takes two buttons to see someone else's code. If only there was a way to make it hidden unless you have a password.

Reply

Forbez
Oooo, nice tutorial. Where'd you learn that from?
I must try this myself.

Reply

Reekun
I tried to insert the script> but do I do that after the <html> or before it??

and for the insert HTML code here is it with the <html> <body> <header> tags or what do I leave off?

-- nevermind, i've fixed my own problem

you have to copy+paste the javascript into a <body> tag

-- help again please

QUOTE
Now insert this to make the text fields, buttons and phisical appearence

CODE
<FORM name=code action="" method=post>
<TABLE cellSpacing=0 cellPadding=0 bgColor=#000000 border=3 align="center">
<TBODY>
<TR>
        <TD bgColor=#6699CC> <font color="#FFFFFF">HTML Encrypter 1: </font><BR>
<TEXTAREA name=asciitext rows=10 wrap=virtual cols=69>Type the code to be encrypted here.</textarea>
</TD></TR>
<TR>
        <TD bgColor=#6699CC>
          <P>

<INPUT class=button onclick=encode() type=button value="Encrypt" name=Button2>
          </P></TD></TR></TBODY></TABLE>
</FORM>
</td>
</tr>
</table>


could you teach me where to throw this into my HTML
like between what tags?
I've bookmarked this page, please help thanks laugh.gif

is this how its supposed to look i stuck it in the body tag



Reply



Got an Opinion! Express your Views! (no registration):-
Add your Reply/ Opinion/ Views/ Comments/ Suggestion/ Questions/ Queries etc.
Posts with decent grammar & English will be accepted and please refrain from profanities.
For asking a Question, We recommend you to sign-up (for free) so that you can track the topic easily.

Nature of your Post*: Opinion/ Reply/ Comments
Question/Query
Feedback to us.
       
Name   Email
Title/Question*

(Maximum characters: 10,000)
You have characters left.
Confirm Code:

Pages: 1, 2, 3, 4, 5
Similar Topics

Keywords : stop, people, pirating, source, codes, encrypt, webpage, source, sode

  1. How To Make Your Own Counter Strike Source Dedicated Server!
    (34)
  2. How To Make Your Signature Look Really Good!
    using various bb codes (15)
    I got a PM the other day asking how I did various things in my signature, well I'm going to show
    you all the secrets /biggrin.gif" style="vertical-align:middle" emoid=":D" border="0"
    alt="biggrin.gif" /> So first of all theres those bars that show what you use and things
    they're called signature bars you can get them by clicking below signaturebar.com is
    fantastic for signature bars, you can even request one of your choice. It is supported by ads and
    donations also by a few talented developers with an eye for detail go take a look! Next theres
    the sl....
  3. Javascript Scroll Bar
    A scroll bar for your webpage using javascript (13)
    In this tutorial I will show you how to create two buttons in the bottom left of the screen that,
    when hovered over, will scroll the page. Now to start with, we must create a our buttons, the first
    line will create a div element, or block. Using blocks you can position items anywhere on a page.
    We use the ID property just to let us know what the block is used for, as for the first block, its
    obvious that it contains the vertical buttons and the second two blocks contains the horizontal
    buttons. The style property of the div tag tells the browser how to draw it, in the....
  4. Handy Javascript Code Snips
    Ready to Apply in your webpage (5)
    /tongue.gif' border='0' style='vertical-align:middle' alt='tongue.gif' /> Some common things to
    implement in our webpage very frequently are as follows. How to implement all these I am going to
    tell you in this tutorial. Add To Favorite Set As Homepage Go To Top Of Page No Right Click
    Print Page Adding Current Date Adding Current Time Pop-Up Page Creation Closing Window
    Copyright Notice Updation 01. Add To Favorite Someone may be interested in the content of your
    page. Offer him/her to add the page in his/her favorite menu. To do this you have ....
  5. ---> Ftp Error Codes What They Mean <---
    (3)
    CODE FTP Error Messages some nice info about ftp error codes so you know what they mean. i am
    sure you see them all the time and sometimes you dont know what they mean, so take a look here. The
    most common codes: 421 - often means: too many users logged to the same account. 530 -
    wrong login:pass, some servers auto-switch to 530 from 421 when they reach the max # of users.
    so notice the error message attached to the code. 550 - common in Ratio site, If the file exsist it
    means you have no access to the file or dir. if you try changing dirs in an FTP ....
  6. How To Make A Simple Webpage From Straight Out Htm
    (10)
    This tutorial will show you how to make a webpage using html. It will be a very simple webpage but
    good for practice. Get free hosting somewhere( anglefire, geocities) and go edit index.html.
    Delete everything that is already there. You will start of by doing this CODE <html>
    <title> What you want to apper at the top of the browser GOES HERE </title>
    <body> <h2> YOUR HEADER GOES HERE </h2> <p>Info about your site can
    go right here. Mabye start a welcome thing telling about your site and other stuff. Mak....

    1. Looking for stop, people, pirating, source, codes, encrypt, webpage, source, sode

Searching Video's for stop, people, pirating, source, codes, encrypt, webpage, source, sode
advertisement



How To Stop People From Pirating Your Source Codes - How to encrypt your webpage source sode



 

 

 

 

ADD REPLY / Got an Opinion! a humble request :-) RAPID SEARCH! Free Hosting [X]
Express your Opinions, Thoughts or Contribute more info. to help others.
Ask your Doubts & Queries to get answers, So that "Together We can help others!"
Register FREE for AD-FREE forum, Create your own topics, Ask Questions, track topics, setup subscriptions & notifications and Get a Free Website w/ Email and FTP.
500MB Space *No Ads*, CPanel, FTP, PHP, MySQL, EMails - 100% FREE