Thanks, I'll look into that, particularly if I can't come up with a way to 
avoid a restart entirely. 

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Richard Koenning
Sent: Thursday, May 31, 2007 5:54 AM
To: openssl-users@openssl.org
Subject: Re: Saving (and restoring) cipher context

Jim Wong wrote:
> 
> I'm developing an application in which we're using AES to encrypt 
> files as they're transferred from another system and saved to disk.  
> We'd like to provide the ability for the application to resume a 
> transfer that was interrupted mid-stream, but the encryption throws a 
> bit of a wrench into things because of the state associated with the 
> encryption context.
> 
> Is there a safe, supported way to stash the context somewhere on disk 
> so that encryption can be resumed where it left off when the file 
> transfer starts up again?  We're currently looking at the EVP 
> functions; would we have to drop down to the lower-level, 
> algorithm-specific routines to do this right?

If you use the CBC or the CFB cipher mode, you can use the last cipher block 
written to the disk as IV (that means, before the restart point) for a call to 
EVP_EncryptInit at the restart of data transmission. Another possibility would 
be to implement counter mode on top of ECB, here should a restart also be 
simple.
Ciao,
Richard Könning
--
Dr. Richard W. Könning
Fujitsu Siemens Computers GmbH
______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
User Support Mailing List                    openssl-users@openssl.org
Automated List Manager                           [EMAIL PROTECTED]
______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
User Support Mailing List                    openssl-users@openssl.org
Automated List Manager                           [EMAIL PROTECTED]

Reply via email to