My Oracle Support Banner

OC4J Client throws javax.crypto.IllegalBlockSizeException After a New Security Provider is Inserted (Doc ID 1142357.1)

Last updated on MARCH 30, 2018

Applies to:

Oracle Containers for J2EE - Version to [Release AS10gR3]
Information in this document applies to any platform.


In OC4J 10.1.3 based environments, when a client tries to establish connections with OC4J client side, and an external security provider is inserted, then the client side is unable to talk with the OC4J server process, and it reports following kind of exceptions:

ExchangingEncryptor.getDecryptedValue() THROW
javax.crypto.IllegalBlockSizeException: Input length must be multiple of 8
when decrypting with padded cipher is showed on oc4j


javax.naming.CommunicationException: <no message>

and inner exception is

caused by: Illegal key size or default parameters [Root exception is$EncryptionException]
Thor.API.Security.LoginHandler.oracleLoginHandler.handleOracleClientLogin(Unknown Source)
at Thor.API.Security.LoginHandler.oracleLoginHandler.login(Unknown Source)
at Thor.API.Security.ClientLoginUtility.login(Unknown Source)
at Thor.API.tcUtilityFactory.<init>(Unknown Source)
at servlets.ServletPrinClose.doGet(
at javax.servlet.http.HttpServlet.service(
at javax.servlet.http.HttpServlet.service(

The exceptions appear after the OC4J client application executes method call to add an extra security provider.

Security.insertProviderAt(new org.bouncycastle.jce.provider.BouncyCastleProvider(), 3);

In this specific scenario the client side is JBoss running a web application that interacts as client of OIM that runs in remote OC4J, but the problem could reproduce as well for other kind of OC4J clients, such as fat applications or other application servers.


The exception are thrown only if the client side inserts a new security provider for example as follows

Security.insertProviderAt(new org.bouncycastle.jce.provider.BouncyCastleProvider(), 3);



To view full details, sign in with your My Oracle Support account.

Don't have a My Oracle Support account? Click to get started!

My Oracle Support provides customers with access to over a million knowledge articles and a vibrant support community of peers and Oracle experts.