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 1iuKcR-0002FR-Rh for pgsql-general@arkaria.postgresql.org; Wed, 22 Jan 2020 18:20:47 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1iuKcP-0005Gb-0w for pgsql-general@arkaria.postgresql.org; Wed, 22 Jan 2020 18:20:45 +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 1iuKcO-0005GU-NE for pgsql-general@lists.postgresql.org; Wed, 22 Jan 2020 18:20:44 +0000 Received: from ms-10.1blu.de ([178.254.4.101]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1iuKcL-0001Vm-TX for pgsql-general@lists.postgresql.org; Wed, 22 Jan 2020 18:20:44 +0000 Received: from [188.174.50.207] (helo=localhost.unixarea.de) by ms-10.1blu.de with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.86_2) (envelope-from ) id 1iuKcJ-0007F3-CM; Wed, 22 Jan 2020 19:20:39 +0100 Received: from localhost.my.domain (localhost [127.0.0.1]) by localhost.unixarea.de (8.15.2/8.14.9) with ESMTPS id 00MIKbHx002962 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Wed, 22 Jan 2020 19:20:38 +0100 (CET) (envelope-from guru@unixarea.de) Received: (from guru@localhost) by localhost.my.domain (8.15.2/8.14.9/Submit) id 00MIKaNc002961; Wed, 22 Jan 2020 19:20:36 +0100 (CET) (envelope-from guru@unixarea.de) X-Authentication-Warning: localhost.my.domain: guru set sender to guru@unixarea.de using -f Date: Wed, 22 Jan 2020 19:20:36 +0100 From: Matthias Apitz To: pgsql-general@lists.postgresql.org Subject: calculating the MD5 hash of role passwords in C Message-ID: <20200122182036.GA2908@c720-r342378> Reply-To: Matthias Apitz MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="uAKRQypu60I7Lcqm" Content-Disposition: inline X-Operating-System: FreeBSD 13.0-CURRENT r342378 (amd64) X-message-flag: Mails containing HTML will not be read! Please send only plain text. User-Agent: Mutt/1.11.1 (2018-12-01) X-Con-Id: 51246 X-Con-U: 0-guru X-Originating-IP: 188.174.50.207 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --uAKRQypu60I7Lcqm Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hello, If I look into the database I see: sisis71=3D# select rolname, rolpassword from pg_authid where rolname =3D 's= isis'; rolname | rolpassword ---------+------------------------------------- sisis | md52f128a1fbbecc4b16462e8fc8dda5cd5 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? Thanks matthias --=20 Matthias Apitz, =E2=9C=89 guru@unixarea.de, http://www.unixarea.de/ +49-176= -38902045 Public GnuPG key: http://www.unixarea.de/key.pub --uAKRQypu60I7Lcqm Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCAAdFiEEXmn7rBYYViyzy/vBR8z35Hb+nREFAl4oknEACgkQR8z35Hb+ nRGwORAAm/4eGwu2+zAE0u74jyU922GGf5ilxu9PhzNHNBgbkxi4VVz8LHTP0bLu excaIIbFNpCfS5Drrx/2VMpYMXDkRKMms3Sm8rZZ12lGKLG0lAq3zVf49NY7kGKU UDCAuez9UTVsdu9fhxkNzYeBV5erw4J8CvnKPrYDNCQzlaadKXNDfGYRrHRxyGfQ O5B2OuZGSV8R4ahZmMdvP0dp84aZMOE5inw7nw91oj55TiX75+lwh8L/npdKQtyp gtdVOnCkWhAiXZZj0IGp0kQjnDbpIqoci/Ntj5mYX1w50Pwq0rDdXvNujYavdARq Kb8cMHB9UVmE4VQH8BKrYx2S3UCUVMdq+vD8EfN1MN3DzgAqsoVvduy1UJ2Qyf7T oHXZn2AupfKJ5MiT9QqEq7Jh1oHytn0KN/uE29kS2/e71eruPuLa8RIx7fntjqTg mfgX4TT7rhur5KJFDXw4IjIo273GZ/xxmTFfxxn5CRhVgE6u/OWLsiVAcxMDGrXc Fdqh+C56Jkpuq7iSYPw6MBCMZEQn/clIXY/M+zE+HaNConhpwZtrXhbEQnhDqHw1 JY7PnN5O7O0nXc0pauzQo9CWSQaCIAtt7HiaZVbUuAzs9fQOuVhjTUCm8mcMiMMd B6oAp2Gpvp6mBDLEp5s+dIafCn+MaVWYMgRm3MfzcLfQV9NbNeM= =+p5W -----END PGP SIGNATURE----- --uAKRQypu60I7Lcqm--