public static Byte[] CreateInitVector(String key)
{
Byte[] retVal = { };
int bitLength = 16;
try
{
if (!String.IsNullOrEmpty(key))
{
String[] bArray = key.Replace(" ", "").Split(',');
if (bArray.Length == bitLength)
{
retVal = new Byte[bitLength];
for (Int32 x = 0; x < bArray.Length; x++)
{
retVal[x] = Convert.ToByte(bArray[x].Trim());
}
}
}
}
catch (Exception err)
{
throw new Exception("Halide.H3Secure Error: " + err.ToString());
}
return retVal;
}