BlowfishJ
Class InOutputStreamTest

java.lang.Object
  |
  +--BlowfishJ.InOutputStreamTest

public class InOutputStreamTest
extends java.lang.Object

Simple tests for the BlowfishInputStream and BlowfishOutputStream.


Constructor Summary
InOutputStreamTest(java.lang.String name)
           
 
Method Summary
static void main(java.lang.String[] args)
          To test file encryption/decryption, pass a file name as the first argument.
static void testStreams()
          This test encrypts a string, then decrypts the encrypted string, then checks that the decrypted string is the same as the original string.
static void testStreams2(java.lang.String test_file)
          This test reads a file, encrypts the file, decrypts the encrypted file, then compares the decrypted file with the original file.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

InOutputStreamTest

public InOutputStreamTest(java.lang.String name)
Method Detail

testStreams

public static void testStreams()
This test encrypts a string, then decrypts the encrypted string, then checks that the decrypted string is the same as the original string.


testStreams2

public static void testStreams2(java.lang.String test_file)
This test reads a file, encrypts the file, decrypts the encrypted file, then compares the decrypted file with the original file. The test passes if the decrypted file and the original file are byte-by-byte identical. On a large file, this test will be slow as there isn't any buffering done.

Parameters:
test_file - file to read.

main

public static void main(java.lang.String[] args)
To test file encryption/decryption, pass a file name as the first argument.