@ 2017-02-09T18:57:00Z <?php
const ENC_METHOD = 'aes-256-ctr';
const ENC_SALT = "87CD2488-180D-442B-A68A-0307DC0CAB4D";
function B2R_Encrypt($message, $key)
{
$key = hash("sha256", ENC_SALT, FALSE);
//$key = hash("sha256", ENC_SALT + $key, TRUE);
echo $key;
$nonceSize = openssl_cipher_iv_length(ENC_METHOD);
$nonce = openssl_random_pseudo_bytes($nonceSize);
$ciphertext = openssl_encrypt(
$message,
ENC_METHOD,
$key,
OPENSSL_RAW_DATA,
$nonce
);
$result = base64_encode($nonce.$ciphertext);
echo $result + ''\n';
return $result;
}
$message = 'Some test password';
$encrypted = B2R_Encrypt($message, '');
echo $encrypted;
Enable javascript to submit You have javascript disabled. You will not be able to edit any code.
Here you find the average performance (time & memory) of each version. A grayed out version indicates it didn't complete successfully (based on exit-code).
Version System time (s) User time (s) Memory (MiB) 7.1.1 0.010 0.067 22.25 7.1.0 0.003 0.063 22.38 7.0.15 0.007 0.060 21.89 7.0.14 0.003 0.077 21.85 7.0.13 0.007 0.057 22.01 7.0.12 0.013 0.050 21.91 7.0.11 0.013 0.053 21.89 7.0.10 0.003 0.077 21.87 7.0.9 0.017 0.077 21.91 7.0.8 0.013 0.070 21.82 7.0.7 0.007 0.060 21.85 7.0.6 0.007 0.060 21.60 7.0.5 0.010 0.053 21.92 7.0.4 0.000 0.060 21.99 7.0.3 0.003 0.060 21.76 7.0.2 0.010 0.053 21.88 7.0.1 0.003 0.060 21.98 7.0.0 0.003 0.060 21.94
preferences:dark mode live preview
141.57 ms | 1394 KiB | 7 Q