| 1 29 package Acme.Crypto; 30 31 import java.io.*; 32 33 45 public abstract class BlockCipher extends Cipher 46 { 47 48 public BlockCipher( int keySize, int blockSize ) 50 { 51 super( keySize ); 52 this.blockSize = blockSize; 53 } 54 55 public int blockSize; 57 58 public int blockSize() 60 { 61 return blockSize; 62 } 63 64 public abstract void encrypt( byte[] clearText, int clearOff, byte[] cipherText, int cipherOff ); 66 67 public abstract void decrypt( byte[] cipherText, int cipherOff, byte[] clearText, int clearOff ); 69 70 public void encrypt( byte[] clearText, byte[] cipherText ) 72 { 73 encrypt( clearText, 0, cipherText, 0 ); 74 } 75 76 public void decrypt( byte[] cipherText, byte[] clearText ) 78 { 79 decrypt( cipherText, 0, clearText, 0 ); 80 } 81 82 } 83 | Popular Tags |