cryptix.tools

Class MCT


public final class MCT
extends java.lang.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

(package private) class
MCT.MCT_Key

Field Summary

(package private) static String
SUBMITTER
(package private) static String
VERSION
(package private) Class
algorithm
(package private) Method
blockSize
(package private) boolean
cbc
(package private) String
cdFileName
(package private) String
ceFileName
(package private) Cipher
cipher
(package private) String
cipherName
(package private) long
decBlocks
(package private) Method
decrypt
(package private) File
destination
(package private) String
dirName
(package private) boolean
ecb
Current values of switches as set from the command line arguments.
(package private) String
edFileName
(package private) String
eeFileName
(package private) long
encBlocks
(package private) Method
encrypt
(package private) long
keyCount
(package private) String
keylengths
(package private) int[]
keys
(package private) Method
makeKey
(package private) String
provider
(package private) boolean
useReflection

Method Summary

(package private) void
cbcDecForKeyIjce(int keysize, PrintWriter pw)
(package private) void
cbcDecForKeyReflect(int keysize, PrintWriter pw)
(package private) void
cbcDecrypt(String decName)
(package private) void
cbcEncForKeyIjce(int keysize, PrintWriter pw)
(package private) void
cbcEncForKeyReflect(int keysize, PrintWriter pw)
(package private) void
cbcEncrypt(String encName)
(package private) void
cbcMCT(String encName, String decName)
(package private) void
ecbForKeyIjce(int keysize, PrintWriter enc, PrintWriter dec)
(package private) void
ecbForKeyReflect(int keysize, PrintWriter enc, PrintWriter dec)
(package private) void
ecbMCT(String encName, String decName)
(package private) static void
halt(String s)
Print an error message to System.err and halts execution returning -1 to the JVM.
static void
main(String[] args)
(package private) static void
notify(String s)
Write a notification message to System.out.
(package private) void
printUsage()
write help text and quit.
(package private) void
processOptions(String[] args)
Process command line arguments.
(package private) void
run()
main action.

Field Details

SUBMITTER

(package private) static final String SUBMITTER

VERSION

(package private) static final String VERSION

algorithm

(package private)  Class algorithm

blockSize

(package private)  Method blockSize

cbc

(package private)  boolean cbc

cdFileName

(package private) final String cdFileName

ceFileName

(package private) final String ceFileName

cipher

(package private)  Cipher cipher

cipherName

(package private)  String cipherName

decBlocks

(package private)  long decBlocks

decrypt

(package private)  Method decrypt

destination

(package private)  File destination

dirName

(package private)  String dirName

ecb

(package private)  boolean ecb
Current values of switches as set from the command line arguments.

edFileName

(package private) final String edFileName

eeFileName

(package private) final String eeFileName

encBlocks

(package private)  long encBlocks

encrypt

(package private)  Method encrypt

keyCount

(package private)  long keyCount

keylengths

(package private)  String keylengths

keys

(package private)  int[] keys

makeKey

(package private)  Method makeKey

provider

(package private)  String provider

useReflection

(package private)  boolean useReflection

Method Details

cbcDecForKeyIjce

(package private)  void cbcDecForKeyIjce(int keysize,
                                         PrintWriter pw)
            throws KeyException

cbcDecForKeyReflect

(package private)  void cbcDecForKeyReflect(int keysize,
                                            PrintWriter pw)
            throws IllegalAccessException,
                   InvocationTargetException

cbcDecrypt

(package private)  void cbcDecrypt(String decName)
            throws KeyException

cbcEncForKeyIjce

(package private)  void cbcEncForKeyIjce(int keysize,
                                         PrintWriter pw)
            throws KeyException

cbcEncForKeyReflect

(package private)  void cbcEncForKeyReflect(int keysize,
                                            PrintWriter pw)
            throws IllegalAccessException,
                   InvocationTargetException

cbcEncrypt

(package private)  void cbcEncrypt(String encName)
            throws KeyException

cbcMCT

(package private)  void cbcMCT(String encName,
                               String decName)
            throws KeyException

ecbForKeyIjce

(package private)  void ecbForKeyIjce(int keysize,
                                      PrintWriter enc,
                                      PrintWriter dec)
            throws KeyException

ecbForKeyReflect

(package private)  void ecbForKeyReflect(int keysize,
                                         PrintWriter enc,
                                         PrintWriter dec)
            throws IllegalAccessException,
                   InvocationTargetException

ecbMCT

(package private)  void ecbMCT(String encName,
                               String decName)
            throws KeyException

halt

(package private) 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

(package private) static void notify(String s)
Write a notification message to System.out.
Parameters:
s - string to output to System.out.

printUsage

(package private)  void printUsage()
write help text and quit.

processOptions

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

run

(package private)  void run()
main action.