[prev in list] [next in list] [prev in thread] [next in thread] 

List:       botan-devel
Subject:    [Botan-devel] How to reset a pipe?
From:       lloyd () randombit ! net (Jack Lloyd)
Date:       2011-02-04 15:26:21
Message-ID: 20110204152621.GL7415 () randombit ! net
[Download RAW message or body]

Hi William,

What you need to do is capture the filter object as a
Keyed_Filter, which will let you reset the IV:

  Keyed_Filter* cipher_filter = get_cipher(...);
  Pipe pipe(cipher_filter);

  // later, need to resync
  cipher_filter->set_iv(...);

-Jack

On Tue, Feb 01, 2011 at 05:33:41PM -0800, William K. Foster wrote:
> Hello,
> 
> I have a Pipe created like this:
> 
>   new Pipe(get_cipher(_cipherSpec, _masterKey, _ivTCP, ENCRYPTION))
> 
> and another at the receiving end like this:
> 
>   new Pipe(get_cipher(_cipherSpec, _masterKey, _ivTCP, DECRYPTION))
> 
> And these are using a block cipher mode such as "Serpent/CTR-BE".
> 
> The question I have, is after using these two pipes for a bit, how can I
> reset them to their initial state for the purposes of the CTR-BE block
> cipher mode?
> 
> The reason I need to do this is that the encrytor can get out of sync with
> the decrypter due to a block not getting through, so I would like a way to
> reset both of them to ensure they are in sync again for the cipher mode.
> 
> Thanks.
> 
> -William

> _______________________________________________
> botan-devel mailing list
> botan-devel at randombit.net
> http://lists.randombit.net/mailman/listinfo/botan-devel



[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic