Introduction to cryptography
According to records, in 400 BC, the ancient Greeks invented the substitution cipher. In 1881, the world's first telephone security patent appeared. During World War II, the German military used the "Enigma" cipher machine. Cryptography played a very important role in the war.
With the development of informatization and digital society, people's awareness of the importance of information security and confidentiality continues to increase, so in 1997, the American National Bureau of Standards announced the implementation
" American Data Encryption Standard (DES)", private forces have begun to fully intervene in the research and application of cryptography, and the encryption algorithms used include DES, RSA, SHA, etc. As the demand for encryption strength continues to increase, AES, ECC, etc. have recently appeared.
Using cryptography can achieve the following purposes:
Confidentiality: Preventing user identification or data from being read.
Data integrity: Prevent data from being changed.
Authentication: Ensure that data is sent from a specific party.
2. Introduction to encryption algorithms
Modern cryptography technology is divided into two categories according to different key types: symmetric encryption algorithms (secret key encryption) and asymmetric encryption algorithms (public key encryption) encryption).
Symmetric key encryption system uses the same secret key for encryption and decryption, and both communicating parties must obtain this key and keep the key secret.
The encryption key (public key) and decryption key (private key) used in the asymmetric key encryption system are different.
Symmetric encryption algorithm
Symmetric encryption algorithm is used to encrypt sensitive data and other information. Commonly used algorithms include:
DES (Data Encryption Standard): Data Encryption standard, faster, suitable for situations where large amounts of data are encrypted.
3DES (Triple DES): Based on DES, a piece of data is encrypted three times with three different keys, which is stronger.
AES (Advanced Encryption Standard): Advanced Encryption Standard, a next-generation encryption algorithm standard with fast speed and high security level;
AES
2000 In October, NIST (National Institute of Standards and Technology) announced the adoption of a new key encryption standard selected from 15 candidate algorithms.
Rijndael was selected to become the future AES. Rijndael was created in the second half of 1999 by researchers Joan Daemen and Vincent
Rijmen. AES is increasingly becoming the de facto standard for encrypting all forms of electronic data.
The National Institute of Standards and Technology (NIST) developed the new Advanced Encryption Standard (AES) specification on May 26, 2002.
Algorithm principle
The AES algorithm is based on permutation and permutation operations. Permutation is the rearrangement of data, and permutation is the replacement of one data unit with another. AES uses several different methods to perform permutation and permutation operations.
AES is an iterative, symmetric key-blocked cipher that can use 128-, 192-, and 256-bit keys and is encrypted with 128-bit (16
bytes) blocks and decrypt data. Unlike public key ciphers which use key pairs, symmetric key ciphers use the same key to encrypt and decrypt data. The number of bits in the encrypted data returned by the block cipher is the same as the input data
.
Iterative encryption uses a loop structure in which the input data is repeatedly permuted and replaced
Comparison of AES and 3DES
Algorithm name
Algorithm type
Key length
Speed
Decryption time (building machine tries 255 keys per second)
Resource consumption
AES
Symmetric block cipher
128, 192, 256 bits
High
149 trillion years
Low
3DES
Symmetric feistel cipher
112 or 168 bits
Low
4.6 billion years< /p>
中
Asymmetric algorithm
The common asymmetric encryption algorithms are as follows:
RSA: Invented by RSA Company, it is a variable-encryption algorithm that supports For long-key public key algorithms, the length of the file blocks that need to be encrypted is also variable;
DSA (Digital Signature Algorithm): Digital signature algorithm, a standard DSS (Digital Signature Algorithm) Signature standard);
ECC (Elliptic Curves Cryptography): elliptic curve cryptography.
ECC
In 1976, because symmetric encryption algorithms could no longer meet the needs, Diffie and Hellman published an article called "New Trends in Cryptozoology", which introduced public key encryption. The concept of RSA algorithm was proposed by Rivet, Shamir and Adelman.
With the advancement and improvement of the method of decomposing large integers, the improvement of computer speed and the development of computer networks, in order to ensure the security of data, the number of RSA keys needs to be continuously increased
However, the increase in key length has caused the encryption and decryption speed to be greatly reduced, and the hardware implementation has become more and more unbearable. This has brought a heavy burden to applications using RSA, so a new algorithm is needed. to
replace RSA.
In 1985, N. Koblitz and Miller proposed using elliptic curves for cryptographic algorithms, based on the discrete logarithm problem ECDLP in a point group on an elliptic curve in a finite field. ECDLP is a harder problem than the factorization problem, it is exponentially difficult.