demo.cipher
Class CipherAll

java.lang.Object
  |
  +--demo.cipher.CipherAll

public class CipherAll
extends Object

This class tests the Cipher.class implematation.

The test includes tests for the implemented key generators (DES, 3DES, IDEA) and for all implemented ciphers:

Version:
File Revision 24

Constructor Summary
CipherAll()
           
 
Method Summary
static void main(String[] arg)
          Starts the Cipher.class implementation test for the implemented DES, 3DES, IDEA, RC2 and ARCFOUR algorithms.
 void start()
           
 void startTest0()
          Tests the Cipher.class implementation for DES, 3DES, IDEA, RC2 and ARCFOUR algorithms.
 boolean testCipher(String algorithm, int keyLength, int clearLength)
          Test the Cipher.class implementation.
 boolean testKeyGen(String algorithm)
          Tests the key generator implementation for the requested algorithm.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CipherAll

public CipherAll()
Method Detail

testKeyGen

public boolean testKeyGen(String algorithm)
                   throws Exception
Tests the key generator implementation for the requested algorithm.

This class creates a key pair for the requested algorithm using the IAIK provider. If the key pair successfully is created, this method returns true.

Parameters:
algorithm - the symmetric algorithm for which the key pair shall be generated
Returns:
true id the key pair successfully has been created false if not

testCipher

public boolean testCipher(String algorithm,
                          int keyLength,
                          int clearLength)
Test the Cipher.class implementation.

This method first creates required key (and parameters), and subsequently performs the requested cipher implementation test by encrypting randomly generated cleartext of given length, decrypting it again, and comparing the result with the original data.

Parameters:
algorithm - the algorithm (transformation string) to use: DES, IDEA, ..., "DES/CBC", ..., "DES/PCBC/PKCS5Padding", ...
keyLength - the length of the key
clearLentgh - the length of the random cleartext

startTest0

public void startTest0()
                throws Exception
Tests the Cipher.class implementation for DES, 3DES, IDEA, RC2 and ARCFOUR algorithms.

First the implemented key generators are tested for the DES, 3DES and IDEA algorithms. Subsequently the cipher implementations for the several algorithms are tested including any supported mode:


start

public void start()

main

public static void main(String[] arg)
Starts the Cipher.class implementation test for the implemented DES, 3DES, IDEA, RC2 and ARCFOUR algorithms.

This Javadoc may contain text parts from Internet Standard specifications (RFC 2459, 3280, 3039, 2560, 1521, 821, 822, 2253, 1319, 1321, ,2630, 2631, 2268, 3058, 2984, 2104, 2144, 2040, 2311, 2279, see copyright note) and RSA Data Security Public-Key Cryptography Standards (PKCS#1,3,5,7,8,9,10,12, see copyright note).

IAIK-JCE 3.1 with IAIK-JCE CC Core 3.1, (c) 1997-2004 IAIK