Jump to content
Excelsior Forums


  • Content count

  • Joined

  • Last visited


Community Reputation

0 Neutral

About Andy

  • Rank
  • Birthday 01/01/1
  1. snowman, Thanks for your reply, but I still have problems. I did as you said and removed JCE related files from bod.zip and sym.zip. I used the JCE sample and exchanged the DHKeyAgreement3.java with my Decrypt.java (changed the .prj and build.bat). Now I get the following exception: Exception in thread "main" java.lang.ExceptionInInitializerError Caused by: java.lang.SecurityException: Cannot set up certs for trusted CAs I've also tried to create a new project using the graphical frontend with the same result. I've tried to 'Bind with classes' and 'Bind to the executable' for the local_policy.jar file and the US_export_policy.jar file. Anyone know a solution for this problem? //Andy
  2. I get the following exception when trying to initialize a SecretKeyFactory: "Algorithm PBEWithMD5AndDES not available" Here's the code: import java.security.Security; import java.security.Provider; import java.security.GeneralSecurityException; import javax.crypto.Cipher; import javax.crypto.CipherInputStream; import javax.crypto.spec.SecretKeySpec; import javax.crypto.spec.PBEKeySpec; import javax.crypto.spec.PBEParameterSpec; import javax.crypto.SecretKeyFactory; import javax.crypto.SecretKey; public class Decrypt { //----------------------------------------------------------------- CONSTRUCTOR /** * Create a new decrypt class */ public Decrypt() { byte[] salt = {(byte)0x01, (byte)0x02, (byte)0x04, (byte)0x08, (byte)0x10, (byte)0x12, (byte)0x20, (byte)0x24}; System.out.println("Decrypt"); Provider sunJce = new com.sun.crypto.provider.SunJCE(); Security.addProvider(sunJce); try { // PBE parameter set pbeParamSpec = new PBEParameterSpec(salt, 23); keyFac = SecretKeyFactory.getInstance("PBEWithMD5AndDES"); char[] passw = "Password".toCharArray(); pbeKeySpec = new PBEKeySpec(passw); pbeKey = keyFac.generateSecret(pbeKeySpec); // PBE Cipher pbeCipherDecr = Cipher.getInstance("PBEWithMD5AndDES"); } catch (GeneralSecurityException gse) { System.out.println("Decrypt(): "+gse.getMessage()); } } //-------------------------------------------------------------- PUBLIC METHODS public static void main(String[] args) { Decrypt d = new Decrypt(); } //----------------------------------------------------------- PRIVATE CONSTANTS //----------------------------------------------------------- PRIVATE VARIABLES private Cipher pbeCipherDecr; private Cipher cipherDecr; private PBEParameterSpec pbeParamSpec; private PBEKeySpec pbeKeySpec; private SecretKeyFactory keyFac; private SecretKey pbeKey; private SecretKeySpec blKey; } When running this class under JRE I get the output 'Decrypt', but when I run the compiled class (compiled with JET) I get the exception. I'm evaluating JET excelsior and I'm using jdk1.4 which includes the JCE package. Anybody know the solution?? Best Regards Andy