Am I misunderstanding what a hash salt is?

后端 未结 5 1924
闹比i
闹比i 2020-12-31 09:42

I am working on adding hash digest generating functionality to our code base. I wanted to use a String as a hash salt so that a pre-known key/passphrase could be prepended

5条回答
  •  無奈伤痛
    2020-12-31 10:11

    If I'm understanding you correctly, it sounds like you've got it right. The psuedocode for the process looks something like:

    string saltedValue = plainTextValue + saltString;
    // or string saltedalue = saltString + plainTextValue;
    
    Hash(saltedValue);
    

    The Salt just adds another level of complexity for people trying to get at your information.

提交回复
热议问题