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

  • SEARCH
  • Home
  • 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 6963663
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T15:49:21+00:00 2026-05-27T15:49:21+00:00

For awhile I have been looking for a more secure way to hash a

  • 0

For awhile I have been looking for a more secure way to hash a user’s password on my website, to be inserted into a database. I have looked into all of the hashing methods available. It’s been said that bcrypt is the best because of its slowness. I was thinking that, if I don’t need the highest security of, but still staying safe. What if I used sha512 and then md5 on that hash. Would it matter if I reversed the order of the hashing? Keep in mind I will be using a separate salt for each operation. How safe would this be? Are there an other combinations that would do the same?

  • 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-27T15:49:23+00:00Added an answer on May 27, 2026 at 3:49 pm

    Any custom method you invent is more likely to have subtle bugs which make your storage method vulnerable. It’s not worth the effort, since you’re not likely to find these subtle bugs until it’s too late. It’s much better to use something that has been tried and tested.

    Generally, these are your choices when storing a password,

    • Use bcrypt.
    • Use a salted, strengthened hash.

    The first method is easy, just use bcrypt. It’s support in pretty much any language, and has been widely used and tested to ensure it’s security.

    The second method requires you to use a general purpose hash function (SHA-2 family or better, not MD5 or SHA-1 as they’re broken/weak) or better yet, a HMAC, create a unique salt for the user and a unique application wide salt, and then iterate the hash function many times (100,000, etc) to slow it down (called key stretching/strengthening).

    e.g. (pseudocode)

    sofar = hash("sha512", user_salt + site_salt + input_password);
    iterations = 100000; // Should be changed based on hardware speed
    while (iterations > 0)
    {
        sofar = hash("sha512", user_salt + site_salt + sofar);
        iterations--;
    }
    user.save("password", "$sha512$" + user_salt + "$" + iterations + "$" + sofar);
    

    Each iteration should rely on the previous iteration so someone can’t parallelize a brute force method to break it. Likewise, the number of iterations should be changed based on the speed of your hardware so that the process is slow enough. Slower is better when it comes to password hashing.

    Summary
    Use bcrypt.

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

Sidebar

Related Questions

I have been looking into this for awhile and have had no real luck.
I have been looking around for awhile now and I can't seem to find
I have been in one competition before, and I have looked into another. But
I have been looking for awhile, and I am just too new with JQuery
I have been looking for an answer to this for awhile and haven't found
I have been looking over the internet for a while about this, but it
I've been looking around for quite a while and feel that I have a
I have been struggling with this question for awhile now, and I haven't reached
Well I have been writing in the same style for awhile now and all
I've been using Textmate for Ruby/Python scripting for awhile and now have a need

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.