Re: crypting prosrc in pg_proc

From: "Jonah H(dot) Harris" <jonah(dot)harris(at)gmail(dot)com>
To: "Zdenek Kotala" <Zdenek(dot)Kotala(at)sun(dot)com>
Cc: "Hans-Juergen Schoenig" <postgres(at)cybertec(dot)at>, "Andrew Dunstan" <andrew(at)dunslane(dot)net>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: crypting prosrc in pg_proc
Date: 2007-08-10 18:14:19
Message-ID: 36e682920708101114x6803de29k1759b18bff799852@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 8/9/07, Zdenek Kotala <Zdenek(dot)Kotala(at)sun(dot)com> wrote:
> If I remember correctly Oracle wrap generates something like bytecode and
> each Oracle installation is able to understand them. But It is not possible
> decode it back to original form.

Regardless of what Oracle tells you, it has always been reversible.
The thing is, there's only a few people who know how to do it. In my
Oracle circles, at last count there were 7 people in the world who
knew how to unwrap 9i and earlier. I know of at least 2 more who know
10g.

Oracle is closed-source, and people can still figure it out. It is
*impossible* to implement a completely secure way to do something
similar with an open-source database.

As Korry said, at some point it's going to be in clear-text... anyone
can break into the hardware, startup a debugger (and/or insert a
hacked version of the PL), and print it out.

The only other way is to actually store the interpreted form of
PL/pgSQL, which would be a large job, and still wouldn't really
protect you. All someone would have to do is build a simple code
generator and run the interpreted form through it.

Obfuscation doesn't really work, it just makes big wigs in companies
*think* it's not easily reversible.

There is no real security. With enough time and experience, anything
can be broken.

--
Jonah H. Harris, Software Architect | phone: 732.331.1324
EnterpriseDB Corporation | fax: 732.331.1301
33 Wood Ave S, 3rd Floor | jharris(at)enterprisedb(dot)com
Iselin, New Jersey 08830 | http://www.enterprisedb.com/

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Sergiy Vyshnevetskiy 2007-08-10 18:45:11 Re: Fixing insecure security definer functions
Previous Message Tom Lane 2007-08-10 18:08:21 Re: domain casting?