Re: encryption problem

From: Justin Clift <justin(at)postgresql(dot)org>
To: Sylvain Sainnier <sainnier(at)avignon(dot)inra(dot)fr>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: encryption problem
Date: 2002-09-13 08:47:47
Message-ID: 3D81A633.1D4EB406@postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at)postgresql(dot)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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Richard Huxton 2002-09-13 09:43:08 Re: postgres functions
Previous Message Tourtounis Sotiris 2002-09-13 08:43:52 explain analyze