pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
BUG #14103: stored function encryption
5+ messages / 3 participants
[nested] [flat]

* BUG #14103: stored function encryption
@ 2016-04-20 10:59  salianjag@gmail.com
  0 siblings, 1 reply; 5+ messages in thread

From: salianjag@gmail.com @ 2016-04-20 10:59 UTC (permalink / raw)
  To: pgsql-bugs

The following bug has been logged on the website:

Bug reference:      14103
Logged by:          Jagadeesha
Email address:      salianjag@gmail.com
PostgreSQL version: 9.5.2
Operating system:   Windows 7
Description:        

how to encrypt functions in Postgresql so that we can hide all my business
logic ?

is there any option like with encryption present in MS SQL ?


-- 
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs



^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: BUG #14103: stored function encryption
@ 2016-04-20 13:54  John R Pierce <pierce@hogranch.com>
  parent: salianjag@gmail.com
  0 siblings, 1 reply; 5+ messages in thread

From: John R Pierce @ 2016-04-20 13:54 UTC (permalink / raw)
  To: salianjag@gmail.com; pgsql-bugs

On 4/20/2016 3:59 AM, salianjag@gmail.com wrote:
> how to encrypt functions in Postgresql so that we can hide all my business
> logic ?

write them in C or another compiled language, supply them as .SO (or 
.dll) files.

> is there any option like with encryption present in MS SQL ?

no.

-- 
john r pierce, recycling bits in santa cruz



-- 
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs



^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: BUG #14103: stored function encryption
@ 2016-04-30 02:01  Bruce Momjian <bruce@momjian.us>
  parent: John R Pierce <pierce@hogranch.com>
  0 siblings, 2 replies; 5+ messages in thread

From: Bruce Momjian @ 2016-04-30 02:01 UTC (permalink / raw)
  To: John R Pierce <pierce@hogranch.com>; +Cc: salianjag@gmail.com; pgsql-bugs

On Wed, Apr 20, 2016 at 06:54:37AM -0700, John R Pierce wrote:
> On 4/20/2016 3:59 AM, salianjag@gmail.com wrote:
> >how to encrypt functions in Postgresql so that we can hide all my business
> >logic ?
> 
> write them in C or another compiled language, supply them as .SO (or .dll)
> files.

FYI, you can often run 'strings' on the object file to see the SQL
queries.

-- 
  Bruce Momjian  <bruce@momjian.us>        http://momjian.us
  EnterpriseDB                             http://enterprisedb.com

+ As you are, so once was I. As I am, so you will be. +
+                     Ancient Roman grave inscription +


-- 
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs



^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: BUG #14103: stored function encryption
@ 2016-04-30 06:27  John R Pierce <pierce@hogranch.com>
  parent: Bruce Momjian <bruce@momjian.us>
  1 sibling, 0 replies; 5+ messages in thread

From: John R Pierce @ 2016-04-30 06:27 UTC (permalink / raw)
  To: pgsql-bugs

On 4/29/2016 7:01 PM, Bruce Momjian wrote:
>>> how to encrypt functions in Postgresql so that we can hide all my business
>>> > >logic ?
>> >
>> >write them in C or another compiled language, supply them as .SO (or .dll)
>> >files.
> FYI, you can often run 'strings' on the object file to see the SQL
> queries.

hah, true, so I guess if you really want to hide it, you've got to hash 
all your string constants, or use an obtuse sql generator.



-- 
john r pierce, recycling bits in santa cruz

^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: BUG #14103: stored function encryption
@ 2016-04-30 23:01  Bruce Momjian <bruce@momjian.us>
  parent: Bruce Momjian <bruce@momjian.us>
  1 sibling, 0 replies; 5+ messages in thread

From: Bruce Momjian @ 2016-04-30 23:01 UTC (permalink / raw)
  To: John R Pierce <pierce@hogranch.com>; +Cc: salianjag@gmail.com; pgsql-bugs

On Fri, Apr 29, 2016 at 10:01:30PM -0400, Bruce Momjian wrote:
> On Wed, Apr 20, 2016 at 06:54:37AM -0700, John R Pierce wrote:
> > On 4/20/2016 3:59 AM, salianjag@gmail.com wrote:
> > >how to encrypt functions in Postgresql so that we can hide all my business
> > >logic ?
> > 
> > write them in C or another compiled language, supply them as .SO (or .dll)
> > files.
> 
> FYI, you can often run 'strings' on the object file to see the SQL
> queries.

Seeing the SQL with 'strings' requires you have read access to the *.so
library files.

Also, this thread suggests that removing SELECT permission on
pg_proc.prosrc allows you to prevent users from seeing the function,
though it doesn't prevent a Postgres super-user from seeing it:

	http://www.postgresql.org/message-id/0100015338ce42f6-58727615-2385-4a80-9a73-c321c21c6928-000000@em...

I am surprised you can still call the function if you do that.

-- 
  Bruce Momjian  <bruce@momjian.us>        http://momjian.us
  EnterpriseDB                             http://enterprisedb.com

+ As you are, so once was I. As I am, so you will be. +
+                     Ancient Roman grave inscription +


-- 
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs



^ permalink  raw  reply  [nested|flat] 5+ messages in thread


end of thread, other threads:[~2016-04-30 23:01 UTC | newest]

Thread overview: 5+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2016-04-20 10:59 BUG #14103: stored function encryption salianjag@gmail.com
2016-04-20 13:54 ` John R Pierce <pierce@hogranch.com>
2016-04-30 02:01   ` Bruce Momjian <bruce@momjian.us>
2016-04-30 06:27     ` John R Pierce <pierce@hogranch.com>
2016-04-30 23:01     ` Bruce Momjian <bruce@momjian.us>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox