Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> encrypt Chinese or Japanese

encrypt Chinese or Japanese

From: yongjia <yongjia_at_hotmail.com>
Date: Thu, 28 Dec 2006 15:18:39 +0800
Message-ID: <emvtln$pfe$1@news.cn99.com>


hi all:

I use dbms_obfuscation_toolkit.desencrypt to encrypt Chinese or Japanese vbstring
but when I decrypt it ,I can not get the right string

who can tell me how to resolve it?



create or replace function get_encrypted_string(orgstr varchar2) return varchar2 as
keystr varchar2(8) := 'angoukey';
encstr varchar2(40);
v_text varchar2(40);

begin
v_text := rpad( orgstr, (trunc(length(orgstr)/8)+1)*8, chr(0));

if orgstr is null then

   return null;
end if;

dbms_obfuscation_toolkit.desencrypt(
input_string => v_text,
key_string => keystr,
encrypted_string => encstr
);

return encstr;
end;

create or replace function get_decrypted_string(encstr varchar2) return varchar2 as
keystr varchar2(8) := 'angoukey';
orgstr varchar2(40);

begin
if encstr is null then

   return null;
end if;

dbms_obfuscation_toolkit.desdecrypt(
input_string => encstr,
key_string => keystr,
decrypted_string => orgstr
);

return rtrim(orgstr,chr(0));
end; Received on Thu Dec 28 2006 - 01:18:39 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US