[Database class] password length
Paul S. Wang
pwang at cs.kent.edu
Sat Feb 26 21:45:27 EST 2011
Scott and Database class,
MD5 always produces a 32-digit hex number.
(for example ab6ae586750e31818d8562ec6cc8293a)
The MySQL PAWORD(...) function produces a 41 character result.
(for example: *F3A2A51A9B0F2BE2468926B4132313728C250DBF)
Thus, we can use a varchar(48) to cover both cases.
Paul
On Sat, Feb 26, 2011 at 01:26:10PM -0500, Scott Kennedy wrote:
> Subject: Database class help fixed
> From: Scott Kennedy <skenned7 at kent.edu>
> In-Reply-To: <20110225031718.GA7845 at cs.kent.edu>
> Date: Sat, 26 Feb 2011 13:26:10 -0500
> To: pwang at cs.kent.edu
> X-Mailer: Apple Mail (2.1082)
> X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.2.3 (mscan3.vs.cs.kent.edu [131.123.39.206]); Sat, 26 Feb 2011 13:26:17 -0500 (EST)
> X-Virus-Scanned: Maia Mailguard 1.0.2a
> X-Spam-Status: No, hits=0.165 tagged_above=0 required=5 tests=AWL=0.165,
> RCVD_IN_DNSWL_NONE=-0.0001
> X-Spam-Level:
> X-MIME-Autoconverted: from quoted-printable to 8bit by msrv.cs.kent.edu id p1QIQMix009699
>
> Paul,
>
> Never mind i figured out the problem. It was that in my database i only allowed for a varchar(20) on passwords thats why things were getting cut off and not matching. Is there any defined length that a password is converted to? like if a user has a really long password say 32 characters will that translate into a really really long md5 hash? I set my db column password to varchar(50) hoping i wont run into this problem again.
>
> -Scott
--
==============================================================================
Paul S. Wang Email: pwang at cs.kent.edu
Director of Research, ICM/Kent Tel: (330) 672-9051
Dept. of Computer Science, Kent State U. FAX: (330) 672-2725
Kent, Ohio, USA 44242-0001 http://www.cs.kent.edu/~pwang/
Institute for Computational Email: icm at mcs.kent.edu
Mathematics (ICM) http://icm.mcs.kent.edu/
==============================================================================
More information about the Dbclass
mailing list