Cryptography Tutorials - Herong's Tutorial Examples - Version 5.32, by Dr. Herong Yang
CFB and OFB Stream Ciphers Implemented in JCE
This section describes how DES CFB and OFB (Output FeedBack) stream ciphers are implemented in the JDK JCE package.
Sun has implemented stream cipher modes for both CFB and OFB modes, but with restrictions that the feedback sizes must be multiples of 8 bits. To use CFB or OFB in a stream cipher mode, you need to specify the feedback size in bits right after the mode name when calling Cipher.getInstance(algorithm) to create a cipher object like:
Cipher cObj1 = Cipher.getInstance("DES/CFB8/NoPadding"); Cipher cObj2 = Cipher.getInstance("DES/CFB16/NoPadding"); Cipher cObj3 = Cipher.getInstance("DES/CFB24/NoPadding"); ... Cipher cObja = Cipher.getInstance("DES/OFB8/NoPadding"); Cipher cObjb = Cipher.getInstance("DES/OFB16/NoPadding"); Cipher cObjc = Cipher.getInstance("DES/OFB24/NoPadding"); ...
Table of Contents