Jump to content

hashing


alienmojo

Recommended Posts

If you have phpMyAdmin, you can do it manually by editing the row you want and selecting sha1 from the function dropdown menu.  If you want to do it through php, then this script will update all current passwords to sha1:

<?php
//Connect code

$query=mysql_query("SELECT * FROM users");
while($user=mysql_fetch_array($query))
{
$id=$user['id'];
$password=sha1($user['password']);
mysql_query("UPDATE users SET password='$password' WHERE id='$id' LIMIT 1");
}
?>

Warning: Only run once, because running more than once will sha1 the sha1'd passwords, totally mucking up the data.

Link to comment
https://forums.phpfreaks.com/topic/36733-hashing/#findComment-175186
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.