You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@camel.apache.org by Christian Müller <ch...@gmail.com> on 2010/06/15 23:48:29 UTC

[DISCUSS] performance improvement for camel-xmlsecurity

Hello list!

Each time the marshal/unmarshal method of
'org.apache.camel.dataformat.xmlsecurity.XMLSecurityDataFormat' [1] is
called, the key encryption key and the data encryption key (only for
marshaling) will be created. I think these 'java.security.Key' objects could
be generated once and reused by subsequent calls. I made a little test which
marshals a xml document 1000 times. Without caching of the keys, the test
needs 2200 ms. With caching, the test needs only 800 ms. What do you think?

Christian

Re: [DISCUSS] performance improvement for camel-xmlsecurity

Posted by Hadrian Zbarcea <hz...@gmail.com>.
I'd have to check the details, but I think the reason a symmetric key is generated for each message is that if one key is compromised (via brute force or whatnot) it cannot be used to decrypt other messages as well. So I believe this is actually a feature.

Hadrian

On Jun 15, 2010, at 5:48 PM, Christian Müller wrote:

> Hello list!
> 
> Each time the marshal/unmarshal method of
> 'org.apache.camel.dataformat.xmlsecurity.XMLSecurityDataFormat' [1] is
> called, the key encryption key and the data encryption key (only for
> marshaling) will be created. I think these 'java.security.Key' objects could
> be generated once and reused by subsequent calls. I made a little test which
> marshals a xml document 1000 times. Without caching of the keys, the test
> needs 2200 ms. With caching, the test needs only 800 ms. What do you think?
> 
> Christian


Re: [DISCUSS] performance improvement for camel-xmlsecurity

Posted by Christian Müller <ch...@gmail.com>.
Sorry, I forgot to add the link...

[1]
http://svn.apache.org/viewvc/camel/trunk/components/camel-xmlsecurity/src/main/java/org/apache/camel/dataformat/xmlsecurity/XMLSecurityDataFormat.java?view=markup

Christian