SQL server database encryption step by step
I have a SQL 2016 database server and would like to implement database encryption. Can someone please point me or have the process on how to do this from the start to the end?
1 how to create master key and certificate
2 run the SQL encryption query
please include other steps that I missed.
SQL Server Other
2 answers
Sort by: Most helpful
-
-
YufeiShao-msft 7,146 Reputation points
2021-08-13T07:37:16.67+00:00 Hi @mgmjtech ,
SQL Server provides the following mechanisms for encryption, you can choose different encryption algorithm to meet your needs:
Asymmetric keys
Symmetric keys
Certificates
Transparent Data Encryption(TDE)
Encrypt a Column of Data:https://learn.microsoft.com/en-us/sql/relational-databases/security/encryption/encrypt-a-column-of-data?view=sql-server-ver15
Always Encrypted: https://learn.microsoft.com/en-us/sql/relational-databases/security/encryption/always-encrypted-database-engine?view=sql-server-ver15
Transact-SQL functions:
create certificate and master key with T-SQL, you can refer to:
https://learn.microsoft.com/en-us/sql/t-sql/statements/create-certificate-transact-sql?view=sql-server-ver15
https://learn.microsoft.com/en-us/sql/t-sql/statements/create-master-key-transact-sql?view=sql-server-ver15According to your question, I guess you want to use TDE.
TDE protects data at rest, which is the data and log files and does real-time I/O encryption and decryption of data and log files. TDE encrypts an entire database using that symmetric key called the database encryption key. The database encryption key is protected by other keys or certificates which are protected either by the database master key or by an asymmetric key stored in an EKM module.
https://learn.microsoft.com/en-us/sql/relational-databases/security/encryption/transparent-data-encryption?view=sql-server-ver15