当前位置:网站首页>Sqlserver encrypts and decrypts data
Sqlserver encrypts and decrypts data
2022-07-04 22:13:00 【CodingSir】
– sqlserver Encrypt data 、 Decrypt
– Create test table
CREATE TABLE TBLUser
(
Name nvarchar(30),
Password varbinary(1000)
)
- 1
- 2
- 3
- 4
- 5
– Create database master **
CREATE master key ENCRYPTION BY PASSWORD ='[email protected]'
- 1
– Create certificate
CREATE CERTIFICATE TestCert with SUBJECT = 'Test Certificate'
- 1
– Create symmetry **
CREATE SYMMETRIC KEY TestSymmetric WITH ALGORITHM = AES_256 ENCRYPTION BY CERTIFICATE TestCert
- 1
– Use symmetric secret keys to encrypt data
OPEN SYMMETRIC KEY TestSymmetric DECRYPTION BY CERTIFICATE TestCert;
INSERT INTO TBLUser values(' Zhang San ', ENCRYPTBYKEY(Key_Guid(N'TestSymmetric'), '123456'));
CLOSE SYMMETRIC KEY TestSymmetric;
- 1
- 2
- 3
– View encrypted data
SELECT * FROM TBLUser
- 1
– Decrypt data
OPEN SYMMETRIC KEY TestSymmetric DECRYPTION BY CERTIFICATE TestCert;
SELECT Name, CAST(DecryptByKey(password) as varchar(100)) Password FROM TBLUser;
CLOSE SYMMETRIC KEY TestSymmetric;边栏推荐
- GTEST from ignorance to proficiency (4) how to write unit tests with GTEST
- From repvgg to mobileone, including mobileone code
- Force buckle 3_ 383. Ransom letter
- Basic structure of PostgreSQL - table
- 傳智教育|如何轉行互聯網高薪崗比特之一的軟件測試?(附軟件測試學習路線圖)
- How to implement Devops with automatic tools
- Bizchart+slider to realize grouping histogram
- HDU - 1078 fatmouse and cheese (memory search DP)
- KDD2022 | 什么特征进行交互才是有效的?
- VS2019 C# release下断点调试
猜你喜欢
![[advanced C language] array & pointer & array written test questions](/img/3f/83801afba153cfc0dd73aa8187ef20.png)
[advanced C language] array & pointer & array written test questions

Visual task scheduling & drag and drop | scalph data integration based on Apache seatunnel

常用的开源无代码测试工具

A large number of virtual anchors in station B were collectively forced to refund: revenue evaporated, but they still owe station B; Jobs was posthumously awarded the U.S. presidential medal of freedo

使用 BlocConsumer 同时构建响应式组件和监听状态

Machine learning notes mutual information

迷失在Mysql的锁世界

能源势动:电力行业的碳中和该如何实现?

卷积神经网络模型之——LeNet网络结构与代码实现

TCP协议三次握手过程
随机推荐
How can the advertising system of large factories be upgraded without the presence of large models
Scala下载和配置
Why do you have to be familiar with industry and enterprise business when doing Bi development?
KDD2022 | 什么特征进行交互才是有效的?
卷积神经网络模型之——LeNet网络结构与代码实现
[optimtool.unconstrained] unconstrained optimization toolbox
湘江鲲鹏加入昇腾万里伙伴计划,与华为续写合作新篇章
Use blocconsumer to build responsive components and monitor status at the same time
智洋创新与华为签署合作协议,共同推进昇腾AI产业持续发展
vim 从嫌弃到依赖(23)——最后的闲扯
并发网络模块化 读书笔记转
Common shortcut keys for hbuilder x
传智教育|如何转行互联网高薪岗位之一的软件测试?(附软件测试学习路线图)
可视化任务编排&拖拉拽 | Scaleph 基于 Apache SeaTunnel的数据集成
力扣2_1480. 一维数组的动态和
赋能数字经济 福昕软件出席金砖国家可持续发展高层论坛
PostgreSQLSQL高级技巧透视表
好用app推荐:扫描二维码、扫描条形码并查看历史
GTEST from ignorance to skillful use (1) GTEST installation
开户哪家券商比较好?网上开户安全吗