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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T18:00:27+00:00 2026-06-02T18:00:27+00:00

I use bcrypt for password hashing in php 5.3+ I understand that bcrypt uses

  • 0

I use bcrypt for password hashing in php 5.3+

I understand that bcrypt uses a random salt that gets built into the resulting hash per item. This makes cracking each hash difficult, and prevents cracking

What I don’t know is whether there still exists good reason to use an additional, application-level global secret key.

E.g. instead of just hashing a password string, e.g. “password1” into a bcrypt hash with the random salt that is built into the bcrypt generation system ( as per here: https://gist.github.com/1053158 ):
$2a$08$mjQAZ5cZi5B9u6zpUU4mGuRcvtxr1K.9ncYpxCdG.YhlD8yFG2mXK

I could also create a constant, e.g.: “@#$%$%&BDFGG@$%BNG$Y^$%SEHYSZTHN$%” , put that constant into the application (either into the application source code or the application’s configuration files), and append that to any string to be hashed.
So “password1″+”@#$%$%&BDFGG@$%BNG$Y^$%SEHYSZTHN$%” -> would get hashed into a different hash from just “password1” alone.
$2a$08$xFgULsrpoIYlbxp1IG3H8.kdVggyhm4aTQXrP2Ptu25nMBUjBdrrK

Obviously in the context of the application itself, this doesn’t help much. If someone tries the password “password1” on the running system, they’ll succeed, because they’ll automatically get the global secret key along for the ride. But if they have the database or access to the database only, it seems like the global secret key may be an additional obstacle? Because, not knowing the global secret key, they would have to crack “”password1@#$%$%&BDFGG@$%BNG$Y^$%SEHYSZTHN$%” instead of just cracking “password1”.

There are some potential benefits that may exist that I can imagine:

  • This might really hinder cracking the hashes using a compromised database alone?

And some vague disadvantages that may exist:

  • This introduces a common thread to all strings that get hashed, which may make it easier to crack hashes if it’s known.
  • It increases the fragility of the data. If the global secret key is lost, e.g. during a server migration, or whatever, the data is now trash.

So I’m trying to figure out whether it’s a good idea to also have a global secret key, or whether the random salt per item is both enough, and all you want. Does anyone know of any implementations that use a global secret key, or research that suggests using it?

  • 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-02T18:00:28+00:00Added an answer on June 2, 2026 at 6:00 pm

    The sole purpose of a salt is to defeat precomputation attacks (eg, rainbow tables). What you describe as a ‘global salt’ is, in fact, a secret key.

    Opinions differ on whether this is useful. The only threat model it helps defend against is one where the attacker can get the contents of the database, but cannot access your source code. Personally, I’m of the opinion that this is a sufficiently narrow possibility that defending against it is unnecessary, and the amount of effort required to do it properly is unwarranted.

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

Sidebar

Related Questions

Possible Duplicate: How do you use bcrypt for hashing passwords in PHP? I am
I want to use bcrypt hashing algorithm in my grails project instead of its
Could you use browserify to require node-bcrypt client-side and then send the hash to
I have read about how to implement security into a website using hashing, and
It seems that understanding what bcrypt is all about not clear for some people
bCrypt's javadoc has this code for how to encrypt a password: String pw_hash =
There is no straight forward bCrypt ( http://codahale.com/how-to-safely-store-a-password/ ) implementation in Objective-C, and while
I've been trying to improve my password hashing class for a CMS I'm currently
I use asp.net forms authentication to handle hashing/salting to and from plaintext passwords to
I'm writing a program where I use MD5 to hash login details before I

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.