Most small online businesses do not store credit card data locally, but that doesn't stop you from using salted hashes of credit card numbers to compare.
Storing a "salted hash" of a credit card number in the manner you describe is only fractionally better than storing the credit card number itself. This is because credit card numbers have very little entropy - less than 36 bits per issuer code, so bruteforcing these hashes can be done very quickly.
https://github.com/whit537/www.gittip.com/issues/345
Even then, I'm not sure I would trust this approach. I feel much more comfortable white-listing accounts, and for the time being that's not too onerous.
You could hash the IP address, with some suitable salt. Then compare against that.
The purpose of storing IP addresses isn't to find out "the IP address of the user submitting the form", but instead to answer "How many other credit card numbers have come from this address?", something that can be done with sha512("salt_mc_salty_$IP")
No, with IP logging it's all-or-nothing. You might as well store them as uint32/uint128.
From a security / data privacy angle, things are rarely 100% perfect or 100% broken. Just because an approach is not 100% perfect, doesn't mean that it is worthless. It can still offer protection of sensitive data.
Storing IPs in the clear in a DB means that if anyone gets any access to it (e.g. SQL injection type attack), they can have the whole lot. With salted IPs it's harder and much longer before they have any decent data.
If you tweaked a hashing algorithm to take circa 100 milliseconds to hash an IP, then "brute forcing" would be much less of a problem because it would take about 13 years to hash the whole lot.
Or $31,000 on EC2. Are these logs per-request or per-transaction? The former could get awfully expensive.
Of course, checking a single target IP address would be trivial. Whether that matters depends on their threat model.
I would also, advise against your plan to just white list givers. There are already too many barriers to contributing. I would suggest just charging and holding onto money when the transactions seem dubious. Do you also get charged the cost of fraud? because if you don't I would just charge the credit cards and forget about it and let your provider do their job.
Could you run them off by just always displaying success for any sane-looking small value donation, without leaking the result from your payment processor?
Alternately (or in addition to this), you could rate-limit form submissions from the same address.
I've supported a number of different online credit card donation forms for various charitable and other causes, and you see this behavior of card testing whenever you set the minimum allowed donation too low, and adopt too few of the necessary precautions.
I wrote a post on the approach to raising the bar I took - it really doesn't require much to get the credit card testers to go away, and if you don't get rid of them rapidly, you'll be dealing with chargebacks from here until eternity:
http://www.exratione.com/2010/10/three-necessary-defenses-fo...