I need to convert a string to a corresponding int array in java. i wrote the following code but its not working as i expected .
String temp= "abc1";
int[] intArray = new int[temp.length()];
for (int i = 0; i < temp.length(); i++) {
intArray[i] = Integer.parseInt(temp[i]);
}
I have written an rc4 encryption program which take the key and plain text as int arrays. So I need to convert the user specified key to int array before passing it to the encryption function. Is this the correct way of using key in encryption programs?