protected static function createIV($size)
{
if (function_exists('openssl_random_pseudo_bytes')) {
$bytes = openssl_random_pseudo_bytes($size, $strong);
}
if (is_null($bytes) || false === $bytes || false === $strong) {
$size *= 2;
$pool = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ';
$bytes = pack('H*', substr(str_shuffle(str_repeat($pool, $size)), 0, $size));
}
return $bytes;
}