Source Code

JavaScript Kit Encrypted Password Generator

  • JavascriptKit
  • 27 June 2014 at 16:58
  • Javascript
  • 1348
  • 4
  • United States

Author: JavascriptKit Language: United States
License: Freeware
Size: 0 KB
Downloads: 1 times


JavaScript may not be the best way to password-protect a webpage, but for those who do not have access to a CGI-BIN, it may very well be the only way. To provide these people with a decent JavaScript password protector that will keep out at least the average surfer, I've created this encrypted password generator. This program dynamically encrypts the password to a page (differently each time) before saving it, making it a LOT harder for foul-minded users to break in. It differs from other good password scripts, such as Gate Keeper, in the following two areas:

The program dynamically encrypts the password (using several advanced JavaScript techniques) when storing it, so simply viewing the source will not reveal it (Most password protectors don't encrypt the password. Gatekeeper does not use a password).
  • Unlike Gate Keeper, the program does NOT simply take the surfer to the file he/she enters as the password. Instead, it navigates to a page only if the surfer correctly enters the password. Invalid passwords will result in an invalid password alert.

The program is similar to Gatekeeper, however, in that the file you are protecting must be renamed to match the password you have chosen for it.

Note: This program dynamically encrypts the password specified, so each time you use the program, the resulting output will be different, even for the same password. An added cushion of security!


var pass=new Array()
var t3=
var lim=4

//configure extension to reflect the extension type of the target web page (ie: .htm or .html)
var extension=.html
var enablelocking=0
var numletter=0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ
var temp3=''
var cur=0

function max(which){
return (pass[Math.ceil(which)+(3&15)].substring(0,1))

function testit(input){
var temp2=temp^parseInt(pass[phase1-1+(1|3)].substring(0,2))
return (temp2)

function submitentry(){
var indicate=true
for (i=(1&2);i<window.max(Math.LOG10E);i++)
for (i=(1&2);i<lim;i++){
if (t3.charAt(i)!=pass[phase1+Math.round(Math.sin(Math.PI/2)-1)].charAt(i))
if (verification.length!=window.max(Math.LOG10E))
if (indicate)
alert(Invalid password. Please try again)

<table border=1 cellspacing=0 cellpadding=0 bgcolor=#FFFFBD>
    <td width=100%><form name=password1><div align=center><center><p><strong>Enter password: </strong><input
      type=text name=password2 size=15><br>
      <input type=button value=Submit onClick=submitentry()></p>

comments powered by Disqus

Related Code

Create Calculator Using Javascript

How to Write a BlackBerry Application – Lesson 3: Create shortcuts and more

How to write a BlackBerry application – Lesson 2: Mail API, Invoke API, Menu

How to write your first BlackBerry application – Lesson 1: UI fields

Mysql Response too slow accessed from website

Get Content of RSS Pasarkode

Apache setting for CodeIgniter when upload in sub domain

Ajax load content

Import Large Database File Size

Get Location Using GeoPlugin


Tag Linked