Skip to content

Instantly share code, notes, and snippets.

@neomadara
Last active March 30, 2021 04:57
Show Gist options
  • Save neomadara/b1e0068d1a1a7cb859d5 to your computer and use it in GitHub Desktop.
Save neomadara/b1e0068d1a1a7cb859d5 to your computer and use it in GitHub Desktop.
encriptar y desencriptar MD5
<?php
function encriptar($texto){
$key='palabraclaveparalacodificacionydecodificacion'; // Una clave de codificacion, debe usarse la misma para encriptar y desencriptar
$encrypted = base64_encode(mcrypt_encrypt(MCRYPT_RIJNDAEL_256, md5($key), $cadena, MCRYPT_MODE_CBC, md5(md5($key))));
return $encrypted;
};
function desencriptar($texto){
$key='farmaciajuntoati'; // Una clave de codificacion, debe usarse la misma para encriptar y desencriptar
$decrypted = rtrim(mcrypt_decrypt(MCRYPT_RIJNDAEL_256, md5($key), base64_decode($cadena), MCRYPT_MODE_CBC, md5(md5($key))), "\0");
return $decrypted;
}
@FernadaIbanezg
Copy link

FernadaIbanezg commented Sep 5, 2018

Qué es lo que tengo que poner en las celdas de Excel , para ver que funciona?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment