BookmarkSubscribeRSS Feed
nickspencer
Obsidian | Level 7
Hello,
I have a SAS data with character column ID that is 20 character in length. But the values are all numbers. I want to encrypt the column ID with symbols, alphabets and numbers. What will be the best way to encrypt the column and be able to decrypt later?
Any suggestion or sample code is appreciated.
1 REPLY 1
SASKiwi
PROC Star

Why do you need to decrypt later when you have the original unencrypted version? One method I use hashes the field using the SAS MD5 function:

Account_Key = put(md5(cats('ID',Account_Number)),$hex10.);

This type of encryption is one-way though - there is no easy way to decrypt it. By maintaining a list of both the original and encrypted versions there is no need for decryption. 

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 1 reply
  • 1034 views
  • 0 likes
  • 2 in conversation