Jump to content

hashing passwords


patchido

Recommended Posts

I am trying to upload a big amount of users into a table in mysql, for this i want to import via phpmyadmin, the only problem is that the password is hasshed, so i did a php file for converting the bulk of passwords into sha1, i did a test with one of them and it is not the same value as if i created with another, can anyone tell why??

 

 

this is my code for the bulk.

 

 

<?php


if (isset($_POST['submit'])) { 
	
	
	
	$textarea = $_POST['passwords'];
	$pass_array = explode("\n",$textarea);
	$sha1_array= array();
	foreach($pass_array as $pass){
	
	$sha1_array[] = sha1($pass);
		
	}
	
	echo print_r($sha1_array);	
		
}
 


	

?>


<form action="pass.php" method="post">
<textarea name="passwords" cols="20" rows="1100"></textarea><br />
<input type="submit" name="submit" value="sha1" />
</form>

 

 

 

 

Thanks

Link to comment
https://forums.phpfreaks.com/topic/275373-hashing-passwords/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.