3v4l.org

run code in 300+ PHP versions simultaneously
<?php $enc_method = 'AES-128-CTR'; $llaveSecreta = 'llave secreta'; // Parametros a encriptar $email = 'prueba@prueba.com'; $password = '123456'; $fecha = '2017-09-23'; // Armar cadena a encriptar $cadenaAEncriptar = $email.'&'.$password.(strlen($fecha) > 0 ? '&'.$fecha : ''); echo "\nCadena a encriptar: ".$cadenaAEncriptar; // Llave de encriptamiento segura $enc_key = openssl_digest($llaveSecreta, 'SHA256', true); echo "\nLlave de encriptamiento segura: ".$enc_key; // Generar IV $enc_iv = openssl_random_pseudo_bytes(openssl_cipher_iv_length($enc_method)); echo "\nNumero IV: ".$enc_iv; // Encriptar cadena $crypted_string = openssl_encrypt($cadenaAEncriptar, $enc_method, $enc_key, 0, $enc_iv); echo "\nCadena encriptada: ".$crypted_string; // Token de autenticacion $crypted_token = $crypted_string."::".bin2hex($enc_iv); echo "\nToken: ".$crypted_token; // Token codigicado para Url echo "\nUrlEncodeToken: ".urlencode($crypted_token);
Output for git.master, git.master_jit, rfc.property-hooks
Cadena a encriptar: prueba@prueba.com&123456&2017-09-23 Fatal error: Uncaught Error: Call to undefined function openssl_digest() in /in/HNUkI:12 Stack trace: #0 {main} thrown in /in/HNUkI on line 12
Process exited with code 255.

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
184.69 ms | 405 KiB | 5 Q