当前位置:网站首页>Quickly understand the commonly used message summarization algorithms, and no longer have to worry about the thorough inquiry of the interviewer
Quickly understand the commonly used message summarization algorithms, and no longer have to worry about the thorough inquiry of the interviewer
2022-06-24 13:13:00 【51CTO】
interviewer : Tell me about your common encryption algorithms ?
Encryption algorithms are usually divided into two types : Symmetric encryption and Asymmetric encryption . among , Symmetric encryption algorithm uses the same key for encryption and decryption ; Asymmetric encryption algorithm uses different keys for encryption and decryption , It is divided into public key and private key . Besides , There is also a class called Message digest algorithm , It is an irreversible algorithm for summarizing data .
This time, let's look at the message digest algorithm .
Message digest algorithm
The message digest algorithm is an algorithm that combines inputs of any length to produce pseudo-random results of fixed length . In information security , There are many important applications , Message digest algorithm is used to realize , E.g. digital signature 、 Message authentication code .
For any given data , Message digest algorithms can easily calculate the digest results . It is difficult to get a known summary result , To calculate the original data . Without changing the summary results , It is not feasible to modify the data content . For two different data , There is only a very low probability that the same summary results will be produced .
The common symmetric encryption algorithms are :MD5 Algorithm 、SHA.
MD5 Algorithm
MD5 Algorithm (Message Digest 5) It's a cryptographic hash function , Produce a 128 Hash value of bits , You can use a length of 32 The hexadecimal string of represents .
MD5 The algorithm was developed by American cryptologists Ronald Linn Rivest( This big guy invented RSA Algorithm R) The design of the , On 1992 Open in , To replace the previous MD4 Algorithm ( And before that MD3 Algorithm 、MD2 Algorithm ).
MD5 The algorithm divides the original data into groups 512 Bit size , Then each group is divided into 16 individual 32 Group the seats , And then with the pre-defined 4 A magic number performs a series of bit operations , Finally, I got four 32 A group of , Put these four 32 After the concatenation of bit groups, a 128 Bit hash value .
We use it Java Write an example :
The operation results are as follows :
2004 year ,MD5 The algorithm proved unable to prevent collision attack , So it doesn't apply to security certification .
2009 year , Xie Tao and Feng Dengguo of the Chinese Academy of Sciences only used The complexity of the collision algorithm , It's broken MD5 Collision resistance of , This attack only takes a few seconds to run on a normal computer .
2011 year ,IETF(Internet Engineering Task Force, Internet Engineering Task Force ) Release RFC 6151, prohibit MD5 Used as key hash message authentication code .
All in all ,MD5 It's no longer safe , Don't use it any more .
SHA
SHA(Secure Hash Algorithm, Secure hash algorithm ) Is a family of cryptographic hash functions , yes FIPS(Federal Information Processing Standards, Federal Information Processing Standards ) Authenticated secure hash algorithm .
SHA The family contains a set of algorithms that have evolved over time , Yes 1993 Published in SHA-0、1995 Published in SHA-1、2001 Published in SHA-2、2015 Published in SHA-3.

Due to MD5 A successful solution , And right SHA-0 and SHA-1 There is a theoretical solution to the problem , Therefore, it is recommended to use SHA-2, Or safer SHA-3.
We use it Java Write a SHA-2 Example :
The operation results are as follows :
JDK8 The following versions do not support SHA-3, So when you run the above code, there will be NoSuchAlgorithmException: SHA3-256 MessageDigest not available abnormal .
summary
The message digest algorithm is an algorithm that combines inputs of any length to produce pseudo-random results of fixed length . The common symmetric encryption algorithms are :MD5 Algorithm 、SHA.
MD5 The algorithm should not be used any more .SHA In the family , Recommended SHA-2, Or safer SHA-3.
边栏推荐
- Dingding, Feishu, and enterprise wechat: different business approaches
- nifi从入门到实战(保姆级教程)——环境篇
- Baidu simian: talk about persistence mechanism and rdb/aof application scenario analysis!
- Nifi from introduction to practice (nanny level tutorial) - environment
- 实现领域驱动设计 - 使用ABP框架 - 创建实体
- 短信服务sms
- LVGL库入门教程 - 颜色和图像
- 【概率论期末抱佛脚】概念+公式(不含参数估计)
- 一文讲透研发效能!您关心的问题都在
- “我这个白痴,招到了一堆只会“谷歌”的程序员!”
猜你喜欢

go Cobra命令行工具入门

openGauss内核:简单查询的执行

Use abp Zero builds a third-party login module (I): Principles

一文理解OpenStack网络

Creation and use of unified links in Huawei applinking

物联网?快来看 Arduino 上云啦

青藤入选工信部网安中心“2021年数字技术融合创新应用典型解决方案”

YOLOv6:又快又准的目标检测框架开源啦

Getting started with the go Cobra command line tool

Pycharm中使用Terminal激活conda服务(终极方法,铁定可以)
随机推荐
Babbitt | metauniverse daily must read: 618 scores have been announced. How much contribution has the digital collection made behind this satisfactory answer
钉钉、飞书、企业微信:迥异的商业门道
CVPR 2022 | 美團技術團隊精選論文解讀
Reset the password, and the automatic login of the website saved by chrome Google browser is lost. What is the underlying reason?
几种常见的DoS攻击
Engage in audio and video development? Several things I have to say about SRT live broadcast protocol
解析nc格式文件,GRB格式文件的依赖包edu.ucar.netcdfAll的api 学习
Implement Domain Driven Design - use ABP framework - create entities
Boss direct employment IPO: both the end and the beginning
Implement Domain Driven Design - use ABP framework - update operational entities
openGauss内核:简单查询的执行
Comparator 排序函数式接口
Parti,谷歌的自回归文生图模型
Leetcode 1218. 最长定差子序列
[database] final review (planning Edition)
【概率论期末抱佛脚】概念+公式(不含参数估计)
How long will it take to open a mobile account? Is online account opening safe?
初中级开发如何有效减少自身的工作量?
1. Snake game design
Several common DoS attacks