Re: calculating the MD5 hash of role passwords in C

From: Stephen Frost <sfrost(at)snowman(dot)net>
To: Matthias Apitz <guru(at)unixarea(dot)de>
Cc: pgsql-general(at)lists(dot)postgresql(dot)org
Subject: Re: calculating the MD5 hash of role passwords in C
Date: 2020-02-05 18:59:53
Message-ID: 20200205185953.GY3195@tamriel.snowman.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Greetings,

* Matthias Apitz (guru(at)unixarea(dot)de) wrote:
> If I look into the database I see:
>
> sisis71=# select rolname, rolpassword from pg_authid where rolname = 'sisis';
> 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?

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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Vik Fearing 2020-02-06 02:54:48 POLL: Adding transaction status to default psql prompt
Previous Message Márcio Antônio Sepp 2020-02-05 17:30:04 Weird behavior with update cascade on partitioned tables when moving data between partitions