Specifies a key value for AES encryption.
Valid in: | SPD Server |
Requirement: | ENCRYPTKEY= must be specified when ENCRYPT=AES. |
assigns an encrypt key value. To create an ENCRYPTKEY= key value with or without quotation marks, follow these rules:
Examples:
%let mykey=abcdefghi12; encryptkey=&mykey encryptkey=key_value encryptkey=key_value1
Examples:
encryptkey='key_value' encryptkey='1234*#mykey'
Examples:
encryptkey="key_value" encryptkey="1234*#mykey" %let mykey=Abcdefghi12; encryptkey="&mykey"
Interaction | You cannot change the key value on an AES-encrypted table without re-creating the table. |
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; |
%let secret=Abcdefghi12;
data tempdata.aestable(encrypt=aes encryptkey="&secret");
libname tempdata sasspds "test" host="host.company.com" service="8561" user="siteusr1" prompt=yes; data tempdata.regtable;x=1;run; option dbidirectexec=yes; proc sql; create table tempdata.aestable(encrypt=aes encryptkey="1234*#mykey") as select * from tempdata.regtable; quit;
proc contents data=tempdata.aestable(encryptkey="1234*#mykey"); run;