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 1hClNx-0007xI-N4 for pgsql-hackers@arkaria.postgresql.org; Sat, 06 Apr 2019 13:29:29 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1hClNv-0003u2-Uq for pgsql-hackers@arkaria.postgresql.org; Sat, 06 Apr 2019 13:29:27 +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 1hClNv-0003tv-MW for pgsql-hackers@lists.postgresql.org; Sat, 06 Apr 2019 13:29:27 +0000 Received: from mx2a.mailbox.org ([2001:67c:2050:104:0:2:25:2] helo=mx2.mailbox.org) by magus.postgresql.org with esmtps (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hClNt-0003F4-QL for pgsql-hackers@postgresql.org; Sat, 06 Apr 2019 13:29:27 +0000 Received: from smtp2.mailbox.org (smtp2.mailbox.org [80.241.60.241]) (using TLSv1.2 with cipher ECDHE-RSA-CHACHA20-POLY1305 (256/256 bits)) (No client certificate requested) by mx2.mailbox.org (Postfix) with ESMTPS id 0157AA191D; Sat, 6 Apr 2019 15:29:22 +0200 (CEST) X-Virus-Scanned: amavisd-new at heinlein-support.de Received: from smtp2.mailbox.org ([80.241.60.241]) by gerste.heinlein-support.de (gerste.heinlein-support.de [91.198.250.173]) (amavisd-new, port 10030) with ESMTP id NtfclSwuVa_Y; Sat, 6 Apr 2019 15:29:14 +0200 (CEST) From: Antonin Houska To: Robert Haas cc: Tom Lane , Toshi Harada , "pgsql-hackers@postgresql.org" Subject: Re: "WIP: Data at rest encryption" patch and, PostgreSQL 11-beta3 In-reply-to: References: <5907.1534140361@localhost> <201808150211.w7F2ApMj023097@ccmail04.silk.ntt-tx.co.jp> <19039.1536933944@localhost> <14646.1552570130@localhost> <13456.1552684223@sss.pgh.pa.us> <27465.1553168779@localhost> <13531.1554477762@localhost> Comments: In-reply-to Robert Haas message dated "Fri, 05 Apr 2019 15:57:33 -0400." MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <18845.1554557353.1@localhost> Content-Transfer-Encoding: quoted-printable Date: Sat, 06 Apr 2019 15:29:13 +0200 Message-ID: <18846.1554557353@localhost> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Robert Haas wrote: > On Fri, Apr 5, 2019 at 11:22 AM Antonin Houska wrote: > > > Wouldn't Tom's proposal to use a stream cipher fix all this? > > > > Yes it would make the extra alignment unnecessary, but our solution tr= ies to > > meet specific requirements of disk encryption. Stream cipher appears t= o be > > incompatible with these requirements: > > > > https://en.wikipedia.org/wiki/Disk_encryption_theory > = > Hmm. Well, I don't know what to do about that, but I think this patch > is going to be facing an uphill battle if the encrypted and > unencrypted WAL formats use different alignment. Once you said this could be a problem, I thought about it a bit more. The = link above tells that stream cipher is not good for disk encryption because it'= s risky to encrypt different data (e.g. old an new version of disk sector) w= ith the same key (or rather with the same combination of key and initializatio= n vector). However WAL is a special case because here we should never need to change = the data at given position. The only exception is that unused space (sequence = of zeroes) becomes a valid record. So if we avoid encryption of the unused sp= ace, it might be o.k. to use the stream cipher for WAL. -- = Antonin Houska Web: https://www.cybertec-postgresql.com