first off, I am not trying to hack paypal. What I'm trying to do is to create a similarly safe database.
OK, so if i sign up with paypal, i can 'deposit' money into my paypal account from my credit card or from my bank account if i have that set up. When this happens money is transfered from myself to paypal. But not really into my paypal account. That is my pay pal account is not an actual physical space with gold sitting in it. Unless I am wrong, what happens here is my account is in a databse table on paypal's servers, and when I make a deposit, they simply change the 'balance field' from whatever to += my deposit. So, if anyone were to be able to hack into this db, they could increase their balance by anything they wanted simply by changing the value in the 'balance field.'
How does paypal go about making sure this cant happen, and what kind of db system do you tink they use. I would guess NOT MySQL, correct?
Thanks all.
If you're going to be handling any customer financial data (i.e., processing credit and/or debit card transactions), you are required to be PCI compliant. This is a set of security standards setup by American Express, Discover, JCB, MasterCard, and Visa International that imposes heavy fines ($5,000 to $100,000 per month) if you are either audited or have a security breach and are found to not meet the standards. For PCI compliance, you are also required to have a network security scan performed every 90 days which "must be conducted by a PCI SSC Approved Scanning Vendor."
Although PCI compliance isn't a guarantee that you're safe (it does more to verify security at the network level, not the application level), it's at least the very least the minimum starting point. In addition, your application should be designed with security in mind to protect from SQL injection, session hi-jacking, and other common security issues.
I doubt it's MySQL -- not because of any security reasons, it's just unusual for something like MySQL to be used in a large-scale multi-national financial system.
I don't know PayPal specifically, but if I were making such a system, there would have to be an audit trail. Meaning you don't just have
"myAccount.balance = 100000000"
somewhere; you have a table of transactions, that say on date X you got a (deposit || debit) from/to (account) in the amount of Y. It adds them up and that's your balance. If there's ever a discrepency, they have that audit trail to look at and find any fraudulent or invalid transfers and correct it quickly. If there is a database field with your balance in it, it's only cached their for speed; the "real" balance comes from that audit trail.It's the same way you balance your checkbook: you keep track of the incoming and outgoing funds, and total it up to see how much you have; if the total is wrong, you go back and look at your log of incoming and outgoing funds to find the error.
They write extremely safe code, don't ever open themselves up to SQL injection attacks, and don't have their database server sitting on the internet. They have a dedicated QA team that tests the heck out of anything new and perform umpteen regression tests and general test scripts.
They probably hire a hacker or two to try to break the system - but only need to pay them if they fail. :-)
Either that, or they get hacked, then sued, then go bankrupt.