SM2 Algorithm Overview

 2021SC@SDUSC

SM2 Algorithm Overview

SM2 elliptic curve public key cryptography algorithm is a public key cryptography algorithm independently designed by my country, including SM2-1 elliptic curve digital signature algorithm, SM2-2 elliptic curve key exchange protocol, SM2-3 elliptic curve public key encryption algorithm, respectively used for Realize functions such as digital signature key negotiation and data encryption.

The SM2 standard includes four parts: General Principles, Digital Signature Algorithm, Key Exchange Protocol, and Public Key Encryption Algorithm, and the appendix of each part details the relevant details and examples of implementation. The SM2 algorithm mainly considers the elliptic curves on the prime fields Fp and F2m, and introduces the representation and operation of these two types of fields, as well as the representation and operation of the points on the elliptic curves on the fields, and the calculation algorithm for multiple points. Then it introduces data conversion in programming language, including data conversion rules between integer and byte string, byte string and bit string, field element and bit string, field element and integer, point and byte string.

The generation and verification of the parameters of the elliptic curve on the finite field are explained in detail. The parameters of the elliptic curve include the selection of the finite field, the parameters of the elliptic curve equation, the selection of the base point of the elliptic curve group, etc., and the selection standard is given for verification. Finally, for the generation of the key pair on the elliptic curve and the verification of the public key, the user’s key pair is (s, sP), where s is the user’s private key, and sP is the user’s public key. Due to the discrete logarithm problem, from sP It is difficult to get s, and the details of key pair generation and verification methods are given for prime fields and binary extended fields. The knowledge in the general principles also applies to the SM9 algorithm.

The comparison of national secret algorithms is shown in the figure below: (see watermark for source)

SM2 and RSA algorithm

Both the SM2 algorithm and the RSA algorithm are public-key cryptographic algorithms. The difference between the SM2 algorithm and the RSA algorithm is that the SM2 algorithm is based on the point group discrete logarithm problem on the elliptic curve. Compared with the RSA algorithm, the 256-bit SM2 password is stronger than the 2048-bit The RSA cipher strength should be high.

Comparison: (see watermark for source)

Security comparison:

Speed ​​comparison:

SM2 Mathematical Fundamentals of Algorithms

The main source of content is "Principles and Practice of Cryptography, Third Edition"

The plaintext x (that is, the initial state w0) becomes y after Nr rounds of encryption. Each round of encryption is completed by the round function g. The realization of g requires two input subkeys K and the end state of the previous round of encryption.

decryption process

My understanding is that the y in the above figure is actually the subkey K, and the input of this function is the subkey K and the intermediate state w.

 Injective function (Source: Injection_Baidu Encyclopedia )

 SPN (Substitution-Permutation Network) is a special class of iterative ciphers.

The input of the first round needs to XOR the initial state w0 and K1 first to obtain u1 and then enter the S box.

No permutation is applied in the last round, and Nr rounds of encryption are required, but K(Nr+1) subkeys are required.

Guess you like

Origin blog.csdn.net/vincy_yeha/article/details/120690341