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:
- public static int blockSize();
Return the length in bytes of the cipher's input block.
- public static synchronized Object makeKey (byte[]);
Expand a user-supplied key material into a cipher's session key.
- public static byte[] blockEncrypt (byte[], int, Object);
Encrypt exactly one block of plaintext.
- public static byte[] blockDecrypt (byte[], int, Object);
Decrypt exactly one block of plaintext.
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 $
- Raif S. Naffah
(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.
|
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
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.
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.
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.