I have a byte array which I\'m encrypting then converting to a string so it can be transmitted. When I receive the string I then have to convert the string back into a byte
First do convertion of your byte array to proper string, by doing
String line= new String(Arrays.toString(your_array))
Then send it and use function below
public static byte[] StringToByteArray(String line) { String some=line.substring(1, line.length()-1); int element_counter=1; for(int i=0; i