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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T11:41:56+00:00 2026-06-18T11:41:56+00:00

I’m the developer of a new website built in PHP and I’m wondering what

  • 0

I’m the developer of a new website built in PHP and I’m wondering what exactly is the best
thing to use for hashing. I’ve looked at md5 and sha1 but is there anything more secure.
I’m sorry if this is a nooby question but I’m new to PHP Security and I’m trying to make my
site as secure as possible. Also what is a salt?
Thanks,
Waseem

  • 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-18T11:41:57+00:00Added an answer on June 18, 2026 at 11:41 am

    First off md5 and sha1 have been proven to be vunrable to collision attacks and can be rainbow
    tabled easily (When they see if you hash is the same in their database of common passwords).
    There are currently two things that are secure enough for passwords, that you can use.
    The first being sha512. sha512 is a sub-version of SHA2. SHA2 has not yet been proven to be
    vunrable to collision attacks and sha512 will generate a 512 bit hash. Here is an example of
    how to use sha512:

    <?php
    hash('sha512',$password);
    

    The other option is called bcrypt. bcrypt is famous for its secure hashes. Its
    probably the most secure one out there and most customizable one too.
    Before you want to start using bcrypt you need to check if your sever has it enabled, Enter
    this code:

    <?php
    if (defined("CRYPT_BLOWFISH") && CRYPT_BLOWFISH) {
        echo "CRYPT_BLOWFISH is enabled!";
    }else {
    echo "CRYPT_BLOWFISH is not available";
    }
    

    If it returns that it is enabled then the next step is easy, All you need to do to bcrypt a
    password is (Note for more customizability you need to see this How do you use bcrypt for hashing passwords in PHP?):

    crypt($password, $salt);
    

    Now to answer your second question. A salt is usally a random string that you add at the end of
    all you passwords when you hash them. Using a salt means if some one gets your database
    they can not check the hashes for common passwords. Checking the database is called using a rainbow table. You should always use a salt when hashing!!

    Here are my proofs for the SHA1 and MD5 collision attack vulnerabilities:
    http://www.schneier.com/blog/archives/2012/10/when_will_we_se.html, http://eprint.iacr.org/2010/413.pdf, http://people.csail.mit.edu/yiqun/SHA1AttackProceedingVersion.pdf, http://conf.isi.qut.edu.au/auscert/proceedings/2006/gauravaram06collision.pdf and Understanding sha-1 collision weakness

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

Sidebar

Related Questions

I want use html5's new tag to play a wav file (currently only supported
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I want to count how many characters a certain string has in PHP, but
I am confused How to use looping for Json response Array in another Array.
I am trying to understand how to use SyndicationItem to display feed which is
I used javascript for loading a picture on my website depending on which small
this is what i have right now Drawing an RSS feed into the php,
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this

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.