[Pgsql-ayuda] Seguridad Postgres

Alvaro Herrera alvherre@dcc.uchile.cl
Wed, 17 Sep 2003 16:30:29 -0400


On Wed, Sep 17, 2003 at 12:12:07PM -0500, Manuel Sugawara wrote:
> Alvaro Herrera <alvherre@dcc.uchile.cl> writes:
> 
> > Oops, es cierto, sorry :-( La idea es usar MD5 para almacenar
> > "versiones digeridas" de las claves de los usuarios, no almacenarlas
> > en claro.  Cuando tienes que autentificar un usuario, obtienes la
> > "sal" que se uso para digerir la clave original, digieres la clave
> > que te esta entregando el usuario con esa sal, y comparas con la
> > almacenada.
> 
> No exactamente, a menos que me falle la memoria MD5 no usa el concepto
> de salt. Creo que estas confundiendo md5 con crypt(3), el algoritmo de
> encripción estándar en Unix basado en DES.

Oops... tienes razon.  Pero en realidad lo que me estaba confundiendo
era una extension de GNU a crypt(3).  Extracto de crypt(3) en mi sistema:

GNU EXTENSION
   The glibc2 version of this function has the following  additional fea-
   tures.   If  salt is a character string starting with the three charac-
   ters "$1$" followed by at most eight characters, and optionally termi-
   nated  by  "$",  then instead of using the DES machine, the glibc crypt
   function uses an MD5-based algorithm,  and  outputs  up  to  34 bytes,
   namely  "$1$<string>$", where "<string>" stands for the up to 8 charac-
   ters following "$1$" in the salt, followed by 22 bytes chosen from  the
   set [a-zA-Z0-9./].  The entire key is significant here (instead of only
   the first 8 bytes).


-- 
Alvaro Herrera (<alvherre[a]dcc.uchile.cl>)
"Porque francamente, si para saber manejarse a uno mismo hubiera que
rendir examen... ¿Quién es el machito que tendría carnet?"  (Mafalda)