I'd like to send data to a SaaS tool, where the data is stored in the cloud. I'll use Google Analytics as an example, but it applies to any similar service.
Google Analytics does not allow you to store personally identifiable information (PII), and there are many examples of online services where you might want to send user data but don't want the service to be able to view that data.
The best solution I have to this problem is encrypting the data before it's sent to the third party, appending a special token that distinguishes the data from other hashes, and then storing both the original value and hashed value in a database. For example, a username like
johndoe could be hashed into
s8d7f89sd7f, then appended with
hashed- to get
hashed-s8d7f89sd7f. You would then store both
hashed-s8d7f89sd7f in your database.
When you visit the third party's website (say, a Google Analytics report with all the hashed values), you could crawl the DOM looking for values that match your special pattern (e.g. words that begin with
hashed-). Then, using a Chrome extension, bookmarklet, or some other local program, you could replace that hashed value to the original value and display it on the page in human-readable form. Unless the website was monitoring the page for changes and phoning them home, they would never have access to the translated values.
The closest solution I've seen to this problem is this Chrome extension, but it stores data in a CSV (not as robust as a database, but that's fixable) and is specific to Google Analytics.
Is there an existing solution to this problem? If not, why? And would the solution proposed above work?