All pastes #929886 Raw Edit

Untitled

public text v1 · immutable
·published 2008-03-06 02:58 UTC
rendered paste body
                // 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;