For providing security and privacy we need to store data in encrypted form.
In SQL this can be done with series of steps:
CREATE TABLE dbo.Employees(
EmployeeID int primary key,
EmployeeName varchar(50) NULL,
normaldata [varchar](20) NOT NULL,
encrydata [varbinary] (200) NULL)
Create the Symmetric Key and associate certificate for encryption and providing type of encryption to be done.
CREATE CERTIFICATE TestCert
WITH SUBJECT = 'Data Encryption';
CREATE SYMMETRIC KEY MyKey
WITH ALGORITHM = DES
ENCRYPTION BY CERTIFICATE TestCert;
OPEN SYMMETRIC KEY MyKey
DECRYPTION BY CERTIFICATE TestCert;
UPDATE dbo.Employees
SET Data = EncryptByKey(Key_GUID("MyKey'), data);
0 Comment(s)