I need to hash a data (19 bytes) to 32 Bytes ysing SHA-256 algorithm. We basically need to match an hash values generated by other application.
I tried to hash using CSNBOWH program but the output of hash is only 20 bytes. Also the output hash value doesn't match with the hash value produced in Java. Cobol produces hash like 0V2!6... so on whereas in java its like 34349sd203a23232...
Pls advise if we have any other function to hash it
Type: String array
These keywords provide control information to the verb. The optional chaining flag keyword indicates whether calls to this verb are chained together logically to overcome buffer size limitations. Each keyword is left-aligned in an 8-byte field and padded on the right with blanks. All keywords must be in contiguous storage. The rule_array keywords are described in Table 1.
Table 1. Keywords for One-Way Hash control informationKeyword Description
Hash method (One, required). The SHA-based hashing functions use CPACF by default. For details about CPACF, see CPACF support.
MD5 Hash algorithm is MD5 algorithm. Use this hash method for PKCS-1.0 and PKCS-1.1. Length of hash generated is 16 bytes.
RPMD-160 Hash algorithm is RIPEMD-160. Length of hash generated is 20 bytes.
SHA-1 Hash algorithm is SHA-1 algorithm. Length of hash generated is 20 bytes.
SHA-224 Hash algorithm is SHA-224 algorithm. Length of hash generated is 20 bytes.
SHA-256 Hash algorithm is SHA-256 algorithm. Length of hash generated is 20 bytes.
SHA-384 Hash algorithm is SHA-384 algorithm. Length of hash generated is 20 bytes.
SHA-512 Hash algorithm is SHA-512 algorithm. Length of hash generated is 20 bytes.
Why do you think you should get a 32-byte output hash?
Guess the value after hashed is stored in EBCDIC which is 32 bytes and if we convert to hex it would become 64. But I mapped with copybook to lookup as hex value. The hex values doesn’t match with the hex value generated by java code. Even it used same sha-256 algorithm