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

Home -> Community -> Usenet -> c.d.o.tools -> Re: HELP! Return variable - (decrypted) - is truncated, why?

Re: HELP! Return variable - (decrypted) - is truncated, why?

From: Newbie \(Joe\) <jranseth_at_hotmail.com>
Date: 2000/07/05
Message-ID: <beI85.88$87.1144@news1.mts.net>#1/1

Here's the decryption function......pretty common. Is there something I'm overlooking?
What is bizarre is that it works most of the time, but truncates perhaps about 20% of the time.
Mh

--
create or replace function decrypt_func   (vstring in varchar2)
return varchar2
is
   noffset           number(3);
   nlength           number(3);
   vtranslateto      varchar2(2000);
   vtranslatefrom    varchar2(2000);
   vtranslateshifted varchar2(2000);
   vfinalstring      varchar2(2000);
   dthedate          date;
begin
   vtranslatefrom := '0987654321)(*&^%$#@!-_=+\|]}[{pPoOiIuU' ||
                     'yYtTrReEwWqQAasSdDfFgGhHjJkKlL;:''"zZx' ||
                     'cvbnm,./?><M NBVCX`~';
   vtranslateto   := 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJ' ||
                     'KLMNOPQRSTUVWXYZ1234567890-=!@#$%^&' ||
                     '*()_+[]\{}|;'':",./<> ?~`';
   noffset        := instr(vtranslatefrom, substr(vstring, 1, 1));
   nlength        := instr(vtranslatefrom, substr(vstring,
                     noffset + 1, 1));
   vtranslateshifted := substr(vtranslatefrom, noffset + 1) ||
                               substr(vtranslatefrom, 1, noffset);
   vfinalstring   := translate(substr(vstring, noffset + 2, nlength),
                               vtranslateshifted, vtranslateto);
   return vfinalstring;
end fundecrypt;
/

--

"Thomas J. Kyte" <tkyte_at_us.oracle.com> wrote in message
news:8jkrap$1ls$1_at_nnrp1.deja.com...

> In article <SP675.358$Hs3.8200_at_news1.mts.net>,
> "mAd hAcker" <madhackerboy_at_hotmail.com> wrote:
> > Using 8.1.6.
> > I have a webpage(stored proc) with a login form. When the user
logs in,
> > I am retrieving a handful of variables and storing them as cookies
(the
> > values are encrypted.) The variable I am concerned with is a user_pin
> > (unique 9 digit number) and is being displayed on the page, as well
and
> > entered into a table upon further transactions.
> >
> > The problem I am having is that sometimes the pin is being
truncated...and
> > at different points, on different tries.
> > I am testing using a pin of 987654321:
> > I have experienced return variables of : 9, 9876, etc....
> >
> > There seems to be no reasonable explanation for this - is there
something
> > that I might be overlooking? It is being truncated both on the page,
and in
> > the table when entered, so the problem is not with the htp.
> > Is this possibly an error in the decryption function? Is it perhaps
just
> > cutting it off for no good reason? (Is my server processing it TOO
> > FAST!?!?!?!?)
> >
> > _
> > Mh
> >
> >
>
> how are you encrypting?
> what does you code look like?
> can you post a really small example?
> >
> --
> Thomas Kyte (tkyte_at_us.oracle.com) Oracle Service Industries
> Howtos and such: http://osi.oracle.com/~tkyte/index.html
> Oracle Magazine: http://www.oracle.com/oramag
> Opinions are mine and do not necessarily reflect those of Oracle Corp
> >
> Sent via Deja.com http://www.deja.com/
> Before you buy.
Received on Wed Jul 05 2000 - 00:00:00 CDT

Original text of this message

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