Re: Storing encrypted data?

From: "Aaron Bono" <postgresql(at)aranya(dot)com>
To: "John Tregea" <john(at)debraneys(dot)com>
Cc: "Michael Fuhr" <mike(at)fuhr(dot)org>, pgsql-sql(at)postgresql(dot)org
Subject: Re: Storing encrypted data?
Date: 2006-07-17 15:55:53
Message-ID: bf05e51c0607170855i632fdd2fob1455fdc8ef4c9d4@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

On 7/17/06, John Tregea <john(at)debraneys(dot)com> wrote:
>
> Hi Michael,
>
> Thanks for your advice. I was looking at the bytea data type in the
> PostgreSQL book I bought (Korry and Susan Douglas, second edition). I
> was concerned that if I have to escape certain characters like the
> single quote or the backslash, how do I guarantee that the escaped
> version does not already appear in the encrypted string?
>
> Should I use the octal value to escape the single quote (\047) and
> backslash (\\134)?
>
> Those character sequences are extremely unlikely to occur in an
> encrypted string.
>
> Is the the right approach ?
>
> Also... I note that I cannot change the data type of my field from text
> to bytea (I am using PGADMIN III). Do you know why?

When I have data like this, I do a Base64 encoding. The string ends up
longer but I no longer have to worry about special characters mucking things
up.

==================================================================
Aaron Bono
Aranya Software Technologies, Inc.
http://www.aranya.com
==================================================================

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Penchalaiah P. 2006-07-18 05:16:29 hi let me know the solution to this question
Previous Message Michael Fuhr 2006-07-17 12:16:50 Re: Storing encrypted data?