Encrypt Text to MD5 on Oracle Database


Encrypt MD5

First of all, you need to have access on DBMS_OBFUSCATION_TOOLKIT since it enables an application to encrypt data using either the Data Encryption Standard (DES) or the Triple DES algorithms. Here is the example how to encrypt text to MD5 on Oracle Database. First create the function called ENCRYPTMD5 and execute it later in order to encrypt the text.

create or replace 
function ENCRYPTMD5 (v_text in VARCHAR2)
return VARCHAR2 is
begin
    return DBMS_OBFUSCATION_TOOLKIT.MD5(input_string => v_text);
end;

 

select ENCRYPTMD5 ('secret text') from dual;

Leave a Reply