generateIv

Generate IV based on ivLength.

Can also be used as nonce.