cryptix.security
Class CFB

java.lang.Object
  |
  +--cryptix.security.StreamCipher
        |
        +--cryptix.security.CFB
Direct Known Subclasses:
PGPCFB

public class CFB
extends StreamCipher

Implements a byte-based stream cipher using n-bit CFB with an n-bit-sized block cipher.

The full block size of the supplied cipher is used for the Cipher Feedback Mode. The bytes supplied are processed and returned immediately.

Copyright © 1997 Systemics Ltd on behalf of the Cryptix Development Team.
All rights reserved.

$Revision: 1.3 $

Since:
Cryptix 2.2
Author:
Systemics Ltd, David Hopwood
See Also:
cryptix.provider.mode.CFB

Field Summary
protected  int blocksize
          Deprecated.  
protected  int bytesLeft
          Deprecated.  
protected  BlockCipher cipher
          Deprecated.  
protected  byte[] iv
          Deprecated.  
protected  byte[] k
          Deprecated.  
 
Constructor Summary
CFB(BlockCipher cipher0)
          Deprecated. This implements variant B: a unique IV for the feedback register must be provided as the first blockLength characters in the stream.
 
Method Summary
 void decrypt(byte[] in, int in_offset, byte[] out, int out_offset, int length)
          Deprecated. This function decrypts a block of data.
 void encrypt(byte[] in, int in_offset, byte[] out, int out_offset, int length)
          Deprecated. This function encrypts a block of data.
 int keyLength()
          Deprecated. This function returns the length of the key for this cipher.
 void next_block()
          Deprecated.  
 void reset()
          Deprecated. Reset the stream and the IV.
 
Methods inherited from class cryptix.security.StreamCipher
decrypt, decrypt, encrypt, encrypt
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

cipher

protected BlockCipher cipher
Deprecated. 

blocksize

protected int blocksize
Deprecated. 

iv

protected byte[] iv
Deprecated. 

k

protected byte[] k
Deprecated. 

bytesLeft

protected int bytesLeft
Deprecated. 
Constructor Detail

CFB

public CFB(BlockCipher cipher0)
Deprecated. 
This implements variant B: a unique IV for the feedback register must be provided as the first blockLength characters in the stream. If the IV is not unique, the plaintext can be recovered.
Parameters:
cipher0 - the block cipher to use
Method Detail

keyLength

public int keyLength()
Deprecated. 
Description copied from class: StreamCipher
This function returns the length of the key for this cipher.
Overrides:
keyLength in class StreamCipher
Following copied from class: cryptix.security.StreamCipher
Returns:
the length (in bytes) of the key used with this cipher

next_block

public void next_block()
Deprecated. 

reset

public void reset()
Deprecated. 
Reset the stream and the IV. Note that a new IV is now needed as described above.

encrypt

public void encrypt(byte[] in,
                    int in_offset,
                    byte[] out,
                    int out_offset,
                    int length)
Deprecated. 
This function encrypts a block of data. The contents of the array in remain unchanged, with the result stored in the array out. The arrays can, however, be the same.
Overrides:
encrypt in class StreamCipher
Parameters:
in - the plain text to be encrypted.
in_offset - the offset within the in buffer.
out - where the encrypted cipher text will be stored.
out_offset - the offset within the out buffer.
length - the length to encrypt.

decrypt

public void decrypt(byte[] in,
                    int in_offset,
                    byte[] out,
                    int out_offset,
                    int length)
Deprecated. 
This function decrypts a block of data. The contents of the array in will not be changed, but will instead store the result in the array out. The arrays can, however, be the same.
Overrides:
decrypt in class StreamCipher
Parameters:
in - the cipher text to be decrypted.
in_offset - the offset within the in buffer.
out - where the decrypted plain text will be stored.
out_offset - the offset within the out buffer.
length - the length to decrypt.