I have this simple question but i dont know which method to convert it..
the case is like this:
i have encrypted a string in byte[] form.
and since it is a string already, but in the end i still need to decrypted it back to original string. for example:
how to make the string to byte[] without changing the value?
any idea of what i'm talking about ?
any idea ?
thanks in advance.
Nick
the case is like this:
i have encrypted a string in byte[] form.
and since it is a string already, but in the end i still need to decrypted it back to original string. for example:
Code:
String str = "Peter is smart"; // encrypt it byte[] data = enc.encryptString(str); String test_str = data.toString(); System.out.println(test_str); // this value is : [B@356f
Code:
String str2 = getTest_Str(); // this String field is a must and value is [B@356f // here i want to make the string into byte[] byte[] bb = str2.someMethod(); System.out.println(bb); // i want this bb value to be exactly the same as test_str above, is [B@356f. // here i can do decryption which take byte[] as parameter. System.out.println(enc.decryptString( bb )); // this should print "Peter is smart"
any idea of what i'm talking about ?
any idea ?
thanks in advance.
Nick
Comment