random_iv()
Generate a random IV with OpenSSL::Random.random_bytes and sets it to the cipher, and returns it.
You must call #encrypt or #decrypt before calling this method.
# File ext/openssl/lib/openssl/cipher.rb, line 55 def random_iv str = OpenSSL::Random.random_bytes(self.iv_len) self.iv = str end