Read the original
Encryption is everywhere in life. Let’s take a look at a few examples:
- Enter your user name and password to log in to the App on your phone.
- Enter the payment password of wechat and Alipay when buying vegetables at the wet market.
- Net bank transfers money, bank card takes cash when input password operation.
In order to consider the security of these operations will involve encryption, you can imagine the importance of encryption in real life. From this article, we will explain the most important encryption method in cryptography: RSA encryption. Before talking about RSA encryption, let’s take a look at cryptography, talk about the development history of cryptography and some common encryption algorithms, cryptography and some common encryption algorithms have a preliminary understanding.
The history of cryptography
As can be seen from the figure above, the development of cryptography is mainly divided into three stages: classical cryptography, modern cryptography and modern cryptography. Let’s introduce them one by one.
1. Classical cryptography
Cryptography before 1949 is collectively known as classical cryptography, classical cryptography mainly has three characteristics, respectively: hidden method, shift method and substitution method.
It was widely used in the forms of hidden poems, hidden poems, leaky poems and paintings in ancient China. For example, in the Water Margin, in order to get Lu Junyi to join the gang, the wise actors Wu Yong and Song Jiang came up with a story of Wu Yongzhi earning jade Kirin, which took advantage of Lu Junyi’s fear of escaping the disaster of blood, and composed four lines of the song of hexagrams:
In the west at the same time, people began to use checkerboard cipher, drum cipher and transposition cipher for encryption, to achieve the purpose of confusing the text. The famous Caesar cipher, in which one letter is replaced by another letter in a fixed position behind it, is a classic example of single-table substitution, but it can be cracked by repeated attempts at single-table simple frequency analysis.
In addition, before the advent of modern cryptography, in order to transmit a large amount of information, the encryption process of some encryption algorithms was too time-consuming, especially in war. Timeliness is important, and this is where crypto slang catches on. In the Pacific campaign, the U.S. army recruited a group of Navajos as communicators. Because the language is only spoken but not written, and the language has not been studied, even if the enemy obtained it, it would be difficult to decode it without the help of Navajo people. The Us army added some other encryption to this to convey military information, which worked surprisingly well, and ultimately helped the Us Marines capture Iwo Jima. The story can be read here 👉 sodium Waho password
​
2. Modern cryptography
Time comes to 1949, in this year, American mathematician, the founder of information theory Shannon published a paper called “Information Theory of Secret Systems”. This paper puts forward two design principles of confusion and diffusion. Since then, cryptography has become a science, and its representative encryption algorithms are DES and AES. Its principle is simply to group before encryption, and make full use of confusion and diffusion in the process of grouping, so that opponents can effectively predict plaintext or key according to the statistical characteristics of ciphertext.
3. Modern cryptography
Soon after, in 1976, Diffie Hermann published a paper called “New Directions in Cryptography,” in which he proposed the Diffie Hermann Key Exchange algorithm, which laid the foundation for modern cryptography and won the Turing Prize in 2015. Its core is one-way trap door function, which is easy to calculate, but difficult to reverse. People design asymmetric encryption algorithm by this idea. In simple terms, encryption and decryption can be separated by two associated keys, so that decryption can be completed without directly passing the key. And “easy to calculate, difficult to reverse” can just take advantage of the three difficult problems in mathematics:
Prime factorization
2. Discrete logarithm problem
Elliptic curve class
Among them, the most classic public key encryption algorithm is RSA algorithm constructed by Rivest, Shamir and Adleman with number theory method in 1978 (the core problem is prime factorization). It is the most mature and perfect public key cryptosystem in theory so far, and has been widely used. It is also the encryption algorithm that this series of articles will focus on.
Three stages of the development of cryptography. From the most primitive, formed by replacing method based on hidden and shift of the art of all kinds of encryption, to later with confusion and diffusion for the principle of encryption science, to the general mathematical problems as the core of modern asymmetric encryption, visible in the process of development of cryptography, encryption and decode always take place in a fierce game, which gave rise to the more secure encrypted form was born.
The above brief introduction to the development history of cryptography, there are two concepts we focus on, that is symmetric encryption and asymmetric encryption.
Symmetric and asymmetric encryption
- Symmetric encryption
Before 1976, all encryption methods were based on the same pattern:
- The sender selects an encryption rule to encrypt the message.
- The recipient decrypts the message using the same rules.
Disadvantages: As shown above, Party A must tell Party B the encryption rules, otherwise it can not be decrypted. Save and transmit the key, become the most headache problem.
- Asymmetric encryption
Encryption and decryption process:
- The receiver first creates two keys, a public key and a private key, and passes the public key to the sender.
- Send Encrypts the information after obtaining the public key and sends the encrypted information to the receiver.
- After receiving the information, the receiver decrypts the information with the private key generated by itself to obtain the original information.
Asymmetric encryption cleverly uses two keys to avoid the problem of keys being leaked during transmission. Asymmetric encryption has been popular since 1976, and here’s a look at some of the encryption algorithms commonly used on the Internet today.
Common Encryption Algorithms
- Hash algorithm
First of all, we’ll look at hash algorithm, use more of them are MD5 and SHA – 1, generated from the MD5 hash function, it is the typical application of information based on a piece of information, in order to prevent the been tampered with, thus it can be used to check the file integrity, and generate a digital signature, can be seen from the chart, MD5 no SHA – 1 high safety, But encryption is faster.
In addition, the results generated by MD5 and SHA-1 algorithms are generally irreversible (which can be cracked by collision method). Strictly speaking, MD5 is not an encryption algorithm but a digest algorithm.
- Symmetric encryption
Through the above we know that symmetric encryption is the product of modern cryptography, but DES, AES encryption algorithm is still widely used. 3DES is a symmetric algorithm based on DES. It encrypts a piece of data using three different keys for three times. However, the encryption intensity is higher, but higher resource consumption is inevitable.
The AES algorithm, which is easier to implement on a variety of hardware and software, is the block encryption standard adopted by the US federal government. AES was invented to replace DES with better security, efficiency and flexibility. Symmetric encryption is hundreds or even thousands of times faster than asymmetric encryption, which is very friendly for encrypting large files, which is why asymmetric encryption is still widely used today.
- Asymmetric encryption
Finally is symmetric encryption algorithm, in addition to the RSA encryption algorithm, we know there is a called a * * * * ECC encryption algorithm, its characteristic is the key length is low, so the same length of key is higher than the RSA security, there is a lot of use during their currency, the principle is through the above mentioned three major mathematical problems of the elliptic curve problem, Asymmetric encryption algorithm has higher security than symmetric encryption algorithm. Taking THE RSA algorithm as an example, it is generally considered that a key length of 1024 bits is basically secure, while a key length of 2048 bits is extremely secure.
conclusion
No matter which era, cryptography is always accompanied by cracking and anti-cracking in the development process, and in this process, encryption is becoming more and more secure. We can see encryption evolving from an art to a science, from symmetric to asymmetric, but what about the next age of encryption?
In fact, there are many stories about encryption, welcome to speak your memory of the ancient and modern encryption story in the message area. Next we will introduce RSA encryption related knowledge, please look forward to!