gnu.crypto.mode

Class CFB

public class CFB extends BaseMode

The cipher feedback mode. CFB mode is a stream mode that operates on s bit blocks, where 1 <= s <= b, if b is the underlying cipher's block size. Encryption is:
   I[1] = IV
   I[j] = LSB(b-s, I[j-1]) | C[j-1]   for j = 2...n
   O[j] = CIPH(K, I[j])               for j = 1,2...n
   C[j] = P[j] ^ MSB(s, O[j])         for j = 1,2...n

And decryption is:

   I[1] = IV
   I[j] = LSB(b-s, I[j-1]) | C[j-1]   for j = 2...n
   O[j] = CIPH(K, I[j])               for j = 1,2...n
   P[j] = C[j] ^ MSB(s, O[j])         for j = 1,2...n

CFB mode requires an initialization vector, which need not be kept secret.

References:

  1. Bruce Schneier, Applied Cryptography: Protocols, Algorithms, and Source Code in C, Second Edition. (1996 John Wiley and Sons) ISBN 0-471-11709-9.
  2. Recommendation for Block Cipher Modes of Operation Methods and Techniques, Morris Dworkin.

Version: $Revision: 1.2 $

Constructor Summary
CFB(IBlockCipher underlyingCipher, int cipherBlockSize)
Package-private constructor for the factory class.
Method Summary
Objectclone()
voiddecryptBlock(byte[] in, int inOffset, byte[] out, int outOffset)
voidencryptBlock(byte[] in, int inOffset, byte[] out, int outOffset)
voidsetup()
voidteardown()

Constructor Detail

CFB

CFB(IBlockCipher underlyingCipher, int cipherBlockSize)
Package-private constructor for the factory class.

Parameters: underlyingCipher The cipher implementation. cipherBlockSize The cipher's block size.

Method Detail

clone

public Object clone()

decryptBlock

public void decryptBlock(byte[] in, int inOffset, byte[] out, int outOffset)

encryptBlock

public void encryptBlock(byte[] in, int inOffset, byte[] out, int outOffset)

setup

public void setup()

teardown

public void teardown()
Copyright © 2001, 2002, 2003 Free Software Foundation, Inc. All Rights Reserved.