// Using a temporary array because assigning the IV per index does not work for some reason byte[] newIV = new byte[this.aes.BlockSize / 8]; string[] hexBytes = this.txtIV.Text.Split('-'); for (int i = 0; i != newIV.Length && i != hexBytes.Length; i++) { newIV[i] = byte.Parse(hexBytes[i], System.Globalization.NumberStyles.HexNumber); } this.aes.IV = newIV;