Consultor Eletrônico



Kbase P115990: Progress SHA1-DIGEST function returns a different result to other tools
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   11/11/2008
Status: Verified

SYMPTOM(s):

Using SHA1-DIGEST function to hash data

Result returned by Progress differs from the result generated in other tools

SHA1-DIGEST("The quick brown fox jumps over the lazy dog") returns:

020014L9ThxnotKPzthJ7hu3bnORuT6xI=

Other resource return the following result for the same string:

2fd4e1c67a2d28fced849ee1bb76e7391b93eb12

FACT(s) (Environment):

OpenEdge 10.x
All Supported Operating Systems

CAUSE:

This is expected and correct behaviour. The SHA1-DIGEST function is returning the correct result but in RAW format. As stated in the function documentation:
"[SHA1-DIGEST] returns a 20-byte binary message digest value as a RAW value."

FIX:

Use the HEX-ENCODE function to convert the RAW value returned by SHA1-DIGEST into a character string. This will show that:

020014L9ThxnotKPzthJ7hu3bnORuT6xI=

Is the same as:

2fd4e1c67a2d28fced849ee1bb76e7391b93eb12