It is better to encrypt data base for security issues. There are many options like ssl, encrypt/decrypt with c#, etc. There is an utility in sql server which can make your website more secure in an easy way. The below listed are some codes which encrypt and decrypt data in sql server. The syntax are as follows :
Code:
Declare @Encrypted varbinary(max)
Declare @Decryptrd varchar(100)
Open Symmetric Key SecuredKey
DECRYPTION by Password=N'Password';
set @Encrypted= EncryptByKey (Key_GUID('SecuredKey'),'Password')
set @Decryptrd =DecryptByKey (@Encrypted)
Print @Encrypted
Print @Decryptrd
CLOSE SYMMETRIC KEY SecuredKey;
Now if you refer the above one can see the firs portion is used to create a password or encryption. Then a password is added. And then in the second position the same password is opened for decryption.
Bookmarks