Re: XTS cipher mode for cluster file encryption

From: Sasasu <i(at)sasa(dot)su>
To: Yura Sokolov <y(dot)sokolov(at)postgrespro(dot)ru>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: XTS cipher mode for cluster file encryption
Date: 2021-10-26 15:47:10
Message-ID: d687d26c-170d-33cc-e615-98532b7d6eec@sasa.su
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 2021/10/26 17:33, Yura Sokolov wrote:
> Yes, AES with AES-NI is fastest. But not so much.
>
> And, AES-CTR could be easily used instead of ChaCha12 in Adiantum.
> Adiantum uses ChaCha12 as a stream cipher, and any other stream cipher will
> be ok as well with minor modifications to algorithm.

not so much ~= half speed.

I prefer to use AES on all devices because AES is faster and more power
efficient. using chacha only on low-end arm devices running complex
program which most people do not have this device.

I reserve my opinion on this point, but I agree with you on the rest.
And I also agree and think it should add more algorithms. The current
implementation does not have any reserved fields, which makes any
upgrade like adding a new algorithm unfeasible.

On 2021/10/26 17:33, Yura Sokolov wrote:
> That is argument. But, again, openssl could be used for primitives:
> AES + AES-CTR + Poly/GCM. And Adiantum like construction could be
> composed from them quite easily.

implement Adiantum is a small problem (which doesn't look good, lack
security audits). the real problem is there are too many code path can
trigger disk IO.
TDE need modify them. each code path has different behavior (align or
unaligned, once or more than once). and front-end tools even not use VF
layer, they use pread with offset. TDE need fix them all. at the same
time, keep the patch small enough.

I still think there need a unified IO API, not only modify
BufFileDumpBuffer() and BufFileLoadBuffer(). the front-end tools also
use this API will be great. with that API, TDE can focus on block IO.
then give out a small patch.

Other works can also benefit from this API, like PostgreSQL with AIO,
PostgreSQL on S3 (BLKSZ=4M), PostgreSQL on PMEM(no FS) and many.

Attachment Content-Type Size
OpenPGP_0x4E72AF09097DAE2E.asc application/pgp-keys 7.9 KB

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Fujii Masao 2021-10-26 16:04:02 Re: Improve the HINT message of the ALTER command for postgres_fdw
Previous Message Scott Mead 2021-10-26 15:23:41 Re: [BUG] Autovacuum not dynamically decreasing cost_limit and cost_delay