- chr: documentation ( source)
- mt_rand: documentation ( source)
- str_repeat: documentation ( source)
<?php
$key_size = 25;
$key = '';
for ($i = 0; $i < $key_size; $i++) {
$key.= chr(mt_rand(0, 255));
}
$a = openssl_encrypt(str_repeat('z', 50), 'rc4-40', $key, OPENSSL_RAW_DATA | OPENSSL_ZERO_PADDING);
$b = openssl_encrypt(str_repeat('z', 50), 'rc4', $key, OPENSSL_RAW_DATA | OPENSSL_ZERO_PADDING);
echo $a == $b ? 'good' : 'bad';