Click here to view and discuss this page in DocCommentXchange. In the future, you will be sent there automatically.

SAP Sybase SQL Anywhere 16.0 » SQL Anywhere Server - Database Administration » User and database security » Data security » Database encryption and decryption

 

Creating an encrypted database (SQL)

You can encrypt a database during creation by using the ENCRYPTED clause with the CREATE DATABASE statement.

Prerequisites

By default, you must have the SERVER OPERATOR system privilege. The required privileges can be changed by using the -gu database server option.

Context and remarks

This task is different from encrypting an existing database. To encrypt an existing database, use the CREATE ENCRYPTED DATABASE statement.

Caution

For strongly encrypted databases, store a copy of the key in a safe location. If you lose the encryption key, there is no way to access the data—even with the assistance of Technical Support. The database must be discarded and you must create a new database.

 Task
  1. In Interactive SQL, connect to an existing database.

  2. Execute a CREATE DATABASE statement that includes the ENCRYPTED clause and the KEY and ALGORITHM options.

Results

An encrypted database is created.

Example

For example, the following statement creates a database file named myencrypteddb.db in the c:\temp\ directory using FIPS-certified 128-bit AES encryption. It also creates a user ID DBA with password sql.

CREATE DATABASE 'c:\\temp\\myencrypteddb.db'
DBA USER 'DBA' DBA PASSWORD 'sql'
TRANSACTION LOG ON
ENCRYPTED ON
  KEY '0kZ2o52AK#'
  ALGORITHM 'AES_FIPS';

 See also