Hi Dear, i encrypt some of the images but it takes so long for encryption and decryption. encryption of images in sdcard are just to void straight copy and a very simple encryption would be ok for instance.
please check my code below and advise how can i make it fast: static{ byte[] iv = new byte[]{ (byte)0x8E, 0x12, 0x39, (byte)0x9C, 0x07, 0x72, 0x6F, 0x5A}; AlgorithmParameterSpec paramSpec = new IvParameterSpec(iv); try { SecretKey key = KeyGenerator.getInstance("DES").generateKey (); ecipher = Cipher.getInstance("DES/CBC/PKCS5Padding"); dcipher = Cipher.getInstance("DES/CBC/PKCS5Padding"); // CBC requires an initialization vector ecipher.init(Cipher.ENCRYPT_MODE, key, paramSpec); dcipher.init(Cipher.DECRYPT_MODE, key, paramSpec); } catch (java.security.InvalidAlgorithmParameterException e) { } catch (javax.crypto.NoSuchPaddingException e) { } catch (java.security.NoSuchAlgorithmException e) { } catch (java.security.InvalidKeyException e) { } } /////////////////////////////// i tried RC4 which throws NullException --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~----------~----~----~----~------~----~------~--~---