Received: from localhost (unknown [200.46.204.182]) by postgresql.org (Postfix) with ESMTP id 9AE0E2E4101 for ; Fri, 21 Dec 2007 10:40:03 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.182]) (amavisd-maia, port 10024) with ESMTP id 56504-04 for ; Fri, 21 Dec 2007 10:39:44 -0400 (AST) Received: from mu-out-0910.google.com (mu-out-0910.google.com [209.85.134.185]) by postgresql.org (Postfix) with ESMTP id E862B2E409A for ; Fri, 21 Dec 2007 10:39:55 -0400 (AST) Received: by mu-out-0910.google.com with SMTP id i10so448384mue.5 for ; Fri, 21 Dec 2007 06:39:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; bh=QzxqMo/geC/Oacp1kjogTfDsKpE4Q1GbgwnjjLUmhOs=; b=suV+M/cp4qT+ccDePJNT0WyODTtsc0tffO2860nN3R7CZxuqUAq0rk1TJrbVRpqHqyJsNRgqjKtyYVqW8xbehCXTZFAzYwULU3VLJqrkhBqBd+qusjdIp6a8FXGDw14SUs03mYeJcyNbrm8ixXXQEul09JNjLnZug0OdE7EqbY8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=dZBZfvxj2LDFZmISXR07Eg+hsYweVhGH7+Y6EyBISi1L+KvG3bG939tUpGhkTQX3ScRuJDATKXHz1qBw2Tgqw1gkk6mHxHNwFOSV0AJVhmA3p7zz+akVvEeyOmpLMCNX9pXMvWyIdQrY0HL56rP1Bp319e0prpJUn1J2VPOpOc8= Received: by 10.78.122.16 with SMTP id u16mr1708195huc.28.1198247993983; Fri, 21 Dec 2007 06:39:53 -0800 (PST) Received: by 10.78.35.10 with HTTP; Fri, 21 Dec 2007 06:39:53 -0800 (PST) Message-ID: <162867790712210639v44a5e4f6y4640f20fbc02126d@mail.gmail.com> Date: Fri, 21 Dec 2007 15:39:53 +0100 From: "Pavel Stehule" To: "Merlin Moncure" Subject: Re: function body actors (was: viewing source code) Cc: "Tom Lane" , "Alvaro Herrera" , "Joshua D. Drake" , "Trevor Talbot" , "Roberts, Jon" , "Kris Jurka" , "Jonah H. Harris" , "Bill Moran" , "pgsql performance" , "Pgsql Hackers" In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <26811.1198215605@sss.pgh.pa.us> <162867790712210018m68117783y791da209a4a97448@mail.gmail.com> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200712/343 X-Sequence-Number: 28159 On 21/12/2007, Merlin Moncure wrote: > On Dec 21, 2007 3:18 AM, Pavel Stehule wrote: > > I have similar patch and it works. There is two isues: > > > > * we missing column in pg_proc about state (not all procedures are > > obfuscated), I solved it for plpgsl with using probin. > > I was hoping to avoid making any catalog or other changes to support > encryption specifically. Maybe your patch stands on its own > merits...I missed the original discussion. Do you think the code you > wrote can be adapted to do other things besides encryption? > I don't know. It was fast hack that just works. It hat to do obfuscation, and it do it well. > > * decrypt is expensive on language handler level. Every session have > > to do it again and again, better decrypt in system cache or somewhere > > there. > > Doesn't bother me in the least...and caching unencrypted data is > scary. Also, aes256 is pretty fast for what it gives you and function > bodies are normally short. The real issue as I see it is where to > keep the key. How did you handle that? > > merlin > Simply. I use for password some random plpgsql message text and compile it. I though about GUC, and about storing password in postgresql.conf. It's equal to protection level. We cannot protect code on 100%. If you have admin or superuser account and if you know some internal, you can simply get code. http://blog.pgsql.cz/index.php?/archives/10-Obfuscator-PLpgSQL-procedur.html#extended sorry for czech desc Pavel