How can I convert an input if 16 characters to a byte array with the following format.
E.g. From textBox.Text = 4a4de6878247d37b
to
byte[] esk_bytearr = { 0x4a, 0x4d, 0xe6, 0x87, 0x82, 0x47, 0xd3, 0x7b };
The method I'm using is not working and is the below.
static byte[] GetBytes(string str)
{
byte[] bytes = new byte[str.Length * sizeof(char)];
System.Buffer.BlockCopy(str.ToCharArray(), 0, bytes, 0, bytes.Length);
return bytes;
}
The byte array is an input to an decryption method using DES. The method is working but the decrypted message is different from when I use directly the esk_bytearr directly as parameter to decryption method. Thanks