Re: How to store a password encripted in a userdefinedtable

From: Shane Ambler <pgsql(at)Sheeky(dot)Biz>
To: Ezequias Rodrigues da Rocha <ezequias(dot)rocha(at)gmail(dot)com>
Cc: Bart Degryse <Bart(dot)Degryse(at)indicator(dot)be>, PostgreSQL <pgsql-sql(at)postgresql(dot)org>
Subject: Re: How to store a password encripted in a userdefinedtable
Date: 2007-03-01 17:14:15
Message-ID: 45E709E7.8090601@Sheeky.Biz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

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 <Bart(dot)Degryse(at)indicator(dot)be>:
>>
>>
>> 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" <ezequias(dot)rocha(at)gmail(dot)com> 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 <ezequias(dot)rocha(at)gmail(dot)com>:
>> > I know it. Thank you so much.
>> >
>> > Ezequias
>> > Grettings from Brazil.
>> >
>> > 2007/3/1, Bart Degryse <Bart(dot)Degryse(at)indicator(dot)be>:
>> > >
>> > >
>> > > update yourtable set passwordfield = md5(passwordfield)
>> > >
>> > > watch out: md5 is irreversable! you can't "un_md5"
>> > >
>> > >
>> > > >>> "Ezequias Rodrigues da Rocha" <ezequias(dot)rocha(at)gmail(dot)com>
>> 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 <desoi(at)pgedit(dot)com>:
>> > > > 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(at)Sheeky(dot)Biz

Get Sheeky @ http://Sheeky.Biz

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Adrian Klaver 2007-03-01 17:19:04 Re: How to store a password encripted in a userdefinedtable
Previous Message Ezequias Rodrigues da Rocha 2007-03-01 16:53:21 Re: How to store a password encripted in a userdefinedtable