Skip to content

Commit c31fd95

Browse files
committed
always encrypted readme
1 parent 9ed969c commit c31fd95

File tree

3 files changed

+82
-9
lines changed

3 files changed

+82
-9
lines changed
Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
-- Always Encrypted Demo - Window 2
2+
-- This connection is used to simulate a client app
23

34
-- note this demo is continued from the first demo window
45

5-
-- 4b. Right-click in this window and choose Connection, then Change Connection.
6-
-- 4c. In the connection dialog, click Options.
7-
-- 4d. Type WideWorldImporters for the database name.
8-
-- 4e. Click on Additional Connection Parameters and enter: Column Encryption Setting=enabled
9-
-- 4f. Click Connect
6+
-- 5b. Right-click in this window and choose Connection, then Change Connection.
7+
-- 5c. In the connection dialog, click Options.
8+
-- 5d. Type WideWorldImporters for the database name.
9+
-- 5e. Click on Additional Connection Parameters and enter: Column Encryption Setting=enabled
10+
-- 5f. Click Connect
1011

1112
-- Note that when acting as a client with access to the certificate, we
1213
-- can see the data. Remember that this can only work because
@@ -16,4 +17,6 @@
1617
SELECT * FROM Purchasing.Supplier_PrivateDetails ORDER BY SupplierID;
1718
GO
1819

20+
21+
1922
-- Continue on the first window.

samples/databases/wide-world-importers/sample-scripts/always-encrypted/DemonstrateAlwaysEncrypted.sql

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -101,9 +101,9 @@ GO
101101
TRUNCATE TABLE Purchasing.Supplier_PrivateDetails;
102102
GO
103103

104-
-- 3a. Now execute the .NET app to populate the data
104+
-- 3. Run the client application PopulateAlwaysEncryptedData.exe to insert sample data
105105

106-
-- Note that it has been inserted but is not visible within the database
106+
-- 4. Verify that, on the server side (which does not have the keys), all the data is encrypted
107107

108108
SELECT * FROM Purchasing.Supplier_PrivateDetails ORDER BY SupplierID;
109109
GO
@@ -113,9 +113,11 @@ GO
113113
-- the client happens to be the same machine as the server in our
114114
-- case.
115115

116-
-- 4a. Open the second query window for this demonstration and follow the instructions there.
116+
-- 5a. Open the second query window for this demonstration and follow the instructions there.
117117

118-
-- 5a. Clean up afterwards.
118+
119+
120+
-- 6. (optional) Clean up afterwards.
119121

120122
-- Remove any existing column keys and/or table
121123
DROP TABLE IF EXISTS Purchasing.Supplier_PrivateDetails;
Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
# Sample for use of Always Encrypted in WideWorldImportersDW
2+
3+
This script demonstrates the use of Always Encrypted to encrypt sensitive data in the database.
4+
5+
6+
### Contents
7+
8+
[About this sample](#about-this-sample)<br/>
9+
[Before you begin](#before-you-begin)<br/>
10+
[Running the sample](#run-this-sample)<br/>
11+
[Sample details](#sample-details)<br/>
12+
[Disclaimers](#disclaimers)<br/>
13+
[Related links](#related-links)<br/>
14+
15+
16+
<a name=about-this-sample></a>
17+
18+
## About this sample
19+
20+
<!-- Delete the ones that don't apply -->
21+
1. **Applies to:** SQL Server 2016 (or higher), Azure SQL Database
22+
1. **Key features:** Always Encrypted
23+
1. **Workload:** OLTP
24+
1. **Programming Language:** T-SQL, C#
25+
1. **Authors:** Greg Low, Jos de Bruijn
26+
1. **Update history:** 26 May 2016 - initial revision
27+
28+
<a name=before-you-begin></a>
29+
30+
## Before you begin
31+
32+
To run this sample, you need the following prerequisites.
33+
34+
**Software prerequisites:**
35+
36+
<!-- Examples -->
37+
1. SQL Server 2016 (or higher) or Azure SQL Database.
38+
2. SQL Server Management Studio
39+
3. Visual Studio 2015
40+
4. The WideWorldImporters database.
41+
42+
<a name=run-this-sample></a>
43+
44+
## Running the sample
45+
46+
1. Build the solution to create the data population app.
47+
48+
2. Open both scripts in different windows or tabs in Management Studio.
49+
50+
3. Follow the instructions in the main script DemonstrateAlwaysEncrypted.sql.
51+
52+
## Sample details
53+
54+
The sample adds a new table with sensitive data about suppliers. This sensitive data is always encrypted.
55+
56+
As part of the sample you create an encryption key that is saved locally (where you run SSMS). The client application inserts data into the table. With the sample scripts you will see how the data is encrypted in the table and cannot be viewed, even by a sysadmin, unless you have the encryption key.
57+
58+
<a name=disclaimers></a>
59+
60+
## Disclaimers
61+
The code included in this sample is not intended to be used for production purposes.
62+
63+
<a name=related-links></a>
64+
65+
## Related Links
66+
<!-- Links to more articles. Remember to delete "en-us" from the link path. -->
67+
TBD
68+

0 commit comments

Comments
 (0)