<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: How to encrypt password on log? in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/How-to-encrypt-password-on-log/m-p/467524#M70698</link>
    <description>&lt;P&gt;PWENCODE will write the encoded password to the SAS log. You then copy the password string, including the sas005 on the front into your CONNECT statement:&amp;nbsp;&lt;SPAN&gt;Connect to Oracle (user=&amp;amp;user password='sas005MyEncodedPassword'&amp;nbsp;path=&amp;amp;db).&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Mon, 04 Jun 2018 21:18:03 GMT</pubDate>
    <dc:creator>SASKiwi</dc:creator>
    <dc:date>2018-06-04T21:18:03Z</dc:date>
    <item>
      <title>How to encrypt password on log?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-encrypt-password-on-log/m-p/467401#M70691</link>
      <description>I need to encrypt the pw ln my log&lt;BR /&gt;I have this now&lt;BR /&gt;&lt;BR /&gt;Options symbolgen;&lt;BR /&gt;%include "h:\passwords.sas";&lt;BR /&gt;Proc sql;&lt;BR /&gt;Connect to Oracle (user=&amp;amp;user password=&amp;amp;ps path=&amp;amp;db);&lt;BR /&gt;Create table table as select * from connection to Oracle&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;I need the log to show xxxxx for passwords</description>
      <pubDate>Mon, 04 Jun 2018 13:50:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-encrypt-password-on-log/m-p/467401#M70691</guid>
      <dc:creator>Gil_</dc:creator>
      <dc:date>2018-06-04T13:50:36Z</dc:date>
    </item>
    <item>
      <title>Re: How to encrypt password on log?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-encrypt-password-on-log/m-p/467404#M70692</link>
      <description>&lt;P&gt;Have you seen this:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://blogs.sas.com/content/sasdummy/2010/11/23/five-strategies-to-eliminate-passwords-from-your-sas-programs/" target="_blank"&gt;https://blogs.sas.com/content/sasdummy/2010/11/23/five-strategies-to-eliminate-passwords-from-your-sas-programs/&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;?&lt;/P&gt;</description>
      <pubDate>Mon, 04 Jun 2018 13:55:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-encrypt-password-on-log/m-p/467404#M70692</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2018-06-04T13:55:49Z</dc:date>
    </item>
    <item>
      <title>Re: How to encrypt password on log?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-encrypt-password-on-log/m-p/467411#M70693</link>
      <description>&lt;P&gt;Turn OFF symbolgen for one thing.&lt;/P&gt;
