Based on a combination of previous answers, I was able to resolve an issue with outputting the appropriate characters for a hash. I am still having a problem with length, as the hash i am getting is much longer than the expected one from the documentation I am following. The api documentation says to use SHA512 and has “FA35A0194E3BE7024CEFB1839CBFC922” as the example parameter, but when I run my hash tester with a simple password like “test” to get a value to pass into it I get “EE26B0DD4AF7E749AA1A8EE3C10AE9923F618980772E473F8819A5D4940E0DB27AC185F8A0E1D5F84F88BC887FD67B143732C304CC5FA9AD8E6F57F50028A8FF” – which is obviously much longer than what I need.
FYI, here is what I’m using to do this:
byte[] hashedPassword = HashAlgorithm.Create("SHA512").ComputeHash(new UTF8Encoding(false).GetBytes("test"));
Console.WriteLine(BitConverter.ToString(hashedPassword).Replace("-", ""));
Hopefully someone out there has more experience than I do (more than none) with this hash stuff. Is it normal to shrink a value like this somehow or take a certain part of it? I’m not really sure what to do from here.
You asked for a 512 bit hash. 512 bits is 64 bytes. 64 bytes written in hex is 128 characters. I’m therefore not understanding why you think something is wrong here.
Why is that obvious?
If it is much longer than what you need then why did you ask for a 512 bit hash in the first place?
Absolutely not.
Hire a professional who specializes in writing security software, who can write the software for you and train you in its correct maintenance. You do not know enough about writing secure software to do so successfully. Writing security systems is one of the hardest things you can do in any language; it takes years of training and experience to write a system that is actually secure against attack.