From: Hugh Sasse Staff Elec Eng Date: 2003-08-08T00:11:34+09:00 Subject: Re: More on DRB & OpenSSL On Thu, 7 Aug 2003, Brian Candler wrote: > On Thu, Aug 07, 2003 at 07:58:59PM +0900, Hugh Sasse Staff Elec Eng wrote: > > This only works on one machine, and leaves the secret lying around > > in memory (@secret). You can't really pass this object over the net > > without exposing the secret. This is the sort of subtlety that > > catches me out every time! > > I think you may have misunderstood the purpose of this class. > > If you are working across two machines, you instantiate a separate copy of > SecureMarshall (with the same shared secret) on each one. You use it to > encode objects, which you squirt across the network, and decode at the other > end. The SecureMarshall object itself is not sent across the network! OK, right, I'm doing much the same, except where the data cannot be shared, because the client machines compute it. That is why they are connected, so they can do their own computation. Then I make the data I send (in the clear) part of the hashing process. [...] > Sure the secret is in memory in @secret. You can't avoid that - well, you > can read it off disk each time you use it instead, but that's no more This is the problem really. I've not surmounted this subtlety yet. > secure; in fact you will leave lots of objects in memory which contain the > secret, until the garbage collector picks them up. > > Regards, > > Brian. > > Thank you, Hugh