hcrypto.cipher
Class BlockCipher
java.lang.Object
hcrypto.cipher.CipherEngine
hcrypto.cipher.BlockCipher
- Direct Known Subclasses:
- AffineEngine, CaesarEngine, CaesarEngine, NullEngine, PlayfairEngine, PolySubstitutionEngine, RailfenceEngine, SubstitutionEngine, TranspositionEngine, VigenereEngine
public abstract class BlockCipher
- extends CipherEngine
Abstract class representing a basic block cipher. It provides
implementations of methods to encrypt and decrypt files
and strings, for the entire range of cipher engines.
Subclasses of this class must implement three methods:
engineInit(HistoricalKey), engineEncode(String)
and engineDecode(String). Of course, each particular cipher algorithm will
implement these methods in its own way.
Traditional character ciphers, such as Caesar, Simple Substitution,
Vigenere, and Enigma, can be represented as special cases of a block
cipher by setting the blocksize to 1. This should be done
in the engineInit() method.
The engineEncrypt() and engineDecrypt() methods also
handle padding of strings that are smaller than blocksize.
Details on the padding scheme are provided in Alphabet.
The class contains algorithm-independent implementations of the following methods:
engineEncrypt(String), engineDecrypt(String),
engineEncryptFile(String, String), and engineDecryptFile(String,String).
| Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
BlockCipher
public BlockCipher()