时间:2021-05-02
可以查看:
复制代码 代码如下:
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
声明:本页内容来源网络,仅供用户参考;我单位不保证亦不表示资料全面及准确无误,也不保证亦不表示这些资料为最新信息,如因任何原因,本网内容或者用户因倚赖本网内容造成任何损失或损害,我单位将不会负任何法律责任。如涉及版权问题,请提交至online#300.cn邮箱联系删除。
本文实例讲述了PHP中加密解密函数与DES加密解密的应用,分享给大家供大家参考。具体如下:例子,php加密解密的例子加密函数:复制代码代码如下:/**功能:对字
收录了一些比较经典的PHP加密解密函数代码,分享给大家。加密解密原理一般都是通过一定的加密解密算法,将密钥加入到算法中,最终得到加密解密结果。?12345678
这个C#类是一个基于Base64的加密和解密类,用户可以可以使用默认的秘钥进行加密、解密,也可以自己设定秘钥进行加密和解密,非常实用代码一:非常精简的代码///
前言数据加密,是一门历史悠久的技术,指通过加密算法和加密密钥将明文转变为密文,而解密则是通过解密算法和解密密钥将密文恢复为明文。它的核心是密码学。数据加密目前仍
本文实例讲述了C#字符串加密解密方法。分享给大家供大家参考。具体如下:复制代码代码如下:#region加密解密staticstringencryptKey="O