Chapter 1: Overview of Encryption

This guide describes the Adaptive Server® Enterprise encrypted columns feature, encryption of external passwords and the SQL text of stored procedures, views, and triggers.

Adaptive Server authentication and access control mechanisms ensure that only properly identified and authorized users can access data. Data encryption further protects sensitive data against theft and security breaches.

The Adaptive Server encrypted columns feature enables you to encrypt column-level data that is at rest, without changing your applications. This native support provides the following capabilities:

Data encryption and decryption is automatic and transparent. If you have insert or update permission on a table, any data you insert or modify is automatically encrypted prior to storage. Daily tasks are not interrupted.

Selecting decrypted data from an encrypted column requires decrypt permission in addition to select permission. Decrypt permission can be granted to specific database users, groups, or roles. Sybase® gives you more control by providing you with granular access capability to sensitive data. Sybase also automatically decrypts selected data for users with decrypt permission.

Encrypting columns in Adaptive Server is more straightforward than using encryption in the middle tier, or in the client application. You use SQL statements to create encryption keys and to specify columns for encryption, and existing applications continue to run without change.

Column encryption keys are stored in the database in encrypted form. You can encrypt a column encryption key using a key encryption key (KEK) derived from a

The password you select reflects your ability to preserve data privacy, even from system administrators. You may choose to protect your column encryption key using dual-control mode to increase the security. See Chapter 2, “Creating and Managing Column Encryption Keys.”

When data is encrypted, it is stored in an encoded form called “cipher text.” Cipher text increases the length of the encrypted column from a few bytes to 32 extra bytes. See “Length of encrypted columns”. Unencrypted data is stored as plain text.

Figure 1-1 describes encryption and decryption processing in Adaptive Server. In this example, a client is updating and encrypting a Social Security Number (SSN).

Figure 1-1: Encryption and decryption in Adaptive Server

Image shows two clients connecting to Adaptive Server and accessing encrypted data with the encryption key.

Column encryption uses a symmetric encryption algorithm, which means that the same key is used for encryption and decryption. Adaptive Server tracks the key that encrypts a given column.

When you insert or update data in an encrypted column, Adaptive Server transparently encrypts the data immediately before writing the row. When you select from an encrypted column, Adaptive Server decrypts the data after reading it from the row. Integer and floating point data are encrypted in the following form for all platforms:

You can encrypt data on one platform and decrypt it on a different platform, provided that both platforms use the same character set.

Generally, using encrypted columns requires these steps:

  1. Install the license option ASE_ENCRYPTION. See the Adaptive Server Enterprise Installation Guide.

  2. The system security officer (SSO) enables encryption in Adaptive Server:

    sp_configure 'enable encrypted columns', 1
    
  3. Depending on the method you chose to protect column encryption keys, create a database-level master key or set the system encryption password. See “Creating the master and dual master keys” for information about creating a master key.

    “Protecting column encryption keys with the system-encryption password” describes how to set the system encryption password.

  4. Create one or more named encryption keys. See Chapter 2, “Creating and Managing Column Encryption Keys.” Consider using passwords to protect data even from the database administrator. See Chapter 7, “Protecting Data Privacy from the Administrator.”.

  5. Specify the columns for encryption. See “Specifying encryption on new tables” and “Encrypting data in existing tables”.

  6. Grant decrypt permission to users who must see the data. You may choose to specify a default plain text value known as a “decrypt default.” The Adaptive Server returns this default, instead of the protected data, to users who do not have decrypt permission. See “Permissions for decryption”.

Once you perform these steps, you can run your existing applications against your existing tables and columns, but now the data in your database is securely protected against theft and misuse. Adaptive Server utilities and other Sybase products can process data in encrypted form, protecting your data throughout the enterprise. For example, you can:

See Chapter 4, “Securing External Passwords and Hidden Text,” for information about strong encryption of external passwords and hidden SQL text.