I want to convert a string value to the same byte array in C# and Java with following codes:
C#:
string key="EA1302AFBCCF791CB0065BFAD948B092";
byte[] keyByte = Encoding.UTF8.GetBytes(plainKey);
Java:
String key="EA1302AFBCCF791CB0065BFAD948B092";
byte[] keyByte = (key).getBytes("UTF-8");
But the length of the generated array is 32 in C# and 343 in Java. I have to create a byte array in C# same as Java, so please don't suggest changes for my Java code.
keyByte.lengthtoSystem.outinstead, and you'll probably find that they match.