Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic

Re: Encrypting Credit card numbers

by Starky (Chaplain)
on Apr 23, 2001 at 11:59 UTC ( #74654=note: print w/replies, xml ) Need Help??

in reply to Encrypting Credit card numbers

Per a previous suggestion, I would recommend to any of my customers who ask the same thing to consider simply charging credit cards as the numbers are submitted, thus avoiding the need to store credit card numbers in the first place. It will save you alot of paranoia and development and maintenance time.

For one company I worked for, in which storing credit card numbers was seen as a hard requirement by the business types, here is what I did:

1) https: Of course, credit card numbers must be submitted on a secure page. This is a no-brainer, but I thought I'd mention it for completeness.

2) Encryption: Credit card numbers are stored by the application server in encrypted form in a database via GnuPG::Interface.

3) Decryption: A separate transaction server, which is locked down tighter than, hee hee, well, real tight, has a daemon running that wakes up every 15 minutes. The daemon checks to see if there are any pending transactions, then (after various gyrations) decrypts the credit cards and submits the transactions, after which they are marked as complete.

The key to this is that your private key(s) are on the transaction server. The transaction server has to be made the most secure box you can make, with every unnecessary process turned off and/or ipchains blocking everything except the database, transaction, and monitoring ports out and ssh in. In this particular company, which shall remain nameless, even the CTO was denied an account on the box. (He wasn't particularly astute or technically savvy, as I hear are many CTOs, and denying him an account definitely made waves, though I stuck to my guns.)

I would also recommend reading up on the precise definition of a transaction (particularly 2-stage transactions) and model your transaction daemon on these specifications. All sorts of things can happen between beginning a credit card transaction and completing the transaction, and you should have status markers that indicate each step of the process as well as store every possible bit of information that goes back and forth. In light of the aforementioned caveat, you should also architect your daemon to be able to recover mid-stage through a botched transaction and proceed to completion. Everything from network outages to credit card processing server errors can cause a transaction to terminate unexpectedly, and accounting will at some point want you to be able to complete any partially completed transactions.

Hope this helps!

Replies are listed 'Best First'.
Re: Re: Encrypting Credit card numbers
by zakzebrowski (Curate) on Apr 23, 2001 at 17:45 UTC
    Rather than repeat what everyone else has been saying, I'll let some books do the talking for me... (Should be available from any good book store online or at your local book store)

    Bruce Schriner - Applied Cryptology, Second Edition Best cryptology book I've seen... discusses algorithims and security in general... ($60)

    Hacking Exposed 2 - (Insert authors here) Huge section on what not to do... ($40)

    Good luck
      If you want to do serious cryptograpgy you should also check (IMHO)
      Cryptography : Theory and practice from Douglas STINSON.

      "Only Bad Coders Badly Code In Perl" (OBC2IP)
        Hey... That was the text that was used for my Intro to Cryptography course in college. Good text.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://74654]
[GrandFather]: That's ok when the signal is a voltage, but there are three axis accelerometers, gyroscopes and magnetometers in these things! A little invention is needed at times!
[Corion]: GrandFather: Yeah, in that aspect, hardware is far more a black box than software
[GrandFather]: Oh, and the manufacturer tells lies too! I'm sure they don't mean to, but I know for sure some of the stuff they say is just wrong. It's possible they don't understand what we are asking, but that's not a good look either
[Corion]: GrandFather: Ah, unit testing hardware is fun, especially when the hardware is uncalibrated ...
[GrandFather]: Us: "What scaling do we need to apply to the numbers from the SDK for the wibble?". Them: "Oh, the numbers from the SDK for the wibble are already correct, they don't need scaling"
[GrandFather]: In our code: wibble range 1 scale by 1, range 2 scale by 2, range 3 scale by 4, range 4 scale by 8

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (7)
As of 2017-08-24 07:16 GMT
Find Nodes?
    Voting Booth?
    Who is your favorite scientist and why?

    Results (365 votes). Check out past polls.