cryptix.tools

Class MCT

public final class MCT extends Object

For a designated symmetric block cipher algorithm, this command generates and exercises Monte Carlo Tests data for both Encryption and Decryption in Electronic Codebook (ECB) and Cipher Block Chaining (CBC) modes.

MCT's output file format is in conformance with the layout described in Section 4 of NIST's document "Description of Known Answer Tests and Monte Carlo Tests for Advanced Encryption Standard (AES) Candidate Algorithm Submissions" dated January 7, 1998.

If the -p argument is not specified, this command assumes that the name of the designated cipher algorithm is also that of its Security Provider. It always tries processing the user's request using Java Reflection API methods on an XXX_Algorithm class, if such a class exists --XXX being the name of the AES candidate algorithm. When such a class exists, it is assumed to include the following static methods:

If an *_Algorithm class was not found, or if found but an exception was thrown during the invocation and/or execution of one of its methods, this command then reverts to using the IJCE API methods for carrying on the user's request.

This duality of functionalities is here for performance reasons since speed is faster with the Reflection API than with the IJCE one --on a Pentium 133MHz, without JIT, using JDK-1.1.5 Reflection API brings more than 10% speed improvement.

Copyright © 1998 Systemics Ltd on behalf of the Cryptix Development Team.
All rights reserved.

$Revision: 1.5 $

Author: Raif S. Naffah

Nested Class Summary
classMCT.MCT_Key
Field Summary
Classalgorithm
MethodblockSize
booleancbc
StringcdFileName
StringceFileName
Ciphercipher
StringcipherName
longdecBlocks
Methoddecrypt
Filedestination
StringdirName
booleanecb
Current values of switches as set from the command line arguments.
StringedFileName
StringeeFileName
longencBlocks
Methodencrypt
longkeyCount
Stringkeylengths
int[]keys
MethodmakeKey
Stringprovider
static StringSUBMITTER
booleanuseReflection
static StringVERSION
Method Summary
voidcbcDecForKeyIjce(int keysize, PrintWriter pw)
voidcbcDecForKeyReflect(int keysize, PrintWriter pw)
voidcbcDecrypt(String decName)
voidcbcEncForKeyIjce(int keysize, PrintWriter pw)
voidcbcEncForKeyReflect(int keysize, PrintWriter pw)
voidcbcEncrypt(String encName)
voidcbcMCT(String encName, String decName)
voidecbForKeyIjce(int keysize, PrintWriter enc, PrintWriter dec)
voidecbForKeyReflect(int keysize, PrintWriter enc, PrintWriter dec)
voidecbMCT(String encName, String decName)
static voidhalt(String s)
Print an error message to System.err and halts execution returning -1 to the JVM.
static voidmain(String[] args)
static voidnotify(String s)
Write a notification message to System.out.
voidprintUsage()
write help text and quit.
voidprocessOptions(String[] args)
Process command line arguments.
voidrun()
main action.

Field Detail

algorithm

Class algorithm

blockSize

Method blockSize

cbc

boolean cbc

cdFileName

final String cdFileName

ceFileName

final String ceFileName

cipher

Cipher cipher

cipherName

String cipherName

decBlocks

long decBlocks

decrypt

Method decrypt

destination

File destination

dirName

String dirName

ecb

boolean ecb
Current values of switches as set from the command line arguments.

edFileName

final String edFileName

eeFileName

final String eeFileName

encBlocks

long encBlocks

encrypt

Method encrypt

keyCount

long keyCount

keylengths

String keylengths

keys

int[] keys

makeKey

Method makeKey

provider

String provider

SUBMITTER

static final String SUBMITTER

useReflection

boolean useReflection

VERSION

static final String VERSION

Method Detail

cbcDecForKeyIjce

void cbcDecForKeyIjce(int keysize, PrintWriter pw)

cbcDecForKeyReflect

void cbcDecForKeyReflect(int keysize, PrintWriter pw)

cbcDecrypt

void cbcDecrypt(String decName)

cbcEncForKeyIjce

void cbcEncForKeyIjce(int keysize, PrintWriter pw)

cbcEncForKeyReflect

void cbcEncForKeyReflect(int keysize, PrintWriter pw)

cbcEncrypt

void cbcEncrypt(String encName)

cbcMCT

void cbcMCT(String encName, String decName)

ecbForKeyIjce

void ecbForKeyIjce(int keysize, PrintWriter enc, PrintWriter dec)

ecbForKeyReflect

void ecbForKeyReflect(int keysize, PrintWriter enc, PrintWriter dec)

ecbMCT

void ecbMCT(String encName, String decName)

halt

static void halt(String s)
Print an error message to System.err and halts execution returning -1 to the JVM.

Parameters: s a message to output on System.err

main

public static void main(String[] args)

notify

static void notify(String s)
Write a notification message to System.out.

Parameters: s string to output to System.out.

printUsage

void printUsage()
write help text and quit.

processOptions

void processOptions(String[] args)
Process command line arguments.

run

void run()
main action.