pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Christoph Moench-Tegeder <cmt@burggraben.net>
To: Matthias Apitz <guru@unixarea.de>
Cc: pgsql-general@lists.postgresql.org
Subject: Re: calculating the MD5 hash of role passwords in C
Date: Thu, 23 Jan 2020 17:15:37 +0100
Message-ID: <20200123161537.GA31330@squirrel.exwg.net> (raw)
In-Reply-To: <20200122194113.GA2410@c720-r342378>
References: <20200122182036.GA2908@c720-r342378>
	<20200122185847.GA90048@elch.exwg.net>
	<20200122194113.GA2410@c720-r342378>

## Matthias Apitz (guru@unixarea.de):

> > The documentation on pg_authid has the details:
> > "The MD5 hash will be of the user's password concatenated to their user name."
> > https://www.postgresql.org/docs/12/catalog-pg-authid.html
> 
> This is still not exactly what I was looking for. But has an interesting
> detail (salting the role password by adding the role name to it). An
> implementation with UNIX crypt(3) for MD5 would need an additional salt
> like '$1$salt' to encrypt 'sisis123sisis'.

It's not crypt(3). It's "the MD5 hash of the user's password concatenated
to their user name".
Try:
perl -MDigest::MD5 -e 'print("md5" . Digest::MD5::md5_hex("sisis123" . "sisis") . "\n");'

Regards,
Christoph

-- 
Spare Space.





view thread (14+ messages)  latest in thread

Message-ID: <20200123161537.GA31330@squirrel.exwg.net>
Permalink:  ../20200123161537.GA31330@squirrel.exwg.net/
Also on:    postgresql.org/message-id/20200123161537.GA31330@squirrel.exwg.net

 · 

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-general@postgresql.org
  Cc: cmt@burggraben.net, guru@unixarea.de
  Subject: Re: calculating the MD5 hash of role passwords in C
  In-Reply-To: <20200123161537.GA31330@squirrel.exwg.net>
  References: <20200122182036.GA2908@c720-r342378> <20200122185847.GA90048@elch.exwg.net> <20200122194113.GA2410@c720-r342378> <20200123161537.GA31330@squirrel.exwg.net>

* 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