主頁 > 知識庫 > MSSQL數(shù)據(jù)加密解密代碼

MSSQL數(shù)據(jù)加密解密代碼

熱門標(biāo)簽:西安青牛防封電銷卡 威海智能語音外呼系統(tǒng) 南京電銷外呼系統(tǒng)運(yùn)營商 北京辦理400電話多少 智能語音外呼系統(tǒng)哪個牌子好 400電話申請需要開戶費(fèi)嗎 重慶防封電銷機(jī)器人供應(yīng)商 山西語音外呼系統(tǒng)價(jià)格 溫州語音外呼系統(tǒng)代理
可以查看:
復(fù)制代碼 代碼如下:

OPEN SYMMETRIC KEY 命令關(guān)于 對稱密鑰加密使用證書解密
CREATE MASTER KEY ENCRYPTION BY PASSWORD = 'password'
go
CREATE CERTIFICATE CertTest
with SUBJECT = 'Test Certificate'
GO
--創(chuàng)建非對稱密鑰
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
--創(chuàng)建對稱密鑰
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

標(biāo)簽:濟(jì)寧 宜春 金昌 新余 河源 中衛(wèi) 黃山 貸款群呼

巨人網(wǎng)絡(luò)通訊聲明:本文標(biāo)題《MSSQL數(shù)據(jù)加密解密代碼》,本文關(guān)鍵詞  MSSQL,數(shù)據(jù),加密解密,代碼,;如發(fā)現(xiàn)本文內(nèi)容存在版權(quán)問題,煩請?zhí)峁┫嚓P(guān)信息告之我們,我們將及時(shí)溝通與處理。本站內(nèi)容系統(tǒng)采集于網(wǎng)絡(luò),涉及言論、版權(quán)與本站無關(guān)。
  • 相關(guān)文章
  • 下面列出與本文章《MSSQL數(shù)據(jù)加密解密代碼》相關(guān)的同類信息!
  • 本頁收集關(guān)于MSSQL數(shù)據(jù)加密解密代碼的相關(guān)信息資訊供網(wǎng)民參考!
  • 推薦文章