Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6547641
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T11:51:20+00:00 2026-05-25T11:51:20+00:00

Before I knew better, I implemented a login system with md5 as the hashing

  • 0

Before I knew better, I implemented a login system with md5 as the hashing algorithm. Now that I do know better, I’d like to move to using PHPass. My problem is that the system is already in production and asking all users to change their passwords would be the mother of all headaches.

I’ve come up with a simple enough solution, but given my previous mistake I’d like to make sure I’m not making an equally grievous mistake due to ignorance.

My solution is as follows:

Change

  1. md5($_POST['pass'])
  2. check md5 hashed password against database value

To

  1. md5($_POST['pass'])
  2. pass md5 hashed password to $hasher->HashPassword()
  3. use $hasher->CheckPassword() to check the re-hashed password against value from DB

Just for clarity, I’m only re-hashing the md5 version because that’s what I already have in the DB. It’s not intended as an added security measure (although if it is, that’s great!).

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T11:51:20+00:00Added an answer on May 25, 2026 at 11:51 am
    1. MD5() problem is WAY exaggerated on this enthusiast programmers community site. Nothing actually bad in this hashing algorithm, especially in comparison with other parts of usual newbie application. Using phpass techniques on a usual PHP site is like using a safe lock on a paper door of a straw hut.

    2. Most important thing in keeping passwords safe against virtual possibility of being stolen and used against the same user on other sites (oh, my!) is password strength and salt. Not hashing algorithm itself. No hashing technique would protect silly pass like “1234” or “joe”.
      So, md5 + strong password + average salt is better than usual password + phpass

    3. There is not a ingle reason to phpass existing md5 hash
      A sensible migration algorithm is

      • check this user record for the new hashing flag.
      • if it’s set –
        • go for phpass auth
      • if not:
        • md5($_POST[‘pass’])
        • check md5 hashed password against database value
        • if correct:
          • phpass($_POST[‘pass’])
          • save result in the database
          • set new hashing flag for this record
      • done
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Long before I knew anything - not that I know much even now -
I know there is hgsubversion extension for mercurial. But before I knew how it
I have NEVER used ANY version control system before. I am currently using the
I have seen this macro defined before but never really knew its purpose. Can
Before I start, I know there is this post and it doesn't answer my
Before I jump headlong into C#... I've always felt that C, or maybe C++,
I knew C, Cpp, Java, Servlets, JSP and Objective C. Now, i want to
A couple of years ago, before I knew about Stack Overflow, I was working
I am having a hard time understanding the ZeroMQ messaging system, so before I
I tried TRAC before and knew how powerful it is But I'm having lots

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.