All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class cryptix.security.CFB

java.lang.Object
   |
   +----cryptix.security.StreamCipher
           |
           +----cryptix.security.CFB

public class CFB
extends StreamCipher
Note: CFB is deprecated.

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 $

Author:
Systemics Ltd, David Hopwood
See Also:
CFB

Variable Index

 o blocksize
 o bytesLeft
 o cipher
 o iv
 o k

Constructor Index

 o CFB(BlockCipher)
This implements variant B: a unique IV for the feedback register must be provided as the first blockLength characters in the stream.

Method Index

 o decrypt(byte[], int, byte[], int, int)
This function decrypts a block of data.
 o encrypt(byte[], int, byte[], int, int)
This function encrypts a block of data.
 o keyLength()
This function returns the length of the key for this cipher.
 o next_block()
 o reset()
Reset the stream and the IV.

Variables

 o cipher
 protected BlockCipher cipher
 o blocksize
 protected int blocksize
 o iv
 protected byte iv[]
 o k
 protected byte k[]
 o bytesLeft
 protected int bytesLeft

Constructors

 o CFB
 public CFB(BlockCipher cipher0)
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

Methods

 o keyLength
 public int keyLength()
This function returns the length of the key for this cipher.

Overrides:
keyLength in class StreamCipher
 o next_block
 public void next_block()
 o reset
 public void reset()
Reset the stream and the IV. Note that a new IV is now needed as described above.

 o encrypt
 public void encrypt(byte in[],
                     int in_offset,
                     byte out[],
                     int out_offset,
                     int length)
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.

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.
Overrides:
encrypt in class StreamCipher
 o decrypt
 public void decrypt(byte in[],
                     int in_offset,
                     byte out[],
                     int out_offset,
                     int length)
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.

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.
Overrides:
decrypt in class StreamCipher

All Packages  Class Hierarchy  This Package  Previous  Next  Index