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 1pDyiS-0002Yf-Sq for pgsql-hackers@arkaria.postgresql.org; Sat, 07 Jan 2023 02:13:48 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1pDyiR-0003QY-6p for pgsql-hackers@arkaria.postgresql.org; Sat, 07 Jan 2023 02:13:47 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pDyiQ-0003QP-Tp for pgsql-hackers@lists.postgresql.org; Sat, 07 Jan 2023 02:13:46 +0000 Received: from momjian.us ([72.94.173.45]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pDyiO-0007iY-HF for pgsql-hackers@lists.postgresql.org; Sat, 07 Jan 2023 02:13:45 +0000 Received: from bruce by momjian.us with local (Exim 4.94.2) (envelope-from ) id 1pDyiM-00F5gY-HT; Fri, 06 Jan 2023 21:13:42 -0500 Date: Fri, 6 Jan 2023 21:13:42 -0500 From: Bruce Momjian To: "agharta82@gmail.com" Cc: pgsql-hackers@lists.postgresql.org Subject: Re: Is OpenSSL AES-NI not available in pgcrypto? Message-ID: References: <6d0809a6-b8f7-4d53-0d2d-07f29a1288bd@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <6d0809a6-b8f7-4d53-0d2d-07f29a1288bd@gmail.com> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Mon, Jan 2, 2023 at 05:57:38PM +0100, agharta82@gmail.com wrote: > So, a test with pgcrypto: > > select pgp_sym_encrypt(data::text, 'pwd') --default to aes128 > from generate_series('2022-01-01'::timestamp, '2022-12-31'::timestamp, '1 > hour'::interval) data > > vs > > select pgp_sym_encrypt(data::text, 'pwd','cipher-algo=bf') -- blowfish > from generate_series('2022-01-01'::timestamp, '2022-12-31'::timestamp, '1 > hour'::interval) data To see the difference, I think you need to construct a single large query that calls many pgcrypto functions, with a small return result, so the network, parsing, and optimizer overhead are minimal compared to the OpenSSL overhread. -- Bruce Momjian https://momjian.us EDB https://enterprisedb.com Embrace your flaws. They make you human, rather than perfect, which you will never be.