PHP script to convert passwords to MD5 encryption!

The below script will convert csv files to MD5 encryption.

Download PHP Script here…

  • Upload the files
  • Copy email & passwords to the ‘passwords.txt’
  • Run the script!
  • You will get encrypted password in ‘passwords-md5.txt’ – you can just rename the file extenstion to .csv

<?php
//THIS IS A ENCRYPTION SCRIPT
//FOR LATER IMPORTING INTO MYSQL DATABASE

// function to accept a plain text password and return a encrypted password
function tep_encrypt_password($pass){
$password = md5($pass);
return $password;
}

// get a file with 2 columns separated by spaces [email password]
$lines = file(‘passwords.txt’,FILE_IGNORE_NEW_LINES);

// iterate each line
foreach($lines as $key => $line){
// put each element into a variable
list($email, $password) = explode(“,”, $line);
// encrypt the password
$password = tep_encrypt_password($password);
// put the elements back into a single line
$lines[$key] = implode(“,”, array($email, $password));
}
// put all of the lines back into a single variable
$lines = implode(“\n”, $lines);
// write the variable to file
file_put_contents(‘passwords-md5.txt’, $lines);
?>