Skip to Main Content

Java Security

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

BC:.DataLengthException: input too large for RSA cipher.

843810Jun 21 2004 — edited Jun 22 2004
I have a bloc of 128 bytes and I want to encrypt it with a RSA 's public key (1024 bit).
I use Bouncy Castle for that. But depending on the generated key sometimes I have this exception:

org.bouncycastle.crypto.DataLengthException: input too large for RSA cipher.

I read in the API java 1.4 taht for RSA ( the plain text muxt be 128-11 bytes) But what I don't understand is that if it is true why It accepts a 128 bytes as input from times to times.

Thank you for your help
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jul 20 2004
Added on Jun 21 2004
10 comments
2,901 views