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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T07:33:50+00:00 2026-06-12T07:33:50+00:00

Possible Duplicate: Secure hash and salt for PHP passwords WARNING Don’t use MD5 for

  • 0

Possible Duplicate:
Secure hash and salt for PHP passwords

WARNING Don’t use MD5 for passwords, use an alternative like bcrypt


For my passwords should I use salt like this (the salt will be unique to each user and not stored directly with the password)…

$salt = sha1(md5("coders gonna code"));
$password = md5($salt.$password);

or would it be okay if I just used:

$password = md5($password);

because if I used salt, even if the user makes up a bad password like password it won’t matter because the salt (in this case) would be 145ac26ff093c6e1317f7d5fb4c9fd11c77be975 so the entry for there password would be 145ac26ff093c6e1317f7d5fb4c9fd11c77be975password which according to http://howsecureismypassword.net/ it would take 3 octodecillion years to crack…. so opinions? Or should I be even worse and go

$password = md5($salt.$password.md5($salt));

If the person has gone far enough to get the salt hash, would anything be able to stop then going futher? < More of a statement this last password


To everyone who said I should do it per user… I know, this is just an example.

  • 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-12T07:33:52+00:00Added an answer on June 12, 2026 at 7:33 am

    You should change the salt so that it is specific to each user, not a system wide constant. This will make rainbow table attacks against your password hashes much more inconvenient.

    There is a good write up on the evolution of salting in this article by Troy Hunt.

    Edit

    $salt something unique to each password record, which adds much entropy to it. This is usually a random sequence of bytes, stored with the user account.

    Hashing is traditionally done on the concatenation of salt + password.

    $passwordHash = hash($salt.$password);
    

    As others have said, don’t use MD5 for hashing. It is broken.

    Applying additional proprietary algorithms to password or salt prior to hashing is not recommended. Instead, look at an industry strength solution such as PBKDF2, which, in addition to salting, also requires many (typically > 10k) repeated iterations which will further slow down an attacker.

    If you adopt OWASP guidelines, the number of hashes performed should be increased regularly (to counteract Moore’s Law). The number of hashes should also be persisted per user, meaning you will need to store the triple of hashed password, salt, and number of iterations.

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

Sidebar

Related Questions

Possible Duplicate: Secure hash and salt for PHP passwords I use the following code
Possible Duplicate: Secure hash and salt for PHP passwords I try to create a
Possible Duplicate: Secure hash and salt for PHP passwords THREE part question: Which technique
Possible Duplicate: Secure hash and salt for PHP passwords I saw someone coding a
Possible Duplicate: Secure hash and salt for PHP passwords I am making a website,
Possible Duplicate: Secure hash and salt for PHP passwords Alright so im thinking of
Possible Duplicate: Secure hash and salt for PHP passwords What is the best way
Possible Duplicate: Secure hash and salt for PHP passwords I am making a system
Possible Duplicate: What function to use to hash passwords in MySQL? Secure password storage
Possible Duplicate: How to secure database passwords in PHP? Recently I was given a

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.