&lt;P&gt;It you are running the CONNECT statement inside a macro then also turn off MPRINT (and probably also the older obscure MACROGEN option).&lt;/P&gt;</description>
      <pubDate>Mon, 04 Jun 2018 14:14:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-encrypt-password-on-log/m-p/467411#M70693</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2018-06-04T14:14:51Z</dc:date>
    </item>
    <item>
      <title>Re: How to encrypt password on log?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-encrypt-password-on-log/m-p/467466#M70696</link>
      <description>&lt;P&gt;I've found &lt;A href="http://documentation.sas.com/?cdcId=pgmsascdc&amp;amp;cdcVersion=9.4_3.2&amp;amp;docsetId=secref&amp;amp;docsetTarget=n02vim6c66rvv4n1c96jk547a9mg.htm&amp;amp;locale=en" target="_self"&gt;PROC PWENCODE&lt;/A&gt; is the most bullet-proof method, although it's largely security by obscurity.&amp;nbsp; If all you need is to prevent the plain-text password from being available to people snooping around your files it works well enough though. Especially if you use that password for other stuff (which is also far from ideal, but a different conversation).&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Definitely use method sas004 or sas005 if available on your SAS version though.&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc pwencode 
    in='mypassword' 
    method=sas005;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 04 Jun 2018 16:34:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-encrypt-password-on-log/m-p/467466#M70696</guid>
      <dc:creator>Sven111</dc:creator>
      <dc:date>2018-06-04T16:34:29Z</dc:date>
    </item>
    <item>
      <title>Re: How to encrypt password on log?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-encrypt-password-on-log/m-p/467514#M70697</link>
      <description>Hi Sven&lt;BR /&gt;I want to use your example this to connect Proc sql;&lt;BR /&gt;Connect to Oracle (user=&amp;amp;user password=&amp;amp;ps path=&amp;amp;db);&lt;BR /&gt;Create table table as select * from connection to Oracl&lt;BR /&gt;How do I refer&lt;BR /&gt;proc pwencode in='mypassword' method=sas005; run&lt;BR /&gt;; to connect?</description>
      <pubDate>Mon, 04 Jun 2018 20:42:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-encrypt-password-on-log/m-p/467514#M70697</guid>
      <dc:creator>Gil_</dc:creator>
      <dc:date>2018-06-04T20:42:34Z</dc:date>
    </item>
    <item>
      <title>Re: How to encrypt password on log?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-encrypt-password-on-log/m-p/467524#M70698</link>
      <description>&lt;P&gt;PWENCODE will write the encoded password to the SAS log. You then copy the password string, including the sas005 on the front into your CONNECT statement:&amp;nbsp;&lt;SPAN&gt;Connect to Oracle (user=&amp;amp;user password='sas005MyEncodedPassword'&amp;nbsp;path=&amp;amp;db).&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 04 Jun 2018 21:18:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-encrypt-password-on-log/m-p/467524#M70698</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2018-06-04T21:18:03Z</dc:date>
    </item>
    <item>
      <title>Re: How to encrypt password on log?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-encrypt-password-on-log/m-p/467546#M70701</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13976"&gt;@SASKiwi&lt;/a&gt;&amp;nbsp;is correct, you basically just run this code:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc pwencode 
    in='mypassword' 
    method=sas005;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Look in the log file for the results, which when I ran it resulted in (let's say)&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;'{SAS005}D03BE345341DB5A0A850BD0ABBD3BB49E8711BFF91749877FE1'&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Then you'd copy that full text above into your connect string as &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13976"&gt;@SASKiwi&lt;/a&gt;&amp;nbsp;showed:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;Connect to Oracle (user=MyUserName&lt;BR /&gt;
PASS='{SAS005}D03BE345341DB5A0A850BD0ABBD3BB49E8711BFF91749877FE1' 
&lt;BR /&gt;PATH=MY_ORACLE_DB_NAME
&lt;BR /&gt;SCHEMA=MySchema)&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;You can also use that password in a LIBNAME connection to Oracle, which I find much more convenient since you can then use it for both implicit and explicit SQL passthrough statements.&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;LIBNAME OracSAS ORACLE &lt;BR /&gt;USER=MyUserName  
&lt;BR /&gt;PASS='{SAS005}D03BE345341DB5A0A850BD0ABBD3BB49E8711BFF91749877FE1'
&lt;BR /&gt;PATH= My_Oracle_DB_Name
&lt;BR /&gt;SCHEMA=MySchema;
&lt;BR /&gt;
&lt;BR /&gt;PROC SQL;
&lt;BR /&gt;    /* Implicit SQL-Passthrough */
&lt;BR /&gt;    SELECT *
&lt;BR /&gt;    FROM   OracSAS.TableName;
&lt;BR /&gt;
&lt;BR /&gt;    /* Explicit SQL-Passthrough */
&lt;BR /&gt;    CONNECT USING OracSAS AS OracDB;
&lt;BR /&gt;    SELECT *
&lt;BR /&gt;    FROM CONNECTION TO OracDB (SELECT * FROM TableName);
&lt;BR /&gt;    DISCONNECT FROM OracDB;
&lt;BR /&gt;;QUIT;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 05 Jun 2018 00:08:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-encrypt-password-on-log/m-p/467546#M70701</guid>
      <dc:creator>Sven111</dc:creator>
      <dc:date>2018-06-05T00:08:25Z</dc:date>
    </item>
  </channel>
</rss>

