Anda memiliki opsi yang berbeda di sini.
-
Anda dapat menggunakan enkripsi simetris untuk data Anda:
BUAT TABEL penjualan (...)
Buat kunci simetris:
CREATE CERTIFICATE cert_sales WITH SUBJECT = N'Sales certificate',
START_DATE = N'2009-01-01', EXPIRY_DATE = N'2018-12-31';
CREATE SYMMETRIC KEY symkey_sales WITH ALGORITHM = AES_256
ENCRYPTION BY CERTIFICATE cert_sales
Enkripsi data:
TRUNCATE TABLE sales;
OPEN SYMMETRIC KEY symkey_sales DECRYPTION BY CERTIFICATE cert_sales;
INSERT INTO sales() SELECT a, ENCRYPTBYKEY(Key_Guid(N'symkey_sales'), B) FROM T2;
CLOSE SYMMETRIC KEY symkey_sales;
Dekripsi data:
OPEN SYMMETRIC KEY symkey_sales DECRYPTION BY CERTIFICATE cert_sales;
SELECT a, CAST(DecryptByKey(B) as nvarchar(100)) FROM sales;
CLOSE SYMMETRIC KEY symkey_sales;
- Anda dapat menggunakan enkripsi asimetris untuk data Anda
- Anda dapat menggunakan Enkripsi Data Transparan untuk mengenkripsi semua file database:
Buat kunci master:
USE master
go
CREATE MASTER KEY ENCRYPTION BY PASSWORD = 'My$Strong$Password$123'
Buat sertifikat:
CREATE CERTIFICATE DEK_EncCert WITH SUBJECT = 'DEK Encryption Certificate'
Buat DEK:
USE MySecretDB
go
CREATE DATABASE ENCRYPTION KEY WITH ALGORITHM = AES_256
ENCRYPTION BY SERVER CERTIFICATE DEK_EncCert
Aktifkan enkripsi:
ALTER DATABASE MySecretDB SET ENCRYPTION ON
- Anda dapat menggunakan BitLocker - enkripsi volume lengkap