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 1iAti1-0007wY-UC for pgsql-general@arkaria.postgresql.org; Thu, 19 Sep 2019 10:30:46 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1iAti0-000892-Mv for pgsql-general@arkaria.postgresql.org; Thu, 19 Sep 2019 10:30:44 +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 1iAti0-00088v-D8 for pgsql-general@lists.postgresql.org; Thu, 19 Sep 2019 10:30:44 +0000 Received: from ms-10.1blu.de ([178.254.4.101]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1iAthx-0007kS-G7 for pgsql-general@lists.postgresql.org; Thu, 19 Sep 2019 10:30:43 +0000 Received: from [132.174.172.2] (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 1iAthw-0005L0-L5 for pgsql-general@lists.postgresql.org; Thu, 19 Sep 2019 12:30:40 +0200 Received: from localhost.my.domain (localhost [127.0.0.1]) by localhost.unixarea.de (8.15.2/8.14.9) with ESMTPS id x8JAUde9002629 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO) for ; Thu, 19 Sep 2019 12:30:39 +0200 (CEST) (envelope-from guru@unixarea.de) Received: (from guru@localhost) by localhost.my.domain (8.15.2/8.14.9/Submit) id x8JAUdaL002628 for pgsql-general@lists.postgresql.org; Thu, 19 Sep 2019 12:30:39 +0200 (CEST) (envelope-from guru@unixarea.de) X-Authentication-Warning: localhost.my.domain: guru set sender to guru@unixarea.de using -f Date: Thu, 19 Sep 2019 12:30:39 +0200 From: Matthias Apitz To: pgsql-general@lists.postgresql.org Subject: PGPASSWORD in crypted form, for example BlowFish or SHA-256 Message-ID: <20190919103039.GA2501@c720-r342378> Reply-To: Matthias Apitz MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit 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: 132.174.172.2 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Hello, Our software, a huge ILS, is running on Linux with DBS Sybase. To connect to the Sybase server (over the network, even on localhost), credentials must be known: a user (say 'sisis') and its password. For Sybase we have them stored on the disk of the system in a file syb.npw as: $ cat /opt/lib/sisis/etc/syb/syb.npw sisis:e53902b9923ab2fb sa:64406def48efca8c for the user 'sisis' and the administrator 'sa'. Our software has as shared library a blob which knows how to decrypt the password hash above shown as 'e53902b9923ab2fb' into clear text which is then used in the ESQL/C or Java layer to connect to the Sybase server. For PostgreSQL the password must be typed in (for pgsql) or can be provided in an environment variable PGPASSWORD=blabla Is there somehow an API in PG to use ciphered passwords and provide as a shared library the blob to decrypt it? If not, we will use the mechanism same as we use for Sybase. Or any other idea to not make detectable the credentials? This was a request of our customers some years ago. matthias -- Matthias Apitz, ✉ guru@unixarea.de, http://www.unixarea.de/ +49-176-38902045 Public GnuPG key: http://www.unixarea.de/key.pub Mientras haya voluntad de lucha habrá esperanza de vencer.