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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T03:24:11+00:00 2026-05-27T03:24:11+00:00

Which method is more secure and what are its disadvantages? // Using a salt.

  • 0

Which method is more secure and what are its disadvantages?

// Using a salt.
$keyed_hash = hash_hmac("sha512", $string.$salt);

// Using a key.
$keyed_hash = hash_hmac("sha512", $string, $key);
  • 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-27T03:24:11+00:00Added an answer on May 27, 2026 at 3:24 am

    What are you trying to do? They have different purposes, in general, but if you are planning to use them to store passwords, they are approximately equivalent. The net result will be similar if the salt is random (as it must be) and the key is random. If you use the same key for everything (or the same salt) then the security level drops dramatically. You have to store the key or salt separately, but it doesn’t matter if someone sees it (as long as you’re using, say, 64-bit random numbers).
    The HMAC computation is more computing intensive than the simple SHA512 computation. If your purpose is to make attackers work harder, then it is better. But the simpler SHA512 with a 64-bit salt will be adequate for most purposes.

    Be aware that at the end of 2012, there will be a new SHA3 algorithm selected; NIST is in the later stages of a competition to choose a new algorithm to replace the SHA2 algorithms, of which SHA512 is one specimen.

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

Sidebar

Related Questions

What's the difference when using GET or POST method? Which one is more secure?
Which method is faster or more responsive in javascript, if-else, the ternary operator or
Which method is best for importing multiple stylesheets? Is one method more efficient than
Is Standard (TCP/IP) a faster or more secure method to connect than Standard TCP/IP
If i’ve got 2(or more) model methods which do (for example, in billing system)
Which method is preferred? Session.Remove(foo); Session[foo] = null; Is there a difference?
Which method would you recommend to pass data from a child view back to
Which method makes the most sense for importing a module in python that is
Which method do you think is the best. Use the System.IO.Packaging namespace? Use interop
which method do you prefer for creating dynamic sql queries? formating or streaming? 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.