Re: Update on Supporting Encryption in Postgresql

From: Alvaro Herrera <alvherre(at)dcc(dot)uchile(dot)cl>
To: Murat Kantarcioglu <kanmurat(at)cs(dot)purdue(dot)edu>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Update on Supporting Encryption in Postgresql
Date: 2004-09-10 17:21:49
Message-ID: 20040910172149.GA11938@dcc.uchile.cl
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, Sep 10, 2004 at 11:52:26AM -0500, Murat Kantarcioglu wrote:

> Can you suggest me a solution to how to do
> this on Postgresql backend?
>
> I am asssuming that somewhere in the code, you are calling a function like
> getPage(Page_id)
> to retrieve the page(I am trying to change backend)

Probably the code you want to modify is in src/backend/storage/smgr.
Maybe you want to add a different storage manager (they are pluggable,
sort of).

> getPage(Page_id)
> {
> ctr=Hash_Table(Page_id) //return somevalue needed for deccryption
> Thread_Read(Page_id) // will call the original read code
> Thread_Encryption.start(ctr, length);
> when both threads are done finish the encryption
> }

I think it would need extensive, painful and unwelcome modifications to
use threads to do the job. You could just as well do it sequentially,
like in

encryptedPage = getPage(page_id);
clearPage = unencrypt(encryptedPage);
return clearPage;

And the reverse for storage. This may only need modifications to
mdread() and mdwrite() ... unless your encryption scheme returns a
different length than the original.

--
Alvaro Herrera (<alvherre[a]dcc.uchile.cl>)
"Estoy de acuerdo contigo en que la verdad absoluta no existe...
El problema es que la mentira sí existe y tu estás mintiendo" (G. Lama)

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Reini Urban 2004-09-10 18:10:50 Re: [HACKERS] more dirmod CYGWIN
Previous Message Murat Kantarcioglu 2004-09-10 16:52:26 Update on Supporting Encryption in Postgresql