sqlserver 对称加密

CREATE SYMMETRIC KEY ZXC WITH ALGORITHM = AES_256 ENCRYPTION BY PASSWORD = 'ZXC123456'  
--创建秘钥

OPEN SYMMETRIC KEY ZXC DECRYPTION BY PASSWORD = 'ZXC123456'   --打开秘钥

SELECT CONVERT(VARCHAR(10), Decryptbykey(Encryptbykey(Key_guid('ZXC'), 'YHDH_C'))) --设置加密
CLOSE SYMMETRIC KEY ZXC;
DROP SYMMETRIC KEY ZXC;

 

posted @ 2019-09-04 10:38  敌八哥  阅读(982)  评论(0编辑  收藏  举报