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 8681889
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T21:37:34+00:00 2026-06-12T21:37:34+00:00

So I have been learning quite a bit about PHP and Mysql, and I

  • 0

So I have been learning quite a bit about PHP and Mysql, and I was wondering about something. Let’s say I was going to make a database storing just usernames and passwords (keeping the example simple). I know that it’s not safe to store passwords without encrypting them because someone might hack into the database.
So I use an MD5 hash or something even safer and store the passwords encrypted, then one of my users has forgotten their login information and they would like to retrieve it by email.

If I’m using a one-way encryption method like MD5 or a better one, how am I supposed to send the user their login information if their password is encrypted and no way to decrypt it?
I would guess that for this purpose (by which I mean the retrieving part) is there another way, or at least another place, where the passwords are stored just for this?

I would be glad if anyone could suggest a method for storing this information safely but in such a way that if one of my users forget their login there’s a way for me to email them back safely.
Or how is a problem like this dealt with nowadays?
And from what I have read MD5 hash was hacked already so a better encrypting hash or method would be nice too.

  • 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-06-12T21:37:36+00:00Added an answer on June 12, 2026 at 9:37 pm

    Then how am I supposed to Send the user their log in information if their password is encrypted and no way to decrypt it?

    You aren’t. You should never send a user’s password to them.

    If a user wants to reset their password then:

    1. Generate a random token
    2. Store that token in a database with a time stamp and the user id
    3. Email the token to the user
    4. When the user visits a page using the token, allow them to enter a new password
    5. Delete the token after it has been used
    6. Delete the token if it is not used within a time period (e.g. 3 hours)

    And from what I read MD5 hash was hacked already so a better encrypting hash or method would be nice to.

    See the PHP manual, this is a FAQ.

    See also, OWASP

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have been neglecting learning about caching for quite some time now, and although
I have been using Silverlight for quite a bit and am learning Windows Phone
I have been learning about Delegation and Data Sources for iOS programming and need
I have been learning a bit of Python 2 and Python 3 and it
I have been learning Windows Phone 7 for quite some time now. However with
I've been learning Android for about two weeks now (expert in as2/3). I have
Im fairly proficient in php and am also learning python. I have been wanting
I'm still quite new to OOP, and have been learning-as-I-go with CodeIgniter2+Doctrine2. I have
I've been learning meta-programming in Ruby, and have found it quite useful. I'm sure
I have been learning NodeJS recently. It seems to be standard in the Node

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.