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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T22:09:01+00:00 2026-05-31T22:09:01+00:00

Using PHP, I am encoding passwords using the hmac function with the sha256 algorithm.

  • 0

Using PHP, I am encoding passwords using the hmac function with the sha256 algorithm. What I’m not sure about is how to properly store the salt.

The whole point of hashing a password is in case a hacker gets access to the database. If I store the salt in the db within the same row as the hashed password, isn’t it just like I am handing the hacker the “secret code”? I am putting up a door with a lock, and handing the intruder the key.

Can anyone please explain to me how they come about storing their salt?

  • 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-31T22:09:02+00:00Added an answer on May 31, 2026 at 10:09 pm

    Putting the salt into the hands of an attacker who has stolen your database isn’t actually a problem. Combining the salt with the original password into the password hash protects against the attacker using “rainbow tables” of millions of known and well-known password hashes to obtain the passwords of some of the stolen user ids.

    Having hashed the password and salt together makes it many orders of magnitude more difficult to crack even a single password, on the basis that the salt invalidates the password hashes known in the rainbow table. So even if the salt is known by the attacker for each of your users, this means that in order to crack any single user, the attacker must compute a whole new rainbow table just for that user alone, which combines the user’s salt with the rest of the passwords known in the rainbow table they started with.

    Salting the password does not make it impossible to crack a password, but far more difficult. An attacker could, for example, target a small subset of your users with the hash and salt in hand, and that’s another reason to encourage strong passwords which are less likely to appear in a rainbow table.

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

Sidebar

Related Questions

I have the following text: We%27re%20proud%20to%20introduce%20the%20Amazing I'd like to remove the encoding using PHP,
I am using php to talk to a mysql database then encoding the associative
I'm using PHP to fetch tasks from my database and encoding it as JSON.
I am importing data from outside into my database MYSQL using PHP Scripts. Encoding
I'm having problems using PHP SimpleXMLElement and simpleSMLToArray() function to parse a SOAP Response.
hi everyone i am fetching some data from a database using php, encoding it
I'm creating hashed passwords using salted sha1 in PHP. My question is: In MySQL
Using PHP, what's the fastest way to convert a string like this: 123 to
Using PHP and MySQL, I have a forum system I'm trying to build. What
Using PHP, I can convert MySQL data or static table data to csv, Excel,

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.