当前位置：网站首页>Cryptanalysis: deep understanding of symmetric encryption and key agreement Technology
Cryptanalysis: deep understanding of symmetric encryption and key agreement Technology
20201207 10:58:28 【Jingdong Zhilian cloud developer】
The author is Jingdong Zhilian cloud  Platform security group Zhang Jingshen
password , It has become the most frequently used thing by the contemporary Internet people , It is quietly guarding our information security . But people have not paid enough attention to the password , So often there will be “123456” This weak code . You may find it funny , But this password has always been at the top of the most common password list , Yes _250 ten thousand People are using , More than... In terms of data disclosure 2300 ten thousand _ Time , Hackers can successfully crack in less than a second .
Fortunately, in our society , There's always a group of people working on cryptography , Protecting our information security 、 System security . Cryptography has a long history , Its primary purpose is to hide the meaning of information , It's not the existence of hidden information . Cryptography has also promoted computer science , Especially the technology used in computer and network security , Such as access control and confidentiality of information . Cryptography has been applied in daily life ： Include _ ATM chip cards 、 Computer users access passwords 、 Electronic Commerce _ wait .
Cryptography is a vast subject , Numerous scholars and researchers who have been studying for decades can only make very small achievements . The following figure shows the author's understanding of cryptography framework , It is enough to show the breadth and profundity of this subject . This paper introduces and demonstrates a small part of cryptography .
▲ chart 1 A partial understanding of the disciplinary framework of cryptography ▲
One 、 Symmetric encryption algorithm
The theoretical basis of encryption is _ replace and transposition _. Substitution is mainly used to disturb , Use different bits 、 Character or grouping of characters to replace the original bit 、 A character or grouping of characters . Transposition is mainly used for diffusion , Don't replace the original text with different text , Instead, the original values are replaced , That is to rearrange the original bits 、 Characters or groups of characters to hide their original meaning .
Symmetric encryption is _ An encryption algorithm that uses the same key for encryption and decryption ._ It is characterized by high speed , Efficient , So it is widely used in the core of many encryption protocols , It is also a kind of encryption method that we usually contact more .
▲ chart 2 Symmetric encryption algorithm encryption and decryption process ▲
Common symmetric encryption algorithms
The common symmetric encryption algorithms are as follows ：
_ Data encryption standard （DES,Data Encryption Standard）,_ Use 64 A key , among 56 Bits are used for encryption ,8 Bits are used for parity . Because of the weak encryption strength , It is not recommended to use ;
_ triple DES, yes DES Upgraded version ._3DES It's not used directly “ encryption > encryption > encryption ” The way , Instead, it adopted “ encryption > Decrypt > encryption ” The way . The main benefits of this realization are , When all three keys are the same , The first two steps of encryption and decryption results offset each other , The overall result is equivalent to only one encryption , Therefore, it can be realized that DES Compatibility of encryption algorithms . That's why triple DES It can be popular , And double DES Or quadruple DES It's gone ;
_ Advanced encryption standard （AES,Advanced Encryption Standard）,_AES Support 128、192 and 256 A key , More in 3DES Faster 、 safer ;
International data encryption algorithm （IDEA,International Data Encryption Algorithm）, The key length used is 128 position ;
_Blowfish Algorithm ,_ The key length is 32448 position .
Two 、 Key distribution
1, Common key distribution methods
Symmetric encryption requires both parties to negotiate and distribute the key before encrypted communication , Generally speaking, key distribution can be in the following ways ：
Alice Select a key and pass it to Bob;
The third party Cindy Select the key and pass it to Alice and Bob;
If Alice and Bob A key has been used before , Then one party can encrypt the new key with the old key and send it to the other party ;
If Alice and Bob With a third party Cindy There is an encrypted connection between , be Cindy The key can be sent to Alice and Bob.
2, More convenient key distribution
Affected by the characteristics of symmetric encryption algorithm itself , When multiple users communicate with each other using symmetric encryption algorithm , The number of keys increases exponentially , It is a great challenge for key distribution and management . When the number of users is n, The maximum number of keys is n*(n1)/2. Such as the 100 Users , At the most 4950 Key .
With the development of technology , There are also some new solutions to symmetric key distribution , Such as asymmetric encryption algorithm ,Diffie–Hellman Algorithm etc. . This kind of algorithm makes the negotiation and management of symmetric encryption key easier and more reliable . When using asymmetric encryption n Users only need to maintain n Key pair , Greatly reduces the key size .
DiffieHellman Algorithm （ abbreviation DH Algorithm ） yes Whitefield Diffie and Martin Hellman stay 1976 A secret key exchange algorithm published in . It's a way to create a secret key , Not encryption . Based on this secret key exchange technology ：_ Both sides of the communication have no prior information from each other , A key can be negotiated over an insecure channel ._ This key is generally used as a symmetric encryption key to encrypt subsequent data transmission between both parties .
It's the same as the theory of asymmetric encryption ,DH The algorithm is also based on a mathematical problem , The difficulty of computing discrete logarithms . say concretely , hypothesis Alice Need and Bob Need to negotiate a secret key , It's a process like this ：
▲ chart 3 DH Algorithm key agreement process ▲
3, utilize DIFFIEHELLMAN Algorithm negotiation key instance
Calculated ,Alice And Bob The key of this negotiation is 36.
The original method of root calculation python The implementation is shown in the figure below ：
▲ chart 4 The original method of root calculation python Realization ▲
3、 ... and 、 At the end
about DH Algorithm , Although both parties have no prior information , Key agreement can be done , But the key agreement process also has the risk of man in the middle attack .
Security in modern cryptography is based on the confidentiality of the key , Instead of the secrecy of classical cryptography algorithms . For most ordinary users or organizations , Instead of trying to develop your own encryption algorithm , Using mature algorithms directly , It's more reasonable to focus on key preservation .
Recommended reading ：

