Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1izPu1-00034T-Kq for pgsql-general@arkaria.postgresql.org; Wed, 05 Feb 2020 18:59:57 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1izPu0-0007pm-F7 for pgsql-general@arkaria.postgresql.org; Wed, 05 Feb 2020 18:59:56 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1izPu0-0007pf-54 for pgsql-general@lists.postgresql.org; Wed, 05 Feb 2020 18:59:56 +0000 Received: from tamriel.snowman.net ([96.255.250.162]) by magus.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1izPtv-0001dK-D4 for pgsql-general@lists.postgresql.org; Wed, 05 Feb 2020 18:59:55 +0000 Received: by tamriel.snowman.net (Postfix, from userid 1000) id A8C435F7A7; Wed, 5 Feb 2020 13:59:53 -0500 (EST) Date: Wed, 5 Feb 2020 13:59:53 -0500 From: Stephen Frost To: Matthias Apitz Cc: pgsql-general@lists.postgresql.org Subject: Re: calculating the MD5 hash of role passwords in C Message-ID: <20200205185953.GY3195@tamriel.snowman.net> References: <20200122182036.GA2908@c720-r342378> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="NaL/HpMgzPsvAiqd" Content-Disposition: inline In-Reply-To: <20200122182036.GA2908@c720-r342378> User-Agent: Mutt/1.5.24 (2015-08-30) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --NaL/HpMgzPsvAiqd Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Greetings, * Matthias Apitz (guru@unixarea.de) wrote: > If I look into the database I see: >=20 > sisis71=3D# select rolname, rolpassword from pg_authid where rolname =3D = 'sisis'; > rolname | rolpassword > ---------+------------------------------------- > sisis | md52f128a1fbbecc4b16462e8fc8dda5cd5 >=20 > I know the clear text password of the role, it is simple 'sisis123', how > could I calculate the above MD5 hash from the clear text password, for > example in C? Which salt is used for the crypt(3) function? Didn't see it mentioned here, but it probably should be- newer PG installs really should be using SCRAM and not md5 and the way the validator is built/stored is rather different from the simple md5 that you've probably seen in the past. Thanks, Stephen --NaL/HpMgzPsvAiqd Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBCgAGBQJeOxCpAAoJEO1sijiDR2RV8uUQAK/d+Npm9F+iW8G/AizolWo0 Fq4VqywIcrb08yyvgF/45sIJ+HyAecgQFbKgwYH6pU8O1GkTkAyTSEiHobcQ2xfs xqj3PkO5nR9epFNbYlBrxDj3CiO6lu9K0RiVOjWjA10hk00JtUUs6gAQ8UrqdtjB B0pYnh6SXD/Wj3AH9nKn4JaPZm++lVhwtYPTicDu7LQ6I05DZ7V1myrShwY/W69d dQMQIbip7zolJ5RqRlpIaQ6ctpM0/5+y5xcdoD5ThddvTrO9MI1SeJ82SmMA7Vlp 1YhSr+cvnXzhFtMJwKYZtT3s9gnMOX/cH/QY30SD0AJrgjgWXejCfPc+rYHnO2Mn XCzu1vzxz1g5OscMjUwu69+MB9KlWffAz65uCHvGCApDhyPv1U3PjjlDVfNNFQK1 v/CMuChW6jO7gtaUO/Jh87iBYHsim5XWIJa/an/PDIdEOXp3+DjpaDpNWMJYY9/n ViMwWatjQ1ZmBbCK6MRdsz8XNItdMbuWpZpR0jIoFmKY53T4+qeyjANH8pHTk9x4 q6L4Z+yYRQ/QXJN9+iVdmBaMk7FVtyqirzNhHLSzXG68xdoWIUXuyZK/oh1XbcDE OTAAhvgj9o0Xl5seoV9ap55s9zQ84PcGIPguYQaeYwIobwueorhzQQyEsUWXafok KErVJ+RlSrupq8RTfXY5 =jimH -----END PGP SIGNATURE----- --NaL/HpMgzPsvAiqd--