Received: from localhost (unknown [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id D2FA42E3CD2 for ; Thu, 20 Dec 2007 16:35:48 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 85640-02 for ; Thu, 20 Dec 2007 16:35:45 -0400 (AST) Received: from nf-out-0910.google.com (nf-out-0910.google.com [64.233.182.184]) by postgresql.org (Postfix) with ESMTP id EA0222E33F3 for ; Thu, 20 Dec 2007 16:35:44 -0400 (AST) Received: by nf-out-0910.google.com with SMTP id f5so9310nfh.23 for ; Thu, 20 Dec 2007 12:35:43 -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=izCdInTP1/mnLWn2iw0Y6gaLkQAoOrGunTSKbu1dJys=; b=mAgL/6/FDYgmU9knWwNjQlY5KcvS8OOQ0EtBLOerBq7FD9bAJ//MiC0dMqXHhSs67pmX884zxVW1oMfTS+zJ1EcvGFCeoyNK2pF95L/Oh3V9vlSgvluq+cgnf59J0bvLiltW9YiQ7p5M4i1Ze/6pnMjN/l7K3XN6K+hzcWyK6bQ= 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=NaHdwKI1OUNHpBDOIM3OjWiNvLLeo7uuUHcSwVzKclee7+eO2cDXBkrzwujvr6OQsx9XzX95UXCcKzvAzLF3ZehVKLwHSfOVJGuQMj7tbEr4eiQz6rclLXLU/iQInHEH781Ml/lAmJfFor7mAsaz0KNxhgvozkGbvfNOZrqZmew= Received: by 10.78.133.2 with SMTP id g2mr795870hud.26.1198182942698; Thu, 20 Dec 2007 12:35:42 -0800 (PST) Received: by 10.78.18.2 with HTTP; Thu, 20 Dec 2007 12:35:42 -0800 (PST) Message-ID: Date: Thu, 20 Dec 2007 15:35:42 -0500 From: "Merlin Moncure" To: "Alvaro Herrera" Subject: Re: viewing source code Cc: "Joshua D. Drake" , "Trevor Talbot" , "Roberts, Jon" , "Kris Jurka" , "Jonah H. Harris" , "Bill Moran" , pgsql-performance@postgresql.org In-Reply-To: <20071220200739.GC11586@alvh.no-ip.org> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <1A6E6D554222284AB25ABE3229A92762112A33@nrtexcus702.int.asurion.com> <476A9ADF.5030101@commandprompt.com> <90bce5730712201047m4dd0fe05k6b1fccc57897326f@mail.gmail.com> <20071220114011.64a650d7@commandprompt.com> <20071220200739.GC11586@alvh.no-ip.org> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200712/322 X-Sequence-Number: 28138 On Dec 20, 2007 3:07 PM, Alvaro Herrera wrote: > I don't think that makes any kind of sense. Hiding prosrc should happen > on a entirely different level from the language on which the function is > written. It's a completely orthogonal decision. Besides, you probably > don't want prosrc to be encrypted -- just not accesible to everyone, and > it doesn't make sense to have a different _language_ to do that. I kinda agree, kinda disagree on this point. You may recall the huge debate a while back where AndrewSN and others were promoting a revised set of views to expose the system catalogs. I thought this was a good idea because the internal catalogs could be hidden from all but the su and the views could be much easier to manipulate in that fashion. The proposal was however shot down for other reasons. I don't really agree that wrapping pl/pgsql with encryptor/decryptor is a bad idea. It's fairly easy to do and very flexible (you don't have to stop at encryption...for example you could run the code through a pre-processor for token substitution). We are not adding a language in the semantic sense, wrapping an existing one. Could probably be extended to multiple languages if desired without too much effort...I think it's only worthwhile bringing in core if you want to hide the internals inside the syntax (CREATE ENCRYPTED FUNCTION foo...) Key management is an issue but easily solved. Uber simple solution is to create a designated table holding the key(s) and use classic permissions to guard it. So I don't agree with your negative comments in this direction but I'm not saying this is the only way to solve this. It is, however the only realistic way to do it without changes to the project or breaking pgadmin. > Also, having an encrypted source code means there must be a decryption > key somewhere, which is a pain on itself. And if you expose the crypted > prosrc, you are exposing to brute force attacks (to which you are not if > prosrc is hidden). i don't buy the brute force argument at all...aes256 or blowfish are perfectly safe. The purpose of encryption is to move sensitive data through public channels...otherwise, why encrypt? merlin