Re: [Aglets-developer] How i can make encryption with Aglet?
Status: Beta
Brought to you by:
cat4hire
From: Luca F. <cat...@ti...> - 2005-04-26 08:00:08
|
On Wednesday 20 April 2005 13:32 Ghada Moustafa's cat walking on the keyboard wrote: > Hi all, > > I made the implementation of DES Algorithm"Digital Encryption Standard",and > it works very will,but when i tried to insert it in onCreation method of my > aglet it enters the second cath when i try to create the cipher and it > couldn`t recognize the DES algorithm although it generates the key of DES > correctly > > try { > KeyGenerator keygen = KeyGenerator.getInstance("DES"); > > SecretKey desKey = keygen.generateKey(); > > } > catch (NoSuchAlgorithmException ex) { > my_frame.jTextArea1.setText("Key generation Failed"); > } > my_frame.jTextArea1.setText("Key generation Right"); > > //////////// From here Error begin//////////////////////// > Cipher desCipher; > > try { > desCipher = Cipher.getInstance("DES"); > } > catch (NoSuchPaddingException ex1) { > my_frame.jTextArea1.setText("Create cipher failed 1"); > } > catch (NoSuchAlgorithmException ex1) { > my_frame.jTextArea1.setText("Create cipher failed 2"); > } > > I think it may be a problem in the security prefrences of Tahiti but i`m > not sure. > > can anyone help me plz A few trivial questions: 1) are your classes in the classpath? 2) if you search for the security provider, can you see all what you want? Provider p[] = Security.getProviders(); for(int i=0; i<p.length; i++){ Enumeration e = p[i].keys(); while(e.hasMoreElements()){ System.out.println("key "+e); } } 3) is your provider specified in java.security? Luca -- Luca Ferrari, cat...@ti... |