Re: Credit Cards & MySQL
| From: | Mike Morton | Date: | Fri, 16 May 2003 21:45:46 +0000 |
| Subject: | Re: Credit Cards & MySQL | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-147982@lists.php.net to get a copy of this message | ||
While I agree with the 'ideal' situation from David, often that is not
possible.
If you have to store credit cards, you need to ensure first of all the the
MYSQL server is NOT accessible from anywhere except the localhost that you
will be calling it from. That minimizes one possible security leak.
The second thing to do would be to encrypt the credit card using the mcrypt
functions and a key that is stored on the server, but is only accessible
OUTSIDE the web directory.
This way in order for someone to get the credit cards, a hacker has to:
A. Get access to the machine - not tough
B. Read your scripts to know the encryption method
C. Gain Access to the mysql server
D. Reproduce the decryption with your key
To make it more difficult to get caught with your pants down, when you have
processed the card via the API, delete the card number from the database.
Not an impossible feat - but realistically, for someone to do all that
requires a modicum of skill, and for a credit card with maybe a 5000$ limit
on it - experience tells me that this is NOT a very likely scenario - in
fact in 5 years of doing this similar method in a previous HIGH profile
company with HEAVY traffic, not one hack or stolen credit card.
In saying that - a better way may be to do a public/private key encryption
scheme on the credit card, where the key has to be entered at the time of
decryption - then you have only to worry about the human factor
losing/passing out the key.
Then again, why not just do real-time authorization with a pre/post auth
model? You may find in reading the terms and conditions of the processor
that you cannot store the credit card information for any length of time.
Just my 2 cents anyhow. I am sure that the 'experts' are laughing, but
sometimes with the lack of reasonable help you are stuck doing the best that
you can with what you have.
On 5/16/03 4:43 PM, "Stephen" <webmaster@melchior.us> wrote:
> I'm doing a project for my new company and I need to store credit card numbers
> in the database then later send them to a credit card processor's API later
> on. What would be the best way to put these numbers in the database and
> encrypt them but be able to decrypt them when I need to send it to the api
> system?
>
> I'm not yours, so why should I be sincere about it,
> Stephen Craton
> Senior Executive Web Developer
> Mophus.com, Inc.
>
>
--
Cheers
Mike Morton
****************************************************
*
* Tel: 905-465-1263
* Email: mike@webtraxx.com
*
****************************************************
"Indeed, it would not be an exaggeration to describe the history of the
computer industry for the past decade as a massive effort to keep up with
Apple."
- Byte Magazine
Given infinite time, 100 monkeys could type out the complete works of
Shakespeare. Win 98 source code? Eight monkeys, five minutes.
-- NullGrey