[Botan-devel] How to reset a pipe?

Jack Lloyd lloyd at randombit.net
Fri Feb 4 10:26:21 EST 2011

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


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

More information about the botan-devel mailing list