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 1iAx8K-0007Wx-4T for pgsql-general@arkaria.postgresql.org; Thu, 19 Sep 2019 14:10:08 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1iAx8J-0000V3-1f for pgsql-general@arkaria.postgresql.org; Thu, 19 Sep 2019 14:10:07 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1iAx8I-0000Ur-Jt for pgsql-general@lists.postgresql.org; Thu, 19 Sep 2019 14:10:06 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1iAx8C-0006U2-Ll for pgsql-general@lists.postgresql.org; Thu, 19 Sep 2019 14:10:05 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id x8JE9vEJ022654; Thu, 19 Sep 2019 10:09:57 -0400 From: Tom Lane To: Matthias Apitz cc: pgsql-general@lists.postgresql.org Subject: Re: PGPASSWORD in crypted form, for example BlowFish or SHA-256 In-reply-to: <20190919103039.GA2501@c720-r342378> References: <20190919103039.GA2501@c720-r342378> Comments: In-reply-to Matthias Apitz message dated "Thu, 19 Sep 2019 12:30:39 +0200" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <22652.1568902197.1@sss.pgh.pa.us> Date: Thu, 19 Sep 2019 10:09:57 -0400 Message-ID: <22653.1568902197@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Matthias Apitz writes: > Is there somehow an API in PG to use ciphered passwords and provide as a > shared library the blob to decrypt it? No. Consider a non-password auth mechanism, for instance SSL certificates. You might find that an SSL certificate file stored where libpq will find it is already about as secure as what you're doing now. If you want to jump through extra hoops for more security, I think you can use ssh-agent to hold the keys. regards, tom lane