I was given an excel file with about 450 username and passwords (the passwords are encoded with MD5 hash) How can I put this excel (.xls) file into my MySQL database and on the website (php side) how can I check if the user entered password is the correct password (I know nothing about hashing a password with MD5 or any hash-sequence for that matter)
相关问题
- Views base64 encoded blob in HTML with PHP
- Laravel Option Select - Default Issue
- PHP Recursively File Folder Scan Sorted by Modific
- Can php detect if javascript is on or not?
- Using similar_text and strpos together
http://www.ibm.com/developerworks/opensource/library/os-phpexcel/ will help you with storing the passwords from the excel file to the mysql database, and md5 documentation is pretty helpful.
You can fetch the password for a given username from the db and check with something like this:
1.- You can export an excel file as a CSV file.
2.- Use phpmyadmin to import to your site a CSV file.
3.- Checking passwords:
the md5 password may be "salted" to provide extra security.
If not salted:
If salt, this salt may etiher be global (same for all accounts), or partly individual, (some account-data is provided when calculationg the hash.
Example:
<?php md5(onceTypedPassword . $globalSalt)
<?php oncedTypedPassword . $globalSalt . $userRec['Firstname'])
If hash is salted you NEED the salt.