-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA512 On 5/7/14, 2:21 AM, [email protected] wrote: > I think that the java implementations implemented the spec and > everything is ok from that POV. > > These implementations are not broken.
The JOSE Java implementations did not implement the spec, though. draft-ietf-jose-json-web-algorithms ยง 4.3 clearly states the hash and mask generation functions are to use the same algorithm -- SHA-1 (and MGF1 with SHA-1) in the case of "RSA-OAEP", and SHA-256 (and MGF1 with SHA-256) in the case of "RSA-OAEP-256". > > > > One could argue that when we replace SHA-1 by SHA-256 in one place > then we might consider to replace it in the padding too. That is exactly what draft-ietf-jose-json-web-algorithms specified. > > My feeling is that using sha-256 for the padding does not give us > more security. YMMW > That is a separate debate, I think. The prevailing opinion (at least around the IETF) is "don't mix the algorithms". - -- - - m&m Matt Miller < [email protected] > Cisco Systems, Inc. > > > > > *From:*jose [mailto:[email protected]] *On Behalf Of *Brian > Campbell *Sent:* Wednesday, May 07, 2014 6:54 AM *To:* Matt Miller > *Cc:* Antonio Sanso; [email protected] *Subject:* Re: [jose] > RSA-OAEP-256 Example > > > > Thanks Matt. > > That is why I was looking for someone to verify using a different > platform. Though I was hoping it'd just work. > > Matt, can you try decrypting this one by chance? Using the same > key. I was more explicit with the parameters and, I think, MGF1 > should be using SHA-256 now too. > > > eyJhbGciOiJSU0EtT0FFUC0yNTYiLCJlbmMiOiJBMTI4Q0JDLUhTMjU2In0.fL5IL5cMCjjU9G9_ZjsD2XO0HIwTOwbVwulcZVw31_rx2qTcHzbYhIvrvbcVLTfJzn8xbQ3UEL442ZgZ1PcFYKENYePXiEyvYxPN8dmvj_OfLSJDEqR6kvwOb6nghGtxfzdB_VRvFt2eehbCA3gWpiOYHHvSTFdBPGx2KZHQisLz3oZR8EWiZ1woEpHy8a7FoQ2zzuDlZEJQOUrh09b_EJxmcE2jL6wmEtgabyxy3VgWg3GqSPUISlJZV9HThuVJezzktJdpntRDnAPUqjc8IwByGpMleIQcPuBUseRRPr_OsroOJ6eTl5DuFCmBOKb-eNNw5v-GEcVYr1w7X9oXoA.0frdIwx8P8UAzh1s9_PgOA.RAzILH0xfs0yxzML1CzzGExCfE2_wzWKs0FVuXfM8R5H68yTqTbqIqRCp2feAH5GSvluzmztk2_CkGNSjAyoaw.4nMUXOgmgWvM-08tIZ-h5w > > > > > On Tue, May 6, 2014 at 8:39 PM, Matt Miller <[email protected] > <mailto:[email protected]>> wrote: > > Short answer: You are all equally broken -- except from a certain > point of view d-: > > Long answer: The code I have is based on OpenSSL, which is > hard-coded to use SHA1 for the hash and mask generation (boo!), > which means one has to implement OAEP-SHA256 from scratch > (hiss!!). > > When I implemented it per RFC 3447 and > draft-ietf-jose-json-web-algorithms-26#section-4.3, I could not > decrypt the provided results. When I hard-coded MGF1 to use > "SHA1", I could decrypt provided results. A search through > BouncyCastle's code shows that > "RSA/ECB/OAEPWithSHA-256AndMGF1Padding" uses a Hash function of > SHA-256 generate the lHash but its MGF1 uses a "SHA-1". Further > evidence is shown with how [FORGE] can be made to work with Java > (search their homepage for "Compatible with Java's > RSA/ECB/OAEPWithSHA-256AndMGF1Padding"). > > Reconciling all of this with > draft-ietf-jose-json-web-algorithms#appendix-A.2 does not look to > be very straight-forward. It appears that the JCA identifier is > meant to be "MGF1 with SHA1"; that ought to be explicitly noted. > The XMLENC reference is arguably incomplete, since > "http://www.w3.org/2009/xmlenc11#rsa-oaep" defaults to > "http://www.w3.org/2009/xmlenc11#mgf1sha1" (MGF1 with SHA1); this > can probably be addressed by explicitly stating the mask > generation function is "http://www.w3.org/2009/xmlenc11#mgf1sha256" > (MGF1 with SHA-256). > > > > > -----BEGIN PGP SIGNATURE----- Version: GnuPG/MacGPG2 v2.0.22 (Darwin) Comment: GPGTools - https://gpgtools.org Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCgAGBQJTaih6AAoJEDWi+S0W7cO1dqMIAIgB0qPxKOkFRQ1w16tiAW0P KZ3bFZ0LX5RnaiL2t0bAfMo4ivSdawRmabLmNVuOrTbKZ5cPpdI9jSYqzAs/3SS6 oLDnFFB6PHCz8nBWRvEtwxGII3t6e3LEoqW7ndcvO/1Le77uy+zAB6Xs0xh1mxWY NEHpVQsKs2Ytjk9ZxcqdUjivZhU17PPmam2hu2xYcZLxI8eHav8uzQJWCYTzg4my uVy8JTbQ6odtx7hiJSpTiY6cYOaa2TcRbroQNKmOsHIQ3em86Esme4cOlPiJ6vds VbBHZXh3NqSjWcmAc5ysTmP7j9ATIn1+ZWlXAZEXAi3mBKme+VGGraO079bhR7Y= =zfUl -----END PGP SIGNATURE----- _______________________________________________ jose mailing list [email protected] https://www.ietf.org/mailman/listinfo/jose
