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 1iAvab-0003jc-2s for pgsql-general@arkaria.postgresql.org; Thu, 19 Sep 2019 12:31:13 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1iAvaZ-0005IH-WC for pgsql-general@arkaria.postgresql.org; Thu, 19 Sep 2019 12:31:11 +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 1iAvaZ-0005I7-J2 for pgsql-general@lists.postgresql.org; Thu, 19 Sep 2019 12:31:11 +0000 Received: from mail-pf1-x42d.google.com ([2607:f8b0:4864:20::42d]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1iAvaW-0000Ur-P6 for pgsql-general@lists.postgresql.org; Thu, 19 Sep 2019 12:31:11 +0000 Received: by mail-pf1-x42d.google.com with SMTP id b128so2237592pfa.1 for ; Thu, 19 Sep 2019 05:31:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=message-id:subject:from:to:date:in-reply-to:references:user-agent :mime-version:content-transfer-encoding; bh=adTvUa3T+BV76QuNM/eYo7J8DacUsZiExH7JHvojrjM=; b=g6mQ3NwECUYQxi9qBRDA3IKkTnOcJQHpXs92y+BZv8kqkRk2wxlbUE9kLJymDsee2h Ox90qh32sqRVYTH6bvCYB1h+BT/aZXIiJiyOl+4Z/k9qh5LlTPM3YXpSxOY7Dgzxr/F/ v8/XRUJrE784HWomA5gZJLI0R3LcOg0cUtaChJ25p6lG+xxnvZ7kZXe8xp7wgat++44Z /S6H/aes4lSmf011WMG/PZUQxDoS81Tl/0SQZqco8hAKItSzj45qWJfAK5Aub3xOVOwa RiiY5y457YM3HXe0Yl4LXN0OOBEug5Gpplo+oZhkFeWtYrNvg+OEUNpX+Z79VsoQzfXI t4NA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:message-id:subject:from:to:date:in-reply-to :references:user-agent:mime-version:content-transfer-encoding; bh=adTvUa3T+BV76QuNM/eYo7J8DacUsZiExH7JHvojrjM=; b=Og3Dxh5Pf40OxXHh5az8bMVlygyswbhE40l9wxUIgKpp63b0P64XkRDKGqkPnXCgZb 0e2fEuwrd2yEAR/55aGhTbJOnOpxmbVYQSfbiVY1OUqXPOJGci9SfLBG2YoEVWN8EqE1 WXrDxjGghDOolYUfZrz67+zcWIezr1++QHEc0TFf5V1e/8VT/RbM7HIVk8H5DaWLsWmE Ry2KYMOnwO3btrfRUsBTPsjXA3WUmRjqI1wzZz5o5R38RKwsNtOMDmlXr9rXX0v621sJ Pjc5BnWuT6s4zFVZSQ8yclGN2GreRab6xKr5c7hOX87j08/EfIK6zsXTnxkGmB+4NJl+ 06bA== X-Gm-Message-State: APjAAAWTnrgmptqV3Rg5K7Af2dwBS9vuOvxYzPnE7d1EDtAAdiBntNfY MG3R/Bt3ZPDVKAXB9JrdAZ4kDCA6 X-Google-Smtp-Source: APXvYqzn82wHpk92pTdBOXmtBgv1zB06LetZGzINghZM+fUvecalQ2ZBr7N1zWXl22O09QgoVJhH7g== X-Received: by 2002:a63:2043:: with SMTP id r3mr8926110pgm.311.1568896266275; Thu, 19 Sep 2019 05:31:06 -0700 (PDT) Received: from 192-168-1-100.tpgi.com.au (146.133.220.203.dial.dynamic.acc01-geor-bat.comindico.com.au. [203.220.133.146]) by smtp.gmail.com with ESMTPSA id dw19sm6344515pjb.27.2019.09.19.05.31.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Sep 2019 05:31:05 -0700 (PDT) Message-ID: Subject: Re: PGPASSWORD in crypted form, for example BlowFish or SHA-256 From: rob stone To: Matthias Apitz , pgsql-general@lists.postgresql.org Date: Thu, 19 Sep 2019 22:31:01 +1000 In-Reply-To: <20190919103039.GA2501@c720-r342378> References: <20190919103039.GA2501@c720-r342378> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.30.5-1.1 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Hello, On Thu, 2019-09-19 at 12:30 +0200, Matthias Apitz wrote: > 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 > > https://www.postgresql.org/docs/11/auth-password.html Chapters 20.5 and 20.6 may give you more information. HTH, Robert