- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Dear Community,
Good morning. I want to unhash these dummy SSNs data. Could you please give me suggestions? I have the following sample program. I want to know how I can unhash the HASH_SSN variable in data two?
Thanks in advance,
data one;
input ID :$ SSN $9. ;
CARDS;
SAM 567457869
SMITH 897845678
SONY 003457896
;
RUN;
DATA TWO;
SET ONE;
HASH_SSN=upcase(put(sha256(strip(SSN)||"e8pZqXwS0R"),$hex64.)) ;
RUN;
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
In a sense, hashing is some kind encryption. It's not meant to be reversed.
So before deciding to hashing values, you need to think of the consequences of doing so. Perhaps you need to store the original and hashed value pair somewhere (in a secure location if security is the reason to hash).
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
As @LinusH said, you can't reverse the hash code function. If there were such a thing, what would be the point of the hash function in the first place? It would no longer be providing any sort of privacy protection.
But if you have your population of ssn's somewhere, you could reapply the hash function to create a map between the encrypted and original values. Then you could use that as a reverse lookup table.
The hash OUTPUT method will overwrite a SAS data set, but not append. That can be costly. Consider voting for Add a HASH object method which would append a hash object to an existing SAS data set
Would enabling PROC SORT to simultaneously output multiple datasets be useful? Then vote for
Allow PROC SORT to output multiple datasets
--------------------------