
The file Nicont.zip include the following archives:

Apcontrol.class
Apform.class
Cifrado.class
Tapiz.class
Apcontrol.jar
Apcontrol.java
Readme.txt

 
The Applet uses four classes, the main class Apcontrol.class, the class Apform.class, 
the class Tapiz.class and the class Cifrado.class. 
The source code of the first three classes is included in the file Apcontrol.java. 
The  class Cifrado is the one that  provides the encryption algorithm and therefore 
their code is not public.  
  
You can use the Applet in a webpage  by means of the following tag:  
<applet code = "Apcontrol.class" archive="Apcontrol.jar" width = "300" height = "240">  
The parameter archive="Apcontrol.jar" is optional and it indicates to the navigator 
that all the .class files necessary  are packed in the file Apcontrol.jar.  
If this parameter is omitted, the navigator will load the file Apcontrol.class and next 
it will go  requesting of the server the following files and the applet will be loaded 
more slowly.  

The applet parameters are the following:

 	an ( width in pixels  ) 
	al ( height in pixels ) 
	title (title of the form ) 
	idioma ( language allowed esp=spanish,  eng = english ) 
	claves ( name of the file that contents the users, passwords and web pages customized) 
	key ( numeric code for encryption, 4 o 5 digits )


The applet shows a form that requests user's name and its password, loading from the server
a text file "lista.txt" ( The name of the file may be changed, it is one of the parameters 
of the Applet). This file should be in the same directory of the server with the webpage that
contains the applet.  This file has the following format:  
  
   Name   Password   webpage  
     
   Juan   alfa       page1.html  
   Pepe   12345      home.html  
    ...    ...        ...  
    ...    ...        ...  
  
Each line contains an user, its password and the page to which can access. These three   
elements should go separated for at least a white space and the data of the first line 
of the file is ignored, for what can be used as header.   
  
If the user and the password introduced through the applet matchs with some of the list,   
the navigator  loads the  corresponding webpage.    
One of the possible inconveniences of this process is that the file that contains the list of  
users and their passwords, it is stored in the cach of the navigator, in the directory   
"Temporary Internet Files" with can be readed by a  hacker. 
 
To avoid this inconvenience the file "lista.txt" can be encrypted using the applet  
 
Encryption Java Applet. 
  
To use the encryption applet we should give it a number of 4 or 5 digits that  will act as 
a key in the code process.  This same number will be sents as parameter to the Applet of 
access control, so that it is able to code the data that the user introduces.  
  
The previous file once encrypted (in this case with the number 8435) it is in the   
following way :  
  
  Name   Password   webpage  
     
   L{eq   crjd     rgkh23ovsp  
   Rkth   38776    juqh/m{or  
    ...    ...       ...  
    ...    ...       ...  
  
 If we pass the value 0 by  the parameter key, the applet considers that the file of keys  
 is not encrypted and therefore it omits the decoding process.  
  
  
The Applet have been  elaborated using the jdk1.1.6 (Java Development Kit /Sun Microsystem) 

  
