Question: Edit the file below, and modify the logic to produce the HMAC_MD5 and HMAC_SH256 hash. You need to use DBMS_CRYPTO.MAC() function to produce the HMAC

Edit the file below, and modify the logic to produce the HMAC_MD5 and HMAC_SH256 hash. You need to use DBMS_CRYPTO.MAC() function to produce the HMAC values, and DBMS_CRYPTO.RANDOMBYTES() function to generate a key.

SET SERVEROUTPUT ON SET ECHO ON DECLARE message VARCHAR2(20) := 'metcs674'; message_raw RAW (2000) := UTL_RAW.cast_to_raw(message); MD5_hash RAW (2048); SH256_hash RAW (2048); BEGIN MD5_hash := DBMS_CRYPTO.Hash ( src => message_raw, typ => DBMS_CRYPTO.HASH_MD5); SH256_hash := DBMS_CRYPTO.Hash ( src => message_raw, typ => DBMS_CRYPTO.HASH_SH256); DBMS_OUTPUT.put_line('message: ' || message); DBMS_OUTPUT.put_line('raw message: ' || message_raw); DBMS_OUTPUT.put_line('hashed message: ' || MD5_hash); DBMS_OUTPUT.put_line('hashed message: ' || SH256_hash); END; /

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!