Always Encrypted is a feature of Microsoft SQL Server 2016+ and Azure SQL Database, designed to protect sensitive data. It allows client applications to encrypt sensitive data without revealing the encryption keys to the database engine, so the data cannot be accessed either in flight on the wire or at rest on SQL Server.
Always Encrypted is a feature of Microsoft SQL Server 2016 and Azure SQL Database, designed to protect sensitive data. It allows client applications to encrypt sensitive data without revealing the encryption keys to the database engine, so the data cannot be accessed either in flight or at rest.
See MSDN for more details.
Encryption Keys
This is mainly focused on 2 Keys
- Column Master Key (CMK)
- Column Encryption Key (CEK)
CMK
Creates a column master key
metadata object in a database. A column master key metadata entry that represents a key, stored in an external key store, which is used to protect (encrypt) column encryption keys when using the Always Encrypted (Database Engine) feature. Multiple column master keys allow for key rotation; periodically changing the key to enhance security. You can create a column master key in a key store and its corresponding metadata object in the database by using the Object Explorer in SQL Server Management Studio or PowerShell.
CEK
Creates a column encryption key with the initial set of values, encrypted with the specified column master keys
. This is a metadata operation. A CEK can have up to two values which allows for a column master key rotation. Creating a CEK is required before any column in the database can be encrypted using the Always Encrypted (Database Engine) feature. CEK's can also be created by using SQL Server Management Studio
Before creating a CEK, you must define a CMK by using Management Studio or the CREATE COLUMN MASTER KEY statement
.
Types of Encryption
- Deterministic Encryption
- Randomized Encryption
Deterministic Encryption
Deterministic encryption always generates the same encrypted value for any given plaintext value. Using deterministic encryption allows point lookups, equality joins, grouping and indexing
on encrypted columns. However, but may also allow unauthorized users to guess information about encrypted values by examining patterns in the encrypted column, especially if there is a small set of possible encrypted values, such as True/False, or North/South/East/West region. Deterministic encryption must use a column collation with a binary2 sort order for character column
Randomized Encryption
Randomized encryption uses a method that encrypts data in a less predictable manner
. Randomized encryption is more secure, but prevents searching, grouping, indexing, and joining
on encrypted columns.