From: Robert R. <rr...@gs...> - 2006-10-22 09:48:45
|
Hey Folks! I'm trying to upgrade the JVM from 1.4.1. to 1.5.0 for an internal project, and am running into a problem. Every time our Cryptix wrapper class gets invoked, i get this following exception (this time i'm running from Junit) EncryptionFailureException(0) Unable to initialize cryptography provider, {}, java.security.NoSuchAlgorithmException:algorithm ARCFOUR is not available from provider Cryptix at com.wendys.common.crypto.Crypto.<init>(Crypto.java:56) at com.wendys.common.crypto.CryptoTest.testEncryptEric(CryptoTest.java:36) I've added the following line to the java.security file: # # List of providers and their preference orders (see above): # security.provider.1=sun.security.provider.Sun security.provider.2=cryptix.provider.Cryptix security.provider.3=sun.security.rsa.SunRsaSign security.provider.4=com.sun.net.ssl.internal.ssl.Provider security.provider.5=com.sun.crypto.provider.SunJCE security.provider.6=sun.security.jgss.SunProvider security.provider.7=com.sun.security.sasl.Provider And out of desperation i've copied all of the jars included with the latest distribution of cryptix to the jre\lib\ext directory of my JDK installation. None of this helps. The odd thing is, if you look at the constructor below, we're asking for cipher 'RC4', but it comes back 'ARCFOUR', and i'm not sure why. If it is at all possible, I would like to try to make this work with no code changes. Thank you. -- public class Crypto { /** The Cipher instance that will be used for encryption/decryption */ private Cipher cipher; /** The name/id of the algorithm used by the Cipher instance (in this case RC4) */ private static final String ALGORITHM_NAME = "RC4"; /** The JCE provider to use for encryption/decryption */ private static final String PROVIDER_NAME = "Cryptix"; /** * Create a new Crypto instance for encryption/decryption * services. Adds/installs the Cryptix provider into the JVM * and creates a new Cipher instance internally. * * @throws EncryptionFailureException if problems occur installing the provider or creating the Cipher */ public Crypto() throws EncryptionFailureException { super(); Security.addProvider(new Cryptix()); try { cipher = Cipher.getInstance(ALGORITHM_NAME, PROVIDER_NAME); } catch (Exception e) { throw new EncryptionFailureException( "Unable to initialize cryptography provider", e ); } } ... |