To encrypt columns in a new table, using this column option on the create table statement:
[encrypt [with [database.[owner].]keyname]]
keyname – identifies a key created using create encryption key. The creator of the table must have select permission on keyname. If keyname is not supplied, Adaptive Server looks for a default key created using the as default clause on the create encryption key. See “create table” for the complete syntax for create table.
The following example creates two keys: a database default key, which uses default values for init_vector, pad and keylength, and a named key, cc_key, with non-default values. The ssn column in the employee table is encrypted using the default key, and the creditcard column in the customer table is encrypted with cc_key:
create encryption key new_key as default for AES create encryption key cc_key for AES with keylength 256 init_vector null pad random create table employee_table (ssn char(15) encrypt) create table customer (creditcard char(20) encrypt with cc_key)
Copyright © 2005. Sybase Inc. All rights reserved. |
![]() |