Received: from localhost (maia-2.hub.org [200.46.204.187]) by postgresql.org (Postfix) with ESMTP id 0B3CC9FBE41 for ; Thu, 1 Mar 2007 13:14:48 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.187]) (amavisd-new, port 10024) with ESMTP id 30347-03 for ; Thu, 1 Mar 2007 13:14:33 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey-1.7.4 Received: from ipmail02.adl2.internode.on.net (ipmail02.adl2.internode.on.net [203.16.214.141]) by postgresql.org (Postfix) with ESMTP id 4761D9FBD21 for ; Thu, 1 Mar 2007 13:14:32 -0400 (AST) Received: from ppp247-71.static.internode.on.net (HELO [192.168.8.200]) ([203.122.247.71]) by ipmail02.adl2.internode.on.net with ESMTP; 02 Mar 2007 03:44:20 +1030 X-IronPort-AV: i="4.14,237,1170595800"; d="scan'208"; a="91627925:sNHT3297522984" Message-ID: <45E709E7.8090601@Sheeky.Biz> Date: Fri, 02 Mar 2007 03:44:15 +1030 From: Shane Ambler User-Agent: Thunderbird 1.5.0.8 (Macintosh/20061025) MIME-Version: 1.0 To: Ezequias Rodrigues da Rocha CC: Bart Degryse , PostgreSQL Subject: Re: How to store a password encripted in a userdefinedtable References: <675205.64473.qm@web55615.mail.re4.yahoo.com> <55c095e90703010658u72d22d38g54256769e01cd8fb@mail.gmail.com> <55c095e90703010702k4920ca20r473154d934c8c8f8@mail.gmail.com> <45E6FC74.A3DD.0030.0@indicator.be> <55c095e90703010853n2e34a260pd7fb8e9430d789a@mail.gmail.com> In-Reply-To: <55c095e90703010853n2e34a260pd7fb8e9430d789a@mail.gmail.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=2.023 tagged_above=0 required=5 tests=AWL, BAYES_50, BIZ_TLD, SPF_HELO_PASS X-Spam-Level: ** X-Archive-Number: 200703/17 X-Sequence-Number: 27655 Ezequias Rodrigues da Rocha wrote: > I am just passing the database owner password (postgresql > autentication) to the statement: > > Select md5('the password I have in my mind') and compare with the > password pgAdmin3 shows me. > > They are completely different. Try SELECT 'md5'||md5('the password I have in my mind'||'userlogin'); > Ezequias > > 2007/3/1, Bart Degryse : >> >> >> It doesn't do that for me. I've tried it on three different databases (of >> two different versions) as three different users and the result is always >> the same (as it should be): >> >> select USER, md5('password') >> >> current_user md5 >> bigdbuser 5f4dcc3b5aa765d61d8327deb882cf99 >> >> current_user md5 >> bigdbsys 5f4dcc3b5aa765d61d8327deb882cf99 >> >> >> current_user md5 >> logstocksys 5f4dcc3b5aa765d61d8327deb882cf99 >> >> Show us some statements. >> >> >> >>> "Ezequias Rodrigues da Rocha" 2007-03-01 >> 16:02 >>> >> >> Just another thing. >> >> Why md5 function return a different string from user role of postgresql ? >> >> It allways put an md5 string concated with another sequence of string. >> >> Why does it occurs ? >> Ezequias >> >> 2007/3/1, Ezequias Rodrigues da Rocha : >> > I know it. Thank you so much. >> > >> > Ezequias >> > Grettings from Brazil. >> > >> > 2007/3/1, Bart Degryse : >> > > >> > > >> > > update yourtable set passwordfield = md5(passwordfield) >> > > >> > > watch out: md5 is irreversable! you can't "un_md5" >> > > >> > > >> > > >>> "Ezequias Rodrigues da Rocha" >> 2007-03-01 >> > > 15:08 >>> >> > > >> > > John, >> > > >> > > That was what I was looking for for a long time. >> > > >> > > Now I will change my teller password account to md5. >> > > >> > > Could someone suggest me how to change all passwords (PLAIN) to md5 ? >> > > >> > > My real best regards >> > > Ezequias >> > > >> > > 2007/3/1, John DeSoi : >> > > > MD5 is built-in to PostgreSQL. It is what PostgreSQL itself uses to >> > > > hash passwords. For example: >> > > > >> > > > select md5('this is my password'); >> > > > >> > > > md5 >> > > > ---------------------------------- >> > > > 210d53992dff432ec1b1a9698af9da16 >> > > > (1 row) >> > > > >> > > > >> > > > >> > > > On Mar 1, 2007, at 6:06 AM, Eugenio Flores wrote: >> > > > >> > > > > Thanks Andrej. But how can I use such algoritms in postgresql? >> arey >> > > > > they defined in a function that I can call? >> > > > > >> > > > > Or, do I have to code one of those algorithm to use it in my >> > > > > application? >> > > > >> > > > >> > > > >> > > > John DeSoi, Ph.D. >> > > > http://pgedit.com/ >> > > > Power Tools for PostgreSQL >> > > > >> > > > >> > > > ---------------------------(end of >> > > broadcast)--------------------------- >> > > > TIP 9: In versions below 8.0, the planner will ignore your >> desire to >> > > > choose an index scan if your joining column's datatypes >> do not >> > > > match >> > > > >> > >> >> >> -- >> =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= >> Atenciosamente >> (Sincerely) >> Ezequias Rodrigues da Rocha >> =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- >> A pior das democracias ainda é melhor do que a melhor das ditaduras >> The worst of democracies is still better than the better of dictatorships >> http://ezequiasrocha.blogspot.com/ >> > > -- Shane Ambler pgSQL@Sheeky.Biz Get Sheeky @ http://Sheeky.Biz