Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

standard_hash or dbms_crypto.encrypt

HabibSep 23 2019 — edited Sep 23 2019

Hello

I am converting some PHP code to PL/SQL. The code creates a hash using hash_hmac function in PHP which generate a keyed hash value using the HMAC method with the given Algorithm. Its breif documentation is available https://www.php.net/manual/en/function.hash-hmac.php

Following is the PHP code:

$hash = hash_hmac('md5', $string, $key);

My requirement is to generate a hash using MD5 and the given key.

I did following:

select standard_hash ('mystring', 'MD5')  from dual;

It generates a hash for mystring using MD5 but as per the requirement I should also give a secret key as given in the PHP code.

I am not good at encryption etc and don't know much about it.

I will be really thankful if someone can please let me know how to do this with PL/SQL.

Regards,

Habib

Comments
Post Details
Added on Sep 23 2019
6 comments
2,060 views