Advertisement
Eduardo_Lanzini

PASSWORD HASH BASIC

Jan 16th, 2018
202
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.99 KB | None | 0 0
  1. <?php
  2.  
  3. if(isset($_GET['password'])){
  4.     $hash = password_hash($_GET['password'], PASSWORD_DEFAULT);
  5. }
  6. if(isset($_GET['verificar'])){
  7.     if (password_verify($_GET['senha'], $_GET['hash'])) {
  8.         $resposta = '<h3>SENHA E HASH COENCIDEM!!!</h3>';
  9.     }else {$resposta = '<h3>SENHA E HASH NÃO COINCIDEM!!!</h3>';}
  10. }
  11. ?>
  12.  
  13. <html>
  14.  
  15. <head>
  16.     <title>PASSWORD HASH GENERATOR</title>
  17. </head>
  18.  
  19. <body>
  20. <h1>PASSWORD HASH GENERATOR</h1><br>
  21.  
  22. <?php
  23.  
  24. if(isset($hash)){
  25.  
  26.     echo '<h3>SENHA INFORMADA: ' . $_GET['password'] . '<br>O PASSWORD HASH É:  '.$hash.'</h3><br><br>';
  27. }
  28.  
  29. ?>
  30.    
  31. <form method="get">
  32.     <label>Senha: </label>
  33.     <input type="text" name="password">
  34.     <input type="submit" name="">
  35. </form>
  36.  
  37. <h1>VERIFICA PASSWORD</h1>
  38.  
  39. <form method="get">
  40.     <label>Senha: </label>
  41.     <input type="text" name="senha">
  42.     <label>hash: </label>
  43.     <input type="text" name="hash">
  44.     <input type="submit" name="verificar">
  45. </form>
  46.  
  47. <?php
  48. if(isset($resposta)){
  49.     echo $resposta;
  50. }
  51.  
  52. ?>
  53.  
  54. </body>
  55.  
  56. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement