KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > ch > ethz > ssh2 > crypto > cipher > NullCipher


1 package ch.ethz.ssh2.crypto.cipher;
2
3 /**
4  * NullCipher.
5  *
6  * @author Christian Plattner, plattner@inf.ethz.ch
7  * @version $Id: NullCipher.java,v 1.3 2005/12/07 10:25:48 cplattne Exp $
8  */

9 public class NullCipher implements BlockCipher
10 {
11     private int blockSize = 8;
12     
13     public NullCipher()
14     {
15     }
16
17     public NullCipher(int blockSize)
18     {
19         this.blockSize = blockSize;
20     }
21     
22     public void init(boolean forEncryption, byte[] key)
23     {
24     }
25
26     public int getBlockSize()
27     {
28         return blockSize;
29     }
30
31     public void transformBlock(byte[] src, int srcoff, byte[] dst, int dstoff)
32     {
33         System.arraycopy(src, srcoff, dst, dstoff, blockSize);
34     }
35 }
36
Popular Tags