Free.util
Class AuthSys

java.lang.Object
  |
  +--Free.util.AuthSys

public class AuthSys
extends java.lang.Object

The AuthSys Class implements a Message Authentication Code system (MAC). AuthSys creates its MAC based on the SHA-1 algorithm included as part of java.security which comes with all Java implementations and is not subject to restrictions. Essentially a message digest of a packet's data portion is created. Then a new message digest of the previous digest concatenated with a passphrase is created. This is returned to be added to packets elsewhere.

Version:
0.5 7 February 2001
Author:
Jason Kitcat

Constructor Summary
AuthSys()
           
 
Method Summary
static boolean checkDigest(Packet pack)
          analyses MAC to ensure packets haven't been tampered.
static java.lang.String makeDigest(java.lang.String data)
          creates a MAC to detect tampering
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AuthSys

public AuthSys()
Method Detail

makeDigest

public static java.lang.String makeDigest(java.lang.String data)
                                   throws java.lang.Exception
creates a MAC to detect tampering
Parameters:
data - The data being sent in the packet
Returns:
A string containing the MAC

checkDigest

public static boolean checkDigest(Packet pack)
                           throws java.lang.Exception
analyses MAC to ensure packets haven't been tampered. Simply calls makeDigest and compares the result with the digest portion of the Packet supplied.
Parameters:
pack - The packet, including message digest
Returns:
A boolean depending on whether the packet is ok.