Follow Slashdot blog updates by subscribing to our blog RSS feed

 



Forgot your password?
typodupeerror
×
Security

Responsible Handling of Billing Information? 259

moving on asks: "I've been asked by a client to build a fee based subscription service using surepay as the vendor for processing credit card transactions. Subscribers to the service will be billed X amount per month and that is the rub. Surepay does not offer recurring billing so I will need to store credit card numbers and related info. The question is then, how does one best do this in the most responsible manner?" The trick here is giving consumers the service they have come to expect from most websites, without exposing their personal information to would-be thieves. Do you think such a system is possible?
This discussion has been archived. No new comments can be posted.

Responsible Handling of Billing Information?

Comments Filter:
  • encryption (Score:4, Informative)

    by paranoic ( 126081 ) on Wednesday December 26, 2001 @02:59PM (#2752561)
    Strong encryption and only connect the machine to any network (internal and external) when the bills have to go out. Filter all replies that don't come from the credit card responder.
    • Re:encryption (Score:5, Informative)

      by Xzzy ( 111297 ) <sether@@@tru7h...org> on Wednesday December 26, 2001 @03:29PM (#2752698) Homepage
      > and only connect the machine to any network
      > (internal and external)

      If you're unable to do this (due to staggered billing or something) the "next best" option is a heavily restricted network.

      Give your machine with the personal information precisely one network connection and plug it into precisely one machine that can talk to the secured machine on precisely one port. Have your border firewall or equivalent drop any outgoing packets from either of these machines. Only let people do work on this machine from the console. Also use a straight cable between the machines.. ethernet port to ethernet port, crossover cable.

      Then you have your webserver talk to the intermediate machine to handle transactions. Process submits authorization or billing request to intermediary, intermediary talks with the database, and issues a "yes" or "no" to the querying program. At some point you'll probably have to actually transmit user data to actually do the billing, so obviously everything in this chain will be encrypted.

      Then install the best intrusion detection tools you can find/afford on all these machines and hire alert people to monitor logs. Treat any unexpected traffic as an attack and have someone walk over to your machines and physically unplug the machine from the intermediary until the situation can be identified/resolved.

      This obviously assumes one believes that physical separation is important and effective, which I happen to do. ;) This also kinda relies on a security through obscurity standpoint, which contrary to popular belief can actually be useful as long as you don't let it lull you into complacency.

      If server theft is a concern you'll also want to yank out floppy drives, physically secure the server somehow, look the bios, and if you absolutely require being able to copy data to this machine give it a read-only cdrom drive.

      IMO, I wouldn't back up the server except for a hard drive image you can use to reinstall everything to a known state. Were I joe online shopper, I'd much rather re-enter cc info than worry that tapes were floating around the country with my data on it.

      If you did even half of this, you'd have several times the level of safety than I've personally seen on some other online merchants, and I've been through a good number of data centers.
      • IMO, I wouldn't back up the server except for a hard drive image you can use to reinstall everything to a known state. Were I joe online shopper, I'd much rather re-enter cc info than worry that tapes were floating around the country with my data on it.

        Most of the time this simply won't be an option. You have to keep backups. And not just so that Joe Shopper has the convenience of having his CC remembered. For starters, another poster noted that this information will be needed to correlate to chargebacks from the CC companies. Secondly, you might not just be storing CC numbers on such a server. What if you were storing other "personal information" that you wanted to ensure was secure? Depends on what you're selling, but purchase history might be one of these. That history and other data is of real value to merchants and can't be exposed to risk of loss due to hard drive failure (which is a high-probability event, relatively speaking).

        In my opinion, if you can secure the machine, you can secure the backups. Hire an armored car if you think it is necessary, but storing backup tapes in a safety deposit box or other secure (off-site) location is pretty secure, especially if the information on the backup is encrypted.
      • ...while you're at it, give the secure machine a private IP address [isi.edu]. That way, (most?) packets from the outside to that machine be dropped before you ever see them. One more layer of crap for a would-be intruder to get through.

      • It would be a good idea to build a few identical machines to act as honeypots. The nice thing about a honeypot (if they machines are identical (same case, drives, etc.)) is that it can deter both physical and net attacks.
    • Re:encryption (Score:3, Informative)

      by merlin_jim ( 302773 )
      What about the storing of the credit information? That will most likely be coming in at arbitrary times, and thus the credit storage machine will need to be connected continuously.

      Look at the guidelines in the Visa CISP. They have good information about this... the bottom line is: use asynchronous encryption (store your private key elsewhere and use it once-monthly to decrypt the data as you send it), use a firewall, and patch your OS often.
  • by rhizome ( 115711 ) on Wednesday December 26, 2001 @03:00PM (#2752565) Homepage Journal
    Why not use a billing service that supports the subscription model you want, rather than trying to find some minefield-laden path toward storing credit card info?
    • I see this same mentality on some of the car related boards that I go to (luckily appears that this is not the programmer's requirement for Surepay)

      Some things you can "sup-up", but certain features don't come on the Yugos of the world...Good luck on reprogramming the manager instead

    • I have to also say that rolling your own recurring billing program is deceptively easy. I just inherited maintenance of a recurring billing program that works in an accounting package. In the several years it has been in the public, it has been plauged with a lot of problems because no one sat down and wrote algorithms for how billings were to be handled. Checks, validations, and scoping mods were added over time without using any particular analysis of where conflicts may happen. The result was it went through at least 4 people's hands before it came to me, and it is only now starting to work when all documented failure cases have been tested with the new set of algorithms I made.

      I will say that the algorithms are fairly easy once all the requirements are known (the designer just hacked it - no requirement spec exists). The big problem is that you will probably find that there are tons of other things you want it to do as your requirements for recurring billing change over time.

    • It is possible to do this with reasonable security, but it requires continual effort and more detail that one will get off /.

      I suggest you offload it to someone else if possible. This will reduce your PR liability and allow someone else to worry about the headache. I am assuming that you are asking this here because you have no full-time computer security staff (I would not even attempt something like this without the full-time security staff in place).
    • that would be a logical path, so there's no way a PHB would want to do that.
      or somebodies brother in law owns the billing company.
    • Because if you are working on a project of any serious size, the selection of merchant bank will be made by finance folks on its own merits. They are not going to accept a clearing provider with a slightly higher rate just because some programmer prefers their API.

      Your advice is applicable to very small net businesses. It is unsuitable to serious e-commerce sites because, among other things, it leaves you completely at the mercy of the clearing provider. Imagine sending an email to all your subscribers saying "Dear valued customer, due to a dispute with our former clearing provider we have lost your card number. Could you please take a moment to go to https://...." You would lose a substantial portion of your hard-won userbase that way.
  • by BlaKnail ( 545030 ) <blindspot@nimh.nEEEet minus threevowels> on Wednesday December 26, 2001 @03:00PM (#2752566)
    Just fork over money to Microsoft, and they will provide you will access to an ultra-secure passport server, so your clients will have nothing to fear.
  • Amazon.com (Score:4, Informative)

    by Anonymous Coward on Wednesday December 26, 2001 @03:01PM (#2752569)
    I remember hearing that Amazon.com originally used a Slackware box with extremely limited connectivity as a 'store' for the credit card info. Set it up with extremely limited connectivity, i.e. on a subnet unreachable by the world. Put only extremely limited services on it, i.e. set it up so there's a pipe for credit card info to get onto the box but nothing on the box is shared out and there's just one data path out from the box that sends an 'okay' signal that info verifies correctly. The machine should be set up so a zip drive is the only way to get info off of it, and you have to sit at the keyboard to do so.
  • by Anonymous Coward on Wednesday December 26, 2001 @03:01PM (#2752575)
    I always thought that this [webtechniques.com] article described a way thats pretty simple, and easy to use / develop.
    Cheers.
    • webtechniques.com article on using GPG

      The only thing that I would add to that is also partitioning the CC-number space so that an attacker who breaks one key doesn't get all the numbers, just a subset. And easy way to do this is to generate a new GPG key (say once per day) on the secure private-keys machine, and copy across the public key only to the servers. These can then encrypt the CCno with the public key, and also store the key used in the same DB entry.

      That plus a bit of salting so that two different customers using the same CC number (say Husband and Wife who share a CC) don't show up as the same, and all is happy.

      The dangerous bit is still going to be personel issues and access control to the private key storage, though passphrases can be used here.

      I guess the issue is that if your system is going to have to be able to decrypt the CC real-time, then you can't have most of the access controls that we're talking about here. A computer is going to have to take an incoming message and load the CCno into memory at some point.
  • Split up the CC# (Score:2, Insightful)

    by c0y ( 169660 )
    Store half the credit card number and half the expiration date in a cookie on the user's computer. Store the other half in the database, encrypted.

    Even if someone cracks the server, the database itself will not yield valid CC's.
    • by A nonymous Coward ( 7548 ) on Wednesday December 26, 2001 @03:51PM (#2752771)
      If someone cracks the web server, then they also have access to the web server code which decrypts the database info.

      If it's readable by the web server, then it's also readable by a cracked web server.

      You really need the secret info on a separate machine, with the CC machine never regurgitating anything except a simple answer (valid / invalid) in response to the full set of info (CC#, expiration, name, address). The only info a cracked web server can get is answers to random info, and it would take too long for the cracked web server to try random possibilities.
    • by GigsVT ( 208848 ) on Wednesday December 26, 2001 @04:00PM (#2752804) Journal
      That is the worst idea I have ever heard. Suppose you decide to store the latter half of the card number in a cookie, and some other site decides to store the beginning part in a cookie, using your method, bam plaintext credit card number on the user's computer, which is probably the least secure place for it to be stored in plaintext, since they probably have an open read-write SMB share hanging out from the latest MS worm.

      This goes to show why it is very dangerous to "Ask Slashdot" about anything important or security related.
      • Suppose you decide to store the latter half of the card number in a cookie, and some other site decides to store the beginning part in a cookie

        It's worse than that. The beginning part of the CCN is just a designation for your bank.

  • by mESSDan ( 302670 ) on Wednesday December 26, 2001 @03:04PM (#2752588) Homepage
    If the question is how to store data in a responsible way, why not ask Surepay, who you are sharing the sensitive data with? Surely they will have some insight into this, and because you are a client, may be more apt to share it.

    Maybe your question could be asked how to safely transfer it?
  • Perhaps it's not possible, but it seems to me both your and your customer's lives would be made a lot easier if you'd go with a credit card processor who does support recurring billing.
    • This doesn't solve the problem, it just transfers it to somebody else i.e. the credit card processor. Now you as a user of the processor still have an obligation to your customers to assertain that the processor has proper safeguards in place.

      There's also something to be said for keeping this data distributed. One humonguos database is a tempting target, and cracking one protection scheme nets a large return. Many small databases each with a different implementation would require a much larger expenditure of effort for the same return and might raise an alarm if other(s) got cracked first.
  • by Anonymous Coward on Wednesday December 26, 2001 @03:06PM (#2752600)
    Just don't. Credit card databases are too tempting a target for crackers. I've seen an ISPs card database hacked when they thought it was safe. It was a Netware server connected to the network, but with no direct internet connectivity. The cracker rooted the linux servers, then built the loadable IPX and netware kernel modules, mounted the netware server from the linux box (which the ISP people didnt realise was possible), and got full details of over 7000 user accounts. btw, in my experience ISPs *never* reveal stuff like this to their customers.

    If you want it to be safe, use something simple and one way, like sending the details over a serial line with the rx wire cut. Cut off the database from the Internet as much as possible. Also try and restrict access within the organisation. The last thing you want is customers to find out their data has been stolen, if it happens remember you have no legal obligation to tell anyone. Keep quiet and maybe your company will still be around in 6 months time.
    • If you want it to be safe, use something simple and one way, like sending the details over a serial line with the rx wire cut. Cut off the database from the Internet as much as possible.

      Most of the solutions posited so far in this discussion keep ignoring the fact that the data has to kept safe *and useable*. In this instance the data has to not only be stored, but sent to Surepay. For an E-Commerce site, the idea is that credit card info should not have to be re-entered everytime the user wants to purchase something. Credit card numbers are not passwords, so the simple 'box only returns a yes/valid' response won't really work for rebilling.
  • hmm, getting a credit card billed monthly sure sounds like most porn sites I've been a member at, err, it sounds like most porn sites I've read about on /.
  • Simple (Score:2, Funny)

    by Anonymous Coward
    Just use a flat file plain text database on your webserver. Then your billing application can easily read and supply the necessary information to surepay. A simple robots.txt file will prevent it from being indexed and it will be 100% secure because it will be hidden!!! Simple, elegant, and secure!
  • by f00zbll ( 526151 ) on Wednesday December 26, 2001 @03:07PM (#2752605)
    Reguardless of what ever language, platform or server you pick, use encryption for sensitive information like credit card number, expiration date, and name for the credit card (in case it's different). Typically in an enterprise environment you want to use one way Hash for the password and dis-allow retrieval of the password. If the user forgets their password, they get a new password and are forced to change it when they login the first time. Yeah, it's more of a pain for the user, but it's the responsible thing to do.

    Use DESEDE or something equal. The main goal is to make it so if someone break into your database, they can't get clear text passwords, credit card numbers or expiration date. If you want to be really hardcore, you can have a different secret key for each user, which is decrypted at runtime to generate the appropriate key used to decrypt the credit card information. Make so that once the system is up, no one can get credit card information without asking the customer. This way the information is only in plain text when the charges are made to the card.

  • by Glytch ( 4881 )
    Hire people to do it all manually. May be more expensive, but paper in a locked filing cabinet can't be hacked. Automation is not always the answer.
    • Re: (Score:2, Offtopic)

      Comment removed based on user account deletion
      • Re:Paper (Score:3, Funny)

        by Skirwan ( 244615 )
        Yeah, and when you take a cold shower, you probably turn on the hot water for 20 minutes until it's cold.
        Abusing unintended timeouts in your hot water supply to access cold water through hot-water channels may be a violation of the DMCA. Please be advised that hot-water channels are to be used solely for the transport of hot or lukewarm water, and that any other use is prohibited by your license agreement. Sharing information that may allow others to mis-use common hot-water channels in unintended and undesired fashions is irresponsible and may leave you liable for criminal damages.

        --
        Damn the Emperor!
    • Hire people to do it all manually. [snip] paper in a locked filing cabinet can't be hacked

      Actually, the people are usually the easiest to 'Hack'. It's usually called social engineering.

  • by spotter ( 5662 ) on Wednesday December 26, 2001 @03:13PM (#2752633)
    I've thought about this problem a bit, but never really had to implement anything, so anything I am about to say, should perhaps be taken with a grain of salt.

    One assumes that the web server is insecure, and therefore is going to store the data on another "secure" machine.

    One needs to make a very specific interface that one can use for the "insecure" machine to talk to the "secure" storage machine (this is the machine that is going to do the cc verification also)

    Presumably, the "secure" machine is not going to be running any services that are accesible to remote users besides whats needed for the the web server to talk to it. One can do something like only allow the machine to talk to the "insecure" webserver, but this doesn't buy you much more security, as all someone has to do is crack the "insecure" web server and you are at the same place you were before.

    Getting back to the interface these programs speak. One basically needs an "input" func, and a "status" func.

    Basically when one register with the site, the werb server doesn't store any information about the credit card on itself, as it immeadily connects to the "secure" machine and uses the input function to inform it about the new account.
    It can then use the status function to determine that status of that account

    status can be OK, or NOT_CHECKED_YET, or NOT ACCEPTED or the like. but basically something that is read only by the server.

    Both of these services should be easy for the "secure" machine to check that its getting properly formed requests (i.e. is someone is trying to attack it). One can also make a script that then verifies each account each month, and since one can do this over a phoneline, you don't even need to allow any other outbound connection from this machine.

    yes, a little bit more thought probably has to go into this, but this is what I came up with a while ago. feel free to criticize away.
  • by bourne ( 539955 ) on Wednesday December 26, 2001 @03:14PM (#2752643)

    Though there is no really good way to do it, the safest way to do it is to isolate credit card info onto a seperate box, limit the access to that box to the absolute minimum required to request a charge, and have that box then directly contact the credit card clearinghouse rather than return a CC# for use by the other half of your application.

    Encryption (SSL minimum, preferably also encrypted in store with keys being supplied by the other half of the application) is necessary, the lockbox code needs to be as limited in capability as can be, and what remains must be thoroughly audited to limit the likelihood of breach. No other services should run on that box, and physical access must be tight. A shared cage at Exodus doesn't do it.

    Whatever you do technically, I think the most important thing is... don't forget to let the customer decide. Any app that stores CC info should allow the customer to decide NOT to have their info stored. I rarely see sites that allow me to "opt out" of having them store my credit card info, and I'd rather retype it than trust them.

    • Actually.....

      Even if they are not storing your credit card info for you to use again (i.e. a profile) they are almost definately storing the info for their own reasons.

      The rationale behind this is that when there is a chargeback (when a customer tells their issuing bank a transaction is fraudulent or otherwise bad) the merchant is responsible for convincing the credit card company that it was a good transaction.

      The problem is that when Visa and MC tell you that you have a chargeback all they give you is the Credit Card number, date, and amount. You need to have stored in your system the details of the transaction linked to that credit card number. Otherwise you can never fight chargebacks and you'll get screwed (for aboveboard merchants ~.4% of transactions result in chargebacks).

      So it's unlikely that anyone who knows what they are doing would build a system that doesn't store your credit card data. Hopefully they are securing it well.....
      • For chargebacks with no transaction linked to the Card Holder/Customer, simply store a MD5 or SHA-1 hash of the CCNum. When you reconcile, hash the CCNum/exp from Visa and compare it with your records. You will probably want to add a fixed padding to the CCNum, otherwise one could crack the hash very quickly (days) using a simple LUHN-10 brute force attack.
        • Probably overkill in most cases. It also makes it impossible to do higher order queries on CC numbers (such as determining type from the first digit).

          As long as you can keep your data safe from your employees simply encrypting the data with something robustish (RSA, Triple DES with a good size key) is gonna be enough protection).

          Also the number itself isn't really the sensitive part of the package. Much of the security with credit cards is matching the number (which is easy to determine, they are not random and they only have 6-8 variable digits, plus there is a checksum/hash formula) with the exparation date. Hashing the Exp Date doesn't buy you anything since there are really only 36-48 possible values (cards only last 3-4 years). Hashing the numbers together does work, but knowing the customers exp date is sometimes important for business reasons (i.e. for subscriptions you don't want to keep charging an expired card).

          So... I'd go with encrypting the whole smash and auditing who can get in and out of the encryption.
  • Internal Controls (Score:5, Insightful)

    by jayfoo2 ( 170671 ) on Wednesday December 26, 2001 @03:16PM (#2752650)
    Absolutely key to securing financial data (or really any data) is the use of good internal controls.

    Most technologists spend a lot of time securing their data from external attack (i.e. a cracker). This is important but it is not the most likely threat.

    Well over half of all thefts of financial data are committed by employees/trusted users of the company. Sometimes by the people who maintain the system and sometimes by others.

    You combat this two ways. First with technology, the system (in this case probably a database) that contains the data should be access controled. It is also a good idea (and required by visa/MC) to encrypt the data. Another thing to watch out for is that you are not putting the credit card data into any other places, i.e. log files. you need to physically control access to the hardware running the system. Finally watch out for your backup tapes/media, especially if they are stored offsite.

    On the soft side you want to have good audit controls on the data. Whatever method is used to access the data should leave a record of it doing so in a manner that is hard to compromise. People who don't need access to that data should not be allowed near it. Finally you need to be able to trust the people with access to the sensitive data, depending on the level of sensitivity this could involve cursory or invasive background checks. Banks background check their employees rather carefully, and for a reason.
  • Well, the billing system needs to store the customer data in plaintext in order to present it to the remote machine. That, of course, makes it very vulnerable.

    I would probably choose an architecture that has a dedicated machine for just the periodic billing to the credit card processor. The machine would sit behind its own hardware firewall (real cheap now) and only be permitted to make outgoing connections (no open ports on the firewall). The web servers would gather updates to user information and make them available for pick-up by the dedicated machine; once picked up, they should get securely deleted from the web servers (keep the data off the disk, purge the swap partition periodically, worry about transaction logs).

    The billing server needs to make backups of the billing information. It can encrypt those and push the encrypted data out. When the machine fails, as it will sooner or later, you can restore from the encrypted information outside the firewall.

    You still need to ensure that the web servers themselves aren't compromised because otherwise people can collect data there as it is submitted by users, but you always have that problem. Personally, I like continuous monitoring of system files and network connections, together with automatic periodic reinstalls. You probably also should have independent sanity checks on the update records (check for size limits, etc.).

    I'd strongly recommend not writing any of this stuff in C/C++ or Perl. In the former, the probability of pointer bugs or buffer overruns is too high, and in the latter, it's too easy to leave out error checking. I'd probably go with Java--it's not perfect, but it's mainstream and reasonably mature.

    • Well, the billing system needs to store the customer data in plaintext in order to present it to the remote machine. That, of course, makes it very vulnerable.

      I should add that if you are really worried, you can store the data in encrypted form on the server and use manual intervention (smart card, password) for decrypting it and sending it to the credit card processor. Then, the machine can only be compromised when a human is present, and you could even ensure that multiple employees have to be present for billing, if you wanted to. But that's probably overkill for credit card numbers, which are not that hard to come by and protect consumers fairly well anyway.

      • OK. How do you charge the credit card, in this case? Certainly not in real-time.

        A better solution (cost-benefit wise) would be to have an iron-clad server (SELinux, maybe) which only allowed a very limited number of possible users and programs to access the CC info. Use firewalls, and keep a full-time computer-security staff (at least one person) to be responsible for managing the security.
        • The problem posed was recurring charges, not one-time real-time charges. Password protection would work this way: once a week/month, someone would walk up to the machine, run a virus check, verify the installation, sign off on a log, and then insert their smartcard into the machine. The server would use the smartcard to temporarily decrypt the CC information and post all the recurring charges to the CC processor. The benefit you gain is that you are guaranteed that security and logs are looked at by a person before any transactions go out.

          Use firewalls, and keep a full-time computer-security staff (at least one person) to be responsible for managing the security.

          Of course. And what I described is one of the approaches such a person could take if security is paramount (no server ports, manual checks before any information is decrypted).

  • It sounds like you need a public/private key pair. The public key could be used on your webserver to generate records to go INTO your database, which could then only be decrypted by the private key. Keep the private key offline, except when it's being used during the billing cycle (you could use an offline computer to be really secure about the billing processing). This should give you the flexiblity you need, being able to write the data at any time, and only read it with the proper key.

    I would imagine that the good old fashioned command line incarnation of PGP would be quite good at doing the encryption, as your write access traffic is quite likely to be very low.

    Keep physical security, and redundant secure backups, and you should be set.

    --Mike--

  • by bluGill ( 862 ) on Wednesday December 26, 2001 @03:21PM (#2752666)

    Bruce S. (I'm not gonna try to spell is last name) of Applied Cryptology fame is where I would start. Read his books, do a formal design of the system, and then hire him/his company to aduit your design BEFORE you start coding.

    Don't forget to have a range of secure systems to work with. Run the web server on openBSD, and have the dataBase on trusted solaris. And use a good database and firewall (none come to mind off hand. (Note I'm giving examples, you can mix and match to please, just so long as they have to break several systems to get the data, none of which trust the others)

    Take the additude that your web server will be cracked. Do your best to detect that. your firewall should protect the database (unless it is hacked!), and the database doesn't trust the firewall. With good detection you should shut down the front line systems before the cracker gets to the back end.

    Remember to have experts aduit your design. Have other experts audit your code. (the later is hard, but it helps a lot)

  • by Dionysus ( 12737 ) on Wednesday December 26, 2001 @03:27PM (#2752694) Homepage
    Why encrypt it? Kinda parasitic to keep information from people, isn't it? And they're not thiefs. They're information liberators.
  • Ditch Surepay... (Score:3, Informative)

    by Brendan Byrd ( 105387 ) <SineSwiper-slash ... esonatorSoft.org> on Wednesday December 26, 2001 @03:30PM (#2752700) Homepage Journal
    If they don't support recurring payments, maybe that's the initial problem. I guess your PHB doesn't like that idea, does he?

    In terms of security/responsibility, it's impossible to create a 100% secure system, but as long as security is a focus in your software (and it isn't rushed), it's destined to be as secure as possible.

    I guess I could list a few pointers to help you out, though (in random order):
    • Don't trust HTML pages to give the correct limitations and forms. People can change local copies and send any data they want.
    • Never use "secret" URLs, unless you use some sort of HTTP passwording system, or something else similar. (This has been the cause of many data-theft attacks.)
    • Encourage customers to use secure passwords, such as 6+ characters, letter/number & upper/lower combos, no dictionary words, etc. (And for god's sake, let them use spaces, if they want.)
    • Store billing information in a seperate system than the web server or any other system. Put the billing server behind the firewall on a private-class network. If one gets hacked, the billing data is safe.
    • Make use of that 3-digit number on the back of CCs to verify that they aren't stealing numbers. (I really don't know if that's possible, but you should investigate it, as it would curb a lot of usage on stolen CC numbers, unless they have the physical card.)
  • Check with Visa (Score:2, Informative)

    by Anonymous Coward
    Visa has some pretty clear rules about what online sites should, and shouldn't do, with credit card data.

    Single sign-on, encryption, restricted access, with (potential) fines for vendors that cause excessive problems. With these, Visa claims a fraud rate of 1% was dropped to 0.06%. If it were me, I'd work with either the CC processor or Visa to work out recurring payments. Make sure you're not legally on the hook for any mistakes or breaches.

    My wife uses throw-a-way numbers, I change them at the first hint of a fraud problem -- both are going to cause you headaches.

    I hate vendors who back-end credit card information and work very hard to avoid them. You could do us a big favor and alude to the vendor (so we know who to avoid).
  • Having credit card data available on your system is a huge potential problem; any security hole might be exploited, and even if none of the card #s are misused, it would make your customers very unhappy.

    I'd recommend transferring the card numbers to another machine via a logging-type channel; in other words, send the card number and billing data to a logger on a machine with no other servers running. The fewer open ports, the less chance of the machine being exploited. An application on that machine could then read the log and insert the appropriate information into its database, and perform the billing functions as needed.
  • NIH? (Score:3, Informative)

    by hey! ( 33014 ) on Wednesday December 26, 2001 @03:38PM (#2752729) Homepage Journal
    There's lots of issues with storing credit cards, not the least is showing that individuals working for you can't misuse the data and would have difficulty even colluding to misuse the data. I know, I was a IT director in the pre-dotcom days when people took these issues seriously.

    Hopefully, there will be some insightful answers posted to /., but I think there are some other parties you may wish to ask. If you have a good CPA, they will know how this issue is handled in related businesses. Also, don't forget the credit card companies themselves, who should be willing to share their ideas for "best practices" when using their products. Remember, they have a vested interest in making their products convenient and safe for vendors to use.

    Finally, this seems like a commodity sort of task that involves lots of headaches to get right (like payroll). Perhaps it would be better to buy the solution from a vendor/service beureau that can handle your requirements and so you can concentrate on the things which differentiate you. If,on the other hand, you are in the business of managing this kind of information you should have people on your team with considerable real world experience in this.

    Good luck.
  • Good practices (Score:4, Interesting)

    by Pinball Wizard ( 161942 ) on Wednesday December 26, 2001 @03:42PM (#2752740) Homepage Journal
    Here, in a nutshell, is how I do it.


    1 - I use OpenBSD for firewalling. You limit connections to your machines by only allowing specific ports to connect to that machine. You can also control which way connections are allowed to connect. For instance you might wish to limit connections to your web server to port 80. For the database server that will hold the credit card data, a good way to do it would be to allow port 22 into the server, and no traffic whatsoever to leave the server.


    2 - Use private key encryption. There is no need for anyone but you to have the key so use a good private-key encryption on your data server. Triple-DES is a good choice. It comes free with OpenBSD


    So, basically, what you need are two OpenBSD boxen, and the expertise to set up two firewalls, SSH, and Triple-DES. Then, to get your data, a cracker has to 1)Crack two OpenBSD boxes 2) Exploit a hole in OpenSSH 3) brute-force Triple-DES.


    In other words, they will be having snowball fights in the ninth layer of hell before someone gets to your data.

    • Use private key encryption. There is no need for anyone but you to have the key

      I don't get it. How will the system encrypt the card numbers if it doesn't have the key?
  • Be careful. I read the surepay site and couldn't find the specific terms of service (TOS), but based on experience with other sites (paypal, propay, instabill, etc), your plan may be illegal.

    If they are going the cheap way (visit their site, buy via link to surepay, return to their site), then the TOS likely says "customers must enter information themselves" (merchants cannot just fill out the 'credit slip' for them).

    This comes up even with some online merchant accounts-- that the _customer_ must fill out each charge slip that gets processed, and the merchant can't just fill it out for them.

    It's a crucial difference that means implementing your own 'fake the customer re-submitting the info to mimic recurrent billing' could violate the TOS and, in turn, Surepay's own arrangements for their bank.

    Of course, if they're using Surepay's premium, it might be do-able-- but that that point, between paying Surepay premium plus hiring you for coding, they're best off just getting their own merchant account and having you code locally-- and securely-- to do what they wanted in the first place.

    Merchant banking is not a place for hacks.
  • I'm sure others here will offer concrete advice on setting such a system
    up, so I'll share my experiences in implementing such systems.

    Something important to remember is that security shouldn't be scaled with
    popularity; sites often imagine that their (relative) obscurity insures
    that they will not be targeted, that security is something that only
    Amazon.com should worry about. This is, of course, far from the truth - in
    my experience, thieves (I will not call them 'hackers' or anything like
    that) target sites whose security and billing systems they know are small
    enough not to take major security steps. The best way to approach it is to
    implement a high level of security in every billing-sensitive system, not
    because it is truly secure, but because other systems are less secure (the
    deterrent effect).

    One client I recently assisted was a medium-sized liberal arts university
    who accepted online applications and the accompanying credit card info
    (for application fees) with absolutely no security - everything was sent
    to plain text files on the servers and then forwarded via internal email.
    Their attitude was that as a university they wouldn't be targeted. They
    were fortunate enough not to have lost any major information (that we
    could determine) but they were foolish to put themselves in a situation
    where their reputation (let alone their customers' information) could have
    been compromised
  • One would assume that you don't allow all sorts of evil things past your firewall. Lets expand on the intent of what you are trying to do and also assume that there needs to be internal access to the data as well--customer support, phone registration, etc. What would you do in that case?

    Certainly you can wrap the calls (client or web) in something like SOAP/XMLRPC/RMI/Corba and then use an encryption package over it. I built something similar to talk to a credit card authorization system using XML over HTTPS with the Java JSSE library extensions. You could certainly do this internally and to the remote authentication system as well.

    The problem most sites seem to have is where the data is located and how access is allowed. Provided you are not putting your client info DB out on the net and leave it inside and protected you shouldn't have much of a problem. Do customers need to change their credit card numbers? One assumes they do and will be prompted when the card expires. This means the web server needs to have access to that data. If not, lock it inside your network and only allow writes to the database and reads only to the monthly revalidation program. In an ideal world, the internal program would have a direct link to the payment system and not have to use the net at all. You should really try to build some data abstraction layers into the system so even if the web server is hacked it can't be used as a platform to run SQL statements directly against the customer data DB. Most of the posts here seem to be about encrytion and the like, but in reality if you allow access by the web server and it is hacked you are pretty much SOL if you have a visable API through a server-side scripted language. Just IMHO.

    -J
  • by Animats ( 122034 ) on Wednesday December 26, 2001 @04:20PM (#2752875) Homepage
    SurePay is on the way out. [surepay.com] They've made a deal with Verisign to migrate users to the Verisign Managed Payment Gateway. The SurePay gateway is only being maintained for existing customers. It should not be used for new development.
  • Well, depending on if you want to store the credit card info on your servers or if you want to store it on someone elses servers.

    If you want to store the info on your own servers the best solution for you would probably be ModernBill [modernbill.com]. It offers an integrated signup process and user management. It can also automatically talk to payment gateways such as AuthorizeNet. Highly reccomended by many. Check out http://www.modernbill.com [modernbill.com].

    If you want to keep your customer info offsite you can check out Ubersmith [ubersmith.com], which is provided by voxel.net [voxel.net]. This is also very good and I know many people who use it. The only problem here is price. It's rather expensive to go this way, but if you can afford it it's probably the best way to go.

    Hope those all help. ;)

  • by phamlen ( 304054 ) <phamlen&mail,com> on Wednesday December 26, 2001 @04:44PM (#2752939) Homepage
    1) As other people have mentioned, the biggest decision is which pay service to use in the first place. The wrong package will result in you:

    implementing strong security on a system, which is difficult to do right

    implementing a lot of customer service tools (to look up credit card numbers, issue refunds, track chargebacks, etc.)

    generally spending more time than necessary in order to poorly implement something that another company has already done. Remember, the billing services are the ones who should be figuring out how to store credit cards, be secure, etc.

    2) The place to look for payment systems is: here [google.com]

    3) Be sure to understand the Customer Service issue. It is quite reasonable to expect that Customer Service will ask to be able to "look at" Credit Card numbers, but consider carefully whether they need to see the Credit Card numbers or just search on the credit card numbers.

    In my experience, you may end up spending more time writing the customer service interface than writing the customer interface - they may need to issue refunds to a card, they may need to investigate chargebacks (a BIG issue - especially with recurring charges.)

    4) Avoid storing the credit cards if at all possible (but understand how you'll issue refunds and search for credit card numbers). As everyone states here, the security required in order to make this secure is easily weeks worth of effort. Again, picking the right payment service can eliminate this effort.

    5) Remember, the client probably doesn't care about security enough to jeopardize payment - this is a clear case where the client probably wants his money more than he cares about preventing "potential attacks".

  • If you have to ask this question on Slashdot, then you shouldn't be doing it. Read "Secrets and Lies," and then think about the question some more.
  • Like most security question, ultimatly this boils down to Security vs. Convience.
    I've worked in a number of arenas tha involve handling credit card information.
    Here is some of the mistakes I've seen, maybe you can avoid doing them.

    I contracted at a known online shopping company. When I sat down at a terminal, my access gave me permissions to the database. My machine had a floppy drive AND a zip drive. none of the CC information was encrypted. I told my manager of that was a security problem? his response? released me for being a threat to their company.

    there are at least three lessons in that story.

    The only way to gain more security is force pin number use onto consumers. Not perfect, but a lot better. Oh yeah encryot it for goodness sake! good encryption. Also CC numbers that expire every 30 days.
  • Another idea... (Score:2, Interesting)

    by Primer ( 25308 )
    1) Keep the data encrypted in the db

    2) Keep the db on an internal 10.1.1.X network and only allow the db port to be accessed from the web server. Only allow ssh access from the dba's workstation. All this via firewalling, of course.

    3) Use binaries for your web server programs, so that the encryption method can't be easily discovered if somehow your db server is compromised. Then, only allow the "update" priviledge to the db user that the web programs use, and...

    4) Do the monthly billing directly from the database server via cron. The db server can be a 10.1.1.X machine and still have interet access via NAT.

    5) Monitor your logs daily so that, in the event your web server IS compromised, you can stop them before any damage is incurred.

    This crap about loading media and unloading it is not practical, since billing is going to be a daily occurence for most companies. The CC data will always need to be accesible. At least that's how things are where I work.

  • My solution (Score:4, Interesting)

    by Amorphous ( 107314 ) on Wednesday December 26, 2001 @05:14PM (#2753040)
    Howdy,

    here's what I did when I implemented the same kind of service:

    first, I choose PGP (GPG) to encrypt the user's CC information in a database on a safe Linux system (firewalled and using an IDS).

    here's my logic: information can be encrypted anytime using the public key, but the private key must be used for decryption. The public key is then stored on the server, but not the private one.

    In case of stealing, you're safe so far.

    Only one program access the CC information and need the private key. On startup, it asks for two information: the "real" private key and a "passphrase" of a minimum length. the key is then XORED with the passphrase and the result is hidden in memory. The passphrase is then given to the employees and changed daily (or anytime you wish).

    So the CC info can be read if:
    1- the server process was started by a thrusted admin knowing the private key, and
    2- the person accessing the data know the day's passphrase.

    if the passphrase is protected while being sent to the server and the employees are either "thrusted" or "unable to hack a secured unix system and debug the memory to restore an xored key", the system should be safe enough

    backups can be made (the key's nowhere nead the hard disks) and the information given to the employees, the passphrase, can't be reused after the end of the day.

    and if it's not secure enough for our most paranoid contenders, it's fun to realise anyway :)
    • Sorry, but I don't understand how you can label that as secure. I'm honestly not intending this as troll/flame, but it seems that security on a unix box is somewhat of a misnomer amongst the actual industry.

      My methodology (and I have done direct work on this) is if it is not secure from root on the local box, it's not secure.. The software should maintain a level of segregation from that single server.

      Let me give you a little bit of insight for your next run at it - variable key/algo encryption. Ensure that soon as it starts, the keys rotate and only a user logging in is able to restore the key hash properly (this can be done a number of different ways) and also ensures that only users looking at it know the key, and if you implement in a certain manner who looked at what, based off key history. It relies on a high degree of entropy, and can be CPU exhaustive but it is well worth it, imo. Being root on a box should not make any app insecure, and I hate seeing stuff like that. Employees are one thing, you can trust them. Maybe I'm missing something in your algorithm.. but it just seems that it's secure in-concept, that no one decides to attack your server. And also, it's not like the evil-ones have to know a whole heck of a lot to dump the memory of the process and work on it later, along with your CC database.
  • Not a simple problem (Score:4, Informative)

    by geraldthewes ( 306845 ) on Wednesday December 26, 2001 @05:20PM (#2753059)
    I've build similar systems in the past. It's not a simple problem. In addition to a very robust and well thought network architecture and a very robust encryption architecture for the Credit Cards as mentionned in the previous posts you have to deal with:

    Credit Card reconciliation - when you bill on a monthly basis, a lot of cards expire, are cancelled, this needs to be detected, the user informed the next time he tries to use the service, etc... There needs to be good adminstrative/financial metrics to track these.

    You need very good operational interfaces and a strong underlying architecture so that people get billed when they should, and not when they should not. It's easy in cruise mode, but harder to keep track as financial processors or external connectivity is down, or after an upgrade, or system crash or other usual operational down-time.

    Things get also quite complicated quickly if you offer multiple subscription services (monthly, yearly, first month free, etc...)

    This stuff is hard to get 100% right (and it needs to be 100% right). I agree with the other post that recommend either a provider that already does that, or buying software that already does this.
  • I have used IBill for two years for recurrent monthly billing, and I am delighted with the service. They have great customer service. http://www.ibill.com
  • If you're here asking us how to do this, you might not be qualified to handle this sort of security issue.

    You have basically two options:

    1. Hire a security consultant
    2. Let your client know that they need to hire a security consultant.
    Either way, you need to let your client know about this issue, and ensure that you're not going to be held responsible in the event of data loss/theft. Try to tackle this one yourself, without enough experience, and you're setting yourself up for a heap of trouble. Be a professional. Know your limitations.
  • While everyone is posting about how to make a super-secure infrastructure, I'm reminded of an old story:

    Two guys are out camping. In the early morning, just past dawn, they hear noises near the campsite. Peeking out the front flap of the tent, they see a grizzly bear sniffing around the perimeter of the campsite. The first guy takes off running. The second guy yells, "Hey, you can't outrun a bear!" The first guy yells, "I don't have to, I just have to outrun you!"

    Of course, if your site isn't perfectly secure, someone might break in and steal a bunch of CC numbers. But they're a lot less likely if your site is mostly secure and the insecure pieces involve a lot of resources (e.g. effort, money, planning, knowledge). Remember, neither the NSA nor the CIA is interested in stealing CC numbers...
  • Secure it (Score:2, Interesting)

    by Spazmania ( 174582 )
    Here's how:

    Overview:

    1) Put the critical private information on an isolated machine.
    2) Permit authorized processes to connect to the isolated machine in WRITE ONLY mode.
    3) Permit authorized processes to connect from the isolated machine to the surepay server.
    4) Permit no other connections.

    The details:

    Set up some database server software on your isolated linux box.

    Write a custom interface from the main system to the linux box which accepts the data into a chrooted environment while running as a normal user (not root).
    Write software which retrieves the data from the chrooted environment (still not root) and stores it in the database.

    Write software which connects from the isolated machine out to the surepay server as necessary.

    Set up firewall rules (a la ipchains) such that the only connections permitted are from the general-purpose server that the user interfaces with, and to (but not from) the surepay servers.

    Problems with this approach:

    1) Can't verify billing status e.g. credit cards in real time.

    2) Credit card data remains vulnerable during the path between when its entered at the web server and when the web server stores it to the isolated server and discards it.


  • OK ... I've taken heat for saying this before on other topics, so I feel compelled to put my head on the chopping block again 8^}

    If you have to ask Slashdot, you aren't qualified !!!!!

    The legal liabilities alone make it an extremely bad idea to even try. As others have pointed out, you started with the wrong givens. If the service that they want you to use doesn't offer recurring billing, then they asked you to use the wrong service! If you can't convince them to use one that is suitable ... maybe because their brother-in-law owns it or something ... let their brother-in-law incur the liability! You definitely, definitely, definitely (did I mention definitely?) should NOT even attempt this !!!!

    If you do anyway, good luck, because that is all that will save you from yourself!

    Cheers!

    Zero__Kelvin
  • Pull a Kobyashi Maru, and change the parameters. Don't charge monthly, charge yearly. Store the date of subscription, and send an email out, once a week, starting two months before a subscription will expire, telling the user to come re-subscribe. That removes the entire requirement to store things.
  • Possible Solution (Score:2, Interesting)

    by jrinderle ( 306005 )
    Here is a solution using PGP:

    1.) Generate a new public/private key pair of significant length using PGP / OpenPGP on a detached (off the network) workstation.

    2.) Store the public key on read-only media. Create two copies. One copy should be kept in a fireproof safe. The other will become a mounted filesystem on the web server.

    3.) Repeat step 2 for the private key. Except, both copies of the key should be kept in a physically secure (restricted access) location.

    4.) Delete the keys from the offline workstation. Delete the swap file. Wipe the free space on the workstation's hard disk. Power off the machine to clear its RAM.

    4.) Mount the public key as a read-only filsystem on the webserver. Read-only media maintains integrity. I recommend it for everything critical that doesn't require writes (kernel, system binaries, HTML files). Once there are cached in memory there is no performance hit.

    5. Modify your web application. Encrypt client credit card numbers using PGP and your public key.

    6. When credit card processing time comes around (every night, once a week), copy the encypted credit card numbers to removable media. Retrieve the CD with your private key. Batch process the credit card numbers from an offline workstation, decrypting the numbers with the pricate key on the CD-ROM. All of this can easily be automated with shell / Perl / Python scripts.

    Again, it is critical that you A) have a backup of your key pair, B) maintain the integrity of the keys with read-only media, C) physically restrict access to your keys (most importantly the private key, but it never hurts to be paranoid). Also, your private key should never come near the web server.

    Remember, document the process. Define policy to administer the process. Develop contingency scenarios (what is the private key is lost, compromised, the hard disk in the web server fails, etc.). Define how you will recover from breeches in policy. Train your employees to act responsbily.
  • Proper billing information security involves two steps: first, the ordinary system security that we all know about - protecting your system from breakins, physical security of the machines, etc. This is a big job in and of itself. On top of that, you then need to worry about encryption of the account information, so that if there is a break-in (either virtual or physical), you are not in a position to be blackmailed by the crackers.

    More details can be found on my company's page about security, here [trustcommerce.com]. Allow me to boast for a moment and state that we are one of the only payment processors that uses a fully encrypted data storage system: no unencypted card numbers are ever writen to disk. Cool, eh?

    As long as I'm evangelizing our service, I will also mention our Billing ID [trustcommerce.com] system. This is probably exactly the sort of thing you should be using for this application: not only does it do automated recurring billing, but it actually stores all the info in an encypted database so that you don't have to be responsible for holding that information locally. You can run transactions on the account either by using the six digit Billing ID returned by the original store transaction, or by scheduling one-time or repeated transactions through either the web interface or the TCLink API. It's a pretty nifty system, you might want to check it out for your app.
  • <plug>
    I think what you are looking for is a payment processor [trustcommerce.com] which supports recurring billing [trustcommerce.com] as well as open source [trustcommerce.com] client APIs?
    </plug>
  • No Magic Bullet (Score:2, Insightful)

    by rasilon ( 18267 )

    There's no magic bullet for this - you can't say use GNUfoo or Sun iMumble, it'll do all you want and wipe you bum too.

    The only one liner I can give you is Security In Depth. Use lots of layers of security and at every layer assume that the one above has been fully compromised. Your DMZ should be well firewalled, permit only ports 80 and 443 (HTTP and HTTPS), deny and log anything else. Your DMZ servers should assume that they can be attacked on any port from any host what so ever. Use the most minimal OS install you can and pick an OS that can be secured and will let you do a minimal install. RedHat has too many features for my taste - you don't want a friendly machine, you want a very unfriendly machine. I would suggest Slackware or Solaris from the general purpose OS pool, or Bastille Linux or OpenBSD from the secured OS pool. Disable or remove inetd completely - it tries to be friendly. Permit no unencrypted traffic. Use tripwire, and be able to reimage the mahines rapidly.

    Your inner firewall should be of a different make to the outer one and should assume that all hosts in the DMZ are compromised. Permit only connections from specific hosts on specific ports to specific hosts on specific ports. Anything else should be denied, logged and the warning sirens sounded.

    Behind here would be your working net where (relativly) non-secure business functions live. Once again, these hosts should assume the worst and that they have to fend for themselves. Etc. Use your imagination.

    One last firewall, preferably a different make again, similar to the last, specific hosts and ports only. You may want to be more cautious about sounding the claxons however, windows likes to chat to things and users occasionally do silly but harmless things - this is not to say drop your guard, just that sleep is sometimes useful.

    Next is the secure net. Absolute bare bones here. What this consists of depends on your application, but usually business logic, database and credit card processing live here, each on their own box, set to maximum paranoia security. Log everything, every login, every logout every process run, every request made, when and by whom. You'll need lots of disk space, archive regularly to read-only media, make several copies and store them in multiple secure locations.

    IDS - Intrusion Detection Systems. These're useful, use lots - different types, different makes, even write a few of your own.

    Incident response. What to do when your firewall is breached. What to do when your web servers are breached. What to do when your working net is breached. What to do when it is an inside job. What to do when your data is stolen. This is where your IDS comes in handy, if your data does walk, you must know where, when, how and who. Access procedures are useful. You will probably never be able to ensure that no one employee can steal your data, but you can ensure that no one employee can steal your data and cover their tracks.
    Note that the word "if" was missing from the last paragraph. If lets you cross your fingers and hope it wont happen. Plan for when, not if.

    Software. Encryption is good. Make sure and pick the right encryption for the job. Credit card data needs to be decrypted, I would suggest BlowFish, passwords don't - try MD5. Always practice safe key management remember your data is only as safe as your keys. Having said that, if your database encryption is ever tested for real you are this > < far away from a Worst Case Scenario.

    Literature. There's lots of literature about, read some of it. Learn to break into computers, try to break into yours. Read some of the OpenBSD stuff, read Bugtraq and the other stuff at SecurityFocus, even if it isn't directly related, the attackers can think laterally, you must too. Try farther afield - failsafe engineering disciplines are a good start (try a google on SAFF for places it really matters.)


  • I posted a brief overview of a solution using PGP eariler. It was by no means perfect, just intended to point you in the right direction.

    Then I began to read what others had posted....

    The best advice I can give you is not to trust anything you read here. Some of the solutions suggested are just bad. I am a security professional so I have some experience in this area. As others have said, recognize that you are not equiped to handle this. Find someone who is.

    But before you outsource, hire consultants, etc... remember -- technology is only a tool. I've seen technology based solutions that were more vulnerable than the problem.

    You have a specific set of risks. Choose a solution that helps to mitigate those risks. Remember to document. Remember people actually have to use the system. Remember a create a well-defined process. Remember to create and enforce policy.

    Also, look to the three R's. I could not find a single post that specifically mentioned recognition.

    Resistance: how can I protect the integrity and privacy of the card numbers?
    Recognition: how do you know if a breech of security has occured?
    Recovery: how do we recover from said breech?
  • My employer has the same requirement.
    Step 1: Lower your expectations. In a perfect world you could do recurring billing, and yet an intruder could not obtain the payment card numbers. In reality, any scheme which allows an automated system to reconstitute the payment card numbers for billing purposes can be used by an intruder (assuming he has root on all your machines) to obtain the list of numbers. Therefore, the realistic goals are:
    1. You cannot obtain any payment card numbers by getting root on one box.
    2. Recreating a card number involves the coooperation of a secure box. This idea recognizes that a web server running a complex application cannot reach a high level of security. There are likely to be holes. However a "secure box" running a minimum of services and relatively simple code can be more trustworthy.
    3. Any webserver can instruct the secure box to:
      1. Learn a new payment card.
      2. Charge a payment card.
      A webserver cannot request any information about a payment card, including the number. (This necessary for criterion 1).
      Implementation: When the secure box records a new payment card, it cryptographically splits the card number into two numbers N1 and N2, neither of which yield any information about the card number. (See Applied Cryptography). N1 is returned to the requesting webserver (which sticks N1 into the database as part of the customer record) while N2 is stored in a text file on the secure server, indexed by a sequence number that is also returned to the webserver and stored in the database.
      When a webserver wants to charge a card, it provides N1 and the sequence number to the secure box. The secure box internally reconstitutes the card number and charges the card.

      Clearly, there are vulnerabilities in this scheme. For example, an attacher could plant a trojan on the webservers which captures the payment card numbers before they are initially sent to the secure box. However we eliminate the ultimate nightmare of having thousands of card numbers copied in one quick attack. Also, of course, anyone who cracks a webserver can throw in bogus charges (accruing to us). This is a nice bit of sabotage, but doesn't make any money for the attacker.

      I have heard of more elaborate schemes, but they seem to consist of security through obscurity. You can make the reconstruction of the card number "complicated", but ultimately all the elements must be available to the automatic billing process. And if the box is cracked, you can assume that all the elements stored on that box have been copied.

      Therefore I think this scheme is about as secure as one can realistically get.
  • That goes for your boss as well, and anyone else up the corporate chain who has allowed this situation to develop. Amateurs, however well-intentioned, should not be given the responsibility of developing financial and accounting systems or policies.

    That said, I must also point something out from the customer's standpoint. There is no possible way that I, the consumer, will accept any term of purchase of any product, that involves the vendor making a monthly charge on my credit card, writing a monthly check on my behalf, or "automatically" withdrawing money from my bank account.

    If a merchant is not capable of sending me a bill each month, the customary method of soliciting payment, he is not worthy of my business. Furthermore, if he demands such an arrangement as a means of automatically making my bill payment on my behalf, he has already made a serious social blunder that cost my business from the first word: it is tantamount to accusing me of being a thief, and at the very least has indicated to me that the merchant already considers me irresponsible before our relationship has even been established.

    I will do no business with such a cretin. End of story.
  • by nologin ( 256407 )
    Use something else than Surepay. If it can't do what you need it to do, don't think you can easily throw a band-aid on to fix the whole thing.

    While I can't be specific, I have had the fortune (or misfortune) of working with an e-commerce company. We had a golden rule w/ respect to storing credit card numbers. If you have a system to store credit card numbers in order to be able to reproduce them at a later date which uses a public info system (such as a website, etc.) the credit card numbers are vulnerable to someone stealing them.

    Trust me. You'll never find a sure way of keeping that credit card number secure. You can say "I'll use encryption, store them (credit card numbers) on a secure server, blah blah blah". They won't be.

    And I probably would trust a full end to end solution either. I just wish I can see the look on the face of a salesman who tries pitching his secure product when it's credit card numbers end up showing up in a Google search results page...
  • convenience vs. risk (Score:2, Interesting)

    by npkatz ( 546327 )
    Buy.com, Ebay and (I think) Amazon let you recall card numbers you used before and use them on new orders. So they keep your old card around. I suggest heavy 2-way encryption with the key very well protected. The question is whether the card numbers are exposed, that is, if one of their employees or business partners can get to the data, is it readable or easily decryptable. If not, I say, you've done your job. I used to like knowing that companies that collect my credit card for payment don't keep it around. So the inconvenience of having to enter it again was OK given the security of their back end. However, having designed e-commerce systems myself, I realized that the lack of the recall feature has absolutely no bearing on the security of my credit card info. So I decided, screw it. Once you've used your card on a site to pay for something, you're vulnerable, at least to the dishonest employees of the vendor or his ISP. Now that I've settled, I really enjoy the convenience of being able to recall my card without having to type it in again. I would design every e-commerce system to have this feature if my clients decided it was right for their business. Norm
  • Here's what Visa recommends to merchants:

    Internet [firewall] web server [firewall] app server [firewall] database server

    ...and the database must be encrypted.

    Check out a company called Protegrity; they offer drop-in encryption for many vendor's databases.
  • Giving customer's the service they expect isn't the hard part. Any software engineer who knows Perl, Java, or C++ should be able to implement it without much difficulty. If you think that is the hard part please do not work in e-commerce.

    The hard part, the meat of the problem, is securing the data. And it's a problem who's difficult is often underestimated.

    I'm assuming that all data is submitted ONLY via 'POST' (i.e. not 'GET'), and via SSL. If this is not the case, see the above comment on working e-commerce.

    I had to design a system like this for the e-commerce company I used to work for. Assuming we where hacked and how, the goal was to minimize the impact it would have. E.g. if the hacker got access to our entire source tree, our database, had a network sniffer, etc. how would we stand under various scenarios. Additionally, we made as few assumptions as possible (e.g. the hacker could have access to our source code, the public key, our db, network sniffing, but did not have access to private the key).

    If you're past that, some advice:

    1) Place all your secure data on a separate server. Minimize the data present on that machine. This will decrease the likelihood of someone needing or asking to get access to data that will additionally expose the secure data. Additionally the server should be as stripped down as possible, as any secure server should be.

    2) Setup your network with an additional zone. The server mentioned above should go in this zone. The new zone will be strictly controlled and only used for holding the server upon which the secure data will reside. This zone should be strictly controlled with it's own router. Everything disallowed and only one or two things (ssh and https) should be opened. Ideally, if your main webserver (probably the most likely spot for a penetration) you'll want to know if this part of the network has been breached as well.

    3) Do not write the secure data to disk (e.g. in log files or in debugging information dump files). Do not pass the data over the network in any insecure manner. This seems obvious, but a lot of people fail to understand the entire environment, and can inadvertently weak their system's security due to this. For example, many people using a servlet container like Resin configure the session data to replicate to another server. While this is a great thing, and reduces the problems of losing any single server, the secure data can be transmitted across the local network in clear text while being replicated. Not good.

    4) The web servers will most likely need to make a secure connection to secure box. This sounds bad at first, but there isn't a better away around it. Ultimately the data has to get from point A to point B. Writing it to disk for batch accumulation is not good (as stated above). Building up a queue and batch submitting jobs to the server doesn't really offer anything over individual submissions. Additionally it increases the detriment of a server crashing before the batch job has been submitted. In some cases this might also be less ideal as the business needs may call for pre-auths to take place as soon as possible, or otherwise sending the order to a distribution center as quickly as possible.

    5) It's obvious to state you should encrypt the data before writing to the database. The part most people miss is HOW to encrypt. Just using a public/private key isn?t enough. Even worse, most folks will miss judge the strength of their system by gauging how long it would take to crack the key being used. While cracking the key is most likely what you would want to do to read the secret message from Alice to Bob, it?s not what someone is going to do to get your credit card numbers.

    If someone wants to get your list of credit cards, it's easier to brute force the number. The average non-amex card is 16 digits. Assume you've gotten the entire database; you'll have a few hundred thousand numbers easy. Assume you're not a greedy hacker and would be happy with say only a hundred thousand numbers. Then the first four digits really aren't random as they often represent the network and bank. (Ever notice that your buddy?s Visa card also begins with a 4? Or that everyone?s Discover card is 6011?) That reduces the complexity by four orders of magnitude. Often the last four digits are show plain text to the customer. That leaves only 10^8 combinations to try. Additionally a clever hacker would do a quick mod-10 check before a more expensive encrypt-and-check call, so that's really not that long.

    So what to do?

    Using a one-way method isn't an option. We need to be able to get the original credit card number back. Not just because of the case cited above, but that's just a real-world need. You cannot legally charge the customer until an item has shipped. If you can't ship right away (i.e. Backorders), you're going to have to hang on to that number and use it to charge the card latter. If you have to break the order into multiple shipments, same thing.

    What we is an asymmetric encryption algorithm. One that will generate a different ciphertext each time the cleartext in encrypted. There are a lot of ways to do this, some encryption even provide for it. If not, simply append a delimiter and a random number to the cleartext and encrypt it. (E.g. instead of encrypting '4111-1111-1111-1111' encrypt '4111-1111-1111-1111*4873924839432432432'.) If you have the private key, it is easy to discard the random text. If you do not have the private key, this makes it difficult to brute force the number.

    6) Backup should be done separately, to separate tapes, on a separate drive connected directly to the machine. The tapes should be treated as access to the machine would be.

    7) Tripwire the private key. In case of a breach, you'll need to know if this file has been accessed.

    8) Use stored procedures to restrict access to the secure data. I love m(y)?sql, but this where Oracle and SQL Server's stored procedures are really nice. Basically the account through which data is being accessed by the applications should not be able to select, update, delete, or insert. Instead offer a stored procedure API to do what is MINIMALLY needed. Generally it's best to offer a minimal, but complete API. That's not the case here. Offer only what's need (e.g. do not provide an interface for updating a card number if that?s not needed, etc.)

    9) Chargebacks and coupon abuse are going to be a pain in the ass. The draw back of the above method is that you cannot easily find an account by credit card number. And, in the real world, sometimes you do have to do it. Often credit card numbers are used to enforce one-per-customer offers. And for good reason -- it's probably the most effective way to do it. However, the cost (insecure data) is too high for the overall business. Slashdot bashing of Marketing be what it may, but if you can explain this to one of the higher ups in the group in an understandable way, as well as work with them to come together with a different solution, they will usually be open to it. Nobody, especially in Marketing, wants to come in one morning, and read on my.yahoo.com that their company?s credit card numbers have been stolen.

    Chargebacks have one advantage over credit card abuse: they are not done one the customer?s dime (i.e. nobody is sitting there waiting for a page to load). Most likely it will be possible to queue them together, and use the first and last four digits to limit the sets of rows to be examined, and then simply start decrypting and comparing. None of the intermediate results, obviously, should be shown. This should ONLY allow to get the customer name, etc. from a valid credit card number. That normal caveats of web development apply here as well, despite it being an internal application.

    10) Work with your Operations team to test the system. If you breach the zone, are there traces? If you scp off the private key, was that correctly detected as well. Remember the old scare stories of people who never tested their backup system until they needed them, only to find out they didn?t work. Make sure everything here is working as expected.

    Anyway, that's all about I can bear to write for now. Hope that helps someone.

    -Bill
  • First you have to get OpenBSD, since Theo and Slashdot says it is the most secure.

    Then I store the private information in a text file that is linked from the front page of my website. I publish personal information under the GPL so that nobody can modify it.

    Information wants to be free. There is no reason to hide information!

Without life, Biology itself would be impossible.

Working...