Home / Free JavaScripts / Password Protecting / Here

Cut & Paste Password 98'

Credit: Vickor

Description: A innovative JavaScript password script that protects a page. Near impossible to crack, as the author claims, since it not only scrambles the login and password, and the URL of the protected page, the surfer entering the password protected page has to come from the password login page itself (prevents people from simply typing the URL of the protected page to gain entry).

Example: click here (login: websit password: abstra)

Directions: This script can get quite complicated to configure. Before showing you Victor's (the author's) step by step instructions on how to set up the script, there are a few things worth mentioning here:

1) The script spans two pages (a stand-alone before page, and a target page)

2) Both the login and password should consist of exactly six characters

3) The URL of the target page has to be absolute (ie: "http://www.mydomain.com/protected.htm", instead of simply "protected.com")

keep the above points in mind as the author takes over.


Password '98 Help and Code
http://www.crosswinds.net/atlanta/~vickor/ncodes

I'm guessing you came here to learn how to setup your password protection page(s).  The first thing you should know is that your password and login will have to be six character and I don't know if spaces will work as a character.  [You can e-mail me at kdbkc@bellsouth.net and I will make the password however long you want it.(Not above 10 characters.)  Be warned though you might not get a fast response if the e-mails in June or July! '98]  Also, this will take up two separate pages.

The first will hold the password information.  This page will also be the one to ask "What is your login?",ect.  This will have to be a page by itself(This makes it nearly impossible for someone to break the coding.). On this page you will put the HTML coding below.  Change the bold letters with what it says to change it to.

<html>
<head>
<title>
Password '98
</title>
</head>
<body>
<script>
<!--
/*This is a really cool password script made by Vickor
kdbkc@bellsouth.net
http://www.crosswinds.net/atlanta/~vickor/ncodes
I ask you not to edit this script but I know some of you will! :-{
*/

var login=prompt("What is your login name?","")
var pass=prompt("What is your password?","")
var passwordis="Second character of login."
var opecc="Second character of your password."
var orelseitis="Fourth character of login."
var orits="Fifth character of your login."
var opecc1="g"
var opikc="Fifth character of your password."
var opick1="Third character of your login."
var opekk="Third character of your password."
var opekk1="Sixth character of your login."
var opic="Sixth character of your password."
var opic1="z"
var opeck="First character of your password."
var opeck1="t"
var opekc="Fourth character of your password."
var opekc1="f"
var shish="First character of your login."

if ((pass == ""+opeck+""+opecc+""+opekk+""+opekc+""+opikc+""+opic+"")&&(login == ""+shish+""+passwordis+""+opick1+""+orelseitis+""+orits+""+opekk1+"")) {
alert("You may proceed.")
var jingle="http://"
var jangle="The last part or subdirectory.  Ex.  blah.html or subdirectory/"
var jingle1="Main name of webpage you want the password to lead to if its correct.  Ex. geocities"
var jangle1="The subdirectory after the main name if needed.  Make sure of a "/" after the name."
var jingle2="The www. if needed.  Make sure of the dot after the "w's"."
var jangle2="The .com/ or .net/ or .org/  ,ect  Make sure of the "." and the "/" "
var jingle3="The second subdirectory if needed.  Don't forget the "/" after the name."
parent.location.href = ""+jingle+""+jingle2+""+jingle1+""+jangle2+""+jangle1+""+jingle3+""+jangle+""
}
else {
alert("****Access Denied! You will be terminated!****")
parent.location.href ="Place to go if password is incorrect.  I recommend http://www.disney.com"
}
//--->
</script>

 
</body>
</html>

The second page should be the page your passwording off.  This should also be the page you linked to in the page you just created.(The link was the weird linking part.  That had to be the link to this new page.)
Replace the bold text with what it says.  The coding is:

<html>
<head>
<title>
Title of page.
</title>
</head>
<body>
<script>
if (document.referrer == "The FULL URL of the site you made earlier in the tutorial."){}

else {
var x=confirm("Would you like to try the password again?")
if (x){
parent.location.href = ""+document.referrer+""
}
else {
parent.location.href = "The site that you want to send them to if there incorrect."
}
}
</script>
Right here is were you put the page that you wanted password protected. (The HTML code for it.)

Thats about it.  As far as I know the password and login are impossible to find out. Atleast by all the ways I know of breaking a password and login.


If you run into any trouble with the above, you may view the source of the two files I used to make this script work

before.htm | page3.htm

http://www.javascriptkit.com
CopyRight © 1997, 1998 JavaScript Kit.