encryption - Encrypting an Arraylist in Java -


how can encrypt arraylist in java using aes 128 bit encryption. gives error

public static  arraylist<entereddetails> encrypt(arraylist<entereddetails> data) throws exception {     key key = generatekey();     cipher c = cipher.getinstance(algo);     c.init(cipher.encrypt_mode, key);     arraylist<entereddetails> encval = c.dofinal(data);     //no suitable method found dofinal      return encval; } 

encryption acts on bytes (byte[] or streams) , not on full objects.

so need convert objects bytes way. serialization obvious way.


Comments

Popular posts from this blog

java.util.scanner - How to read and add only numbers to array from a text file -

rewrite - Trouble with Wordpress multiple custom querystrings -