Hash Function

Other discussions about CSPro
Forum rules
New release: CSPro 8.0
Post Reply
emdisala
Posts: 26
Joined: March 16th, 2021, 12:30 pm

Hash Function

Post by emdisala »

Dear all,

Let me ask about the hash function in CSPro which users SHA-256 key algorithm

Code: Select all

string spw=prompt("Password");
errmsg (hash(strip(spw)));
I used the above code (sample) to generate Hash value in CSPro and compared output with some online tools (some listed below). It seems CSPro algorithm produce different value and the other tools not.

In my next project I am going to import usernames and hash values of passwords from CSDB to MYSQL to give same login credentials.

Please guide me

Thank you

Disala

Code: Select all

hello in
CSPRO : 
4B79991287DB1A152B62891BBACFAECE819F942453EE687037EEFF5433A1DFD7

https://codebeautify.org/sha256-hash-generator
2cf24dba5fb0a30e26e83b2ac5b9e29e1b161e5c1fa7425e73043362938b9824

https://defuse.ca/checksums.htm#checksums
2cf24dba5fb0a30e26e83b2ac5b9e29e1b161e5c1fa7425e73043362938b9824

https://www.movable-type.co.uk/scripts/sha256.html
2cf24dba5fb0a30e26e83b2ac5b9e29e1b161e5c1fa7425e73043362938b9824
Gregory Martin
Posts: 1777
Joined: December 5th, 2011, 11:27 pm
Location: Washington, DC

Re: Hash Function

Post by Gregory Martin »

If you want to replicate the results on an online website, here is something comparable, using a salt:
hash("hello", 32, "cspro")
That gives: 623147E5EF6B08661182E4240F7911D3C22DBB40C5AA5E7CDF2BEB1C6930BE67

On this website, if you enter salt (cspro), text (hello), iterations (1024), key size (32): https://neurotechnics.com/tools/pbkdf2-test

You'll get: 623147e5ef6b08661182e4240f7911d3c22dbb40c5aa5e7cdf2beb1c6930be67

That website shows you how to get the above results in JavaScript, as an example.
emdisala
Posts: 26
Joined: March 16th, 2021, 12:30 pm

Re: Hash Function

Post by emdisala »

Dear Gregory,

Thank you for your prompt reply and aware me about salt value.

Disala
Post Reply