Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1gFF2F-0007wk-PM for pgsql-admin@arkaria.postgresql.org; Wed, 24 Oct 2018 09:01:04 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1gFF2E-00084d-3b for pgsql-admin@arkaria.postgresql.org; Wed, 24 Oct 2018 09:01:02 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1gFF2D-00084V-Ll for pgsql-admin@lists.postgresql.org; Wed, 24 Oct 2018 09:01:01 +0000 Received: from r0.smtpout1.paris1.alwaysdata.com ([2a00:b6e0:1:40:1:0:10:1]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gFF27-0000Lx-9a for pgsql-admin@postgresql.org; Wed, 24 Oct 2018 09:01:00 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=alwaysdata.net; s=hexack; h=In-Reply-To:Content-Transfer-Encoding: Content-Type:MIME-Version:References:Message-ID:Subject:To:From:Date:Sender: Reply-To:Cc:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=gsfnFniNb01DfXy/Ev8pr99hFT+yicpUHXFljF2cWJU=; b=CSbBZ/7PBSfSa8q9lAKdBKyUWG ECAIoE3DWuZHloD1DIlWKQ0vBjOQtFporp0qWJSh7BsSi8Wuk3U1fAW8YePim1chVSP7kKwj0RZzs PG/V+mYLBOlPlxzb4jbuEz80rcI/TXo37cxtZQ2abLl+8DvXcYY9K+ig5omsrDhNXwbA=; Received: from mas01-1-78-225-200-186.fbx.proxad.net ([78.225.200.186] helo=office.hexack.fr) by smtpout1.paris1.alwaysdata.com with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1gFF1d-0007bi-NZ; Wed, 24 Oct 2018 11:00:25 +0200 Date: Wed, 24 Oct 2018 11:00:24 +0200 From: =?utf-8?B?U3TDqXBoYW5l?= KANSCHINE To: Anjul Tyagi , pgsql-admin@postgresql.org Subject: Re: Encryption / Decryption via PGCrypto Message-ID: <20181024090024.jyw2f4l2uygydh3y@office.hexack.fr> References: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: Organization: HexACK User-Agent: NeoMutt/20170113 (1.7.2) X-alwaysdata-ID: 366327667 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Hi, Le mer. 24 oct., vers 08:27, Anjul Tyagi exprimait : > > We are implementing the pgcrypto in our database to encrypt and decrypt the > Column data. for testing purpose we have generate the PGP public / private > key and use those when we read and write data. > > How can we secure the key, if we keep the key outside how can we use that > into query. We keep the private key on the app server. It communicates with postgres through SSL and postgres logs aren't too verbose in order to avoid key exposition. If there's a better way, i'm curious of it. Regards, -- Stéphane KANSCHINE - https://www.hexack.fr./ - https://www.nuajik.io./ @ stephane@hexack.fr  +33 6 64 31 72 52