openssl_cipher_iv_length

Supported Versions: PHP 5 >= 5.3.3, PHP 7, PHP 8
Gets the cipher iv length
<?php openssl_cipher_iv_length(string $cipher_algo): int|false
<?php     public function encrypt($value, $serialize = true)

    {

        $iv = random_bytes(openssl_cipher_iv_length(strtolower($this->cipher)));



        $value = \openssl_encrypt(

            $serialize ? serialize($value) : $value,
<?php             return false;

        }



        return strlen(base64_decode($payload['iv'], true)) === openssl_cipher_iv_length(strtolower($this->cipher));

    }