Questions tagged [always-encrypted]

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

  1. Column Master Key (CMK)
  2. 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.

Read more here

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.

Read more here

Types of Encryption

  1. Deterministic Encryption
  2. 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.

Read more here

299 questions
3
votes
0 answers

How to propagate Always encrypted column encryption to Test, Acceptance and Production?

We are using Always encrypted in a .Net core application. The Sql Server database is maintained with EF-core migrations. I was wondering how to propagate the column encryptions for the selected columns over to Test, Acceptance and Production. I…
R. Schreurs
  • 8,587
  • 5
  • 43
  • 62
3
votes
1 answer

Using Always Encrypted with EF Core and storing Master Key in Azure Key Vault

I have a .Net Core 3.1 project using EF Core to access data in an Azure SQL Database. I'm currently trying to implement the Always Encrypted feature on some sensitive column. I successfully encrypted the column, storing the Master Key in Azure Key…
3
votes
1 answer

CI with a SQL Always Encrypted column

We are trying to add Always encrypted in one of our application and we would like to make it work with our CI flow. We are using DACPAC deploy with Azure Devops. Everything worked until now but we are facing a challenge with always…
3
votes
3 answers

Securely storing oAuth Tokens in Azure

I'm building a service where I will allow users to use different Identity Providers. Once a user authenticates with the provider, I need to store the token so that I can make calls on their behalf. My question is about securely storing this token in…
Andy T
  • 10,223
  • 5
  • 53
  • 95
3
votes
1 answer

SSIS Data Flow into always encrypted column with Azure Key Vault

Has anyone managed to get an SSIS Data Flow task into an always encrypted column with Azure Key Vault working? I am running an SSIS Data Flow Task from a table in a database with not encrypted columns into a table in another database with always…
AlejandroR
  • 5,133
  • 4
  • 35
  • 45
3
votes
0 answers

How to fix "Certificate with thumbprint null not found in certificate store null" when trying to get plaintext from encrypted columns-sql server?

I have a remote SQLserver (2017 ) version, with a database Test_database, which has 1 encrypted column, encrypted using "Always Encrypted Certificate". How to decrypt the values in this column using JDBC? I tried exporting the certificate in .pfx…
3
votes
3 answers

SQL71501: column [dbo].[columnname] has an unresolved reference to column encryption key [keyname]

I have a SQL table with a column which is using always encrypted. I am trying to setup CI / CD pipeline for a Visual Studio database project. I am unable to build the project because VS2017 is unable to recognize this particular…
3
votes
1 answer

SQL Always Encrypted in Azure

I need to build a web app that accesses some encrypted columns on a DB. All must be hosted in the client's azure account. I have searched for a couple of days and read a lot of tutorials but I can't find an answer to my problem. I have mainly…
3
votes
0 answers

Azure web app with access to multiple key vaults

I'm wondering if an Azure web application can have access to multiple key vaults? This is because one of our web applications has multiple database connection strings and each of the databases has columns encrypted with always encrypted and the…
dhughes
  • 645
  • 1
  • 7
  • 19
3
votes
1 answer

SQL Server Always Encrypted: Operand type clash: varchar is incompatible with varchar(max)

As we have regulation changes coming in force in the UK soon a database that I am working on that needs to be updated to have any personal identifiable information encrypted. A number of my tables have been altered successfully, however on some…
Simon Price
  • 3,011
  • 3
  • 34
  • 98
3
votes
0 answers

Better Replication to move columns encrypted using SQL Always encryption

I have currently using Transaction replication in my production database and replicating the same database for internal purpose. Due to GDPR compliance, we are going to encrypt our database customer information columns using Always Encryption. I…
3
votes
1 answer

Cannot find the Active Directory object '' in tenant

How do I resolve this issue? anyone experience this before? I'm trying to enable always encrypted in my sql server database by running the below script as described in the tutorial. I've checked the tenant Id in my azure, and the AAD everything…
user3520410
  • 41
  • 1
  • 4
3
votes
2 answers

How to use Like Operator on SQL Server Always Encrypted column?

Please help me in fixing the below query in SQL Sever 2016 where columns FIRST_NAME, LAST_NAME are always encrypted. SELECT * FROM MY_TABLE WHERE (LAST_NAME LIKE '%[@,#,$,%,*]%' OR LAST_NAME LIKE '%,%') OR (FIRST_NAME LIKE '%[@,#,$,%,*]%' OR…
abcreddy
  • 102
  • 3
  • 19
3
votes
1 answer

Always Encrypted with Asp.net Identity

We are trying to use Always Encrypted feature of Sql 2016 with Asp.net Identity 2.0. We have a requirement to encrypt customer's data when we store it to AspNetUsers table. This is to follow GDPR compliance. We have set Always Encrpted on…
user3344235
  • 51
  • 1
  • 5
3
votes
1 answer

SQL Server Always Encrypted Operand type clash: varchar is incompatible with varchar(60) when running EXEC sproc

I am unable to EXEC a stored procedure that upserts a table that has an encrypted column using Always Encrypted. However, I am able to copy the SQL from the sproc and run that as regular SQL with the parameters set, Just cannot get the sproc to fire…
1 2
3
19 20