Cryptographer.java
723bd9bb30a12faa082889d4718d0c8553a2447b580093b604426709ad7836e1
//
// Cryptographer.java - An abstract class for cryptograpy algorithms.
//
// Copyright (C) 1996-97 by Connect Software, Inc. All rights reserved.
//
// Designed and written by Gionata Mettifogo.
//
// This class does not implement cryptography algorithms and is not subject to export restrictions.
//
package connect.cryptography; // belongs to the cryptography package
public class Cryptographer
{
public Cryptographer()
{
}
public int getBlockLength()
{
return -1; // no fixed length for the block (this is true with all stream cyphers)
}
public void encrypt(byte [] data, int offset, int length)
{
// no encryption in base class (will be overidden)
}
public void encrypt(byte [] data)
{
encrypt(data, 0, data.length); // ecnrypt entire array at once
}
public void decrypt(byte [] data, int offset, int length)
{
encrypt(data, offset, length); // this works if algorithm is symmetric
}
public void decrypt(byte [] data)
{
decrypt(data, 0, data.length); // decrypt entire array at once
}
}