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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T17:10:52+00:00 2026-05-27T17:10:52+00:00

I read on PHP.net that MD5 is useless, and they suggest using crypt +

  • 0

I read on PHP.net that MD5 is useless, and they suggest using crypt + salt.

So, I went to their function description and read

<?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!";
}
?>

or in my case something like :

$stored_password=fetch_password($user);
if (crypt($_REQUEST['password'],$stored_password)===$stored_password) {
// ok
}

So, when I see that the salt is stored in the hashed password and that you use that hashed password as salt, I think Crypt + Salt is not more secure against a brute force on output (hackers who managed to steal hashed passwords). Is it more secure?

Against a dictionary attack, I can understand its power, but for a brute force attack on hashed passwords, I don’t see the advantage.

  • 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-27T17:10:53+00:00Added an answer on May 27, 2026 at 5:10 pm

    Crypt with hash is simply more expensive than MD5. An attacker would need more compute time, thence this is more secure.

    For a password and MD5, an attacker could use precomputed tables for MD5 PLUS have the advantage of MD5 to be very fast.

    For a password and salted crypt, precomputed tables would be useless, PLUS crypt needs more horsepowers than MD5

    There are specially-crafted algoritms (google bcrypt), that have an intentionally high compute cost to take this even further.

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

Sidebar

Related Questions

Read some texts about locking in PHP. They all, mainly, direct to http://php.net/manual/en/function.flock.php .
I am trying to read some settings from php.ini using zend. The API that
I recently read about http://php.net/pcntl and was woundering how good that functions works and
using Fast CGI I can't get it to read the php.ini file. See my
I'm using PHP to read if an entry in my table on the database
I read data from a mysql database that has is filled by php scripts.
I've read through the Google Spreadsheets API PHP documentation. All examples are using Zend,
I'm using the basic example from php.net on my local machine (Macbook Pro w/
I've read that in PHP non-persistent open links are automatically closed at the end
I read in some Microsoft documentation that PHP, together with Ruby on Rails, is

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.