DATA Step, Macro, Functions and more

Decryption of csv file after importing in sas

Reply
Contributor
Posts: 25

Decryption of csv file after importing in sas

Hello,

 Is it possible to import CSV and decrypt data column which is AES encrypted via key?

Regards,

GP

Valued Guide
Posts: 519

Re: Decryption of csv file after importing in sas

Posted in reply to gauravp1993

No, I don't think this is possible. An encrypted file is binary, not text.

Contributor
Posts: 25

Re: Decryption of csv file after importing in sas

Posted in reply to andreas_lds

Hi Andreas,

 

Only two column out of 8 has been encrypted using AES and being collectively sent as csv file. Is it still not possible to decrypt?

 

Thank you.

Super User
Super User
Posts: 9,416

Re: Decryption of csv file after importing in sas

Posted in reply to gauravp1993

So you are saying you have a text file, which has several data columns divided by commas, and some of those data columns have had some algorithm applied to them.  If so then you need access to that algorithm and the solving code, and then you would apply it to the data once you have read the data into SAS.  There is no un-encode coded data function as far as I am aware.  I would ask why you have chosen to go this route in the first place of encoding some data.  It would be far simpler, and more secure, to protect the whole file - most apps can do it, e.g. zip - and send the whole file like that via secure FTP or Web Portal.

Super User
Posts: 9,890

Re: Decryption of csv file after importing in sas

[ Edited ]
Posted in reply to gauravp1993

Only if the encrypted value was converted to readable code, eg with base64 encoding.

 

Because encryption would get you values that sooner or later will contain delimiters and therefore break your file structure. Raw encrypted values and separators don't work together.

 

And from the documentation I get it that only complete files, not separate columns, can be encrypted.

---------------------------------------------------------------------------------------------
Maxims of Maximally Efficient SAS Programmers
How to convert datasets to data steps
How to post code
Super User
Posts: 5,851

Re: Decryption of csv file after importing in sas

Posted in reply to gauravp1993
You can encrypt/encode specific fields and store the result. Like if you create a hash in SAS with md5 and then create file using the hex. format as an example.
But like mentioned above there is no decrypt function in SAS. But if you have access to a third party binary you can call it from SAS using CALL MODULE.
Data never sleeps
Ask a Question
Discussion stats
  • 5 replies
  • 132 views
  • 0 likes
  • 5 in conversation