RsaEncryptionTest.testExceptionPKCS1

17 views
Skip to first unread message

calvin.raison

unread,
Nov 11, 2018, 6:21:11 PM11/11/18
to wycheproof-users
Hi Wycheproof team,

I have a question about the RsaEncryptionTest.testExceptionPKCS1 test.

Some of the test cases in this test perform an RSA encryption with no padding (using the "RSA/ECB/NOPADDING" algorithm string) and plaintext that is less than a whole block. (e.g. 127 bytes instead of 128 bytes, see comment: "the decrypted padded plaintext is shorter than RSA key") The test expects this encryption to succeed and uses the ciphertext later in the test.

As there is no padding, doesn’t the plaintext for this encryption have to be an exact block?

Regards,

Calvin.

Daniel Bleichenbacher

unread,
Nov 12, 2018, 7:28:53 AM11/12/18
to calvin.raison, wycheproof-users

--
You received this message because you are subscribed to the Google Groups "wycheproof-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to wycheproof-users+unsubscribe@googlegroups.com.
To post to this group, send email to wycheproof-users@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/wycheproof-users/ccdbf6f5-ec7d-405c-a91f-96e19408e8b0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Yes, this is wrong. The padded plaintext should simply have some leading 0's.
I'm going to convert the test vectors into a JSON file, so that the same test can also be
run against non-Java libraries.

calvin.raison

unread,
Nov 12, 2018, 5:24:31 PM11/12/18
to wycheproof-users
Thanks for the prompt response.


On Monday, 12 November 2018 22:28:53 UTC+10, bleichen wrote:
On Mon, Nov 12, 2018 at 12:21 AM, calvin.raison <calvin...@rsa.com> wrote:
Hi Wycheproof team,

I have a question about the RsaEncryptionTest.testExceptionPKCS1 test.

Some of the test cases in this test perform an RSA encryption with no padding (using the "RSA/ECB/NOPADDING" algorithm string) and plaintext that is less than a whole block. (e.g. 127 bytes instead of 128 bytes, see comment: "the decrypted padded plaintext is shorter than RSA key") The test expects this encryption to succeed and uses the ciphertext later in the test.

As there is no padding, doesn’t the plaintext for this encryption have to be an exact block?

Regards,

Calvin.

--
You received this message because you are subscribed to the Google Groups "wycheproof-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to wycheproof-use...@googlegroups.com.
To post to this group, send email to wychepro...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages