当前位置:网站首页>对称加密与非对称加密
对称加密与非对称加密
2022-07-17 04:08:00 【金色%夕阳】
1、对称加密
对称加密,即采用对称的密码编码技术,他的特点是,加密和解密使用相同的秘钥。
常见的对称加密算法有DES、3DES、Blowfish、IDEA、RC4、RC5、RC6和AES。
优点:对称加密算法使用起来简单快捷,密钥较短,且破译困难。
缺点:
1、对称加密算法一般不能提供信息完整性的鉴别。它无法验证发送者和接受者的身份;
2、对称密钥的管理和分发工作是一件具有潜在危险的和烦琐的过程。如何防止秘钥泄露是一个难点。
2、非对称加密
非对称加密技术,需要两个秘钥,公钥和私钥。公钥和私钥成对出现。
用法:如果用公钥对数据进行加密,只有用对应的私钥才能解密;如果用私钥对数据进行加密,那么只有用对应的公钥才能解密。因为加密和解密使用的是两个不同的密钥,所以这种算法叫作非对称加密算法。
非对称加密的典型应用是数字签名。
常见的非对称加密算法有:RSA、ECC(移动设备用)、Diffie-Hellman、El Gamal、DSA(数字签名用)。
3、对称+非对称

1、发送方
1、报文原文使用对称加密技术。对称加密的秘钥(避免混淆,这里称对称密码)。根据随机数生成。每次发起请求时,会重新产生一个随机数,进一步降低被破解的风险。
2、对称密码通过非对称加密方式进行加密。公钥由后台产生,匹配的私钥由后台保管。这样产生一个加密后的对称密码。前端在发送给后端之后,后端需要用匹配的私钥才能解开。
2、接收方
1、会使用匹配的私钥解密加密的对称密码,获取到真实的对称密码。
2、使用对称密码,解密加密报文,获取原报文内容。
优点:
1、因为我们的对称密码是使用非对称加密的,因此,想要破解,需要找到相应的公钥才行。
2、每次请求会重新生成一个对称密码,这就加大了破解的难度。
4、总结
(1) 对称加密加密与解密使用的是同样的密钥,所以速度快,但由于需要将密钥在网络传输,所以安全性不高。
(2) 非对称加密使用了一对密钥,公钥与私钥,所以安全性高,但加密与解密速度慢。
(3) 解决的办法是将对称加密的密钥使用非对称加密的公钥进行加密,然后发送出去,接收方使用私钥进行解密得到对称加密的密钥,然后双方可以使用对称加密来进行沟通。
边栏推荐
- STM32——定时器系列(二)通用定时器
- C# 详解out输出参数
- minimum spanning tree
- 模拟服务器进行请求
- V4L2学习资料收集
- Machine learning 09: unsupervised learning
- leetcode209. Minimum length subarray
- Wechat online education video on demand learning applet graduation design (3) background function
- Openresty as a static resource server
- String extension method usage
猜你喜欢

Nearly 90% of servers can be saved, but the anti fraud efficiency has increased significantly. Why is PayPal's plan to break the "Ai memory wall" so cost-effective?

分布式笔记(02)— 分布式缓存之 Redis(用途、特点、高可用方案 Redis Cluster、Twemproxy、Codis 简要说明)

笔记本电脑插入耳机仍然外放(亲测有效)

High performance and economy: aoteng persistent memory helps mobile cloud cope with severe memory challenges

06 MAUI,WPF使用 MVVM Toolkit 框架 构建 MVVM 程序

If by frame package name modifier

OSPF comprehensive experiment

priority_ Introduction and use of queue

Live broadcast of cloud intelligence face to face is waiting for you: computing power redefines productivity
![[database] knowledge and skills at the end of the term ----- Chapter 9 database design](/img/8d/90ccb1eac114706d27fccc1250b58c.png)
[database] knowledge and skills at the end of the term ----- Chapter 9 database design
随机推荐
Introduction au cadre Maui 05 compréhension du modèle de données mvvm
PAC Decade: witness HPC from CPU era to XPU Era
Build a portrait matting server based on openvino model server
[wechat applet] super easy to understand conditional rendering and list rendering
Intel experts share: how to program efficiently on XPU architecture? Zhiqiang Research Institute
Openresty as a static resource server
结构体通过成员变量获取主结构体地址(struct)
笔记本电脑插入耳机仍然外放(亲测有效)
C# 字符串(string)常用方法
B+树存储过程、触发器、Substring和substr的区别及Truncate和Delete的区别
surging作者出具压测结果
Heartless sword Chinese English bilingual poem 005 Lyric
小程序毕设作品之微信电子书阅读小程序毕业设计(3)后台功能
CAD视频课程推荐 b站
The adaptation of go language under windows10:vscode
64. Minimum path sum: given an M x n grid containing non negative integers, please find a path from the upper left corner to the lower right corner, so that the sum of the numbers on the path is the m
JS array processing [slice implements the deletion, insertion and replacement of arrays]
T+0变T+1!快赎金额降至1万!又有银行调整现金理财产品申赎规则
安全第三天iptables防止nmap扫描以及binlog
OSPF basic optimization