Main algorithm
des
The Data Encryption Standard (DES) is a symmetric key encryption block cipher algorithm, which was confirmed as the Federal Data Processing Standard (FIPS) by the National Bureau of Standards of the Federal Government of the United States in 1976, and then spread widely all over the world. It is based on a symmetric algorithm using a 56-bit key.
DES is not a secure encryption method now, mainly because the 56-bit key it uses is too short.
Please refer to the principle: encryption technology 0 1- symmetric encryption -DES principle.
3DES
Triple Data Encryption Algorithm (abbreviated as TDEA, Triple DEA), or triple DES, is a symmetric key encryption block cipher, which is equivalent to applying DES algorithm three times to each data block. Due to the enhancement of computer computing power, the original DES is easy to be violently cracked because of its low key length. 3DES aims to provide a relatively simple method, that is, to avoid similar attacks by increasing the key length of DES, instead of designing a brand-new block cipher algorithm.
Note: The key security of 3DES with three independent keys is 168 bits, but its effective security is only 1 12 bits due to an attack in the middle (knowing plaintext and ciphertext).
3DES adopts "key package", which contains three DES keys, K 1, K2 and K3, all of which are 56 bits (excluding parity bits).
Password = E k3 (D k2 (E k 1 (plaintext)))
Decryption is the opposite process:
Clear text = D k3 (E k2 (D k 1 (ciphertext)))
Auger electron spectroscopy
The full name of AES is advanced encryption standard. Its appearance is mainly to replace DES encryption algorithm, because the key length of DES algorithm is 56 bits, so the theoretical security strength of DES algorithm is 56 bits. So on 1997 10, the National Institute of Standards and Technology announced that it would collect advanced encryption standards to replace DES. AES has also been responded by many cryptographers all over the world, and many people have submitted their own algorithms. Finally, five candidate algorithms entered the final round: Rijndael, Serpent, Twofish, RC6 and MARS. In the end, Rijndael algorithm wins through strict steps such as security analysis and performance evaluation of hardware and software.
AES cipher and block cipher Rijndael are basically the same. The block size and key size of Rijndael can be 128 bits, 192 bits and 256 bits. AES only requires the packet length to be 128 bits, so only Rijndael with the packet length of 128 bits is called AES algorithm.
AES in this paper is Rijndael algorithm by default, and the packet length is 128 bits.
Please refer to the principle: encryption technology 02- symmetric encryption -AES principle.
algorithm comparison
Public key cryptography is an encryption and decryption technology using different keys, which is used to ensure the confidentiality of messages just like symmetric cryptography. One of the most widely used public key encryption algorithms is RAS. Compared with symmetric cryptography, public key cryptography is very slow, so it is usually used together with symmetric cryptography to form a hybrid cryptosystem. Public key cryptography can solve the problem of key exchange in symmetric cryptography, but there is a risk of being disguised by man-in-the-middle attacks, so it is necessary to authenticate public keys with digital signatures.
The concept of public key cryptography is put forward to solve the two most difficult problems in symmetric cryptography.
Application scenario
Several misunderstandings
Main algorithm
Diffie–Hellman key exchange
Diffie-Herman key exchange (English: Diffie-Hellman key exchange, abbreviated as D-H) is a security protocol. It allows both parties to create keys through insecure channels without any prior information from the other party. This key can be used as a symmetric key to encrypt communication content in subsequent communication. The concept of public key exchange was first put forward by Ralph C. Merkle, and this key exchange method was published by Bailey Whitfield Diffie and Martin Edward Hellman in 1976, which is also the first asymmetric scheme published in public literature.
The effectiveness of Diffie-Hellman algorithm is based on the difficulty of calculating discrete logarithm. Simply put, we can define discrete logarithm as follows. Firstly, the primitive heel of prime number p is defined. The primitive root of prime number p is an integer, and its power can produce all integers between 1 and p- 1, that is, if a is the primitive root of prime number p, then
A mod p, a 2mod p, ..., A p- 1 mod p are different, and they are all integers 1 to p- 1.
For any primitive A of integer B and prime P, we can find a unique exponent I, so
B ≡ a i (mod p) where 0
Where A, B and P are public and I is private, the difficulty of cracking is the difficulty of calculating I. ..
Elgar Marr
In 1985, T.Elgamal proposed a public key system based on discrete logarithm, which is closely related to Diffie-Hellman key distribution system. Elgamal cryptosystem is applied in some technical standards, such as digital signature standard (DSS) and S/MIME e-mail standard.
The basic principle is to exchange keys with Diffie-Hellman, assuming that the exchanged key is K, and then encrypt the message M to be sent with K. ..
Therefore, the security factor of Elgamal depends on Diffie-Hellman key exchange.
In addition, after Elgamal encryption, the length of message transmission will be doubled.
Republic of South Africa (Republic of South Africa)
The algorithm was proposed by Ron Livingstone, adi shamir and Leonard Aderman of MIT in 1977, and was first published in 1978. RSA is one of the earliest public key algorithms that meet the requirements, and it has been widely accepted and implemented as a general public key encryption method since its birth.
The validity of RSA algorithm is mainly based on the difficulty of factorization of large numbers.
Please refer to the principle: encryption technology 03- asymmetric encryption -RSA principle.
Eccentric wheel (short for eccentric)
Most products and standards that use public key cryptography for encryption and digital signature use RSA algorithm. We know that in order to ensure the security of RSA, the number of keys has been increasing in recent years, which is a heavy burden for applications that use RSA, especially for e-commerce that conducts a large number of secure transactions. Recently, a competitive elliptic curve cryptosystem (ECC) challenged RSA. In the process of standardization, such as the IEEE P 1363 standard on public key cryptography, people have also considered ECC.
Compared with RSA, the main attraction of ECC is that it can obtain the same security by using a much shorter key than RSA, so it can reduce the processing load.
ECC is much more complicated than RSA or Diffie-Hellman principle, so I won't go into details in this article.
algorithm comparison
Application of public key cryptosystem
Calculations for Cryptanalysis (NIST SP-800-57)
Note: L= size of public key, and N= size of private key.
Hash function is a technique to convert a long message into a short hash value to ensure message integrity. SHA- 1 has been widely used in hash algorithm, but it should not be used for new purposes, because some theoretically feasible attack methods against this algorithm have been found. The algorithms we should mainly use in the future include SHA-2, which has been widely used at present, and SHA-3, which has a new structure. Hash function can be used alone or as a component of message authentication, digital signature and pseudo-random number generator.
Main applications
Main algorithm
Message summary 5
MD5 Message-Digest Algorithm (English: MD5 Message-Digest Algorithm) is a widely used cryptographic hash function, which can generate a hash value of 128 bits (16 bytes, expressed as a 32-bit hexadecimal number) to ensure the integrity and consistency of information transmission. MD5 was designed by American cryptographer Ronald Linn Rivest and published in 1992 to replace MD4 algorithm. The program of this algorithm is standardized in RFC 132 1.
In 2009, Xie Tao and Feng Dengguo of Chinese Academy of Sciences cracked the anti-collision performance of MD5 with a collision algorithm complexity of 2 20.96. The attack only takes a few seconds to run on a common computer. In 20 1 1, RFC 6 15 1 prohibits MD5 from being used as an authentication code for key hash messages.
Please refer to the principle: encryption technology 04- hash algorithm -MD5 principle.
SHA- 1
SHA- 1 (English: Secure Hash Algorithm 1, Chinese name: Secure Hash Algorithm 1) is a cryptographic hash function, which was designed by the National Security Agency of the United States and published by the National Institute of Standards and Technology (NIST) as the Federal Data Processing Standard (FIPS). SHA- 1 can generate a hash value of 160 bits (20 bytes), which is called message digest, and the hash value is usually expressed as 40 hexadecimal numbers.
In 2005, cryptanalysts found an effective attack method on SHA- 1, which indicated that the algorithm might not be secure enough to continue using. Since 20 10, many organizations have suggested replacing SHA- 1 with SHA-2 or SHA-3. Microsoft, Google and Mozilla all announced that their browsers will stop accepting SSL certificates signed by SHA- 1 algorithm in 20 17.
20 17 On February 23rd, CWI Amsterdam and Google announced a successful SHA- 1 collision attack, and released two PDF files with different contents but the same SHA- 1 hash value as proof of concept.
In 2020, the selective prefix collision attack against SHA- 1 has been put into practical use. It is suggested that SHA-2 or SHA-3 should be used instead of SHA- 1.
Please refer to the principle: encryption technology 05- hash algorithm -SHA series principle.
SHA-2
SHA-2, whose name comes from the abbreviation of Secure Hash Algorithm 2 (English: Secure Hash Algorithm 2), is a cryptographic hash function algorithm standard, which was formulated by the National Security Agency of the United States and published by the National Institute of Standards and Technology (NIST) on 200 1. It belongs to one of SHA algorithms and is the successor algorithm of SHA- 1. It can be further divided into six different algorithm standards, including: SHA-224, SHA-256, SHA-384, SHA-5 12, SHA-5 12/224 and SHA-5 12/256.
The main idea of SHA-2 series algorithm is basically the same as SHA- 1.
Please refer to the principle: encryption technology 05- hash algorithm -SHA series principle.
Sha -3
SHA-3 third generation secure hash algorithm (Secure Hash Algorithm 3), formerly known as Keccak algorithm.
Keccak is an encryption hash algorithm, which was developed by Guido Bertoni, Joan Dumont, Micha? L Peeters, Gilles Van Assche designed on RadioGatún n.
20 12 10 year 10.2, Keccak was selected as the winner of the NIST hash function competition. SHA-2 has no obvious weakness at present. Because MD5, SHA-0 and SHA- 1 were successfully cracked, NIST felt that it needed an alternative cryptographic hash algorithm, namely SHA-3 now.
SHA-3 was officially published by NIST through FIPS 202 on August 5, 20 15.
Please refer to the principle: encryption technology 05- hash algorithm -SHA series principle.
algorithm comparison