On Sun, Feb 02, 2003 at 05:32:07PM -0500, Jonathan Brandmeyer wrote:
> On Sun, 2003-02-02 at 15:11, gl wrote:
> > Another question - it seems that I can _de_crypt with
> > CTR_MODE<>::_En_cryption objects, just as you could (well, needed to) in
> > 4.2.  Is this algorithm dependent or mode dependent?  I'm trying to reduce
> > code size for a self-extractor, so sharing my encryption class code is
> > desirable.
> 
> I am still learning the API for this library, but ifI recall the theory
> correctly, CTR, OFB, and CFB all use the underlying block cipher in
> encyrption mode for both encryption and decryption.

That's true, but it doesn't answer gl's question. In CTR and OFB modes, 
encryption and decryption are exactly the same operation, because they 
both generate a keystream that's independent of the plaintext, and then 
XOR the plaintext with it. In CFB mode, encryption and decryption are 
different, but they both only use the block cipher's encrypt operation.

Reply via email to