Save This Page
Home » openjdk-7 » com.sun.crypto » provider » [javadoc | source]
com.sun.crypto.provider
final class: OutputFeedback [javadoc | source]
java.lang.Object
   com.sun.crypto.provider.FeedbackCipher
      com.sun.crypto.provider.OutputFeedback
This class represents ciphers in output-feedback (OFB) mode.

This mode is implemented independently of a particular cipher. Ciphers to which this mode should apply (e.g., DES) must be plugged-in using the constructor.

NOTE: This class does not deal with buffering or padding.

Fields inherited from com.sun.crypto.provider.FeedbackCipher:
embeddedCipher,  blockSize,  iv
Constructor:
 OutputFeedback(SymmetricCipher embeddedCipher,
    int numBytes) 
Method from com.sun.crypto.provider.OutputFeedback Summary:
decrypt,   encrypt,   getFeedback,   init,   reset,   restore,   save
Methods from com.sun.crypto.provider.FeedbackCipher:
decrypt,   decryptFinal,   encrypt,   encryptFinal,   getBlockSize,   getEmbeddedCipher,   getFeedback,   getIV,   init,   reset,   restore,   save
Methods from java.lang.Object:
clone,   equals,   finalize,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from com.sun.crypto.provider.OutputFeedback Detail:
  void decrypt(byte[] cipher,
    int cipherOffset,
    int cipherLen,
    byte[] plain,
    int plainOffset) 
    Performs decryption operation.

    The input cipher text cipher, starting at cipherOffset and ending at (cipherOffset + len - 1), is decrypted. The result is stored in plain, starting at plainOffset.

    It is the application's responsibility to make sure that cipherLen is a multiple of the stream unit size numBytes, as any excess bytes are ignored.

    It is also the application's responsibility to make sure that init has been called before this method is called. (This check is omitted here, to avoid double checking.)

  void encrypt(byte[] plain,
    int plainOffset,
    int plainLen,
    byte[] cipher,
    int cipherOffset) 
    Performs encryption operation.

    The input plain text plain, starting at plainOffset and ending at (plainOffset + len - 1), is encrypted. The result is stored in cipher, starting at cipherOffset.

    It is the application's responsibility to make sure that plainLen is a multiple of the stream unit size numBytes, as any excess bytes are ignored.

    It is also the application's responsibility to make sure that init has been called before this method is called. (This check is omitted here, to avoid double checking.)

 String getFeedback() 
    Gets the name of this feedback mode.
  void init(boolean decrypting,
    String algorithm,
    byte[] key,
    byte[] iv) throws InvalidKeyException 
    Initializes the cipher in the specified mode with the given key and iv.
  void reset() 
    Resets the iv to its original value. This is used when doFinal is called in the Cipher class, so that the cipher can be reused (with its original iv).
  void restore() 
    Restores the content of this cipher to the previous saved one.
  void save() 
    Save the current content of this cipher.