Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

how to change md5 customers password to plain text ?


Guest

Recommended Posts

Posted

Hello,

 

in my mysql it shows customer passwords as md5 hashes... i want them to be stored as plain text instead...? when people create a account... i dont want password to be md5 hashed. is this possible?

 

below is my code to /imcludes/functions/password_funcs.php

 

does anyone know how to change the code so when people register and login, it doesn't use any of md5 encryption? i want it just to use plain text.

 

Thanks, Mike.

 

<?php
/*
 $Id: password_funcs.php 1739 2007-12-20 00:52:16Z hpdl $

 osCommerce, Open Source E-Commerce Solutions
 http://www.oscommerce.com

 Copyright (c) 2003 osCommerce

 Released under the GNU General Public License
*/

////
// This funstion validates a plain text password with an
// encrpyted password
 function tep_validate_password($plain, $encrypted) {
   if (tep_not_null($plain) && tep_not_null($encrypted)) {
// split apart the hash / salt
     $stack = explode(':', $encrypted);

     if (sizeof($stack) != 2) return false;

     if (md5($stack[1] . $plain) == $stack[0]) {
       return true;
     }
   }

   return false;
 }

////
// This function makes a new password from a plaintext password. 
 function tep_encrypt_password($plain) {
   $password = '';

   for ($i=0; $i<10; $i++) {
     $password .= tep_rand();
   }

   $salt = substr(md5($password), 0, 2);

   $password = md5($salt . $plain) . ':' . $salt;

   return $password;
 }
?>

Archived

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

×
×
  • Create New...