Jump to content

hashing passwords


Go to solution Solved by Christian F.,

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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.