JDK-5056438 : Cipher.init throws exception if Cipher is generated using RC4 as algorithm
  • Type: Bug
  • Component: security-libs
  • Sub-Component: javax.crypto
  • Affected Version: 5.0
  • Priority: P4
  • Status: Closed
  • Resolution: Fixed
  • OS: generic,windows_xp
  • CPU: generic,x86
  • Submitted: 2004-06-02
  • Updated: 2006-10-10
  • Resolved: 2005-02-18
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
Other JDK 6
5.0u7Fixed 6 betaFixed
Related Reports
Duplicate :  
Description
Cipher.init(int opmode, Key key) throws exception when Cipher is generated using RC4 as algorithm, but no exception were thrown if algorithm is ARCFOUR. 

The following exception is generated by the test program attached (SQE ws: .../security/src/Manual/PKCS11/TestSunJCE.java):

--- START  ---
... TESTING: Algorithm = ARCFOUR : KeyLength = 128 ...
Provider: SunJCE version 1.5
IV: null
=== STATUS: PASS
... TESTING: Algorithm = RC4 : KeyLength = 128 ...
Provider: SunJCE version 1.5
IV: null
=== STATUS: FAIL (with exception)
java.security.InvalidKeyException: Illegal key size or default parameters
	at javax.crypto.Cipher.a(DashoA12275)
	at javax.crypto.Cipher.init(DashoA12275)
	at javax.crypto.Cipher.init(DashoA12275)
	at TestSunJCE.testSecretKey(TestSunJCE.java:213)
	at TestSunJCE.main(TestSunJCE.java:480)
--- END: ---
STATUS: FAIL

Comments
CONVERTED DATA BugTraq+ Release Management Values COMMIT TO FIX: dragon
01-09-2004

EVALUATION ###@###.### 2004-06-03 will fix. ###@###.### 2004-06-08 This is due to the aliasing of RC4 and ARCFOUR. The generated Key always has ARCFOUR but the Cipher instance is requested using "RC4", so the crypto permission check failed due to different algorithm names.
01-09-2004