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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T16:06:09+00:00 2026-05-13T16:06:09+00:00

First, I see that to use CRYPT_BLOWFISH, i need to use a 16 char

  • 0

First, I see that to use CRYPT_BLOWFISH, i need to use a 16 char salt starting with $2a$. However, the php.net documentation for crypt() says that some systems don’t support CRYPT_BLOWFISH. How often is that the case?

Next, from their example on the docs, I see I use crypt() as follows:

<?php
$password = crypt('mypassword'); // let the salt be automatically generated

/* You should pass the entire results of crypt() as the salt for comparing a
   password, to avoid problems when different hashing algorithms are used. (As
   it says above, standard DES-based password hashing uses a 2-character salt,
   but MD5-based hashing uses 12.) */
if (crypt($user_input, $password) == $password) {
   echo "Password verified!";
}
?>

In order to use CRYPT_BLOWFISH, would the only thing I need to modify be the first line to make it like so;

crypt('mypassword', '$2a$07$usesomesillystringforsalt$')

and then the rest of the lines are fine as is?

  • 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-13T16:06:10+00:00Added an answer on May 13, 2026 at 4:06 pm

    For PHP before 5.3.0 crypt() used the lib supplied by the OS. If you are using an earlier version, then you’d need to check your OS documentation to see if it is supported (check the value of the CRYPT_BLOWFISH constant) – if not then the algorithm is implemented within the mcrypt() extension for PHP.

    The example you’ve quoted from the docs doesn’t seem to make much sense:

      $stored_password=fetch_password($user);
    
      if (crypt($_REQUEST['password'],$stored_password)===$stored_password) {
          // note that crypt automatically extracts the salt and alogrithm type
          // from $stored_password
          ....
    

    You only need to specify the prefix ($2a$) when creating the password.

    HTH

    C.

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

Sidebar

Related Questions

I need a jquery script section that checks to see if the first digit
I wanna check sharepoint title first and see if the lib doesn't have that
First let me say that I did see this article: How to remove AspxAutoDetectCookieSupport
I have a .txt file with content(see first image) I need the content in
I see sites that use this convention. hxxp://www.twitter.com/golem hxxp://www.twitter.com/golem/following I am trying to do
Update: I don't use TFS anymore. But from the comments I can see that
First see my Source Code: WebClient client = new WebClient(); String url = http://localhost;
It is not the first time i see it Ive seen in Facebook source
I'm just taking my first steps with Azure and the first thing I see
I'm familiarizing myself with Ruby and it's the first time I see synonyms for

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.