主页 > 知识库 > MSSQL数据加密解密代码

MSSQL数据加密解密代码

热门标签:西安青牛防封电销卡 威海智能语音外呼系统 南京电销外呼系统运营商 北京办理400电话多少 智能语音外呼系统哪个牌子好 400电话申请需要开户费吗 重庆防封电销机器人供应商 山西语音外呼系统价格 温州语音外呼系统代理
可以查看:
复制代码 代码如下:

OPEN SYMMETRIC KEY 命令关于 对称密钥加密使用证书解密
CREATE MASTER KEY ENCRYPTION BY PASSWORD = 'password'
go
CREATE CERTIFICATE CertTest
with SUBJECT = 'Test Certificate'
GO
--创建非对称密钥
CREATE ASYMMETRIC KEY TestAsymmetric
WITH ALGORITHM = RSA_2048
ENCRYPTION BY PASSWORD = 'password1' ;
GO
ALTER ASYMMETRIC KEY TestAsymmetric WITH PRIVATE KEY (DECRYPTION BY PASSWORD = 'password1')

--DROP ASYMMETRIC KEY TestAsymmetric
--创建对称密钥
CREATE SYMMETRIC KEY TestSymmetric
WITH ALGORITHM = AES_256
ENCRYPTION BY PASSWORD = 'password' ;
GO

OPEN SYMMETRIC KEY TestSymmetric
DECRYPTION BY PASSWORD = 'password' ;

go
SELECT

ENCRYPTBYASYMKEY(ASYMKEY_ID ('TestAsymmetric'), name) ,
CAST(deCRYPTBYASYMKEY (ASYMKEY_ID( 'TestAsymmetric'),ENCRYPTBYASYMKEY (ASYMKEY_ID( 'TestAsymmetric'),name ) )
as nvarchar(200 )),
ENCRYPTBYCERT ( Cert_ID('CertTest' ),name),
CAST(deCRYPTBYCERT (Cert_ID ('CertTest'), ENCRYPTBYCERT (Cert_ID( 'CertTest'),name ))
as nvarchar (200)),
EncryptByKey ( KEY_GUID('TestSymmetric' ),name),
CAST(decryptByKey (EncryptByKey (KEY_GUID ('TestSymmetric'), name))
as nvarchar (200))

FROM sys .objects

标签:济宁 宜春 金昌 新余 河源 中卫 黄山 贷款群呼

巨人网络通讯声明:本文标题《MSSQL数据加密解密代码》,本文关键词  MSSQL,数据,加密解密,代码,;如发现本文内容存在版权问题,烦请提供相关信息告之我们,我们将及时沟通与处理。本站内容系统采集于网络,涉及言论、版权与本站无关。
  • 相关文章
  • 下面列出与本文章《MSSQL数据加密解密代码》相关的同类信息!
  • 本页收集关于MSSQL数据加密解密代码的相关信息资讯供网民参考!
  • 推荐文章