Forum: JRuby PKCS_OAEP_PADDING issue

99eba006c2238e04e98e153106604be9?d=identicon&s=25 Derry O' Sullivan (Guest)
on 2014-07-15 17:43
(Received via mailing list)

I'm using OAEP padding as part of some decryption/encryption steps -
specifically using: /ECB/OAEPWithSHA1AndMGF1Padding

Testing encryption/decryption via standard ruby 1.9.3 and openssl 0.9.8e
works as expected. We don't explicitly name the above padding - we pass
OpenSSL::PKey::RSA::PKCS1_OAEP_PADDING (padding parameter 4) to
RSA decryption methods and it works correctly.

When repeating the same test via JRuby 1.7.11 + 1.9.3, we saw padding
failures and after some debugging, linked it to the fact that the
JRuby padding associated with padding parameter 4 (
is actually the same algorithm but with MD5 vs SHA1 as the digest

Modifying that file and changing MD5->SHA1 fixed our issues. Is there a
reason why this is the case? I'm trying to understand why the behaviour
different between standard ruby and JRuby.

Thanks in advance,

Please log in before posting. Registration is free and takes only a minute.
Existing account

NEW: Do you have a Google/GoogleMail, Yahoo or Facebook account? No registration required!
Log in with Google account | Log in with Yahoo account | Log in with Facebook account
No account? Register here.