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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T05:17:06+00:00 2026-06-08T05:17:06+00:00

I have been looking into the options for handling passwords for user login and

  • 0

I have been looking into the options for handling passwords for user login and I had some questions about how to use CRYPT_BLOWFISH. I read about how to implement it but I would like to understand it better before I start to play with it.

so I was planning on doing something like this:

 function genBlowfishSalt()
 {
      //return random string for Salt
 }

 $hash = crypt($password, '$2a$12$'. genBlowFishSalt());

my questions are as follows:

1) What is ‘$2a$12$’ ?

2) I understand that I would have to store the salt for each user in this case, I suppose it would be acceptable to store it without its own hash? Does the salt get appended to the hashed value?

3) Upon login, how would I run a comparison of hashed values?

4) I also read that there was a concept of needing to store a number of iterations for each user, how does that factor in with the hashing of the password?

Thanks!

  • 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-08T05:17:08+00:00Added an answer on June 8, 2026 at 5:17 am

    1) That is the salt of the hash, you need to make the salt more random (EG different salt for each user for maximum protection)

    2) Yes you can store the salt in one field and the salted hash in another.

    3) You would to the following steps

    1. Get the password and username from the form
    2. Grab the salt from the database, and then crypt() the password string with that salt
    3. The new string that you get (hashed+salted password) you would then compare that with the database (EG is username = xxx and password = zz9zjz9) and see if any rows are returned, if there are rows returned then you know that it is the right password and log the person in.

    4) I’m not sure what you mean, please elaborate!

    • 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 some options for creating a slide out bar for
I have been looking into AWS spot instances for some jobs however instead of
I have been looking into connection pool options and it is somewhat unclear to
I have been looking around the current options (and related SO questions) regarding PHP
After having some issues using OpenSSL and gSOAP, I have been looking into the
I have been looking into backbone.js and I can't seem to figure out how
I have been looking into CruiseControl configuration recently (I'm a complete CC noob) and
I have been looking into different systems for creating a fast cache in a
I have been looking into MVVM design patterns with WPF for a project. I
I have been looking into HTML5 manifest but I am unclear as to whether

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.