How to decrypt information with shell script in SAS?

Reply
Contributor
Posts: 34

How to decrypt information with shell script in SAS?

Hello ,

Thank you for the the previous reply for my question on How to Run Shell Script inside SAS?

I tried using the following piece of code but would like to describe my issue in detail

 

filename oscmd pipe "/users/smith/report.sh 2>&1";

data _null_;
infile oscmd;
input;
put _infile_;
run;

filename oscmd clear;

The main purpose of running the shell script is to decrypt a particular variable within SAS.

 Let me be clear.

I have a database_test in which I have a particular table Table_ABC which contains the var1 that has the encrypted value.

I need to read this encrypted_value using SAS and then put it into the shell script inside SAS to get the decrypted_value and store it in another variable var2 in the same database_test .

In short I need to do all this decryption process from within the SAS.

 

As I am a beginner to SAS I dont know how to approach this situation .

 

Please help

 

Thanks in advance

PROC Star
Posts: 1,760

Re: How to decrypt information with shell script in SAS?

You are talking about 2 different, independent problems:

- seeing the result of a system command in SAS

- decrypting an encrypted variable

What do these 2 questions have to do with each other? What is the actual problem you want solved?

Contributor
Posts: 34

Re: How to decrypt information with shell script in SAS?

Hello,

Thank you for your reply.

- I asked  if it is possible to run shell script is because the library used for the encryption of the variable is a simple wrapper for the standard ruby OpenSSL library. Since I do not want to use ruby inside my SAS I converted them into a shell script without any ruby libraries and want to run it on  SAS. 

-Now for decryption-- I need to pass the encrypted value into my shell script and get the decrypted output from inside SAS itself.

 

This is the actual problem that I need to get solved

Frequent Contributor
Posts: 83

Re: How to decrypt information with shell script in SAS?

Can you just decrypt everything ahead of running the SAS program?  That would simplify things a lot and would likely be substantially faster than an entry by entry decryption as well.

Super Contributor
Posts: 439

Re: How to decrypt information with shell script in SAS?

I think you're going to have to extract the encrypted value from your SAS data set and pass that as a parameter to your shell script, have the output written to a file then read that back into SAS.

 

I must say if the variable has to be encrypted it must be confidential and none of this process seems terribly secure to me. 

PROC Star
Posts: 1,760

Re: How to decrypt information with shell script in SAS?

So you need something like this?

data WANT;
  set TABLEABC;
  FILEVAR='/users/smith/decrypt.sh '||VAR1;
  infile DUMMY pipe filevar=FILEVAR;
  input; 
  put _infile_;
run;

where your script reads an ecrypted value and writes back a decrypted value.

 

 

Ask a Question
Discussion stats
  • 5 replies
  • 170 views
  • 0 likes
  • 4 in conversation