Received: from localhost (unknown [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id 1F17E64FC20 for ; Thu, 25 Sep 2008 19:08:44 -0300 (ADT) Received: from postgresql.org ([200.46.204.86]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 37019-05 for ; Thu, 25 Sep 2008 19:08:39 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from westnet.com (westnet.com [216.187.52.2]) by postgresql.org (Postfix) with ESMTP id EE9EC64FC01 for ; Thu, 25 Sep 2008 19:08:39 -0300 (ADT) Received: from westnet.com (localhost [127.0.0.1]) by westnet.com (8.14.0/8.14.0) with ESMTP id m8PM8bl6025279; Thu, 25 Sep 2008 18:08:37 -0400 (EDT) Received: from localhost (gsmith@localhost) by westnet.com (8.14.0/8.13.2/Submit) with ESMTP id m8PM8bBH025276; Thu, 25 Sep 2008 18:08:37 -0400 (EDT) X-Authentication-Warning: westnet.com: gsmith owned process doing -bs Date: Thu, 25 Sep 2008 18:08:37 -0400 (EDT) From: Greg Smith X-X-Sender: gsmith@westnet.com To: Christophe cc: Postgres General List Subject: Re: Obfuscated stored procedures (was Re: Oracle and Postgresql) In-Reply-To: <8F40543B-779F-4413-BADF-714F7E0FF565@thebuild.com> Message-ID: References: <41c1fa08-86a0-4023-acaa-d838d5b0abf8@i24g2000prf.googlegroups.com> <48BB040E.3040108@earlham.edu> <48C5C394.1070602@gmail.com> <819df3760809131924o4ec38ebetfde7cd890767b1a9@mail.gmail.com> <1A6E6D554222284AB25ABE3229A9276201A1993B@nrtexcus702.int.asurion.com> <20080915135847.GF3666@fetter.org> <7be3f35d0809150731k575bf7aajc689a4278176b1a8@mail.gmail.com> <000001c91748$af9288b0$0eb79a10$@com> <20080915202922.1778a062.wmoran@collaborativefusion.com> <20080916005025.GE3666@fetter.org> <20080915221136.f39a284e.wmoran@collaborativefusion.com> <16972.1221531560@sss.pgh.pa.us> <8F40543B-779F-4413-BADF-714F7E0FF565@thebuild.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests=none X-Spam-Level: X-Archive-Number: 200809/1046 X-Sequence-Number: 138053 On Thu, 25 Sep 2008, Christophe wrote: > it strikes me that a reasonable approach would be a non-core pluggable > language which accepts encrypted strings as functions, decrypts them > (using a key compiled into the language module), and passes them on to > PL/pgSQL for execution...This would, of course, be easily hacked with > someone who can step through the language module with a debugger If we presume that the module doing the encryption/decryption is itself is a common open-source implementation, all I have to do is read in the de-obfuscator code byte at a time, stopping every time I have a key length worth of bytes to see if they unlock something that looks like plaintext. You have to move to at least another layer of relatively serious security before you need debugger-level skills to crack it. People routinely tear through protection like this even on closed-source systems that benefit some from security by obscurity, and if you can know the method used that usually allows an even easier approach. -- * Greg Smith gsmith@gregsmith.com http://www.gregsmith.com Baltimore, MD