PWENCODE Procedure

Example 4: Specifying Method= SAS005 to Encode a Password

Features:

IN= argument

METHOD= argument

Details

This example shows a simple case of encoding a password using the sas005 encoding method and writing the encoded password to the SAS log. SAS005 uses a 256-bit fixed key that uses a 64-bit random salt to encode the password.

Program

Encode the password using SAS005.
proc pwencode in='mypassword' method=sas005;
run;

Log

Note that each character of the password is replaced by an X in the SAS log. SAS005 encoding uses AES encryption with a 256-bit fixed key and a 64-bit random salt value. SAS005 increases security for stored passwords by using the SHA-256 hashing algorithm and is hashed for additional iterations. Because SAS005 uses random salting, each time you run the following code, a different password is generated.

230  proc pwencode in=XXXXXXXXXXXX method=sas005;
231  run;


{SAS005}ADD8AB7108595A7D1A69190D78CDFE6145C1EB849CC7A43D

NOTE: PROCEDURE PWENCODE used (Total process time):
      real time           0.01 seconds
      cpu time            0.01 seconds
Last updated: September 15, 2026