How do I make a simple Password field... More.

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Wayne Davis

    How do I make a simple Password field... More.

    I want to password protect the continued running of a section of javascript.

    What I need is for the user to see a login field, they type a code in, if it
    is good, the script continues, if bad, it stops dead.
    I would like to base the password on julian date so some example numerical
    calcs (so I can see how they are structured in Java) would be handy.

    Also, how do I time out a group of statements after a preset amount of time
    like 1 minute or so.

    I am not a Java programmer, but if examples are shown, I can usually figure
    out the specific details.

    THANKS in advance.


  • Stuart Palmer

    #2
    Re: How do I make a simple Password field... More.

    Problem with JS passsword rotection is that someone may be able to read and
    work out the password as they can grab your code even if it's calculated. I
    would suggest having the password verified serverside myself.

    Stu

    "Wayne Davis" <waydavis58@hot mail.com.NOSPAM > wrote in message
    news:vdvVa.4015 $Ye.3093@fed1re ad02...[color=blue]
    > I want to password protect the continued running of a section of[/color]
    javascript.[color=blue]
    >
    > What I need is for the user to see a login field, they type a code in, if[/color]
    it[color=blue]
    > is good, the script continues, if bad, it stops dead.
    > I would like to base the password on julian date so some example numerical
    > calcs (so I can see how they are structured in Java) would be handy.
    >
    > Also, how do I time out a group of statements after a preset amount of[/color]
    time[color=blue]
    > like 1 minute or so.
    >
    > I am not a Java programmer, but if examples are shown, I can usually[/color]
    figure[color=blue]
    > out the specific details.
    >
    > THANKS in advance.
    >
    >[/color]


    Comment

    • Wayne Davis

      #3
      Re: How do I make a simple Password field... More.

      I will be using a webpage encrypter on the html. That should protect it
      sufficiently no?



      "Stuart Palmer" <tryandspamme@y oucant.com> wrote in message
      news:bg5vuh$p74 $1@sp15at20.hur sley.ibm.com...[color=blue]
      > Problem with JS passsword rotection is that someone may be able to read[/color]
      and[color=blue]
      > work out the password as they can grab your code even if it's calculated.[/color]
      I[color=blue]
      > would suggest having the password verified serverside myself.
      >
      > Stu
      >
      > "Wayne Davis" <waydavis58@hot mail.com.NOSPAM > wrote in message
      > news:vdvVa.4015 $Ye.3093@fed1re ad02...[color=green]
      > > I want to password protect the continued running of a section of[/color]
      > javascript.[color=green]
      > >
      > > What I need is for the user to see a login field, they type a code in,[/color][/color]
      if[color=blue]
      > it[color=green]
      > > is good, the script continues, if bad, it stops dead.
      > > I would like to base the password on julian date so some example[/color][/color]
      numerical[color=blue][color=green]
      > > calcs (so I can see how they are structured in Java) would be handy.
      > >
      > > Also, how do I time out a group of statements after a preset amount of[/color]
      > time[color=green]
      > > like 1 minute or so.
      > >
      > > I am not a Java programmer, but if examples are shown, I can usually[/color]
      > figure[color=green]
      > > out the specific details.
      > >
      > > THANKS in advance.
      > >
      > >[/color]
      >
      >[/color]


      Comment

      • Lasse Reichstein Nielsen

        #4
        Re: How do I make a simple Password field... More.

        "Wayne Davis" <waydavis58@hot mail.com.NOSPAM > writes:

        Please don't top post.
        [color=blue]
        > I will be using a webpage encrypter on the html. That should protect it
        > sufficiently no?[/color]

        No. Any encryption where the client can decrypt the contents unaided
        (as it must to use the page) can also be made to show the decrypted
        page.

        I bet I can break the encrypter in at most 15 minutes, if I want to
        (and probably a lot faster).

        /L
        --
        Lasse Reichstein Nielsen - lrn@hotpop.com
        Art D'HTML: <URL:http://www.infimum.dk/HTML/randomArtSplit. html>
        'Faith without judgement merely degrades the spirit divine.'

        Comment

        • Wayne Davis

          #5
          Re: How do I make a simple Password field... More.

          What is "top post"?

          And when I say it is encrypted, I mean the WHOLE PAGE is an encrypted
          Javascript. You can read it, but I don't think it would help you. So I
          think giving me examples in plain Javascript would suffice.

          Below is a sample webpage that says: "Hello There" in the middle of the
          screen. This looks like it would thwart most attempts to "break" it. No?
          Take a crack at it. I'll post the ORIGINAL page as (I) wrote it later.
          --------------------------------------------------------
          <SCRIPT LANGUAGE="Javas cript"><!--

          //0019910288283-004994838-00292992-
          function process(pe)
          {
          document.write( unescape(pe))
          return ""
          }
          function start()
          {
          var pe=new Array()
          pe[0]=new
          Array("%3C%53%4 3%52%49%50%54%2 0%4C%41%4E%47%5 5%41%47%45%3D%2 2%4A%61%76%61%7 3
          %63%72%69%70%74 %22%3E%0A%64%6F %63%75%6D%65%6E %74%2E%6F%6E%63 %6F%6E%74%65%78 %
          74%6D%65%6E%75% 20%3D%20%64%69% 73%61%62%6C%65% 52%69%67%68%74% 43%6C%69%63%6B% 3
          B%0A%66%75%6E%6 3%74%69%6F%6E%2 0%64%69%73%61%6 2%6C%65%52%69%6 7%68%74%43%6C%6 9
          %63%6B%28%29%0A {%0A%20%72%65%7 4%75%72%6E%20%6 6%61%6C%73%65%3 B%0A}%0A%76%61% 7
          2%20%6D%65%73%7 3%61%67%65%3D%2 2%22%0A%66%75%6 E%63%74%69%6F%6 E%20%63%6C%69%6 3
          %6B%28%65%29%0A {%0A%69%66%20%2 8%6E%61%76%69%6 7%61%74%6F%72%2 E%61%70%70%4E%6 1
          %6D%65%20%3D%3D %20%22%4E%65%74 %73%63%61%70%65 %22%20%26%26%0A %28%65%2E%77%68 %
          69%63%68%20%3D% 3D%20%33%20||%2 0%65%2E%77%68%6 9%63%68%20%3D%3 D%20%32%29%29%0 A
          %72%65%74%75%72 %6E%20%66%61%6C %73%65%3B%69%66 %20%28%64%6F%63 %75%6D%65%6E%74 %
          2E%61%6C%6C%29% 0A{%0A%69%66%20 %28%65%76%65%6E %74%2E%62%75%74 %74%6F%6E%20%3D %
          3D%20%33%29%0A{ %0A%72%65%74%75 %72%6E%20%66%61 %6C%73%65%3B%0A }%0A%69%66%20%2 8
          %65%76%65%6E%74 %2E%62%75%74%74 %6F%6E%20%3D%3D %20%32%29%0A{%0 A%72%65%74%75%7 2
          %6E%20%66%61%6C %73%65%3B%0A}%0 A}%69%66%20%28% 64%6F%63%75%6D% 65%6E%74%2E%6C% 6
          1%79%65%72%73%2 9%0A{%0A%69%66% 20%28%65%2E%77% 68%69%63%68%20% 3D%3D%20%33%29% 0
          A{%0A%72%65%74% 75%72%6E%20%66% 61%6C%73%65%3B% 0A}%0A}%0A}%0A% 69%66%20%28%64% 6
          F%63%75%6D%65%6 E%74%2E%6C%61%7 9%65%72%73%29%0 A{%0A%64%6F%63% 75%6D%65%6E%74% 2
          E%63%61%70%74%7 5%72%65%45%76%6 5%6E%74%73%28%4 5%76%65%6E%74%2 E%4D%4F%55%53%4 5
          %44%4F%57%4E%29 %3B%0A%64%6F%63 %75%6D%65%6E%74 %2E%63%61%70%74 %75%72%65%45%76 %
          65%6E%74%73%28% 45%76%65%6E%74% 2E%4D%4F%55%53% 45%55%50%29%3B% 0A}%0A%64%6F%63 %
          75%6D%65%6E%74% 2E%6F%6E%6D%6F% 75%73%65%64%6F% 77%6E%3D%63%6C% 69%63%6B%0A%64% 6
          F%63%75%6D%65%6 E%74%2E%6F%6E%6 D%6F%75%73%65%7 5%70%3D%63%6C%6 9%63%6B%0A%3C%2 F
          %73%63%72%69%70 %74%3E%3C%73%74 %79%6C%65%20%4D %65%64%69%61%3D %22%50%72%69%6E %
          74%22%20%74%79% 70%65%3D%22%74% 65%78%74%2F%63% 73%73%22%3E%0A% 62%6F%64%79%20{ %
          64%69%73%70%6C% 61%79%3A%6E%6F% 6E%65}%0A%3C%2F %73%74%79%6C%65 %3E%0A%3C%21%44 %
          4F%43%54%59%50% 45%20%48%54%4D% 4C%20%50%55%42% 4C%49%43%20%22% 2D%2F%2F%57%33% 4
          3%2F%2F%44%54%4 4%20%48%54%4D%4 C%20%34%2E%30%3 1%20%54%72%61%6 E%73%69%74%69%6 F
          %6E%61%6C%2F%2F %45%4E%22%3E%0D %0A%3C%68%74%6D %6C%3E%0D%0A%3C %68%65%61%64%3E %
          0A%3C%4D%45%54% 41%20%48%54%54% 50%2D%45%51%55% 49%56%3D%22%50% 72%61%67%6D%61% 2
          2%20%43%4F%4E%5 4%45%4E%54%3D%2 2%6E%6F%2D%63%6 1%63%68%65%22%3 E%0A%3C%4D%45%5 4
          %41%20%48%54%54 %50%2D%45%51%55 %49%56%3D%22%69 %6D%61%67%65%74 %6F%6F%6C%62%61 %
          72%22%20%43%4F% 4E%54%45%4E%54% 3D%22%6E%6F%22% 3E%0A%3C%6D%65% 74%61%20%6E%61% 6
          D%65%3D%22%4D%5 3%53%6D%61%72%7 4%54%61%67%73%5 0%72%65%76%65%6 E%74%50%61%72%7 3
          %69%6E%67%22%20 %63%6F%6E%74%65 %6E%74%3D%22%54 %52%55%45%22%3E %0A%3C%4D%45%54 %
          41%20%48%54%54% 50%2D%45%51%55% 49%56%3D%22%45% 78%70%69%72%65% 73%22%20%43%4F% 4
          E%54%45%4E%54%3 D%22%2D%31%22%3 E%0A%0D%0A%3C%7 4%69%74%6C%65%3 E%55%6E%74%69%7 4
          %6C%65%64%20%44 %6F%63%75%6D%65 %6E%74%3C%2F%74 %69%74%6C%65%3E %0D%0A%3C%6D%65 %
          74%61%20%68%74% 74%70%2D%65%71% 75%69%76%3D%22% 43%6F%6E%74%65% 6E%74%2D%54%79% 7
          0%65%22%20%63%6 F%6E%74%65%6E%7 4%3D%22%74%65%7 8%74%2F%68%74%6 D%6C%3B%20%63%6 8
          %61%72%73%65%74 %3D%69%73%6F%2D %38%38%35%39%2D %31%22%3E%0D%0A %3C%2F%68%65%61 %
          64%3E%0D%0A%0D% 0A%3C%62%6F%64% 79%20%6F%6E%64% 72%61%67%73%74% 61%72%74%3D%22% 7
          2%65%74%75%72%6 E%20%66%61%6C%7 3%65%22%20%6F%6 E%73%65%6C%65%6 3%74%73%74%61%7 2
          %74%3D%22%72%65 %74%75%72%6E%20 %66%61%6C%73%65 %22%20%20%6F%6E %43%6F%6E%74%65 %
          78%74%4D%65%6E% 75%3D%22%72%65% 74%75%72%6E%20% 66%61%6C%73%65% 22%20%3E%0D%0A% 3
          C%64%69%76%20%6 1%6C%69%67%6E%3 D%22%63%65%6E%7 4%65%72%22%3E%3 C%66%6F%6E%74%2 0
          %63%6F%6C%6F%72 %3D%22%23%30%30 %30%30%46%46%22 %3E%3C%66%6F%6E %74%20%73%69%7A %
          65%3D%22%2B%34% 22%3E%48%65%6C% 6C%6F%20%54%68% 65%72%65%21%0D% 0A%20%20%3C%2F% 6
          6%6F%6E%74%3E%3 C%2F%66%6F%6E%7 4%3E%0D%0A%3C%2 F%64%69%76%3E%0 D%0A%3C%2F%62%6 F
          %64%79%3E%0D%0A %3C%2F%68%74%6D %6C%3E%0D%0A")
          process(pe);
          }
          start();
          var time
          function statusBlock(){
          window.status = ".."
          window.setTimeo ut ("statusBlock() ;", 100);}
          statusBlock();

          //-->
          </script>
          -------------------------------------------------------------



          "Lasse Reichstein Nielsen" <lrn@hotpop.com > wrote in message
          news:k7a094zy.f sf@hotpop.com.. .[color=blue]
          > "Wayne Davis" <waydavis58@hot mail.com.NOSPAM > writes:
          >
          > Please don't top post.
          >[color=green]
          > > I will be using a webpage encrypter on the html. That should protect it
          > > sufficiently no?[/color]
          >
          > No. Any encryption where the client can decrypt the contents unaided
          > (as it must to use the page) can also be made to show the decrypted
          > page.
          >
          > I bet I can break the encrypter in at most 15 minutes, if I want to
          > (and probably a lot faster).
          >
          > /L
          > --
          > Lasse Reichstein Nielsen - lrn@hotpop.com
          > Art D'HTML: <URL:http://www.infimum.dk/HTML/randomArtSplit. html>
          > 'Faith without judgement merely degrades the spirit divine.'[/color]


          Comment

          • LuSiVe

            #6
            Re: How do I make a simple Password field... More.

            In message <A4HVa.4115$Ye. 102@fed1read02> , Wayne Davis <waydavis58@hot ma
            il.com.NOSPAM> writes[color=blue]
            >What is "top post"?
            >
            >And when I say it is encrypted, I mean the WHOLE PAGE is an encrypted
            >Javascript. You can read it, but I don't think it would help you. So I
            >think giving me examples in plain Javascript would suffice.
            >
            >Below is a sample webpage that says: "Hello There" in the middle of the
            >screen. This looks like it would thwart most attempts to "break" it. No?
            >Take a crack at it. I'll post the ORIGINAL page as (I) wrote it later.
            >--------------------------------------------------------
            ><SCRIPT LANGUAGE="Javas cript"><!--
            >
            >//0019910288283-004994838-00292992-
            >function process(pe)
            >{
            >document.write (unescape(pe))[/color]

            Change this line to:

            alert(unescape( pe))

            and you see it.
            [color=blue]
            >return ""
            >}
            >function start()
            >{
            >var pe=new Array()
            >pe[0]=new
            >Array("%3C%53% 43%52%49%50%54% 20%4C%41%4E%47% 55%41%47%45%3D% 22%4A%61%76%61% 73
            >%63%72%69%70%7 4%22%3E%0A%64%6 F%63%75%6D%65%6 E%74%2E%6F%6E%6 3%6F%6E%74%65%7 8%
            >74%6D%65%6E%75 %20%3D%20%64%69 %73%61%62%6C%65 %52%69%67%68%74 %43%6C%69%63%6B %3
            >B%0A%66%75%6E% 63%74%69%6F%6E% 20%64%69%73%61% 62%6C%65%52%69% 67%68%74%43%6C% 69[/color]

            .... Rest of code snipped ....

            --
            Toodles, LuSiVe

            Comment

            • Lasse Reichstein Nielsen

              #7
              Re: How do I make a simple Password field... More.

              "Wayne Davis" <waydavis58@hot mail.com.NOSPAM > writes:
              [color=blue]
              > What is "top post"?[/color]

              It is to put your reply at the top and include the entire post you
              reply to below. The preferred way of responding is the "interleave d"
              method where you include selected parts of the previous message, enough
              to give a context to your reply, and then reply to each part.
              [color=blue]
              > And when I say it is encrypted, I mean the WHOLE PAGE is an encrypted
              > Javascript. You can read it, but I don't think it would help you. So I
              > think giving me examples in plain Javascript would suffice.
              >
              > Below is a sample webpage that says: "Hello There" in the middle of the
              > screen. This looks like it would thwart most attempts to "break" it. No?
              > Take a crack at it. I'll post the ORIGINAL page as (I) wrote it later.[/color]

              Starting 12.22 local time.
              End 12.27 local time.
              Result (as written after the encoded version):
              ---
              <SCRIPT LANGUAGE="Javas cript">
              document.oncont extmenu = disableRightCli ck;
              function disableRightCli ck()
              {
              return false;
              }
              var message=""
              function click(e)
              {
              if (navigator.appN ame == "Netscape" &&
              (e.which == 3 || e.which == 2))
              return false;if (document.all)
              {
              if (event.button == 3)
              {
              return false;
              }
              if (event.button == 2)
              {
              return false;
              }
              }if (document.layer s)
              {
              if (e.which == 3)
              {
              return false;
              }
              }
              }
              if (document.layer s)
              {
              document.captur eEvents(Event.M OUSEDOWN);
              document.captur eEvents(Event.M OUSEUP);
              }
              document.onmous edown=click
              document.onmous eup=click
              </script><style Media="Print" type="text/css">
              body {display:none}
              </style>
              <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
              <html>
              <head>
              <META HTTP-EQUIV="Pragma" CONTENT="no-cache">
              <META HTTP-EQUIV="imagetoo lbar" CONTENT="no">
              <meta name="MSSmartTa gsPreventParsin g" content="TRUE">
              <META HTTP-EQUIV="Expires" CONTENT="-1">
              <title>Untitl ed Document</title>
              <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
              </head>
              <body ondragstart="re turn false" onselectstart=" return false" onContextMenu=" return false" >
              <div align="center"> <font color="#0000FF" ><font size="+4">Hello There!
              </font></font>
              </div>
              </body>
              </html>
              ---

              I had to use some time collecting the wrapped lines (i.e., your posted
              version won't work if copied verbatim).

              The page doesn't validate. You are not allowed to have script elements
              before the <head> tag.

              The function that attempts to clobber the status line, as well as the
              attempt to stop the context menu, will fail in my browser anyway.

              Encrypting web pages cannot work, it's simply theoretically impossible
              to make a page that the browser can decrypt, but its user cannot.
              /L
              --
              Lasse Reichstein Nielsen - lrn@hotpop.com
              Art D'HTML: <URL:http://www.infimum.dk/HTML/randomArtSplit. html>
              'Faith without judgement merely degrades the spirit divine.'

              Comment

              • Wayne Davis

                #8
                Re: How do I make a simple Password field... More.

                Well, You have all proven the point. And of course you are 100% correct.
                Hmm.... So now, to do what I want would require some code on the server?
                Is this a simple thing to do yet/still?


                Comment

                • Dr John Stockton

                  #9
                  Re: How do I make a simple Password field... More.

                  JRS: In article <A4HVa.4115$Ye. 102@fed1read02> , seen in
                  news:comp.lang. javascript, Wayne Davis <waydavis58@hot mail.com.NOSPAM >
                  posted at Tue, 29 Jul 2003 20:38:10 :-
                  [color=blue]
                  >What is "top post"?[/color]

                  Putting responses before quoted material, generally untrimmed. Read the
                  FAQ. Eschew the practice, as experienced posters to.

                  [color=blue]
                  >And when I say it is encrypted, I mean the WHOLE PAGE is an encrypted
                  >Javascript. You can read it, but I don't think it would help you. So I
                  >think giving me examples in plain Javascript would suffice.
                  >
                  >Below is a sample webpage that says: "Hello There" in the middle of the
                  >screen. This looks like it would thwart most attempts to "break" it. No?
                  >Take a crack at it.[/color]

                  It is unfair to post a page that is not valid script; you have allowed
                  the newsreader to break lines. After correcting that, one can see the
                  code by doing alert(unescape( pe)) which, on looking at your
                  article, is a fairly obvious approach.

                  Executing S = <that string> ; F.Code.value = unescape(S)
                  in my js-quick.htm loads the textarea with the script.

                  W3's TIDY does not much like the decoded code, though.

                  --
                  © John Stockton, Surrey, UK. ?@merlyn.demon. co.uk Turnpike v4.00 IE 4 ©
                  <URL:http://jibbering.com/faq/> Jim Ley's FAQ for news:comp.lang. javascript
                  <URL:http://www.merlyn.demo n.co.uk/js-index.htm> JS maths, dates, sources.
                  <URL:http://www.merlyn.demo n.co.uk/> TP/BP/Delphi/JS/&c., FAQ topics, links.

                  Comment

                  Working...