Re: encryption problem - Mailing list pgsql-general

From Justin Clift
Subject Re: encryption problem
Date
Msg-id 3D81A633.1D4EB406@postgresql.org
Whole thread Raw
In response to encryption problem  (Sylvain Sainnier <sainnier@avignon.inra.fr>)
List pgsql-general
Hi Sylvain,

There are a couple of general approaches to encrypting your data, and it
depends on what you really need.

Are you after a way to encrypt *everything* in your database (no
problem), or just some specific data?

Something to remember is that unless you want to write special
functions, any data that you encrypt and put in a table loses a bunch of
SQL abilities.

i.e.

Let's say you have three strings that you encrypt.

a) 'foo'  becomes  'adfasdfs32sdf'
b) 'bar'  becomes  'ds3sdf93jsl3s'
c) 'baz'  becomes  'bsadf823js83j'

And you then store these in a database like this:

 something |   crypted
++++++++++++++++++++++++++
 alpha     | adfasdfs32sdf
 bravo     | ds3sdf93jsl3s
 charlie   | bsadf823js83j

Suddenly reasonable no longer becomes easy:

i.e.

SELECT crypted FROM sometable WHERE crypted = 'xyz' ORDER BY crypted;

This wouldn't give the same type of results as if the data hadn't been
encrypted, etc.

In this scenario it can be a better idea to have the whole database
inside an encrypted disk partition (see www.kerneli.org if you're on
Linux), as that will let you do all of your normal SQL, etc.

Hope this helps.

:-)

Regards and best wishes,

Justin Clift


Sylvain Sainnier wrote:
>
> Hello
>
> I would encrypt data that I insert in my table, and I don't know how to do
> this.
> can you help me
>
> thanks
>
> ---------------------------(end of broadcast)---------------------------
> TIP 3: if posting/reading through Usenet, please send an appropriate
> subscribe-nomail command to majordomo@postgresql.org so that your
> message can get through to the mailing list cleanly

--
"My grandfather once told me that there are two kinds of people: those
who work and those who take the credit. He told me to try to be in the
first group; there was less competition there."
   - Indira Gandhi

pgsql-general by date:

Previous
From: Tourtounis Sotiris
Date:
Subject: explain analyze
Next
From: Richard Huxton
Date:
Subject: Re: postgres functions