Skip to content

Instantly share code, notes, and snippets.

@TiuTalk
Created December 8, 2011 17:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save TiuTalk/1447656 to your computer and use it in GitHub Desktop.
Save TiuTalk/1447656 to your computer and use it in GitHub Desktop.
<?php
$salt = '1%1cAu!g+>K53PY}';
// Senha do usuário, pode ter vindo do $_POST, $_GET ou outro lugar
$senha = 'olá mundo';
// Encripta a senha usando MD5
$senha = md5($senha . $salt);
// Resultado:
// c1de0ebde1fd59955ccd57ccd89ac2e9
// Salvamos essa senha encriptada no banco
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment