|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--demo.cipher.CipherAll
This class tests the Cipher.class implematation.
The test includes tests for the implemented key generators (DES, 3DES, IDEA) and for all implemented ciphers:
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 |
public CipherAll()
Method Detail |
public boolean testKeyGen(String algorithm) throws Exception
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
.
algorithm
- the symmetric algorithm for which the key pair shall
be generatedtrue
id the key pair successfully has been created
false
if notpublic boolean testCipher(String algorithm, int keyLength, int clearLength)
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.
algorithm
- the algorithm (transformation string) to use:
DES, IDEA, ..., "DES/CBC", ..., "DES/PCBC/PKCS5Padding", ...keyLength
- the length of the keyclearLentgh
- the length of the random cleartextpublic void startTest0() throws Exception
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:
public void start()
public static void main(String[] arg)
|
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). | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |