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 1pE2F9-0006AB-MX for pgsql-hackers@arkaria.postgresql.org; Sat, 07 Jan 2023 05:59:47 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1pE2F8-0004Uh-7T for pgsql-hackers@arkaria.postgresql.org; Sat, 07 Jan 2023 05:59:46 +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 1pE2F7-0004UF-R9 for pgsql-hackers@lists.postgresql.org; Sat, 07 Jan 2023 05:59:45 +0000 Received: from mail-wr1-x431.google.com ([2a00:1450:4864:20::431]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1pE2F2-00019p-Vr for pgsql-hackers@lists.postgresql.org; Sat, 07 Jan 2023 05:59:44 +0000 Received: by mail-wr1-x431.google.com with SMTP id m7so3068292wrn.10 for ; Fri, 06 Jan 2023 21:59:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=HGGSSXyvDX4xH2fs2A4sQqjrjCONvHQCy+hZ12s/jCY=; b=Jbo8vKPsxBjhGLeQgHfrkZYUq54pEXLYvrhs36g4glk21+T1OSIV86S0vPxhO3L6EC mGsmV52H7Rwwlgkaxl+UmxNeyE8bfppQtL+1CoOdJAF2lpO1CARQusfqdnxx8KBapyBW Mg3kcOFoVRSkmsg0nGPFxfiaxfmhOLeBCf0MneLmdD74HBpq6UY+kNFZCRBM3N7zqkpP C53XINpXCzoPZ3TyZGpbTgkyqogKLO5Na4JEh7W9EdEMR17kZVXgEdfeM+LXzAdklz7V PozKV4nRk4RzTHV8gtmZX99UBU7npENAd/IlD1yMggo8ayuc5K4cSC2GwXyyPv4Rl80x yYCg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=HGGSSXyvDX4xH2fs2A4sQqjrjCONvHQCy+hZ12s/jCY=; b=SUUUES+FPdB/xNsSlYlGXlbaPuxP996fdIJrui1W3kbOrwli6S7E58X9B0GU/ADMce CLM1szZNGNl0LXUG1MMzbcQaoZDbadZfb+02ZRVmLgnppRdMourM8qCC93ZyV06w94JM Sm2R9YdTr6vTt2ykn7eLXDwhjTGOz7rHngFxPiHe7Fy3yzEAWBTk256G3ypcvw+kt+yS YltzEGtRvquhGP+iczbTnGYvazuXEzAMov1Jg7iYNlU4uZ/ZQGFHON/RzXdO/xAfc3cS Njjo3sjXrVvfrjdOKiv5LM0uzYJkgRRSoGnTqLmF81+S+TeuL7TzLQ/7Yup/k7VR+dKk EOYg== X-Gm-Message-State: AFqh2kqufMa6e6axOACizPhQsdCcDI4um3DLTXfubwxLn+leNiSyvzVF L0UJROTmUWZl3SM807OUI1NMbGDnavl5+Ose6bWesHw= X-Google-Smtp-Source: AMrXdXvUgNOHW8rSIamHVzgsvA7C3E9fiPubnZld3gnFl4Sp320x/zXInHDLtbmnCxdHL6+j7DSXI8lxLJ17v6f6vJA= X-Received: by 2002:adf:ebc7:0:b0:24c:21bf:aad8 with SMTP id v7-20020adfebc7000000b0024c21bfaad8mr1173963wrn.120.1673071179180; Fri, 06 Jan 2023 21:59:39 -0800 (PST) MIME-Version: 1.0 References: <6d0809a6-b8f7-4d53-0d2d-07f29a1288bd@gmail.com> In-Reply-To: From: agharta agharta Date: Sat, 7 Jan 2023 06:59:25 +0100 Message-ID: Subject: Re: Is OpenSSL AES-NI not available in pgcrypto? To: Bruce Momjian Cc: pgsql-hackers@lists.postgresql.org Content-Type: multipart/alternative; boundary="00000000000051ae4105f1a63d0a" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --00000000000051ae4105f1a63d0a Content-Type: text/plain; charset="UTF-8" Hi Bruce, Thanks for reply. I've give up: i've found a slide in percona site about pgcrypto that said the developers of plugin intentionally introduces time consuming code to prevent brute force attacks. My queries involves pgcrypto only in a small number of record (about 2000), so at the end the execution time remains the same....sadly. Now my hopes are now in TDE. Hope to see that feature in PostgrSQL soon. Many thanks again for support to all! Have a nice day, Agharta Il sab 7 gen 2023, 03:13 Bruce Momjian ha scritto: > 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. > --00000000000051ae4105f1a63d0a Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi Bruce,
Thanks for reply.

I've give up: i've found a s= lide in percona site about pgcrypto that said the developers of plugin inte= ntionally introduces time consuming code to prevent brute force attacks.

My queries involves pgcryp= to only in a small number of record (about 2000), so at the end the executi= on time remains the same....sadly.

Now my hopes are now in TDE. Hope to see that feature in PostgrS= QL soon.

Many thanks aga= in for support to all!

H= ave a nice day,
Agharta=C2=A0


Il sab 7 gen 2023, 03:13 Bruce Momjian <bruce@momjian.us> ha scritto:
On Mon, Jan=C2=A0 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<= br> > from generate_series('2022-01-01'::timestamp, '2022-12-31&= #39;::timestamp, '1
> hour'::interval) data
>
> vs
>
> select pgp_sym_encrypt(data::text, 'pwd','cipher-algo=3Dbf= ') -- blowfish
> from generate_series('2022-01-01'::timestamp, '2022-12-31&= #39;::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.

--
=C2=A0 Bruce Momjian=C2=A0 <bruce@momjian.us>=C2=A0 =C2=A0 =C2=A0= =C2=A0 https://momjian.us
=C2=A0 EDB=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 https://enterprisedb.com

Embrace your flaws.=C2=A0 They make you human, rather than perfect,
which you will never be.
--00000000000051ae4105f1a63d0a--