How to hide source code of a website

Discussion in 'Web Design, HTML And CSS' started by JohnAadam, Oct 26, 2011.

  1. JohnAadam

    JohnAadam New Member

    Joined:
    Oct 19, 2011
    Messages:
    27
    Likes Received:
    1
    Trophy Points:
    0
    Can anyone please tell me how to hide source code of a website . I need it very desperately:crazy:
     
  2. shabbir

    shabbir Administrator Staff Member

    Joined:
    Jul 12, 2004
    Messages:
    15,375
    Likes Received:
    388
    Trophy Points:
    83
    You can encode the html and do it if you don't want developers to not see the code.
     
  3. pank001

    pank001 New Member

    Joined:
    Jul 3, 2010
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    0
    Occupation:
    Student
    Location:
    Dewas, India
    Home Page:
    http://innovate.tk
    And how to do that???
     
  4. Alex.Gabriel

    Alex.Gabriel New Member

    Joined:
    Oct 23, 2011
    Messages:
    86
    Likes Received:
    7
    Trophy Points:
    0
    Occupation:
    Linux system administrator
    Location:
    Italy
    Home Page:
    http://blog.evilcoder.net
    You can rename your files in .php if you are using .html then encode all the code but a person who wants to decode it and knows the method of encryption can decrypt your code. there is a php crypt algorithm that uses a key to decrypt and to encrypt. anyway you can use ioncube to encode your files. remember that .html source can always be seen from browser.
     
  5. pank001

    pank001 New Member

    Joined:
    Jul 3, 2010
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    0
    Occupation:
    Student
    Location:
    Dewas, India
    Home Page:
    http://innovate.tk
    But as the php's code output is in the form of html and if the output is encrypted then how browser will render that output page of php?
     
  6. Alex.Gabriel

    Alex.Gabriel New Member

    Joined:
    Oct 23, 2011
    Messages:
    86
    Likes Received:
    7
    Trophy Points:
    0
    Occupation:
    Linux system administrator
    Location:
    Italy
    Home Page:
    http://blog.evilcoder.net
    Well , when you encode any file you must make it logic. for example an encoded html text for example :
    Code:
    <html>
    will be encoded as
    Code:
    &lt;HTML&gt;
    so with a html decoder you get back the original value.
    I have seen that some peoples are encoding entire pages with base64 but this method is easy to recognize and to decrypt using php's base64_decode function. Anyway , this function is php-made and is recognized by browsers. I have used that algorithm to to encode direct links to media files on my website and make sure nobody can get them. I haven't tryed to encode an entire page but i think will work with some encoding.
    I should ask this before : do you want to hide source code in browser or in file?
     
    shabbir likes this.
  7. CarlyFiorina

    CarlyFiorina Banned

    Joined:
    Jun 16, 2011
    Messages:
    31
    Likes Received:
    0
    Trophy Points:
    0
    Hello,

    protect your source code!

    follow these easy 5 steps:
    Step 1:

    let's assume your main page is named index.htm. Rename index.htm to encrypt.htm.

    Step 2:

    open encrypt.htm source code and add the code below to the file, right after the opening BODY tag.

    CODE
    Code:
    <script language=JavaScript>m='%3Cscript%20language%3DJavaScript%3E%3C%21--%0D%0A%0D%0Avar%20message%3D%22Function%20Disabled%21%22%3B%0D%0A%0D%0Afunction%20clickIE%28%29%20%20%7Bif%20%28document.all%29%20%7Balert%28message%29%3Breturn%20false%3B%7D%7D%0D%0Afunction%20clickNS%28e%29%20%7Bif%20%0D%0A%28document.layers%7C%7C%28document.getElementById%26%26%21document.all%29%29%20%7B%0D%0Aif%20%28e.which%3D%3D2%7C%7Ce.which%3D%3D3%29%20%7Balert%28message%29%3Breturn%20false%3B%7D%7D%7D%0D%0Aif%20%28document.layers%29%20%0D%0A%7Bdocument.captureEvents%28Event.MOUSEDOWN%29%3Bdocument.onmousedown%3DclickNS%3B%7D%0D%0Aelse%7Bdocument.onmouseup%3DclickNS%3Bdocument.oncontextmenu%3DclickIE%3B%7D%0D%0A%0D%0Adocument.oncontextmenu%3Dnew%20Function%28%22return%20false%22%29%0D%0A%0D%0A//%20--%3E%3C/script%3E';d=unescape(m);document.write(d);</script>

    Step 3:

    create a text file and name it index.htm (or whatever your main file was named originally). the contents of the new index.htm file is given below - the code below is all that will be contained in index.htm.

    CODE
    Code:
    <script language=JavaScript>m='%3C%21--%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%0D%0A%23%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%23%0D%0A%23%20%20%20%20%20%20%20%23%0D%0A%23%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%23%0D%0A%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%0D%0A%23%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%23%0D%0A%23%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%23%0D%0A%23%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%23%0D%0A%23%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%23%0D%0A%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%23%0D%0A%23%0D%0A%23%%3E';d=unescape(m);document.write(d);</script>
    Step 4:

    create a text file and name it encrypt.js. the contents of the new encrypt.js file is given below -this is all that will be contained in encrypt.js.

    CODE
    document.write('<title>||||| SOURCE CODE ENCRYPTION |||||</title>');
    document.write('<frameset rows="100%,*" framespacing="0" border="0">');
    document.write('<frame frameborder="0" name="topFrame" src="encrypt.htm" noresize="noresize" />');
    document.write('</frameset>');


    Step 5:

    copy all the files to your server (index.htm, encrypt.htm, and encrypt.js). all the files must be located in the same directory. then open the index.htm file. try to view the source code, then try to right click on the page.

    Best regards
    Carly Fiorina
     
    Last edited by a moderator: Nov 9, 2011
  8. JohnAadam

    JohnAadam New Member

    Joined:
    Oct 19, 2011
    Messages:
    27
    Likes Received:
    1
    Trophy Points:
    0
    Hey Alex, CarlyFiorina . Thanks for the suggestion. I just tried what CarlyFiorina said and its was working :happy: .
     
  9. CarlyFiorina

    CarlyFiorina Banned

    Joined:
    Jun 16, 2011
    Messages:
    31
    Likes Received:
    0
    Trophy Points:
    0
    Hello,

    Many many thanks for sharing your information, I am highly appreciated!!

    Any problem please suggest:)
    Carly Fiorina
     
    Last edited: Nov 16, 2011
  10. Brunolin4

    Brunolin4 New Member

    Joined:
    Dec 31, 2011
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    0
    Where can i change the page code? I.e index.html.

    And where can i put the encryt code in my control panel?
     
  11. kylexy

    kylexy New Member

    Joined:
    Feb 21, 2012
    Messages:
    11
    Likes Received:
    1
    Trophy Points:
    0
    Hey Carly Fiorina ... mind if you explain that technique a little bit, i tried to make that work, but it shows only a blank page in my browser... please i'm also in desperate need to hide the source code
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice