Re: MySQL PASSWORD('x') function workalike

From: Marko Kreen <marko(at)l-t(dot)ee>
To: Nate Lawson <nate(at)rootlabs(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: MySQL PASSWORD('x') function workalike
Date: 2000-10-19 17:35:54
Message-ID: 20001019193554.A23705@l-t.ee
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Wed, Oct 18, 2000 at 03:11:12PM -0700, Nate Lawson wrote:
> In MySQL, I can get a hash of a VARCHAR by using the PASSWORD('') call. I
> know for DB admin there is pg_passwd, but is there a function interface so
> that I can get password hashes of arbitrary strings in SQL? (Note that I
> mean crypto hashes like MD5 and hopefully compatible with the hashes used
> for pg_passwd).

You can check out my implementation I just released ;)

http://www.l-t.ee/marko/pgsql/pgcrypto-0.1.tar.gz

And you can check out -hackers mail I sent. btw its 20k not
11k as the previous mail said :)

copy-paste desc:

---------------

It exports 2 functions to SQL level:

digest(data::text, hash_name::text)
which returns hexadecimal coded hash over data by
specified algorithm. eg

> select digest('blah', 'sha1');
5bf1fd927dfb8679496a2e6cf00cbe50c1c87145

digest_exists(hash_name::text)::bool
which reports if particular hash type exists.

--
marko

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Efrain Caro 2000-10-19 17:37:40 Re: (+) oracle notation
Previous Message Efrain Caro 2000-10-19 17:11:15 Re: (+) oracle notation