1 29 package Acme.Crypto; 30 31 import java.io.*; 32 33 47 public class NullCipher extends BlockCipher 48 { 49 50 public NullCipher() 52 { 53 super( 0, 8 ); 54 } 55 56 57 59 public void setKey( byte[] key ) 61 { 62 throw new InternalError ( "NullCipher does not need a key" ); 63 } 64 65 66 68 public void encrypt( byte[] clearText, int clearOff, byte[] cipherText, int cipherOff ) 70 { 71 copyBlock( clearText, clearOff, cipherText, cipherOff, blockSize ); 72 } 73 74 public void decrypt( byte[] cipherText, int cipherOff, byte[] clearText, int clearOff ) 76 { 77 copyBlock( cipherText, cipherOff, clearText, clearOff, blockSize ); 78 } 79 80 } 81 | Popular Tags |