Antes que nada disculpa la demora, no te imaginas lo cargado de estos meses.
Respondiendo a tu pregunta (si es que todavia puedo serte de utilidad),
DBMS_OBFUSCATION_TOOLKIT provee de algoritmos de encryptacion basados en estandares.
Estas rutinas estan perfectamente documentadas en:
http://download-west.oracle.com/docs/cd/B14117_01/appdev.101/b10802/d_obtool.htm#1002213Aqui un ejemplo de como utilizarlo:
-- encrypt.sql
-- demonstrates the use of the dbms_obfuscation_toolkit by
-- Prompting a user for a password and encrypting and decrypting
-- The data
set serveroutput on;
CLEAR BUFFER
PROMPT Please enter a password - Must be 8 characters !
PROMPT
ACCEPT PASSWD
DECLARE
input_string VARCHAR2(16) := '&PASSWD';
raw_input RAW(128) := UTL_RAW.CAST_TO_RAW(input_string);
key_string VARCHAR2(16) := 'keepthesecretnum';
raw_key RAW(128) := UTL_RAW.CAST_TO_RAW(key_string);
encrypted_raw RAW(2048);
encrypted_string VARCHAR2(2048);
decrypted_raw RAW(2048);
decrypted_string VARCHAR2(2048);
error_in_input_buffer_length EXCEPTION;
PRAGMA EXCEPTION_INIT(error_in_input_buffer_length, -28232);
INPUT_BUFFER_LENGTH_ERR_MSG VARCHAR2(100) :=
'*** DES INPUT BUFFER NOT A MULTIPLE OF 8 BYTES - IGNORING EXCEPTION ***';
double_encrypt_not_permitted EXCEPTION;
PRAGMA EXCEPTION_INIT(double_encrypt_not_permitted, -28233);
DOUBLE_ENCRYPTION_ERR_MSG VARCHAR2(100) :=
'*** CANNOT DOUBLE ENCRYPT DATA - IGNORING EXCEPTION ***';
-- 1. Begin testing raw data encryption and decryption
BEGIN
dbms_output.put_line('> ========= BEGIN TEST RAW DATA =========');
dbms_output.put_line('> Raw input : ' ||
UTL_RAW.CAST_TO_VARCHAR2(raw_input));
BEGIN
dbms_obfuscation_toolkit.DESEncrypt(input => raw_input,
key => raw_key, encrypted_data => encrypted_raw );
dbms_output.put_line('> encrypted hex value : ' ||
rawtohex(encrypted_raw));
dbms_obfuscation_toolkit.DESDecrypt(input => encrypted_raw,
key => raw_key, decrypted_data => decrypted_raw);
dbms_output.put_line('> Decrypted raw output : ' ||
UTL_RAW.CAST_TO_VARCHAR2(decrypted_raw));
dbms_output.put_line('> ');
if UTL_RAW.CAST_TO_VARCHAR2(raw_input) =
UTL_RAW.CAST_TO_VARCHAR2(decrypted_raw) THEN
dbms_output.put_line('> Raw DES Encyption and Decryption successful');
END if;
EXCEPTION
WHEN error_in_input_buffer_length THEN
dbms_output.put_line('> ' || INPUT_BUFFER_LENGTH_ERR_MSG);
END;
dbms_output.put_line('> ');
END;
/
La salida de este ejemplo debe ser:
SQL> start encrypt
Please enter a password - Must be 8 characters !
Wildwind
old 2: input_string VARCHAR2(16) := '&PASSWD';
new 2: input_string VARCHAR2(16) := 'wildwind';
> ========= BEGIN TEST RAW DATA =========
> Raw input : wildwind
> encrypted hex value : 28EAA8E9E2CEA710
> Decrypted raw output : wildwind
>
> Raw DES Encyption and Decryption successful
>
PL/SQL procedure successfully completed.