web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

Salt-Hash the passphase in Dynamics 365

(2) ShareShare
ReportReport
Posted on by 470

*This post is locked for comments

I have the same question (0)
  • Verified answer
    Community Member Profile Picture
    on at

    We use this exact method. We had a portal which previously worked off of clear text so we created two new fields, Salt and Hash, when the user logged in for the first time, we salted and hashed the password and saved to the customer entity. In our case I implemented the salt and hash function inside a workflow object so our customer support people would be able to reset passwords.

    I would suggest not using sha1 though as it has been cracked now so use sha256 or something else.

    public static string ComputeHash(string input, HashAlgorithm algorithm, Byte[] salt)
    {
      Byte[] inputBytes = Encoding.UTF8.GetBytes(input);
      // Combine salt and input bytes
      Byte[] saltedInput = new Byte[salt.Length + inputBytes.Length];
      salt.CopyTo(saltedInput, 0);
      inputBytes.CopyTo(saltedInput, salt.Length);
      Byte[] hashedBytes = algorithm.ComputeHash(saltedInput);
      return BitConverter.ToString(hashedBytes);
    }

  • Rao Rapolu Profile Picture
    470 on at

    Thanks Stephen for heads up.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
SA-08121319-0 Profile Picture

SA-08121319-0 4

#1
Calum MacFarlane Profile Picture

Calum MacFarlane 4

#3
Alex Fun Wei Jie Profile Picture

Alex Fun Wei Jie 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans