Hack Forums
STRONG cryptography, SHA-1 - Printable Version

+- Hack Forums (https://hackforums.net)
+-- Forum: Tech (https://hackforums.net/forumdisplay.php?fid=444)
+--- Forum: Coding (https://hackforums.net/forumdisplay.php?fid=151)
+---- Forum: Software Development (https://hackforums.net/forumdisplay.php?fid=118)
+---- Thread: STRONG cryptography, SHA-1 (/showthread.php?tid=6262175)



STRONG cryptography, SHA-1 - pwd000 - Jan 27, 2024

Code
<?php



$str = "12345678"; # <input type="password" name="password">
echo "<h1>SHA1</h1>".sha1($str);
$str2 = sha1($str);
echo "<br>";
$array = array(sha1($str));

echo "<br>";
$arr1 = str_split($str2); #str_split — Convert a string to an array
$arr2 = str_split($str,2); #str_split — Convert a string to an array

echo "<br>";


for($i=0; $i<sizeof($arr1); ++$i) { #typically rendered as a hexadecimal number, 40 digits long
    if ($i <=19){
    $a[]=$str2[$i];        
    }
    elseif ($i >19 && $i <=21)
    $b[]=$str2[$i];
    else
    $c[]=$str2[$i];
}

$comma_separated = implode($a); #implode — Join array elements with a string
$comma_separated2 = implode($c); #implode — Join array elements with a string


echo "<br>";
echo "<h1>SHA1-pwd000: </h1>".$comma_separated.$arr2[0].$comma_separated2;
?>



RE: STRONG cryptography, SHA-1 - Hackers - Jan 28, 2024

I think you should provide some information with your code instead of just dumping this out. I can see what you're doing here, but it's important to give some context for people reading your threads.


RE: STRONG cryptography, SHA-1 - Jacked - Jan 29, 2024

I can see that. Thank you for sharing.