Database
Microsoft SQL Server Always En...

Configure Microsoft SQL Always Encrypted

4min

Perform the following tasks to configure this integration:

1 | Generate Column Master Key (CMK)

1

Open Microsoft SQL Server Management Studio.

2

Connect to the SQL Server.

3

Open your database, and go to Security > Always Encrypted Keys > Column Master Key. Right-click and select New Column Master Key.

4

In the New Column Master Key window, enter a name and select Key Storage Provider (CNG) in the Key Store drop-down list.

5

Select Futurex CNG in the Select a provider drop-down list.

6

Select [ Generate Key ].

Your key appears in the window after creation.

7

Select [ OK ] to save and close.

2 | Generate a Column Encryption Key (CEK)

1

Under the same database, go to Security > Always Encrypted Keys > Column Encryption Key. Right-click and select New Column Encryption Key.

2

Enter a name for the key. Then, select the CEK you generated in the previous section in the drop-down list.

3

Select [ OK ] to finish.

3 | Encrypt columns with FXCNG

1

Under the database, expand Tables. Right-click on the table you want to encrypt and select Encrypt Columns.

2

In the Always Encrypted wizard, on the Introduction page, select [ Next ].

3

In the Column Selection page, select the columns you want to encrypt, select the Encryption Type, and set the Encryption Key to the CEK you generated in the previous subsection. Then, select [ Next ].

4

In the Master Key Configuration page, select [ Next ].

5

In the In-Place Encryption Settings page, select [ Next ].

6

In the Run Settings page, select Proceed to finish now, and select [ Next ].

7

In the Summary page, select [ Finish ].

When the encryption is complete, a green checkmark displays next to Performing Encryption Operations. You can view additional information by selecting Always Encrypted Wizard Log Report.

8

Select [ Close ] to finish.

View the encrypted columns

To view the clear data for encrypted columns, perform the following steps to enable encryption in the Server Management Studio launcher.

1

Open Microsoft SQL Management Studio.

2

Go to the Always Encrypted tab.

3

Select the Enable Always Encrypted (column encryption) checkbox.

4

Connect to the server with the administrative user you used to configure Always Encrypted.

5

When you run your first query, a dialog box appears, prompting you to enable Parameterization. Select either [ Enable ] or [ Close ]. You can modify this setting later under Query > Query Options > Advanced.

6

Query your encrypted table.

The encrypted data displays in plain text.