Specifies a key value for AES encryption.
Category: | Table Control |
Restriction: | ENCRYPT=AES must be set. |
Requirement: | This option is required when ENCRYPT=AES is set. |
Interaction: | You cannot change the key value on an AES encrypted data set without re-creating the data set. |
Data source: | SAS data set, SPD Engine data set |
Note: | Check your log after this operation to ensure that the encrypt key values are not visible. For more information, see “Blotting Passwords and Encryption Key Values” in SAS Language Reference: Concepts. |
assigns an encrypt key value. The key value can be up to 64 bytes long. You are able to create an ENCRYPTKEY= key value with or without quotation marks using the following rules:
Note | When the ENCRYPTKEY= key value uses DBCS characters,
the 64-byte limit applies to the character string after it has been
transcoded to UTF-8 encoding. You can use the following DATA step
to calculate the length in bytes of a key value in DBCS: data _null_;
key=length(unicodec("key-value","UTF8"));
put "key length=" key;
run; |
Note: If you lose or forget the ENCRYPTKEY= value, there will be no way to open the file or recover the data.
append base=name data=name(encryptkey=key-value); run;The option can be specified either in parentheses after the name of the SAS data file or after a forward slash.
%let secret=myvalue;
create table myschema.dsname {options encrypt=aes encryptkey="&secret"};
create table myfiles.salary {options encrypt=aes encryptkey="1234*#mykey"} (name char(15), yrsal double, bonuspct double); insert into myfiles.salary {option encryptkey="1234*#mykey"} values ('Muriel', 34567, 3.2); insert into myfiles.salary {option encryptkey="1234*#mykey"} values ('Bjorn', 74644, 2.5); insert into myfiles.salary {option encryptkey="1234*#mykey"} values ('Freda', 38755, 4.1); insert into myfiles.salary {option encryptkey="1234*#mykey"} values ('Benny', 29855, 3.5); insert into myfiles.salary {option encryptkey="1234*#mykey"} values ('Agnetha', 70998, 4.1);