SlideShare a Scribd company logo
UNDERSTANDING
SQL SERVER 2016 ALWAYS ENCRYPTED
Ed Leighton-Dick
ABOUT ME
Email: ed@leightondick.com
Blog: edleightondick.com
Twitter: @eleightondick
AGENDA
• A bit of background
• Always Encrypted
• Best Practices
THE CURRENT STATE OF
SQL SERVER ENCRYPTION
SECURITY HAS BECOME CRUCIAL
• More risk to companies’ systems than ever before
• Security is all about mitigating risk
• Encryption is an important fail-safe in a security strategy
• Variety of existing methods
ENCRYPTION IN THE APPLICATION
• Extremely flexible
• Extremely customizable
• Wide variety of algorithms
• Data may be encrypted from application to storage
COLUMN-LEVEL ENCRYPTION
• Introduced in SQL Server 2005
• Highly configurable
• Major types of encryption provided
• Simple to use
• Developer has to know little about encryption to use
• Can be made secure using SQL Server permissions
TRANSPARENT DATA ENCRYPTION
• Introduced in SQL Server 2008
• All data in database protected while on disk
• Can be used with any application
ALL OF THESE HAVE
SERIOUS SHORTCOMINGS…
The bottom line: None of these are sufficient anymore!
BY APPLICATION
• Developers control
the keys
• No separation of
duties
• Not consistently
implemented
• Time-consuming
IN-COLUMN
• DBAs control the keys
• Not consistently
implemented
• Time-consuming
TDE
• DBAs control the keys
• All data viewable
• Data decrypted in
memory
WE NEED TO DO BETTER
• Hackers are becoming more sophisticated
• Data breaches are becoming more frequent and more
expensive
• Regulations (legal and contractual) are becoming more strict
• Public tolerance is declining
AND YET…
• Many companies have not implemented a comprehensive
security strategy!
• “Too expensive”
• “Too difficult”
• “Too time-consuming”
• “It won’t/can’t happen to us”
• “No one wants what we have”
• “That’s someone else’s job”
• “I don’t get it”
ALWAYS ENCRYPTED
The New Black?
ALWAYS ENCRYPTED:
A STEP IN THE RIGHT DIRECTION
• Encryption occurs in the data driver
• ADO.NET, ODBC, JDBC drivers currently available
• Data is only unencrypted between application and driver
• SQL Server cannot decrypt data on its own
• Transparent to applications
• Searchable while encrypted
• Works on both on-premises and cloud databases
• Available in SQL 2016, Azure SQL DB v12
ALWAYS ENCRYPTED
ARCHITECTURE
Image credit: MSDN (http://bit.ly/1Se0sm0)
ALWAYS ENCRYPTED SOLVES SOME
BIG PROBLEMS
• Strong encryption
• Separation of duties
• Consistent, simple implementation
• Encryption methods are not visible in code or database
DEMO
TYPES OF ENCRYPTION
• Algorithm: AEAD_AES_256_CBC_HMAC_SHA_256
• Deterministic
• Searchable
• Allows grouping, indexing, joining
• Requires *_BIN2 collation
• Randomized
• No searches, grouping, indexing, joining
DATATYPE CONVERSIONS
• Conversions happen behind the scenes
• Ciphertext stored as VARBINARY
• Length
• Most data types: 65 bytes
• Decimal/Numeric/UID: 81 bytes
• Variable length: Variable (formula)
• Reference: bit.ly/1S9ieNu
TYPES OF KEYS
• Column master key (CMK)
• Encrypts CEK
• Stored externally in key stores
• Column encryption key (CEK)
• Encrypted by up to 2 CMKs to allow rotation
• Stored internally
KEY STORES
• Local certificate store
• Hardware Security Modules (HSM)
• aka Extensible Key Management (EKM)
• Azure Key Vault
• Custom
METADATA
• Column Master Keys
• sys.column_master_keys
• Column Encryption Keys
• sys.column_encryption_keys
• sys.column_encryption_key_values
• Column encryption
• sys.columns
• Parameters
• sys.sp_describe_parameter_encryption
DEPLOYMENT
• Can be scripted using T-SQL or PowerShell
• CMK via PowerShell
AND NOW, THE BAD NEWS…
• Always Encrypted is not a silver bullet
• V1 product = Significant limitations
LIMITATIONS
• Comparisons on AE columns
• Deterministic – Equality
• Randomized – None
• Other operations disallowed
• LIKE, range lookups
• Functions, etc.
• Data must be passed as typed parameters
• ADO.NET: SqlParameter
• ODBC: SQLBindParam
LIMITATIONS: DATATYPES/FEATURES
xml
timestamp/rowversion
image
ntext/text
sql_variant
hierarchyid
geography
geometry
alias/sysname
UDTs
FILESTREAM
ROWGUIDCOL
String w/o BIN2
Full-text search
Computed
Ref by computed
Sparse column set
Ref by statistics
Partitioning column
DEFAULT, CHECK
IDENTITY
CDC
Temporal table
Masked
PolyBase
Hekaton
Table variables
FOR XML
FOR JSON PATH
Replication
Linked servers
SSDT
*Key/index
*Stretch
*Triggers
… and more
LIMITATIONS: PERFORMANCE (CTP)
• Significant impact on both speed and space...?
Image credit: Aaron Bertrand, SQLPerformance.com (http://bit.ly/1quelGS)
LIMITATIONS: PERFORMANCE (RTM)
©2016 Kingfisher Technologies
33
38
87
44
-
10
20
30
40
50
60
70
80
90
100
Insert 100K Rows Read Random Rows
Impact of Always Encrypted - 1-Core Client, 1-Core Server
Unencrypted Always Encrypted
LIMITATIONS: PERFORMANCE (RTM)
©2016 Kingfisher Technologies
33 38
87
44
400
191
-
50
100
150
200
250
300
350
400
450
Insert 100K Rows Read Random Rows
Impact of Always Encrypted – 1-Core Client, 1-Core Server
Unencrypted Always Encrypted Legacy Encryption
LIMITATIONS: PERFORMANCE (RTM)
©2016 Kingfisher Technologies
92 106109 118
594
520
-
100
200
300
400
500
600
700
Insert 100K Rows Read Random Rows
Impact of Always Encrypted - 4-Core Client, 16-Core Server
Unencrypted Always Encrypted Legacy Encryption
LIMITATIONS: PERFORMANCE (RTM)
5.164
17.031
15.282
0
2
4
6
8
10
12
14
16
18
Total Space
Space Used (MB)
Unencrypted Always Encrypted Legacy Encryption
©2016 Kingfisher Technologies
LIMITATIONS: SECURITY
• Key management still necessary
• CMK must be accessible to each client
• CMK can be compromised in key store if not properly secured
• CEK still stored in database
• Compromise less likely but theoretically possible
• Deterministic encryption values can be guessed
• Driver replaced by malware
BEST PRACTICES
MIGRATING PROTECTED DATA
• CREATE/ALTER USER …
ALLOW_ENCRYPTED_VALUE_MODIFICATIONS
• Skips metadata checks on server during bulk copy
• Be extremely careful… Data corruption is possible
• Best Practices
• Use separate account or disable option when not in use
• When possible, use client driver with capability to suppress
cryptographic metadata checks for a single session (i.e., ADO.Net)
• Reference: bit.ly/1SmXEmv
CONTROLLING THE PERFORMANCE
IMPACT
• Only enable when necessary
• When most queries access encrypted columns…
• Enable in connection string
• Disable on individual queries
• When most queries do not access encrypted columns...
• Disable in connection string
• Enable on individual queries
• Reference: bit.ly/1SmXPhI
KEY MANAGEMENT
• Lost keys = Lost data
• Backup all CEKs regularly
• Protect your keys
• EKM > Local
• Regular backups + strong passwords + strict controls
• Rotate column master keys regularly
• Reference: bit.ly/1SmXXh8
WRAP-UP
REVIEW
• New challenges require new techniques
• Always Encrypted is a good fit… for some workloads
• Not a silver bullet
• Whatever encryption you use, take care of it!
RESOURCES
• MSDN has complete documentation
• More links on edleightondick.com (coming soon)
QUESTIONS?
Email: ed@leightondick.com
Blog: edleightondick.com
Twitter: @eleightondick
THANK YOU FOR ATTENDING!
~ Please remember to fill out your comment cards ~

More Related Content

What's hot (20)

PDF
[224]네이버 검색과 개인화
NAVER D2
 
PDF
데이터야놀자발표_데이터로토이서비스만들기_조동민 (2).pdf
DONGMIN CHO
 
PPTX
Terraform in production - experiences, best practices and deep dive- Piotr Ki...
PROIDEA
 
PPT
Data Warehouse
Samir Sabry
 
PPT
Sql Server Performance Tuning
Bala Subra
 
PDF
What’s new in Galera 4
MariaDB plc
 
PDF
Under the Hood of a Shard-per-Core Database Architecture
ScyllaDB
 
PPTX
Introducing DocumentDB
James Serra
 
PDF
Presentation On NoSQL Databases
Abiral Gautam
 
PDF
[124]네이버에서 사용되는 여러가지 Data Platform, 그리고 MongoDB
NAVER D2
 
PDF
A Thorough Comparison of Delta Lake, Iceberg and Hudi
Databricks
 
PDF
From Raw Data to an Interactive Data App in an Hour: Powered by Snowpark Python
HostedbyConfluent
 
PPTX
The Basics of MongoDB
valuebound
 
PDF
Performance Monitoring: Understanding Your Scylla Cluster
ScyllaDB
 
PPTX
Dmv's & Performance Monitor in SQL Server
Zeba Ansari
 
PDF
MongoDB.local DC 2018: Tutorial - Data Analytics with MongoDB
MongoDB
 
PDF
Lessons Learned: Implementing Azure Synapse Analytics in a Rapidly-Changing S...
Cathrine Wilhelmsen
 
PPTX
Oracle Database 12c - Data Redaction
Alex Zaballa
 
PPT
9. Document Oriented Databases
Fabio Fumarola
 
PDF
2024.05.01 RAG 세미나: 자연어처리의 정보검색 기법과 최신 RAG 모델
Cheoneum Park
 
[224]네이버 검색과 개인화
NAVER D2
 
데이터야놀자발표_데이터로토이서비스만들기_조동민 (2).pdf
DONGMIN CHO
 
Terraform in production - experiences, best practices and deep dive- Piotr Ki...
PROIDEA
 
Data Warehouse
Samir Sabry
 
Sql Server Performance Tuning
Bala Subra
 
What’s new in Galera 4
MariaDB plc
 
Under the Hood of a Shard-per-Core Database Architecture
ScyllaDB
 
Introducing DocumentDB
James Serra
 
Presentation On NoSQL Databases
Abiral Gautam
 
[124]네이버에서 사용되는 여러가지 Data Platform, 그리고 MongoDB
NAVER D2
 
A Thorough Comparison of Delta Lake, Iceberg and Hudi
Databricks
 
From Raw Data to an Interactive Data App in an Hour: Powered by Snowpark Python
HostedbyConfluent
 
The Basics of MongoDB
valuebound
 
Performance Monitoring: Understanding Your Scylla Cluster
ScyllaDB
 
Dmv's & Performance Monitor in SQL Server
Zeba Ansari
 
MongoDB.local DC 2018: Tutorial - Data Analytics with MongoDB
MongoDB
 
Lessons Learned: Implementing Azure Synapse Analytics in a Rapidly-Changing S...
Cathrine Wilhelmsen
 
Oracle Database 12c - Data Redaction
Alex Zaballa
 
9. Document Oriented Databases
Fabio Fumarola
 
2024.05.01 RAG 세미나: 자연어처리의 정보검색 기법과 최신 RAG 모델
Cheoneum Park
 

Viewers also liked (6)

PDF
pea informática 1 mdc 4 a
So96vil
 
PPTX
Extending Your Availability Group for Disaster Recovery
Ed Leighton-Dick
 
PDF
20151228_マイナンバー対応、情報漏洩対策にアクセスコントロールとカラムベースのデータ暗号化ソリューション by 株式会社インサイトテクノロジー 森田俊哉
Insight Technology, Inc.
 
PPTX
Dammit Jim! Dr McCoy’s Field Guide to system_health (and the default trace)
Ed Leighton-Dick
 
PPTX
DevOps+Data: Working with Source Control
Ed Leighton-Dick
 
PPTX
Always encrypted overview
SolidQ
 
pea informática 1 mdc 4 a
So96vil
 
Extending Your Availability Group for Disaster Recovery
Ed Leighton-Dick
 
20151228_マイナンバー対応、情報漏洩対策にアクセスコントロールとカラムベースのデータ暗号化ソリューション by 株式会社インサイトテクノロジー 森田俊哉
Insight Technology, Inc.
 
Dammit Jim! Dr McCoy’s Field Guide to system_health (and the default trace)
Ed Leighton-Dick
 
DevOps+Data: Working with Source Control
Ed Leighton-Dick
 
Always encrypted overview
SolidQ
 
Ad

Similar to Understanding SQL Server 2016 Always Encrypted (20)

PDF
Organizational compliance and security in Microsoft SQL 2012-2016
George Walters
 
PDF
Sql Server 2016 Always Encrypted
Duncan Greaves PhD
 
PPTX
SQL Server 2016 RC3 Always Encryption
sultankhan
 
PDF
Organizational compliance and security SQL 2012-2019 by George Walters
George Walters
 
PDF
Geek Sync | Always Encrypted for Beginners
IDERA Software
 
PPTX
Protecting Your Data with Encryption
Ed Leighton-Dick
 
PPT
Steve Jones - Encrypting Data
Red Gate Software
 
PPT
SQL Server 2016 Security Features
Sam Nasr, MCSA, MVP
 
PPTX
Seguridad en sql server 2016 y 2017
Maximiliano Accotto
 
PPTX
Seguridad en sql server 2016 y 2017
Maximiliano Accotto
 
PPT
Formal Lecture.ppt
EqinNiftalyev
 
PDF
SQL Server Column Based Encryption
David Dye
 
PPTX
2° Ciclo Microsoft CRUI 3° Sessione: l'evoluzione delle piattaforme tecnologi...
Jürgen Ambrosi
 
PDF
Sql server column level encryption
muhammadhashir57
 
PPTX
The Spy Who Loathed Me - An Intro to SQL Server Security
Chris Bell
 
PDF
Programming
ssuser4978d4
 
PPTX
SQL Server 2016 New Security Features
Gianluca Sartori
 
PPT
Database Security & Encryption
Tech Sanhita
 
PPT
SQL Server Encryption - Adi Cohn
sqlserver.co.il
 
PDF
Sql Server 2008 Security Enhanments
Eduardo Castro
 
Organizational compliance and security in Microsoft SQL 2012-2016
George Walters
 
Sql Server 2016 Always Encrypted
Duncan Greaves PhD
 
SQL Server 2016 RC3 Always Encryption
sultankhan
 
Organizational compliance and security SQL 2012-2019 by George Walters
George Walters
 
Geek Sync | Always Encrypted for Beginners
IDERA Software
 
Protecting Your Data with Encryption
Ed Leighton-Dick
 
Steve Jones - Encrypting Data
Red Gate Software
 
SQL Server 2016 Security Features
Sam Nasr, MCSA, MVP
 
Seguridad en sql server 2016 y 2017
Maximiliano Accotto
 
Seguridad en sql server 2016 y 2017
Maximiliano Accotto
 
Formal Lecture.ppt
EqinNiftalyev
 
SQL Server Column Based Encryption
David Dye
 
2° Ciclo Microsoft CRUI 3° Sessione: l'evoluzione delle piattaforme tecnologi...
Jürgen Ambrosi
 
Sql server column level encryption
muhammadhashir57
 
The Spy Who Loathed Me - An Intro to SQL Server Security
Chris Bell
 
Programming
ssuser4978d4
 
SQL Server 2016 New Security Features
Gianluca Sartori
 
Database Security & Encryption
Tech Sanhita
 
SQL Server Encryption - Adi Cohn
sqlserver.co.il
 
Sql Server 2008 Security Enhanments
Eduardo Castro
 
Ad

More from Ed Leighton-Dick (6)

PPTX
SQL Server: Now It's Everywhere You Want to Be
Ed Leighton-Dick
 
PPTX
How to Keep Your Databases Secure in Just Minutes a Day
Ed Leighton-Dick
 
PPTX
SQL Server Features That Will Blow Your Mind!
Ed Leighton-Dick
 
PPTX
Get Involved!
Ed Leighton-Dick
 
PPTX
Service Broker: The Queue Continuum
Ed Leighton-Dick
 
PPTX
Practically Normal: An Introduction to Normalization
Ed Leighton-Dick
 
SQL Server: Now It's Everywhere You Want to Be
Ed Leighton-Dick
 
How to Keep Your Databases Secure in Just Minutes a Day
Ed Leighton-Dick
 
SQL Server Features That Will Blow Your Mind!
Ed Leighton-Dick
 
Get Involved!
Ed Leighton-Dick
 
Service Broker: The Queue Continuum
Ed Leighton-Dick
 
Practically Normal: An Introduction to Normalization
Ed Leighton-Dick
 

Recently uploaded (20)

PPTX
AI Presentation Tool Pitch Deck Presentation.pptx
ShyamPanthavoor1
 
PPTX
Exploring Multilingual Embeddings for Italian Semantic Search: A Pretrained a...
Sease
 
PPTX
apidays Munich 2025 - Building an AWS Serverless Application with Terraform, ...
apidays
 
PPTX
Aict presentation on dpplppp sjdhfh.pptx
vabaso5932
 
PPTX
Advanced_NLP_with_Transformers_PPT_final 50.pptx
Shiwani Gupta
 
PDF
apidays Helsinki & North 2025 - REST in Peace? Hunting the Dominant Design fo...
apidays
 
PPTX
Listify-Intelligent-Voice-to-Catalog-Agent.pptx
nareshkottees
 
PDF
Web Scraping with Google Gemini 2.0 .pdf
Tamanna
 
PDF
apidays Helsinki & North 2025 - API-Powered Journeys: Mobility in an API-Driv...
apidays
 
PPTX
apidays Helsinki & North 2025 - Agentic AI: A Friend or Foe?, Merja Kajava (A...
apidays
 
PDF
Avatar for apidays apidays PRO June 07, 2025 0 5 apidays Helsinki & North 2...
apidays
 
PDF
The European Business Wallet: Why It Matters and How It Powers the EUDI Ecosy...
Lal Chandran
 
PDF
What does good look like - CRAP Brighton 8 July 2025
Jan Kierzyk
 
PDF
Simplifying Document Processing with Docling for AI Applications.pdf
Tamanna
 
PPTX
SlideEgg_501298-Agentic AI.pptx agentic ai
530BYManoj
 
PDF
OOPs with Java_unit2.pdf. sarthak bookkk
Sarthak964187
 
PDF
OPPOTUS - Malaysias on Malaysia 1Q2025.pdf
Oppotus
 
PDF
Product Management in HealthTech (Case Studies from SnappDoctor)
Hamed Shams
 
PDF
apidays Helsinki & North 2025 - Monetizing AI APIs: The New API Economy, Alla...
apidays
 
PPT
Growth of Public Expendituuure_55423.ppt
NavyaDeora
 
AI Presentation Tool Pitch Deck Presentation.pptx
ShyamPanthavoor1
 
Exploring Multilingual Embeddings for Italian Semantic Search: A Pretrained a...
Sease
 
apidays Munich 2025 - Building an AWS Serverless Application with Terraform, ...
apidays
 
Aict presentation on dpplppp sjdhfh.pptx
vabaso5932
 
Advanced_NLP_with_Transformers_PPT_final 50.pptx
Shiwani Gupta
 
apidays Helsinki & North 2025 - REST in Peace? Hunting the Dominant Design fo...
apidays
 
Listify-Intelligent-Voice-to-Catalog-Agent.pptx
nareshkottees
 
Web Scraping with Google Gemini 2.0 .pdf
Tamanna
 
apidays Helsinki & North 2025 - API-Powered Journeys: Mobility in an API-Driv...
apidays
 
apidays Helsinki & North 2025 - Agentic AI: A Friend or Foe?, Merja Kajava (A...
apidays
 
Avatar for apidays apidays PRO June 07, 2025 0 5 apidays Helsinki & North 2...
apidays
 
The European Business Wallet: Why It Matters and How It Powers the EUDI Ecosy...
Lal Chandran
 
What does good look like - CRAP Brighton 8 July 2025
Jan Kierzyk
 
Simplifying Document Processing with Docling for AI Applications.pdf
Tamanna
 
SlideEgg_501298-Agentic AI.pptx agentic ai
530BYManoj
 
OOPs with Java_unit2.pdf. sarthak bookkk
Sarthak964187
 
OPPOTUS - Malaysias on Malaysia 1Q2025.pdf
Oppotus
 
Product Management in HealthTech (Case Studies from SnappDoctor)
Hamed Shams
 
apidays Helsinki & North 2025 - Monetizing AI APIs: The New API Economy, Alla...
apidays
 
Growth of Public Expendituuure_55423.ppt
NavyaDeora
 

Understanding SQL Server 2016 Always Encrypted

  • 1. UNDERSTANDING SQL SERVER 2016 ALWAYS ENCRYPTED Ed Leighton-Dick
  • 2. ABOUT ME Email: [email protected] Blog: edleightondick.com Twitter: @eleightondick
  • 3. AGENDA • A bit of background • Always Encrypted • Best Practices
  • 4. THE CURRENT STATE OF SQL SERVER ENCRYPTION
  • 5. SECURITY HAS BECOME CRUCIAL • More risk to companies’ systems than ever before • Security is all about mitigating risk • Encryption is an important fail-safe in a security strategy • Variety of existing methods
  • 6. ENCRYPTION IN THE APPLICATION • Extremely flexible • Extremely customizable • Wide variety of algorithms • Data may be encrypted from application to storage
  • 7. COLUMN-LEVEL ENCRYPTION • Introduced in SQL Server 2005 • Highly configurable • Major types of encryption provided • Simple to use • Developer has to know little about encryption to use • Can be made secure using SQL Server permissions
  • 8. TRANSPARENT DATA ENCRYPTION • Introduced in SQL Server 2008 • All data in database protected while on disk • Can be used with any application
  • 9. ALL OF THESE HAVE SERIOUS SHORTCOMINGS… The bottom line: None of these are sufficient anymore! BY APPLICATION • Developers control the keys • No separation of duties • Not consistently implemented • Time-consuming IN-COLUMN • DBAs control the keys • Not consistently implemented • Time-consuming TDE • DBAs control the keys • All data viewable • Data decrypted in memory
  • 10. WE NEED TO DO BETTER • Hackers are becoming more sophisticated • Data breaches are becoming more frequent and more expensive • Regulations (legal and contractual) are becoming more strict • Public tolerance is declining
  • 11. AND YET… • Many companies have not implemented a comprehensive security strategy! • “Too expensive” • “Too difficult” • “Too time-consuming” • “It won’t/can’t happen to us” • “No one wants what we have” • “That’s someone else’s job” • “I don’t get it”
  • 13. ALWAYS ENCRYPTED: A STEP IN THE RIGHT DIRECTION • Encryption occurs in the data driver • ADO.NET, ODBC, JDBC drivers currently available • Data is only unencrypted between application and driver • SQL Server cannot decrypt data on its own • Transparent to applications • Searchable while encrypted • Works on both on-premises and cloud databases • Available in SQL 2016, Azure SQL DB v12
  • 14. ALWAYS ENCRYPTED ARCHITECTURE Image credit: MSDN (http://bit.ly/1Se0sm0)
  • 15. ALWAYS ENCRYPTED SOLVES SOME BIG PROBLEMS • Strong encryption • Separation of duties • Consistent, simple implementation • Encryption methods are not visible in code or database
  • 16. DEMO
  • 17. TYPES OF ENCRYPTION • Algorithm: AEAD_AES_256_CBC_HMAC_SHA_256 • Deterministic • Searchable • Allows grouping, indexing, joining • Requires *_BIN2 collation • Randomized • No searches, grouping, indexing, joining
  • 18. DATATYPE CONVERSIONS • Conversions happen behind the scenes • Ciphertext stored as VARBINARY • Length • Most data types: 65 bytes • Decimal/Numeric/UID: 81 bytes • Variable length: Variable (formula) • Reference: bit.ly/1S9ieNu
  • 19. TYPES OF KEYS • Column master key (CMK) • Encrypts CEK • Stored externally in key stores • Column encryption key (CEK) • Encrypted by up to 2 CMKs to allow rotation • Stored internally
  • 20. KEY STORES • Local certificate store • Hardware Security Modules (HSM) • aka Extensible Key Management (EKM) • Azure Key Vault • Custom
  • 21. METADATA • Column Master Keys • sys.column_master_keys • Column Encryption Keys • sys.column_encryption_keys • sys.column_encryption_key_values • Column encryption • sys.columns • Parameters • sys.sp_describe_parameter_encryption
  • 22. DEPLOYMENT • Can be scripted using T-SQL or PowerShell • CMK via PowerShell
  • 23. AND NOW, THE BAD NEWS… • Always Encrypted is not a silver bullet • V1 product = Significant limitations
  • 24. LIMITATIONS • Comparisons on AE columns • Deterministic – Equality • Randomized – None • Other operations disallowed • LIKE, range lookups • Functions, etc. • Data must be passed as typed parameters • ADO.NET: SqlParameter • ODBC: SQLBindParam
  • 25. LIMITATIONS: DATATYPES/FEATURES xml timestamp/rowversion image ntext/text sql_variant hierarchyid geography geometry alias/sysname UDTs FILESTREAM ROWGUIDCOL String w/o BIN2 Full-text search Computed Ref by computed Sparse column set Ref by statistics Partitioning column DEFAULT, CHECK IDENTITY CDC Temporal table Masked PolyBase Hekaton Table variables FOR XML FOR JSON PATH Replication Linked servers SSDT *Key/index *Stretch *Triggers … and more
  • 26. LIMITATIONS: PERFORMANCE (CTP) • Significant impact on both speed and space...? Image credit: Aaron Bertrand, SQLPerformance.com (http://bit.ly/1quelGS)
  • 27. LIMITATIONS: PERFORMANCE (RTM) ©2016 Kingfisher Technologies 33 38 87 44 - 10 20 30 40 50 60 70 80 90 100 Insert 100K Rows Read Random Rows Impact of Always Encrypted - 1-Core Client, 1-Core Server Unencrypted Always Encrypted
  • 28. LIMITATIONS: PERFORMANCE (RTM) ©2016 Kingfisher Technologies 33 38 87 44 400 191 - 50 100 150 200 250 300 350 400 450 Insert 100K Rows Read Random Rows Impact of Always Encrypted – 1-Core Client, 1-Core Server Unencrypted Always Encrypted Legacy Encryption
  • 29. LIMITATIONS: PERFORMANCE (RTM) ©2016 Kingfisher Technologies 92 106109 118 594 520 - 100 200 300 400 500 600 700 Insert 100K Rows Read Random Rows Impact of Always Encrypted - 4-Core Client, 16-Core Server Unencrypted Always Encrypted Legacy Encryption
  • 30. LIMITATIONS: PERFORMANCE (RTM) 5.164 17.031 15.282 0 2 4 6 8 10 12 14 16 18 Total Space Space Used (MB) Unencrypted Always Encrypted Legacy Encryption ©2016 Kingfisher Technologies
  • 31. LIMITATIONS: SECURITY • Key management still necessary • CMK must be accessible to each client • CMK can be compromised in key store if not properly secured • CEK still stored in database • Compromise less likely but theoretically possible • Deterministic encryption values can be guessed • Driver replaced by malware
  • 33. MIGRATING PROTECTED DATA • CREATE/ALTER USER … ALLOW_ENCRYPTED_VALUE_MODIFICATIONS • Skips metadata checks on server during bulk copy • Be extremely careful… Data corruption is possible • Best Practices • Use separate account or disable option when not in use • When possible, use client driver with capability to suppress cryptographic metadata checks for a single session (i.e., ADO.Net) • Reference: bit.ly/1SmXEmv
  • 34. CONTROLLING THE PERFORMANCE IMPACT • Only enable when necessary • When most queries access encrypted columns… • Enable in connection string • Disable on individual queries • When most queries do not access encrypted columns... • Disable in connection string • Enable on individual queries • Reference: bit.ly/1SmXPhI
  • 35. KEY MANAGEMENT • Lost keys = Lost data • Backup all CEKs regularly • Protect your keys • EKM > Local • Regular backups + strong passwords + strict controls • Rotate column master keys regularly • Reference: bit.ly/1SmXXh8
  • 37. REVIEW • New challenges require new techniques • Always Encrypted is a good fit… for some workloads • Not a silver bullet • Whatever encryption you use, take care of it!
  • 38. RESOURCES • MSDN has complete documentation • More links on edleightondick.com (coming soon)
  • 40. THANK YOU FOR ATTENDING! ~ Please remember to fill out your comment cards ~

Editor's Notes

  • #11: Code is time-consuming to build, maintain Code that implements encryption should be locked down, but rarely is Writing own encryption code assumes expertise that may not exist – Some developers even like to create their own “encryption” routines!
  • #15: All editions of Azure SQL DB v12 – No word on SQL 2016 editions yet .Net 4.6, ODBC v13, JDBC v6
  • #17: It’s not perfect, though… we’ll talk about that later.
  • #19: BIN2 - binary code point comparison sort Main collation: Latin1_General_BIN2 (131 total - most languages covered) – Latin1_General_100_BIN2 handles Unicode better
  • #22: Azure Key Vault/EKM/HSM not available with ODBC (yet) Azure Key Vault – Installed separately