日期:2014-05-16 浏览次数:20949 次
CREATE OR REPLACE FUNCTION "DES_test3"(str in varchar2,mkey in varchar2) return varchar2
deterministic IS
l_data varchar2(255);
l_data2 varchar2(255);
l_key varchar2(100);
begin
l_key := mkey
l_data := rpad(str, (trunc(length(str) / 8) + 1) * 8, chr(0));
dbms_obfuscation_toolkit.DESEncrypt(input_string => l_data,
key_string => l_key,
encrypted_string => l_data2);
return l_data2;
end DES_test1;
CREATE OR REPLACE FUNCTION "DES2"(str in varchar2) return varchar2
deterministic IS
l_data varchar2(255);
l_data2 varchar2(255);
begin
l_data := rpad(str, (trunc(length(str) / 8) + 1) * 8, chr(0));
dbms_obfuscation_toolkit.DESEncrypt(input_string => l_data,
key_string => 'MagicKey',
encrypted_string => l_data2);
return l_data2;
end DES2;