473,672 Members | 2,871 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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.
Jul 20 '05 #1
8 3943
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" <wa********@hot mail.com.NOSPAM > wrote in message
news:vdvVa.4015 $Ye.3093@fed1re ad02...
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.

Jul 20 '05 #2
I will be using a webpage encrypter on the html. That should protect it
sufficiently no?

"Stuart Palmer" <tr**********@y oucant.com> wrote in message
news:bg******** **@sp15at20.hur sley.ibm.com...
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" <wa********@hot mail.com.NOSPAM > wrote in message
news:vdvVa.4015 $Ye.3093@fed1re ad02...
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.


Jul 20 '05 #3
"Wayne Davis" <wa********@hot mail.com.NOSPAM > writes:

Please don't top post.
I will be using a webpage encrypter on the html. That should protect it
sufficiently no?


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 - lr*@hotpop.com
Art D'HTML: <URL:http://www.infimum.dk/HTML/randomArtSplit. html>
'Faith without judgement merely degrades the spirit divine.'
Jul 20 '05 #4
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" <lr*@hotpop.com > wrote in message
news:k7******** **@hotpop.com.. .
"Wayne Davis" <wa********@hot mail.com.NOSPAM > writes:

Please don't top post.
I will be using a webpage encrypter on the html. That should protect it
sufficiently no?


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 - lr*@hotpop.com
Art D'HTML: <URL:http://www.infimum.dk/HTML/randomArtSplit. html>
'Faith without judgement merely degrades the spirit divine.'

Jul 20 '05 #5
In message <A4HVa.4115$Ye. 102@fed1read02> , Wayne Davis <waydavis58@hot ma
il.com.NOSPAM> writes
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))
Change this line to:

alert(unescape( pe))

and you see it.
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


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

--
Toodles, LuSiVe

Jul 20 '05 #6
"Wayne Davis" <wa********@hot mail.com.NOSPAM > writes:
What is "top post"?
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.
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.


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 - lr*@hotpop.com
Art D'HTML: <URL:http://www.infimum.dk/HTML/randomArtSplit. html>
'Faith without judgement merely degrades the spirit divine.'
Jul 20 '05 #7
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?
Jul 20 '05 #8
JRS: In article <A4HVa.4115$Ye. 102@fed1read02> , seen in
news:comp.lang. javascript, Wayne Davis <wa********@hot mail.com.NOSPAM >
posted at Tue, 29 Jul 2003 20:38:10 :-
What is "top post"?
Putting responses before quoted material, generally untrimmed. Read the
FAQ. Eschew the practice, as experienced posters to.

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.


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.
Jul 20 '05 #9

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

11
3702
by: John Victor | last post by:
In my mysql database, I've stored all the passwords using the PASSWORD() function. Now I'm running a test and need to compare the password in my php document to that saved in the database. I used the string "Select name From users Where password = PASSWORD('$testPass')" and ran mysql_query() using the string. But nothing was returned. So I decided to run a test and try to change a password from my php page using the string
1
1079
by: Newbie! | last post by:
Hi Group, I have VB.NET and wanted to build a simple User/Password Login for My App. I have a Database with 3 Field, PrimaryID, UserName & Password. I want to be able to have a ComboBox look at the UserField and then the User type in the Password, how would I do something like this? Does anybody know of any Example anywhere?
1
1213
by: Neal Middlemore | last post by:
Hi, I want to be able to add some simple security to one of my pages, basically my page allows users to submit a text field which gets parsed into MySQL db and displayed on other pages. At the moment anyone can submit text which opens the page to abuse. I don't want to implement a user login system. I had envisaged the addition of a password entry box which the Submit button checks against the db before proceeding, so if any user has the...
5
8147
by: Vincent van Beveren | last post by:
Hi everyone, I have a page with a login box. Because of lack of space, instead of labels I put the descriptive text in the input fields (so username input says 'username', and password input says 'password'). The password field however, once it does have the focus, it should mask its input. Now what I've done, and works in firefox, is onfocus="this.type='password'; this.value='';". (Its a bit more complex than that, but this is...
5
2260
by: samadams_2006 | last post by:
I'm having a problem in accessing a Microsoft Access Database in a VB.NET Web Application. It's so straight forward, I thought I'd walk you through all the details here: 1) I have a .NET Web Application called "Lesson18b" under "C:\Inetpub\wwwroot\Lesson18b". 2) I have one Web Form on this Lesson called "Form18b.aspx" 3) In this same Folder under Inetpub I have the Microsoft NorthWinds
2
2938
by: moi | last post by:
Hello, i have a Asp.net V2 login page with a password to enter. In some case, a user could forget and tell IE to save its password : How to prevent it ? Is there a way to disable it ? to block it ? Or could i create a button that save another text (replace) the cached password ? the user will be prompted to click the button to remove its cached password .... how to do it ?
5
1502
by: Hitesh Joshi | last post by:
Hi, Not sure if this is the right group to ask this question... I have never worked with asp or vb and I need some starting point clue on delima I am facing. I need to access an external website from within an access db. i.e. an user would click a command button it will open the website. This website is password protected. the webserver url is like http://server1/login.asp is there any simple way I can send username and password from...
1
2626
by: dan.cawthorne | last post by:
Hi all, Need Some Help With A Simple Password Form What a I Have Is Single Field Table, With One Record In It The Field is Called table is also called "Password" which ive created a form that represents this table, so the admin can change the password if needed at ease.
20
2372
by: cmbcorp | last post by:
Hi, I have been playing around with a simple php login script and im getting an error message when i attempt to log in with the username and password i set in the sql table. The error message is as follows: Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/greenpos/public_html/test4/checklogin.php on line 28 Wrong Username or Password The code: <?php $host="localhost"; // Host name
0
8508
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8428
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8854
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8652
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7484
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6264
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4253
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4448
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2104
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.