Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kId18-00078e-Fe for pgsql-docs@arkaria.postgresql.org; Wed, 16 Sep 2020 19:22:58 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1kId17-0008AT-DX for pgsql-docs@arkaria.postgresql.org; Wed, 16 Sep 2020 19:22:57 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kId17-0008AM-8K for pgsql-docs@lists.postgresql.org; Wed, 16 Sep 2020 19:22:57 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kId14-0001TS-VA for pgsql-docs@lists.postgresql.org; Wed, 16 Sep 2020 19:22:56 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 08GJMqJ0003308; Wed, 16 Sep 2020 15:22:52 -0400 From: Tom Lane To: zenpolcorporation@gmail.com cc: pgsql-docs@lists.postgresql.org Subject: Re: How to interpret the salt sent in the AuthenticationMD5Password message from the server. In-reply-to: <160027570302.24369.6463926392340126344@wrigleys.postgresql.org> References: <160027570302.24369.6463926392340126344@wrigleys.postgresql.org> Comments: In-reply-to PG Doc comments form message dated "Wed, 16 Sep 2020 17:01:43 -0000" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <3306.1600284172.1@sss.pgh.pa.us> Date: Wed, 16 Sep 2020 15:22:52 -0400 Message-ID: <3307.1600284172@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk PG Doc comments form writes: > In short, what is the format of the salt sent to the server? I think you might have a conceptual error here. The salt is sent from the server to you, not the other way around. It's just four random bytes in the AuthenticationMD5Password message, which I'm pretty sure you should incorporate verbatim in your MD5 input. The bytes are just binary data, they're not ASCII or encoded in some way. regards, tom lane