cds.util
Class SecureCDS

java.lang.Object
  extended bycds.util.SecureCDS

public class SecureCDS
extends java.lang.Object

This class deals with securing CDS data exchange between server and clients in contexts where user authentication/authorisation is mandatory.

The mechanism is based on:

  1. Public/private key creation
  2. Private key encryption at the client side (local password)
  3. critical data exchange preceeded by sending a message both clear and encrypted. The server encrypts the clear message and compares it with the encrypted version.

Version:
1.0 Jun 2002
Author:
Marc Wenger/CDS

Field Summary
(package private)  javax.crypto.Cipher descode
           
(package private)  javax.crypto.Cipher desdecode
           
private static java.lang.String DSA_ALGO
           
(package private)  java.security.Key key
           
(package private)  java.security.KeyPair keys
           
private static java.lang.String RSA_ALGO
           
 
Constructor Summary
SecureCDS(java.lang.String algo)
          Create a cipher engine based on a single symetric key
SecureCDS(java.lang.String pwd, byte salt, int count)
          Create a ciper engine based on a key build from an explicit password
SecureCDS(java.lang.String algo, int keysize)
          Create a cipher engine based on a pair of public/private key
 
Method Summary
private static void check(SecureCDS sec, java.lang.String str)
          Check programme
 byte[] decrypt(byte[] str)
           
 byte[] encrypt(byte[] str)
           
static void main(java.lang.String[] args)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DSA_ALGO

private static final java.lang.String DSA_ALGO
See Also:
Constant Field Values

RSA_ALGO

private static final java.lang.String RSA_ALGO
See Also:
Constant Field Values

keys

java.security.KeyPair keys

key

java.security.Key key

descode

javax.crypto.Cipher descode

desdecode

javax.crypto.Cipher desdecode
Constructor Detail

SecureCDS

public SecureCDS(java.lang.String algo,
                 int keysize)
          throws java.lang.Exception
Create a cipher engine based on a pair of public/private key


SecureCDS

public SecureCDS(java.lang.String algo)
          throws java.lang.Exception
Create a cipher engine based on a single symetric key

Parameters:
algo - cipher algorithm (DES)

SecureCDS

public SecureCDS(java.lang.String pwd,
                 byte salt,
                 int count)
          throws java.lang.Exception
Create a ciper engine based on a key build from an explicit password

Method Detail

encrypt

public byte[] encrypt(byte[] str)
               throws java.lang.Exception
Throws:
java.lang.Exception

decrypt

public byte[] decrypt(byte[] str)
               throws java.lang.Exception
Throws:
java.lang.Exception

check

private static void check(SecureCDS sec,
                          java.lang.String str)
Check programme


main

public static void main(java.lang.String[] args)