[Shib-Users] How to change EncryptionMethod

44 views
Skip to first unread message

Ramm

unread,
Nov 5, 2009, 4:39:37 PM11/5/09
to shibbole...@internet2.edu

Hi

Want to change encryption method from aes128-cbc to aes256-cbc and
rsa-oaep-mgf1p to rsa-1_5, how can I do that. Just say metadata file where
we give the certs !

Current
-----------
<EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#aes128-cbc"
xmlns:xenc="http://www.w3.org/2001/04/xmlenc#" />
<KeyInfo xmlns:ds="http://www.w3.org/2000/09/xmldsig#">
<EncryptedKey Id="_b6582f1623dd7fd6724cf448d3a66509"
xmlns:xenc="http://www.w3.org/2001/04/xmlenc#">
<EncryptionMethod
Algorithm="http://www.w3.org/2001/04/xmlenc#rsa-oaep-mgf1p"
xmlns:xenc="http://www.w3.org/2001/04/xmlenc#">

Desired
-------
<EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#aes256-cbc"
xmlns="http://www.w3.org/2001/04/xmlenc#" />
<KeyInfo xmlns="http://www.w3.org/2000/09/xmldsig#">
<EncryptedKey xmlns="http://www.w3.org/2001/04/xmlenc#">
<EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#rsa-1_5" />

Thx
Ram
--
View this message in context: http://n2.nabble.com/How-to-change-EncryptionMethod-tp3955257p3955257.html
Sent from the Shibboleth - Users mailing list archive at Nabble.com.

Brent Putman

unread,
Nov 5, 2009, 5:23:04 PM11/5/09
to shibbole...@internet2.edu
Unfortunately you can't do it easily. We don't currently make use of
the KeyDescriptor/EncryptionMethod info in SAML metadata at all. We
have intention to do so, but it hasn't been high on the priority list.
OpenSAML defaults to AES-128 for the data encryption (for compatibilty
reasons with older versions of OpenSSL), and when transporting an
encrypted AES key, defaults to RSA-OAEP (the latter b/c it's recommended
by the XML Encryption spec for wrapping AES keys).

To change those defaults, currently you'd have to write a little Java
extension code to the IdP config tooling and install it. If you care
enough about it to go that route, I can provide more detailed info on
request.

Also, you can only easily change the global defaults that way. We don't
currently have any way to configure crypto settings on a
relying-party-specific basis. That is a possible feature for a future
release.

--Brent

Ramm

unread,
Nov 5, 2009, 6:28:58 PM11/5/09
to shibbole...@internet2.edu
I really appreciate your prompt reply with exact details. I would like extend my IDP to use aes256 and willing work that extra Java code to idp config tolling. Please advice !  thank you very much

Ramm

View this message in context: Re: [Shib-Users] How to change EncryptionMethod

Brent Putman

unread,
Nov 5, 2009, 8:23:36 PM11/5/09
to shibbole...@internet2.edu
Since you are not the first to ask for this, I decided to just code this
up as a little Maven extension project for the IdP. The actual
functional code is only a few lines. You can find both source and
binary tarballs and zips here:

https://www.middleware.georgetown.edu/idp-crypto-config/

Be sure to see the install docs in doc/INSTALL.txt

Right now, it just hardcodes those 2 overrides that you asked for, with
those values. Pretty trivial to change the source to use different
values, or add other overrides. If this is valuable enough to enough
people, we can make it an official IdP extension and also could look at
making it more generalizable/configurable, perhaps with some sort of
declarative config, either in the bean XML declaration or in a
properties file or something.

The intention at the OpenSAML library level is to eventually have such a
declarative config mechanism, but we're not there yet.

--Brent


Ramm wrote:
> I really appreciate your prompt reply with exact details. I would like
> extend my IDP to use aes256 and willing work that extra Java code to
> idp config tolling. Please advice ! thank you very much
>
> Ramm
>
> On Thu, Nov 5, 2009 at 2:23 PM, Brent Putman [via Shibboleth] <[hidden
> email]

> <http://n2.nabble.com/user/SendEmail.jtp?type=node&node=3955773&i=0>>

Scott Cantor

unread,
Nov 5, 2009, 8:31:06 PM11/5/09
to shibbole...@internet2.edu
Brent Putman wrote on 2009-11-05:
> Unfortunately you can't do it easily. We don't currently make use of
> the KeyDescriptor/EncryptionMethod info in SAML metadata at all. We
> have intention to do so, but it hasn't been high on the priority list.
> OpenSAML defaults to AES-128 for the data encryption (for compatibilty
> reasons with older versions of OpenSSL), and when transporting an
> encrypted AES key, defaults to RSA-OAEP (the latter b/c it's recommended
> by the XML Encryption spec for wrapping AES keys).

Any OpenSSL that has AES128 has all of them, so if that was the concern, you
needn't worry about it.

However, I believe recent work suggests AES128 is the strongest of the
ciphers because of the fewer rounds used with AES256. So it's probably a
good default.

The algorithm we avoided for OpenSSL reasons was SHA256 vs. SHA1. You may be
confusing the two, Brent.

-- Scott


Brent Putman

unread,
Nov 6, 2009, 12:12:18 AM11/6/09
to shibbole...@internet2.edu

Scott Cantor wrote:
> However, I believe recent work suggests AES128 is the strongest of the
> ciphers because of the fewer rounds used with AES256. So it's probably a
> good default.
>

Hadn't heard that. Good to know, I'll have to go read up on it.


> The algorithm we avoided for OpenSSL reasons was SHA256 vs. SHA1. You may be
> confusing the two, Brent.
>


Yep, you're right, the OpenSSL issue I was remembering was with the
signing Reference digest algorithm.

We did change the Java encryption default from AES-256 to AES-128 in
java-xmltooling r472, Dec 5, 2007. I knew I wasn't mis-remembering
that! I was however mis-remembering the reason: in order to use 256
bit keys, you have to install the JCE unlimited strength jurisdiction
policy files (or at least at that time you had to, not sure about now).
That means mucking with your JRE, which we didn't want to make a default
requirement.

https://mail.internet2.edu/wws/arc/shibboleth-dev/2007-12/msg00044.html


So, my apologies for maligning OpenSSL! Poor thing. ;-)


Ramamohan Rao Kommineni

unread,
Nov 6, 2009, 10:28:29 AM11/6/09
to shibbole...@internet2.edu
thank you very much Brent. I will go ahead try out and let you.
Reply all
Reply to author
Forward
0 new messages