https://en.wikipedia.org/wiki/Homomorphic_encryption
Homomorphic encryption is a form of encryption that allows
computation on ciphertexts, generating an encrypted result
which, when decrypted, matches the result of the
operations as if they had been performed on the plaintext.
Homomorphic encryption can be used for secure outsourced
computation
...The decryption should happen on back-office payment processing server, with the keys held by a hardware security module.
Or better yet don't store the card details at all, but there are valid business reasons that is sometimes necessary.
TL;DR - PCI compliance was a joke in my experience.
The payment page didn't log requests (made figuring some things out hard), it submitted the encrypted card data (public key) to another server through the firewall with only a single non-standard port open, to the data store with write only access. There was then a trigger on insert that would launch a small console app that passed the decrypted (private key stored locally) card and charge information to Authorize.Net, if successful it would then write a success to the charges database, and send that charge identifier to the application's data store.
Only access to the payment server was from behind the firewall over RDP and MSSQL over non standard ports.
Just the description of this satisfied the PCI guy, and no physical inspection of the hardware was ever done. I'm not sure if what I did was best practice, and I was always so scared it would get hacked. Thankfully after so many fraud charges that my boss couldn't handle the $15 chargebacks we switched to paypal and I no longer had sleepless nights.
It’s still not perfect because an attacker can potentially send requests to the key management server, but they shouldn’t be able to walk away with they keys to perform decryption outside of the system.
You then set up monitoring to watch how many decryption operations are being performed per minute or hour and alert admins when it steps outside of normal useage patterns.
It’s not perfect but can help you to 1) catch an attacker early and 2) have some type of estimate of the size of the breach when discovered. A very patient attacker may not trigger an alarm of decryption operations but in that case he’s got to work much slower, which limits the scope of the attack while they hopefully trigger something else that exposes them.
The gist is you create an encryption key for your row, encrypt it using your encryption service, and store it next to your actual payload. To decrypt, ask the service to decrypt the key which you use to decrypt the payload. If your database gets popped, your decryption server hopefully didnt because you hardened it specifically.
Envelope encryption is a good scheme. Under envelope encryption you have a master key and per-row or per-unit keys. You store the per-unit keys encrypted with the master key, and the master key is stored offsite.
For example on an AWS environment, you would use AWS KMS with IAM authentication to handle the master key crypt for the individual keys, and the encrypted versions of the individual keys are stored in a database that you own.
You encrypt your data with the individual keys (eg, one key per user, or one key per DB row, or one key per namespace, whatever), but the individual keys are decryptable only by KMS.
Under this scheme an attacker must both be able to get ahold of the encrypted individual keys, and be able to decrypt them with the master key.
Of course this leaves you very vulnerable if the master key is acquired, but KMS does not allow you to read the master key at all, you have to use the AWS API to make encryption/decryption requests. So the vulnerability is less about how secure the key is and more about how secure your IAM setup and instances are.
Or are we assuming that the decryption service enforces some policy about what and how much to decrypt?
But you're also forgetting that most data breaches in real life involve database backups, staging servers, development environments, and people with access. So envelope encryption really helps prevent those. Even if someone gets a hand on your DB dump they're unable to use it without authorization to the KMS, which they won't have unless they can also get into your application server.
Don't forget that data is most often leaked by people. DB backups, dev environments, inappropriate transfers. We hear about the big targeted attacks, but probably 90% of actual breaches are due to human misuse.
If you don't need to decrypt the data on the same system, you could always use asymmetric encrpytion, so encrypt with the "public" key and then keep the private key elsewhere.
If you require to be able to decrypt on the system in question then you need a key somewhere, so secure storage of the key is very important.
One option, often deployed in banks, is to store the key in a hardware security module (HSM) and then ensure that it's not available outside of that.
There's a load of tradeoffs to using HSMs but they can be useful where symmetric encrpytion is needed.
Amazon and Azure offer these in the cloud.
An attacker that compromised the customer facing application only has access to tokens and would be forced to access sensitive data via the data bunker. That application is heavily monitored and would hopefully be quickly noticed.
The HSM adds an additional layer of protection against loss of sensitive data via backup tapes or some insider attacks.
Physically separate the key storage from the data storage. Different servers, different user auth mechanism. Make them compromise both systems.
Unique keys per client.
Use key-encrypting keys, periodically replace them.
PCI environment must be totally self contained and not mixed with standard working environment. If an employee is phished, their credentials for email/etc should not gain access to the env.
Don't allow developers to deploy or even read from prod db. Have a separate deployment team, all access to prod database audited via production tickets.
Assuming a layered system, something like Vault transit encryption (perhaps with the master key in an HSM) should keep decryption keys away from front-end machines, though as ever, once you have root and can access the memory of a machine where the encryption keys are stored, most bets are off.
The general idea is to insert some kind of bogus information into a system, with no links to other systems, and then trigger a notification if someone accesses it.
You are already fucked at this point. I would focus my attention on prevent hackers from 1) gaining any unauthorized access. 2) from doing any sort of privilege escalation from a restricted account/service.
That seems like the least interesting bit of information here for individuals.
It's really bizarre to me that people here seem to consider their credit card numbers more sensitive than their travel history or even contact information.
Generally people's level of care will correlate to what nefarious purposes the data can be used for. There aren't that many such purposes with the data exposed here until you consider the passport number (probably something more secure than a SSN for most Americans?), payment info, or login info. The purposes I can think of for the other data are reliant on the metadata that so-and-so was at that location at that time, when I might have believed something else.
I'd be far more concerned about my privacy than my banks money.
As to privacy, after the number of breaches of personal info. there have been, I'd be inclined to let the idea that this level of personal data is private :)
Don't you review your charges regularly? Even without fraud you're bound to be losing money to erroneous charges if you don't.
>b) dispute them
I've usually just had to submit a quick online form consisting almost entirely of checkboxes, while yeah that's some work it's still not going to take more than a minute of my time.
>c) go through the annoying process of having your card re-issued.
Seems like this is vastly more annoying with some card issuers than others.
Also not all of the cardholders will be online customers, so they'll have the delights of call center processes to go through.
Whilst it's obvious you don't regard loss of your credit card information as a serious inconvenience, I don't think that's necessarily a universal sentiment.
I work at a bank, and you would be surprised how many people don't know how much they have in the bank until they get the message saying there's no money.
so many people do this. As long as they don't get that message, they don't worry about how much is in there.
Edit: Ugh. Yes. My mind was apparently elsewhere. Keyspace would drive the time needed.
Though it is a relatively short list of known plaintext. especially if you focus on the bin ranges for say the three most popular banks in the US.
But, only interesting if Marriot was using some encryption with a small keyspace.
If yes, how much would you expect the bruteforcer to earn per successful attempt?
At the very least you'll need cardholder name and expiry to match up, and hopefully you'll need CVV/CVC as well.
Of course I really hope the Marriott weren't storing CVV in a reversibly encrypted format.
You're not allowed to store the CV2 in any form that could be recovered (i.e. plain text or reversibly encrypted) or brute forced (i.e. hashed/salted). PCI rules say you simply aren't allowed to store the CV2 after the call for an authorisation, as it's no longer required. If they were storing the CV2 then they're in trouble.
Credit card fraud is far more involved than just getting payment information, you won't succeed at ordering anything of value without understanding how anti-fraud systems work.
I'm guessing that higher end criminal spend quite a bit of time working out how to bypass anti-fraud systems, it's an ongoing battle.
After spending years hanging around in those circles I'm rather convinced that the only people making real money with credit card fraud are the shops, hackers stealing the cards and reshipping services.
The biggest buyers on the shops seemed to be criminal gangs engaging in relatively small-scale fraud maybe moving hundreds of thousands a month.
Password hashing is different because there is no key space.
Except that doesn't really make anything better, because now an attacker could simply use that salted and hashed credit card number elsewhere to make payments too!
The real solution is to use something like OAuth for payments. You authorize a merchant to take ongoing payments from you, and the card issuer gives the merchant a token which is only useful for making payments from you to them, and can't be used to make payments to anyone else.
It simply means if the card number is used for fraud, it'll be easier to track down who leaked the card numbers.
https://squareup.com/gb/townsquare/what-does-tokenization-ac...
Oh dear.