473,382 Members | 1,407 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

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 3931
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********@hotmail.com.NOSPAM> wrote in message
news:vdvVa.4015$Ye.3093@fed1read02...
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**********@youcant.com> wrote in message
news:bg**********@sp15at20.hursley.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********@hotmail.com.NOSPAM> wrote in message
news:vdvVa.4015$Ye.3093@fed1read02...
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********@hotmail.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="Javascript"><!--

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

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

"Lasse Reichstein Nielsen" <lr*@hotpop.com> wrote in message
news:k7**********@hotpop.com...
"Wayne Davis" <wa********@hotmail.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@hotma
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="Javascript"><!--

//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%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%6 9%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********@hotmail.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 "interleaved"
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="Javascript">
document.oncontextmenu = disableRightClick;
function disableRightClick()
{
return false;
}
var message=""
function click(e)
{
if (navigator.appName == "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.layers)
{
if (e.which == 3)
{
return false;
}
}
}
if (document.layers)
{
document.captureEvents(Event.MOUSEDOWN);
document.captureEvents(Event.MOUSEUP);
}
document.onmousedown=click
document.onmouseup=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="imagetoolbar" CONTENT="no">
<meta name="MSSmartTagsPreventParsing" content="TRUE">
<META HTTP-EQUIV="Expires" CONTENT="-1">
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body ondragstart="return 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********@hotmail.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.demon.co.uk/js-index.htm> JS maths, dates, sources.
<URL:http://www.merlyn.demon.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
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...
1
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...
1
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...
5
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...
5
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...
2
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...
5
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...
1
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...
20
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...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

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.