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 1jgaHo-0000Y0-Ko for pgsql-general@arkaria.postgresql.org; Wed, 03 Jun 2020 20:46:56 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1jgaHn-0002uZ-Ic for pgsql-general@arkaria.postgresql.org; Wed, 03 Jun 2020 20:46:55 +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 1jgaHn-0002uR-Ax for pgsql-general@lists.postgresql.org; Wed, 03 Jun 2020 20:46:55 +0000 Received: from momjian.us ([72.94.173.45]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jgaHk-0004Ny-M4 for pgsql-general@lists.postgresql.org; Wed, 03 Jun 2020 20:46:54 +0000 Received: from bruce by momjian.us with local (Exim 4.92) (envelope-from ) id 1jgaHj-00035u-E1; Wed, 03 Jun 2020 16:46:51 -0400 Date: Wed, 3 Jun 2020 16:46:51 -0400 From: Bruce Momjian To: Tim Cross Cc: pgsql-general@lists.postgresql.org Subject: Re: GPG signing Message-ID: <20200603204651.GA28673@momjian.us> References: <1590519662.31834.32.camel@bloodnok.com> <87lflefd3e.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <87lflefd3e.fsf@gmail.com> User-Agent: Mutt/1.10.1 (2018-07-13) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On Wed, May 27, 2020 at 10:14:46AM +1000, Tim Cross wrote: > > Marc Munro writes: > > > I need to be able to cryptographically sign objects in my database > > using a public key scheme. > > > > Is my only option to install plpython or some such thing? Python > > generally makes me unhappy as I'm never convinced of its stability or > > the quality of its APIs, and it is not obvious to me which of the many > > different gpg-ish packages I should choose. > > > > Any other options? Am I missing something? > > > > This is something you would normally implement at the application level, > using the database as just the store for the data and signatures or > signed digests. > > Main reason for this is to allow for secure key management. It is very > difficult to implement a secure key management solution at the database > level unless it is designed into the fundamental architecture of the > rdbms. It is the same age old problem - how can you encrypt data AND > have the keys for the encrypted data in the same place. The main reason > for encryption is so that if your store gets compromised, the data > cannot be read. However, if your key is also in the store, then when > your compromised, your key is compromised and your encryption becomes a > mute issue. This blog entry illustrates row signing on the client side: https://momjian.us/main/blogs/pgblog/2018.html#September_7_2018 -- Bruce Momjian https://momjian.us EnterpriseDB https://enterprisedb.com The usefulness of a cup is in its emptiness, Bruce Lee