pg.ddx.io  pgsql-php@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Marek Lewczuk <newsy@lewczuk.com>
To: pgsql-php@postgresql.org
Subject: Re: MD5 in pg and php
Date: Thu, 29 Apr 2004 09:31:14 +0100
Message-ID: <4090BD52.9060708@lewczuk.com> (raw)
In-Reply-To: <20040429070716.GA6918@localhost.localdomain>
References: <20040429070716.GA6918@localhost.localdomain>

Joolz wrote:
> Hi, I'm completely new to hashing, so please bear with me.
> 
> I want to store passwords in a pg db, MD5 seems like a good way to
> enhance security (no more plaintext passwords over the line etc.) I
> had a look at MD5, in PHP 4.3.4 there is a function md5() which seems
> to work nicely:
> 
>   echo md5('apple');
> 
> returns ae6d32585ecc4d33cb8cd68a047d8434 every time. Apart from the
> PHP frontend, I also want to be able to use the same algorithm in
> native pg. I found that postgresql-contrib-7.3.4 has a function
> crypt() which I expected to work the same. However:
> 
>   select crypt('apple', gen_salt('md5'));
> 
> gives values different from the PHP md5() function, and moreover,
> they're different each time. Can anyone please tell me what I should
> do to get the same result in native pg as in PHP?
> 
> Thanks!
> 

I whould suggest to update PG to version 7.4, where there is built-in 
MD5 function.

 



view thread (10+ messages)  latest in thread

Message-ID: <4090BD52.9060708@lewczuk.com>
Permalink:  ../4090BD52.9060708@lewczuk.com/
Also on:    postgresql.org/message-id/4090BD52.9060708@lewczuk.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-php@postgresql.org
  Cc: newsy@lewczuk.com
  Subject: Re: MD5 in pg and php
  In-Reply-To: <4090BD52.9060708@lewczuk.com>
  References: <20040429070716.GA6918@localhost.localdomain> <4090BD52.9060708@lewczuk.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox