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!

Exception:javax.crypto.IllegalBlockSizeException

843811Oct 15 2008 — edited Oct 16 2008
Exception:javax.crypto.IllegalBlockSizeException: Data must not be longer than 117 bytes

i try to find solution for this problem from google and know this problem cause by following code
Cipher cipher = Cipher.getInstance("RSA/ECB/PKCS1Padding");
someone told me also PKCS1 padding is the modulus size in bytes less the PKCS1 overhead of 11 bytes,however RSA have 1024bit/128bytes,that is more than PKCS1 can support.

i found another example from internet use
Cipher cipher = Cipher.getInstance("XTEA/ECB/PKCS5Padding","BC");
for instead,that is provide by "The Bouncy Castle Crypto package ".i download jce-jdk13-141.jar and jce-ext-jdk13-141.jar and set classpath to C:\Program Files\Java\jdk1.6.0_06\jre\lib\ext

however compiler show "Exception:java.security.NoSuchProviderException: No such provider: BC"

Since i'm a newbie in java,so need your guide esp show me example code since i learning java from others java code.

what should i do now? what encryt mode i need to use and how to code in java. i appreciate your example.


Sincerely

ocibala
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Nov 13 2008
Added on Oct 15 2008
27 comments
6,645 views