Обсуждение: encryption problem

Поиск
Список
Период
Сортировка

encryption problem

От
Sylvain Sainnier
Дата:
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


Re: encryption problem

От
Justin Clift
Дата:
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

Re: encryption problem

От
Bruce Momjian
Дата:
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

I would look at /contrib/pgcrypto for encryption/decryption routines.

--
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073

Re: encryption problem

От
Jan Wieck
Дата:
Bruce Momjian wrote:
>
> 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
>
> I would look at /contrib/pgcrypto for encryption/decryption routines.

Or look into encrypting the entire filesystem you have your data
directory in. There are several commercial products and I've seen
a HOWTO for Linux somewhere that describes it with open source
stuff. Basically you mount a huge encrypted file through the
loopback device and an encrypt/decrypt driver.


Jan

>
> --
>   Bruce Momjian                        |  http://candle.pha.pa.us
>   pgman@candle.pha.pa.us               |  (610) 359-1001
>   +  If your life is a hard drive,     |  13 Roberts Road
>   +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073
>
> ---------------------------(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


--
#======================================================================#
# It's easier to get forgiveness for being wrong than for being
right. #
# Let's break this rule - forgive
me.                                  #
#==================================================
JanWieck@Yahoo.com #