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 -> Re: dbms_obfuscation_toolkit input length -- example added

Re: dbms_obfuscation_toolkit input length -- example added

From: Dieter Buecherl <Dieter.Buecherl_at_t-online.de>
Date: Tue, 19 Feb 2002 13:07:45 +0100
Message-ID: <a4tf54$f1p$02$1@news.t-online.com>


create or replace function encUTF (a varchar2, k varchar2 default 'AAAAAAAA')
return varchar2
is
  i varchar2(100) := a;
  b varchar2(100);
  g number;
begin
  select vsize(i) into g from dual;
  dbms_output.put_line(g);
  while g mod 8 <> 0 loop

      i := i || ' ';
      select vsize(i) into g from dual;
      dbms_output.put_line(g);
      dbms_output.put_line(a);

  end loop;
  b := dbms_obfuscation_toolkit.desencrypt(input_string => i, key_string => k);
  dbms_output.put_line(b);
  return b;
end encUTF ;
/

declare a varchar2(100);
begin
a := encUTF('Dieter Bücherl');
a := encUTF('');
end;

"Dieter Buecherl" <Dieter.Buecherl_at_t-online.de> schrieb im Newsbeitrag news:a4te8n$h7g$07$1_at_news.t-online.com...
> Hello, Hanne
>
> I've attempted the same on a database with UTF-8 charset.
> I thnik that dbms_obfuscation_toolkit.desencrypt does not check the length
> of the string but the number of bytes.
> You can verify the bytelength of your input_string with vsize,
> e.g. select vsize('äöüÄÖÜß') from dual
> If you can pad the input_string to a vsize of 8, 16, ..., then
> dbms_obfuscation_toolkit.desencrypt will handle it accordingly.
>
> HTH Dieter
>
>
> "Hanne Hagedorn" <hanne.hagedorn_at_wwl.de> schrieb im Newsbeitrag
> news:f356d7a3.0202180742.664e0ad5_at_posting.google.com...
> > Hi,
> >
> > I'm trying to encrypt columns in 8.1.7 using the
> > dbms_obfuscation_toolkit.desencrypt function, which requires a
> > multiple of 8 bytes as input. If the input contains only characters in
> > the US7ASCII charset, I can pad it to the correct length, so there is
> > no problem. But whenever I try to encrypt something containing special
> > characters like the german 'ä,ö,ü', the package complains about
> > invalid input length. This happens with a database charset of
> > iso8859p1 or utf-8. Is there any chance to handle this?
> >
> > Thanks,
> > Hanne
>
>
Received on Tue Feb 19 2002 - 06:07:45 CST

Original text of this message

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