Re: Encryption For Specific Column- Where to store the key

From: Craig Ringer <craig(at)postnewspapers(dot)com(dot)au>
To: Manuel Gysin <manuel(dot)gysin(at)quantum-bytes(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Encryption For Specific Column- Where to store the key
Date: 2011-06-16 04:00:14
Message-ID: 4DF97FCE.1080706@postnewspapers.com.au
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 15/06/11 14:07, Manuel Gysin wrote:

> A discussion about this topic can be found under http://www.experts-exchange.com/Database/PostgreSQL/Q_21934798.html

Use Stack Overflow instead ;-)

Anyway: Given the additional detail you provided in that post, where it
becomes clear that you only need to be able to *read* the CCNs
occasionally and only in batches, perhaps you should consider using
public key crypto.

Store the last 4 digits of the CCN unencrypted but not the CVV or expiry
time. That way you can show a hint to the user about which card you're
using without them (or anyone else) being able to extract the full details.

Encrypt the full details using a public key when you store them in the
database. The web front end only needs to know the public key to encrypt
data. It doesn't need to know the private key, and without it it cannot
*decrypt* the data again.

Now your batch invoicing program can load the private key off a USB key
or SD card - or just keep it on disk and decrypt it using a strong
passphrase that is hand-entered by a user. When you're not doing
invoicing and billing, your system doesn't have any access to the
private key and cannot decrypt the stored data.

If you switch to rolling billing later on, you'll need to adjust this
process, but it still allows you to keep the part that can read the
credit card numbers very separate from the part that interacts with
untrusted users over the Internet.

--
Craig Ringer

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Craig Ringer 2011-06-16 04:14:13 Re: You could be a PostgreSQL Patch Reviewer!
Previous Message Craig Ringer 2011-06-16 03:55:08 Re: Encryption For Specific Column- Where to store the key