List:General Discussion« Previous MessageNext Message »
From:Benjamin Pflugmann Date:August 11 2002 5:51pm
Subject:Re: Need reversible encryption as string
View as plain text  
Hi.

On Sun 2002-08-11 at 12:07:47 -0500, paul@stripped wrote:
> At 9:25 -0700 8/11/02, Michael Collins wrote:
[...]
> >SELECT * FROM MYDB
> >WHERE EmailAddress=$EmailEntered AND 
> >DECODE(LoginPassword,'MySalt')=$PasswordEntered
> 
> If you write the query like that, yes, it will use a complete scan.

I beg to differ. If there is an index on EmailAddress it will be used
and only all entries with the same email address (which should be one
or only one) will be scanned.

> But you could also use
> 
> ... AND LoginPassword = ENCODE($PasswordEntered,'MySalt')

But that's a good idea anyhow. 

Bye,

	Benjamin.

-- 
benjamin-mysql@stripped
Thread
Need reversible encryption as stringMichael Collins11 Aug
  • Re: Need reversible encryption as stringMike Hall11 Aug
    • Re: Need reversible encryption as stringMichael Collins11 Aug
    • Re: [OT] assigning new passwords (was: Need reversible encryption as string)Benjamin Pflugmann11 Aug
  • Re: Need reversible encryption as stringPaul DuBois11 Aug
    • Re: Need reversible encryption as stringBenjamin Pflugmann11 Aug
      • Re: Need reversible encryption as stringPaul DuBois11 Aug
  • Re: [OT] assigning new passwords (was: Need reversible encryption as string)Mike Hall11 Aug
    • Re: [OT] assigning new passwords (was: Need reversible encryptionas string)Joe Shear12 Aug
Re: Need reversible encryption as stringMichael Collins11 Aug