Re: field with Password - Mailing list pgsql-general

From Iñigo Barandiaran
Subject Re: field with Password
Date
Msg-id 4989A827.5060104@vicomtech.org
Whole thread Raw
In response to Re: field with Password  ("Raymond C. Rodgers" <sinful622@gmail.com>)
Responses Re: field with Password  (Iñigo Barandiaran <ibarandiaran@vicomtech.org>)
List pgsql-general
Thanks Raymond !!!!<br /><br /> That is something I wanted! It's Great if it is already integrated in Postgre! Superb.
Thisis much more easy.<br /><br /> Thank you All.<br /><br /> Best,<br /><blockquote
cite="mid:4989A790.7090401@gmail.com"type="cite"></blockquote> Iñigo Barandiaran wrote: <blockquote
cite="mid:49897455.7080602@vicomtech.org"type="cite">Thanks! <br /><br /><br /> Ok. I've found <a
class="moz-txt-link-freetext"href="http://256.com/sources/md5/" moz-do-not-send="true">http://256.com/sources/md5/</a>
library.So the idea is to define in the dataBase a Field of PlainText type. When I want to insert a new user, I define
apassword, convert to MD5 hash with the library and store it in the DataBase. Afterwards, any user check should get the
contentof the DataBase of do the inverse process with the library. Is it correct? <br /><br /> Thanks so much!!!!!! <br
/><br/> Best, <br /><br /></blockquote> Well, you can use the built-in md5 function for this purpose. For instance, you
couldinsert a password into the table with a statement like:<br /><br /><blockquote>insert into auth_data (user_id,
password)values (1, md5('test'));<br /></blockquote><br /> And compare the supplied password with something like:<br
/><br/><blockquote>select true from auth_data where user_id = 1 and password = md5('test');<br /></blockquote><br />
Youdon't need to depend on an external library for this functionality; it's built right into Postgres. Personally, in
myown apps I write in PHP, I  use a combination of sha1 and md5 to hash user passwords, without depending on Postgres
todo the hashing, but the effect is basically the same.<br /><br /> Raymond<br /><br /> 

pgsql-general by date:

Previous
From: Emilie Laffray
Date:
Subject: Re: Crash of Postgresql on Windows
Next
From: Richard Huxton
Date:
Subject: Re: Crash of Postgresql on Windows