11.11 TECHTALK  The indepth security defense system behind Jingdong's 100 billion orders

Major events in front of cyber attacks , Jingdong Zhilian cloud's attack and defense way

Automatic analysis of professional sandbox and malicious samples
Welcome to click 【 Jingdong Zhilian cloud 】, Learn about the developer community
More wonderful technology practice and exclusive dry goods analysis
Welcome to your attention 【 Jingdong Zhilian cloud Developer 】 official account
版权声明
本文为[Jingdong Zhilian cloud developer]所创，转载请带上原文链接，感谢
https://chowdera.com/2020/12/20201207105541970s.html
边栏推荐
 C++ 数字、string和char*的转换
 C++学习——centos7上部署C++开发环境
 C++学习——一步步学会写Makefile
 C++学习——临时对象的产生与优化
 C++学习——对象的引用的用法
 C++编程经验（6）：使用C++风格的类型转换
 Won the CKA + CKS certificate with the highest gold content in kubernetes in 31 days!
 C + + number, string and char * conversion
 C + + Learning  capacity() and resize() in C + +
 C + + Learning  about code performance optimization
猜你喜欢

C + + programming experience (6): using C + + style type conversion

Latest party and government work report ppt  Park ppt

在线身份证号码提取生日工具

Online ID number extraction birthday tool

️野指针？悬空指针？️ 一文带你搞懂！

Field pointer? Dangling pointer? This article will help you understand!

HCNA Routing＆Switching之GVRP

GVRP of hcna Routing & Switching

Seq2Seq实现闲聊机器人

【闲聊机器人】seq2seq模型的原理
随机推荐
 LeetCode 91. 解码方法
 Seq2seq implements chat robot
 [chat robot] principle of seq2seq model
 Leetcode 91. Decoding method
 HCNA Routing＆Switching之GVRP
 GVRP of hcna Routing & Switching
 HDU7016 Random Walk 2
 [Code+＃1]Yazid 的新生舞会
 CF1548C The Three Little Pigs
 HDU7033 Typing Contest
 HDU7016 Random Walk 2
 [code + 1] Yazid's freshman ball
 CF1548C The Three Little Pigs
 HDU7033 Typing Contest
 Qt Creator 自动补齐变慢的解决
 HALCON 20.11：如何处理标定助手品质问题
 HALCON 20.11：标定助手使用注意事项
 Solution of QT creator's automatic replenishment slowing down
 Halcon 20.11: how to deal with the quality problem of calibration assistant
 Halcon 20.11: precautions for use of calibration assistant
 “十大科学技术问题”揭晓！青年科学家50²论坛
 "Top ten scientific and technological issues" announced Young scientists 50 ² forum
 求反转链表
 Reverse linked list
 js的数据类型
 JS data type
 记一次文件读写遇到的bug
 Remember the bug encountered in reading and writing a file
 单例模式
 Singleton mode
 在这个 N 多编程语言争霸的世界，C++ 究竟还有没有未来？
 In this world of N programming languages, is there a future for C + +?
 es6模板字符
 js Promise
 js 数组方法 回顾
 ES6 template characters
 js Promise
 JS array method review
 【Golang】️走进 Go 语言️ 第一课 Hello World
 [golang] go into go language lesson 1 Hello World