[drupal-devel] In database enryption.

Gordon Heydon gordon at heydon.com.au
Wed Jun 8 02:12:02 UTC 2005


Hello,

thanks for the response.

On Tue, 2005-06-07 at 21:05 -0400, Daniel Convissor wrote:
> On Wed, Jun 08, 2005 at 10:42:38AM +1000, Gordon Heydon wrote:
> > 
> > What I was thinking of doing is using the mcrypt module for php to
> > encrypt the credit card for storage in the database. The problem that I
> > have come up against is working out which would be the best method of
> > creating the key for the encryption.
> 
> Below is what I would do.  Perhaps folks here have other ideas.  I'm sure 
> there are plenty of articles about this on the net if you looked.
> 
> In general, if you're not performing a recurring transactions, do not 
> store the credit card numbers, just save the last four digits.

I have done this already. card numbers are disposed of once they are no
longer required.

> But, if you need to save the cc numbers to perform recurring transactions, 
> have the key be typed in manually by the person 
> (webmaster/administrator/office staff/etc -- NOT the customer) performing 
> the current transaction.  There should be one key.  The key should be 
> considered a "password."  The key should be md5 hashed then stored 
> somewhere for later comparison.  So, if the person types in the wrong key, 
> the program won't run (and won't mistakenly encrypt the cards with the 
> wrong key).

Yes but this is not really possible, things need to be automated for
this client. Another option is to keep the keep on another machine so
and retrieved over a secure link when it is required.

> Of course, make sure that database is stored in a secure location and the 
> password is only entered via secure connections.

Basically my worries is if the entire site is compromised, then this
would be a problem.

Thanks for the help.
Gordon.




More information about the drupal-devel mailing list