Have I Been Pwned Checker

'' && strlen($_GET['sha1hash']) == 40 ) { $sha1hash = strtoupper($_GET['sha1hash']); $textToHash = ''; if( isset( $_GET['password'] ) ) { $textToHash = filter_var ( trim( $_GET['password'] ), FILTER_SANITIZE_SPECIAL_CHARS ); } elseif ( isset( $_GET['textToHash'] ) ) { $textToHash = filter_var ( trim( $_GET['textToHash'] ), FILTER_SANITIZE_SPECIAL_CHARS ); } $prefix = substr($sha1hash, 0, 5); } else { $prefix = 'AAAAA'; $showResult = FALSE; } $setupurl = $url . $prefix; ?>

Text to hash

SHA1 hash


Explanation : https://haveibeenpwned.com/API/v3#PwnedPasswords


' . print_r( $hashList, TRUE) . ''; $result = explode("\n", str_replace("\r", "", $hashList)); //echo '
' . print_r( $result, TRUE) . '
'; $hashfound = FALSE; foreach ($result as $key => $value) { $split = explode( ':', $value); //echo '
' . print_r( $split, TRUE ) . '
'; if ( $prefix . $split[0] == $sha1hash ) { $result[$key] = '' . $value . ''; $hashfound = TRUE; } } $whatTextString = $textToHash <> '' ? '

Your Text «' . $textToHash . '» has ' . strlen($textToHash). ' characters.
' : ''; if ( $hashfound == FALSE ) { echo '

' . $whatTextString . 'Hash ' . $sha1hash . ' not found.

'; } else { echo '

' . $whatTextString . 'Hash ' . $sha1hash . ' found.

'; } echo '
'; echo '
' . print_r( $result, TRUE) . '
'; } ?>

Download this file and change extension to .php