Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New to the CF scene
    Join Date
    Jan 2007
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question HTML source code encryption problem

    ok i got a huge problem....

    heres a java code i got from dynamicdrive that encrypts your html code source:
    Code:
    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!");
    }
    after which you put your html code in this form with its button generate:
    Code:
    <textarea rows=5 name=text cols=300 style="background-color:#EBEBEB;width:95%"></textarea><br>
    <input type=button value=Compile name=compileIt onClick=generate()>
    my idea is to put a hidden html source inside the java code e.g:
    Code:
    <meta HTTP-EQUIV="REFRESH" content="0; url="+url+"">
    in which all you have to do is put a url in the form e.g:http://yahoo.com and the output will be a encrypted version of
    Code:
    <meta HTTP-EQUIV="REFRESH" content="0; url=http://yahoo.com">
    which wud look somethin like this:
    Code:
    <script>
    <!--
    document.write(unescape("%3Cmeta%20HTTP-EQUIV%3D%22REFRESH%22%20content%3D%220%3B%20url%3Dhttp%3A//yahoo.com%22%3E"));
    //-->
    </script>

    I tried adding an id on the form like [id="url"] and put var
    code = document.getElementById("url").value;
    document.getElementById("url").value="<meta HTTP-EQUIV='REFRESH' content='0; url="+ur+l"'>;"

    but still no good

    can anyone help me with this?.. it wud really be appriciated...
    Last edited by tribalost; 01-03-2007 at 02:09 PM.

  • #2
    Supreme Master coder! Philip M's Avatar
    Join Date
    Jun 2002
    Location
    London, England
    Posts
    18,308
    Thanks
    203
    Thanked 2,563 Times in 2,541 Posts
    a) Meta tags may only appear in the <HEAD> section of the page.

    b) 'Would' is so spelled, and the personal pronoun I is capitalised, by literate people.

    c) The whole idea of encyrpting your HTML (or Javascript) code is a huge waste of time as anyone with minimal knowledge can easily decrypt it. The 'encryption' simply consists of substituting the ASCII code for the characters. Anything within quotes is not 'encrypted' at all.

  • #3
    New to the CF scene
    Join Date
    Jan 2007
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts
    The meta tag was just an example

    The I and would thing... sorry im only 17, a typical teen that loves to chat and use shortcut msgs...
    Last edited by tribalost; 01-03-2007 at 04:07 PM.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •