3v4l.org

run code in 300+ PHP versions simultaneously
<?php $key = hash('sha256', 'spottycats', true); var_dump(bin2hex($key)); $cipher = openssl_encrypt( 'Yes, it totally does.', 'aes-128-ctr', $key, OPENSSL_RAW_DATA, str_repeat("\x00", 16) ); $hmac = hash_hmac( 'sha256', $cipher, hash('sha256', 'spottycats', true), true ); echo base64_encode($cipher . $hmac), PHP_EOL;

preferences:
59 ms | 402 KiB | 5 Q