PassWord 4.x applet

Setup example 1:

At this example I'll assume you red the previous chapters.
So you know how to create an html page and the workings of applet tags.
This way I only have to discuss the password 4 applet tags.

Setup 1:
The user enters his user name and password.
The password here is an encrypted filename.
The applet decrypts the password to the filename.
It uses the username as decryption key.
After that the applet queries the providers computer to see if this file exists.
If it does it redirects the browser to this page.
If it doesn't exist the browser is redirected to a denial page.
(With this setup doesn't use password files)

You should already know that the browser queries the provider's computer.
The provider's computer has software that isn't on your local personal computer.
So if you are trying to test it on your local file system you may encounter some problems.
The browser most likely doesn't have complete access to your file system.
Normally it only has access files in the path to PassWord4.class and into subdirectories beyond that path.

Firs I'll give you an overview off all tags involved.
After that I'll explain how to convert a non-encrypted password into an encrypted password.

Here is an overview of all the tags needed.
<APPLET CODE="PassWord4.class" WIDTH="400" HEIGHT="275">
<PARAM NAME="CABBASE" VALUE="PassWord4.cab">
<!--main methods -->
<PARAM NAME="is_password_calculator" VALUE="false">
<PARAM NAME="password_is_redirect_url" VALUE="true">
<!-- the applet itself -->
<PARAM NAME="background" VALUE="display2.gif">
<PARAM NAME="bgcolor" VALUE="#00CCFF">
<!--the username textfield -->
<PARAM NAME="user_name" VALUE="User name: ">
<PARAM NAME="user_name_y" VALUE="70">
<!--PARAM NAME="user_name_x" VALUE="40"-->
<PARAM NAME="user_name_bgcolor" VALUE="lightgray">
<--the password textfield -->
<PARAM NAME="password" VALUE="PassWord : ">
<PARAM NAME="password_echo_character" VALUE="x">
<PARAM NAME="password_y" VALUE="105">
<!--PARAM NAME="password_x" VALUE="40"-->
<PARAM NAME="password_bgcolor" VALUE="lightgray">
<!-- enter button -->
<PARAM NAME="enter_up_image" VALUE="enter_up.gif">
<PARAM NAME="enter_over_image" VALUE="enter_over.gif">
<PARAM NAME="enter_down_image" VALUE="enter_down.gif">
<PARAM NAME="enter_y" VALUE="140">
<!--PARAM NAME="enter_x" VALUE="41"-->
<PARAM NAME="enter_bgcolor" VALUE="lightgray">
<PARAM NAME="enter_down_sound" VALUE="computer.au">
<!-- clear button -->
<PARAM NAME="clear_up_image" VALUE="clear_up.gif">
<PARAM NAME="clear_over_image" VALUE="clear_over.gif">
<PARAM NAME="clear_down_image" VALUE="clear_down.gif">
<PARAM NAME="clear_y" VALUE="188">
<!--PARAM NAME="clear_x" VALUE="41"-->
<PARAM NAME="clear_down_sound" VALUE="woeep.au">
<PARAM NAME="clear_bgcolor" VALUE="lightgray">
<!-other things -->
<PARAM NAME="error_sound" VALUE="error2.au">
<PARAM NAME="debug" VALUE="false">
<PARAM NAME="denied_page" VALUE="denied.html">
<PARAM NAME="target" VALUE="_blanc">
</APPLET>

Note that tags starting with <!-and ending with --> are html comments.

Now I'll explain each applet tag:
<APPLET CODE="PassWord4.class" WIDTH="400" HEIGHT="275">
This is the applet starting tag.
I already discussed it.
If you don't know just copy this one.

<PARAM NAME="CABBASE" VALUE="PassWord4.cab">
This causes Ms Explorer to load a cabfile
A cab file is an archive file just like *.zip files
It contains multiple files in an compressed form.
This way Ms Explorer browsers will load faster.
Netscape will ignore the cab file and load all files seperatly
So you also need to please all other files at your directory
This cab file only contains the applet's class and sound files
Cab files also can contain other files like pictures.

<PARAM NAME="is_password_calculator" VALUE="false">
<PARAM NAME="password_is_redirect_url" VALUE="true">
These determine how this applet is working.
I think the names are quite obvious.
The last and first one you actually not need her for this setup.
You can omit them.
<PARAM NAME="is_password_calculator" VALUE="false">
Only set it true if you want a password calculator.
<PARAM NAME="password_is_redirect_url" VALUE="true">
Means that the browser is redirected to the decrypted password.

The next tags only determine how the applet feels and looks.

<PARAM NAME="bgcolor" VALUE="#00CCFF">
<PARAM NAME="background" VALUE="display2.gif">
You can give the applet a background color with the bgcolor parameter.
The applet supports some color names but not all.
(black, blue, cyan, darkgray, gray, green, lightgray, magenta, orange, pink, red, white, yellow)
There are simply to many color names.
(There are a couple of million colors possibles)
So the applet also understands the hexadecimal RGB color representation also.
This notation is also used with the bgcolor attribute of the <body> tag.
So you also can look it up in any good html book.
With the background parameter you can select a background image for the applet.
Applets by default support *.gif and *.jpg images.
There are several types of *.gif images.
However it will support transparent gifs.
Not all browsers do support animated gifs with applets.
(There is a bug in the Java Virtual Machine in some versions of Netscape) (It's a wrong implementation of a part of the http protocol.)
(If it shows up also depends on the http software is installed on your provider's computer)

You will have to add some components and configure them.
By default the applet will lay out the components vertically.
But it's also possible to lay it out manually.
Note: The upper left coordinates are (0,0)

<!--the username textfield -->
<PARAM NAME="user_name" VALUE="User name: ">
<PARAM NAME="user_name_y" VALUE="70">
<!--PARAM NAME="user_name_x" VALUE="40"-->
<PARAM NAME="user_name_bgcolor" VALUE="lightgray">
On this component the user will enter his user name.
With parameter user_name you can change the text label.
For example if your applet is used in another language.
The parameters user_name_x and user_name_y are used to layout the component manually.
You can also leave the layout to the applet's layout manager. In that case just omit these tags.
Note: I've commented out the x coordinate in this example.
With user_name_bgcolor you can set the label's background color.

<!--the password textfield -->
<PARAM NAME="password" VALUE="PassWord : ">
<PARAM NAME="password_echo_character" VALUE="x">
<PARAM NAME="password_y" VALUE="105">
<!--PARAM NAME="password_x" VALUE="40"-->
<PARAM NAME="password_bgcolor" VALUE="lightgray">
On this component the user will enter his password.
With the password parameter you can change the label.
A useful thing is to set an echo character for this textfield.
In this case someone can't spy over the users back to see what he is entering.
password_y and password_x are used to lay-out the component manually.
With password_bgcolor you can set a background color.

<!-- enter button -->
<PARAM NAME="enter_up_image" VALUE="enter_up.gif">
<PARAM NAME="enter_over_image" VALUE="enter_over.gif">
<PARAM NAME="enter_down_image" VALUE="enter_down.gif">
<PARAM NAME="enter_y" VALUE="140">
<!--PARAM NAME="enter_x" VALUE="41"-->
<PARAM NAME="enter_bgcolor" VALUE="lightgray">
<PARAM NAME="enter_down_sound" VALUE="computer.au">
These configure the enter button.
The user can click with the mouse on this button.
I've chosen to use images to display the button.
With transparent gif images you'll get the best effect.
Anyway you can use the images that came with the applet.
<PARAM NAME="enter_up_image" VALUE="enter_up.gif">
The button has three states.
When the button is up , on mouse over and when pressed.
Only the first image is mandatory.
You should images of the same size.
(Again only non-animated gifs and jpg images are supported)
With enter_x and enter_y you can manually lay out this component if you wish.
You can also let the applet do the layout.
In that case omit these two tags.
The enter_bgcolor parameter is used to give the component a background color.
Another nice feature is to use a button sound.
You can let the applet play a sound when the button is pressed.
Applets only support *.au (=ulaw) files.
Only the 8000Khz mono unsigned version of *.au files are supported.
You can use goldwave to convert wav files to au files.

<!-- clear button -->
<PARAM NAME="clear_up_image" VALUE="clear_up.gif">
<PARAM NAME="clear_over_image" VALUE="clear_over.gif">
<PARAM NAME="clear_down_image" VALUE="clear_down.gif">
<PARAM NAME="clear_y" VALUE="188">
<!--PARAM NAME="clear_x" VALUE="41"-->
<PARAM NAME="clear_down_sound" VALUE="woeep.au">
<PARAM NAME="clear_bgcolor" VALUE="lightgray">
This is actual the same as the enter button.
The enter button is described above.

<PARAM NAME="error_sound" VALUE="error2.au">
You can let the applet play a sound if the entry is invalid.

<PARAM NAME="debug" VALUE="false">
This parameter is for debugging purposes.
It will display additional information on the browsers Java console.
Note: This console is by default disabled on Ms Explorer.
You can enable it through one of the pull down menus.
Tools, Internet options, advanced, enable java console (requires a restart).

<PARAM NAME="denied_page" VALUE="denied.html">
This page will be displayed if the entry is incorrect.

<PARAM NAME="target" VALUE="_blanc">
This is the default target that is used.
Note: there are three special html frame target names
_blanc opens the page in a new window.
_self opens the page in the same window.
_top the page replaces the current html frames.

</APPLET>
The applet ending tag as described in one of the earlier sections.