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 1jybjj-0007TR-0T for pgsql-admin@arkaria.postgresql.org; Thu, 23 Jul 2020 13:58:15 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1jybjh-0007hM-VH for pgsql-admin@arkaria.postgresql.org; Thu, 23 Jul 2020 13:58:13 +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 1jybjh-0007hE-O3 for pgsql-admin@lists.postgresql.org; Thu, 23 Jul 2020 13:58:13 +0000 Received: from tamriel.snowman.net ([2001:470:e38f::11]) by magus.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1jybja-0001WN-JM for pgsql-admin@lists.postgresql.org; Thu, 23 Jul 2020 13:58:13 +0000 Received: by tamriel.snowman.net (Postfix, from userid 1000) id 2125E5F79F; Thu, 23 Jul 2020 09:58:04 -0400 (EDT) Date: Thu, 23 Jul 2020 09:58:04 -0400 From: Stephen Frost To: Tal Glo Cc: Paul =?iso-8859-1?Q?F=F6rster?= , Ron , pgsql-admin@lists.postgresql.org Subject: Re: Encryption in pg_dump Message-ID: <20200723135803.GR12375@tamriel.snowman.net> References: <2BCA8D4B-E94D-4F2F-99A5-D783912A1CDF@gmail.com> <20200722185541.GE3899@momjian.us> <6D40812C-3F42-41A2-A548-4EC7754DF473@gmail.com> <87zh7qbxqk.fsf@gmail.com> <4DCA85A3-B307-48E8-9B30-0D8E2E4911D2@gmail.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="XPX6T3UXHpsvYx46" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.24 (2015-08-30) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --XPX6T3UXHpsvYx46 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Greetings, * Tal Glo (glozmantal@gmail.com) wrote: > There is a way to implement full homomorphic encryption (FHE) with > Postgres. The decision which attributes to encrypt must be done at database > planning step. It worth mentioning that FHE is good to implement, if one > wants to be able to do server side supported mathematical operations on the > encrypted data. If the data just needs to be stored in an encrypted form > then using FHE might be a storage overkill. A dump of the database with FHE > encrypted attributes preserves the encryption of the encrypted attributes. Wasn't it relatively recently pointed out that having the ability to do mathematical operations on the encrypted data ends up leading someone to be able to deduce a fair bit of information much more easily than actually breaking the encryption would involve..? https://eprint.iacr.org/2016/775.pdf Not finding it right now but I recall there being another paper which basically pointed out that if you have context information about the encrypted data (if it's credit card numbers, or SSNs, or such), along with the ability to perform some operations (addition, ordering, etc) that you could derive the real values without that much difficulty. > 1. The encrypted attributes were big in size and Postgres cannot store the > FHE cypher texts data type. 20,858 encrypted values used 3,6GB. ~33% of > that size is because of base64 and the rest of the size ist because of my > chosen encryption parameters. A bit confused as to why you'd use base64 to store the data- would make a lot more sense to use bytea. > 2. Handling queries related to FHE encrypted attributes on the server side > requires an implementation of own C language functions. This could certainly be done in an extension, of course. Thanks, Stephen --XPX6T3UXHpsvYx46 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBCgAGBQJfGZdrAAoJEO1sijiDR2RVoisQAMc6epnYZLnUvg18oQLFI9yZ zG5L4SwfygJCW9QqGK86piy9QMS/s9ylKoXCvPFO8GUBlIKatGiD9LZm22Z8QTD6 snvYzqe5x8rc24qGHzuikyy2lDJllZp5epzNRmh5wXZ4Zjt9sDogN0RTHCft/0vH Gt061RV6RIk3r915fryliSrBgOjHZ0QwGeBYcfjDco8zddIWfqTvndxcH8awtfIe E6ojRfHtFTLkcUw/VEIGfltSjH6UHMkx3VxXSwkMxSNvTiRFVHrk8DMhqoClY2bg MQbx8mEiaQd3PvDOFcctIi/u0BavbnV+4g5G6c0N3JeeF2ROKck+S6Ntq8te3Toa 3qxxTD9THbLpxgLLDI5JB9Ie4SSFFmhbUidtmNoXIABbyhCo3Id4RwsHlH3r3PC8 WDYf3kjzfruZPCnjkx6BFHxbAm06Pa4EA9YlJqfFoVVaNGJ5tf5AVLFuMzqEAZVl zlCiaTkxHK8hy6VUgVXBDwOYPPdf+35qrepn9dwB5FYK9scwNKbD1BpN4XaW6TVO 8rhu2TooSpfin6jktKe6W3f7J7vguKrgvm+Ig2uLYUyeWhMj6gV4w0/445SHtdH8 BTSWcsXmq66AaLRrzZA3C31LSbJabTia6o7cISegBXKvEpkWC7u77b+2Lvh44XeG uAUSICg860S4rQNAtYOY =l3jE -----END PGP SIGNATURE----- --XPX6T3UXHpsvYx46--