I have two locations within the same firm that hold credit card numbers. I want to be able to "join" on credit card number to do business analytics after transmitting card number-linked data from one location to another.
The credit card number itself isn't actually needed to link the datasets. A token, with zero or very rare collisions, would be good enough.
The problem then becomes how to generate tokens in the two locations such that the same credit card maps to the same token, and do so securely.
Naively, one could just use a cryptographic hash, but since the space being mapped is so small (facially 10^16, but of course actually less than that), that's not a good solution, especially if the hashes aren't salted. (And it's not clear how salting would work and yet enable records to be linked anyway.)
One could also propose using strong symmetric encryption of the CCN's themselves, with very careful sharing of the secret key, but I'm not well enough versed in cryptography to know if the fact the set of plaintexts is so limited opens up the scheme to attack.
(NB: I know one shouldn't "roll your own crypto". I'm not directly on this project, but I'm curious about the solutions I hear being discussed.)