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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T12:52:12+00:00 2026-05-20T12:52:12+00:00

function oneWayEncrypt($string) { $salt = md5($string.yHuJ@8&6%4#%([@d-]); $salt2 = md5($string.@!#&+-)jU@[yT$@%); $string = hash(‘sha512’,$salt$string$salt2); return $string;

  • 0
function oneWayEncrypt($string) { 
    $salt = md5($string."yHuJ@8&6%4#%([@d-]"); 
    $salt2 = md5($string."@!#&+-)jU@[yT$@%"); 

    $string = hash('sha512',"$salt$string$salt2"); 

    return $string; 
} 
  • 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-20T12:52:13+00:00Added an answer on May 20, 2026 at 12:52 pm

    Using SHA-512 is a good idea to get a cryptographically strong hash, but your choice of a salt does not add much extra security. In particular, a salt is only good if its value is random and cannot be predicted in advance. This prevents an attacker from precomputing a table of known hashes with which to try to attack your database. If the salt is known, then the attacker can just precompute a table of hash values with the salt hardcoded in.

    In your case, the salt is essentially known to the attacker because it’s deterministically computed from the input string. If I wanted to attack your system, I could iterate across a bunch of known strings, (deterministically) compute the salt for each string, then compute the SHA-512 hash of the salted string and store it in a table. From this, I could invert a hash to a password for any string I happened to precompute.

    If you want a better security system, instead consider using a salt that’s randomly-generated and then stored alongside the resulting hash. That way, no matter what tables I precompute, there’s a slim chance that the table will be useful because I won’t necessarily have computed the tables for all possible salts. Essentially, each random bit in your salt doubles the amount of work I have to do, so if you pick a good random salt (say, 128 bits) then there’s no feasible way I could do a precomputation attack. I’d have to attack SHA-512, a hash assumed to be cryptographically secure (the name means “Secure Hash Algorithm”), to break your system.

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

Sidebar

Related Questions

function json (url){ $.getJSON(url, function(data) { return data; }) } this function don't see
function loaded() { document.addEventListener('touchmove', function(e){ e.preventDefault(); }); myScroll = new iScroll('scroller'); } document.addEventListener('DOMContentLoaded', loaded);
function Subscribe() { if (typeof (Page_ClientValidate) == 'function') { Page_ClientValidate(); } if (Page_IsValid) {
function redirect($url){ header(HTTP/1.1 303 See Other); header(Location: $url); exit(); } I have the function
Function Edit(ByVal id As Integer) As ActionResult Dim entities As New Deployment_devEntities() Dim w
function twitterify($ret) { $ret = preg_replace(#(^|[\n ])([\w]+?://[\w]+[^ \\n\r\t< ]*)#, \\1<a href=\\\2\ target=\_blank\>\\2</a>, $ret); $ret
function safe(){ if($(this).is(':checked')){ $(select[name='sort']).attr(disabled, disabled); $(input[name='group']).attr(disabled, disabled) } else { $(select[name='sort']).attr(disabled, false); $(input[name='group']).attr(disabled, false)
function addFav(id){ $.ajax({ url: misc/favAdd.php, type: POST, data: { mode: 'ajax', user: id}, dataType:
function blah(_x) { console.info(_x.toSource().match(/\/\/\s*@version\s+(.*)\s*\n/i)); } function foobar() { // ==UserScript== // @version 1.2.3.4 //
function appendRefToLinks(ref){ alert(hi); $j('a').each(function(i){ alert('hello'); $j(this).attr('href',$j(this).attr('href') + ?ref= + $j.cookie.get(tb_ref)); }); } I see

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.