An encryption and decryption method, authentication method, device, equipment and storage medium

By generating shared keys and session keys between encryption and decryption ends, and using backpack public keys and private keys for encryption and decryption, the problem that the existing hybrid cryptosystem cannot meet high security requirements is solved, and the efficiency of information transmission is improved. Security.

CN114095151BActive Publication Date: 2024-08-23MASHANG CONSUMER FINANCE CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202010758492.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-07-31
Publication Date
2024-08-23
Estimated Expiration
2040-07-31

AI Technical Summary

Technical Problem

The existing hybrid public cryptography system cannot meet the high security needs of users, and there is a risk of key theft due to improper key management.

Method used

An encryption and decryption method is used to generate the shared key and session key between the encryption end and the decryption end, and use the backpack public key and private key to perform data encryption and decryption, combined with random information to improve the security of the key.

Benefits of technology

It improves the security of information transmission, reduces the risk of key theft, and enhances the security of data protection.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114095151B
    Figure CN114095151B
Patent Text Reader

Abstract

The present invention discloses an encryption and decryption method, an authentication method, a device, an equipment and a storage medium, which relate to the field of information security technology, and improve the security of information. The method comprises: generating a first shared key between an encryption end and a decryption end; generating a first session key for data encryption according to the first shared key and random information corresponding to the current data encryption interaction with the decryption end; encrypting the current data using the backpack public key vector of the decryption end and the first session key to obtain the first encrypted information. The embodiments of the present invention can improve the security of information.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of information security technology, and in particular to an encryption and decryption method, an authentication method, a device, a equipment and a storage medium. Background Art

[0002] At present, the mode of data protection using encryption and decryption technology can be divided into two categories: symmetric encryption and asymmetric encryption technology. Symmetric encryption technology uses only one common key for encryption and decryption. The advantages are fast computing power and low resource consumption, but the disadvantage is that if the key is stolen, all transmitted data encryption and decryption will be cracked. The advantage of asymmetric encryption technology is that it uses cryptographic technology to generate two keys, the so-called public key and the private key. When the sender transmits data, the data will be encrypted with the public key disclosed by the receiver at the sending end. When the encrypted data is transmitted to the receiving end, the receiver uses his own private key to decrypt it. Although this method is safer than symmetric encryption, it may still be at risk of key theft due to improper key management of the receiver or sender. Therefore, combining the advantages of symmetric and asymmetric encryption technologies to develop a hybrid public cryptographic system has become a major direction in the field of cryptography.

[0003] Existing hybrid public cryptographic systems include backpack public key cryptographic systems, elliptic curve cryptographic systems (ECC), etc. However, the security of these systems cannot meet the high security requirements of users. Therefore, it is necessary to propose an encryption, decryption and authentication scheme to improve the security of information. Summary of the invention

[0004] The embodiments of the present invention provide an encryption and decryption method, an authentication method, an apparatus, a device and a storage medium to improve the security of information.

[0005] In a first aspect, an embodiment of the present invention provides an encryption method, which is applied to an encryption end, including:

[0006] Generate a first shared key between the encryption end and the decryption end;

[0007] Generate a first session key for current data encryption according to the first shared key and random information corresponding to the current data encryption interaction with the decryption end;

[0008] The current data is encrypted using the backpack public key vector of the decryption end and the first session key to obtain first encrypted information.

[0009] In a second aspect, an embodiment of the present invention provides a decryption method, which is applied to a decryption end, comprising:

[0010] generating a second shared key between the decryption end and the encryption end;

[0011] Generate a second session key for current data encryption according to the second shared key and the random information corresponding to the current data encryption interaction of the encryption end;

[0012] Get the encryption information of this data;

[0013] The encrypted information is decrypted using the second session key and the backpack private key vector of the decryption end.

[0014] In a third aspect, an embodiment of the present invention provides an encryption and decryption method, including:

[0015] The encryption end generates a first shared key with the decryption end, and the decryption end generates a second shared key with the encryption end;

[0016] The encryption end generates a first session key for current data encryption according to the first shared key and the random information corresponding to the current data encryption interaction between the decryption end and the encryption end; the decryption end generates a second session key for current data encryption according to the second shared key and the random information corresponding to the current data encryption interaction between the encryption end and the encryption end;

[0017] The encryption end encrypts the current data using the backpack public key vector of the decryption end and the first session key to obtain first encrypted information;

[0018] The decryption end obtains the first encrypted information;

[0019] The decryption end root decrypts the first encrypted information using the second session key and the backpack private key vector of the decryption end to obtain the current data.

[0020] In a fourth aspect, an embodiment of the present invention provides an authentication method, which is applied to an authentication center, including:

[0021] Receive the client's authentication request;

[0022] Generate a backpack public key vector using a backpack algorithm according to the authentication request;

[0023] Sending the backpack public key vector to the client;

[0024] Receiving a backpack value sent by the client, wherein the backpack value is calculated by the client using the backpack public key vector;

[0025] The client is authenticated according to the backpack value.

[0026] In a fifth aspect, an embodiment of the present invention provides an encryption device, applied to an encryption end, comprising:

[0027] A first generating module, used to generate a first shared key between the encryption end and the decryption end;

[0028] A second generating module, configured to generate a first session key for current data encryption according to the first shared key and random information corresponding to the current data encryption interaction with the decryption end;

[0029] The first acquisition module is used to encrypt the current data using the backpack public key vector of the decryption end and the first session key to obtain first encrypted information.

[0030] In a sixth aspect, an embodiment of the present invention provides a decryption device, applied to a decryption terminal, comprising:

[0031] A first generating module, used to generate a second shared key between the decryption end and the encryption end;

[0032] A second generating module, configured to generate a second session key for current data encryption according to the second shared key and random information corresponding to the current data encryption interaction of the encryption end;

[0033] The first acquisition module is used to obtain the encryption information of this data;

[0034] The first decryption module is used to decrypt the encrypted information by using the second session key and the backpack private key vector of the decryption end.

[0035] In a seventh aspect, an embodiment of the present invention provides an authentication device, applied to an authentication center, including:

[0036] A first receiving module, used to receive an authentication request from a client;

[0037] A first generating module, configured to generate a backpack public key vector using a backpack algorithm according to the authentication request;

[0038] A first sending module, configured to send the backpack public key vector to the client;

[0039] A second receiving module is used to receive a backpack value sent by the client, wherein the backpack value is calculated by the client using the backpack public key vector;

[0040] The first authentication module is used to authenticate the client according to the backpack value.

[0041] In an eighth aspect, an embodiment of the present invention further provides an electronic device, comprising: a memory, a processor, and a program stored in the memory and executable on the processor, wherein when the processor executes the program, the steps in any one of the methods described in the first to fourth aspects above are implemented.

[0042] In a ninth aspect, an embodiment of the present invention further provides a readable storage medium, on which a program is stored, and when the program is executed by a processor, the steps in any one of the methods described in the first to fourth aspects above are implemented.

[0043] In the embodiment of the present invention, the encryption end generates a first shared key, and generates a first session key for data encryption based on the first shared key and the random information corresponding to the data encryption interaction with the decryption end. After that, the data is encrypted using the backpack public key vector of the decryption end and the first session key to obtain the first encrypted information. Since the backpack public key vector of the decryption end is obtained by the authentication center using the backpack algorithm and sent to the decryption end, and the session key is obtained based on the first shared key and the random information corresponding to the data encryption interaction with the decryption end, the session key obtained using the embodiment of the present invention is more secure, thereby improving the security of information transmission. BRIEF DESCRIPTION OF THE DRAWINGS

[0044] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings required for use in the description of the embodiments of the present invention will be briefly introduced below. Obviously, the accompanying drawings in the following description are only some embodiments of the present invention. For ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without paying creative labor.

[0045] Figure 1 is a flow chart of an encryption method provided by an embodiment of the present invention;

[0046] Figure 2 is a flow chart of a decryption method provided by an embodiment of the present invention;

[0047] Figure 3 is a flow chart of an encryption and decryption method provided by an embodiment of the present invention;

[0048] Figure 4 is a flow chart of an authentication method provided by an embodiment of the present invention;

[0049] Figure 5 is a schematic diagram of interaction between a client and an authentication center provided by an embodiment of the present invention;

[0050] Figure 6 This is one of the schematic diagrams of interaction between client A and client B provided in an embodiment of the present invention;

[0051] Figure 7 This is the second schematic diagram of interaction between client A and client B provided in an embodiment of the present invention;

[0052] Figure 8 is a structural diagram of an encryption device provided by an embodiment of the present invention;

[0053] Fig. 9 is a structural diagram of a decryption device provided by an embodiment of the present invention;

[0054] Fig.10 is a structural diagram of an encryption and decryption device provided by an embodiment of the present invention;

[0055] Fig.11 It is a structural diagram of an authentication device provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0056] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0057] See also Figure 1 , Figure 1 is a flow chart of an encryption method provided by an embodiment of the present invention, which is applied to an encryption end, such as Figure 1 As shown, the following steps are included:

[0058] Step 101: Generate a first shared key between an encryption end and a decryption end.

[0059] In the embodiment of the present invention, the encryption end may obtain the public key of the decryption end, and then generate the first shared key according to the private key of the encryption end and the obtained public key of the decryption end.

[0060] Specifically, K AB =sK A ×S B ;

[0061] Among them, K AB represents the first shared key, sK A represents the private key of the encryption end, S B Represents the public key of the decryption end.

[0062] Optionally, in order to further improve security, before generating the shared key, the encryption end and the decryption end may also perform mutual authentication. If the mutual authentication is successful, step 101 is executed.

[0063] Specifically, the encryption end performs a first verification on the decryption end according to the obtained backpack value of the decryption end, the public key of the decryption end, the public key of the authentication center and the verification public key of the decryption end. If the first verification of the decryption end passes, a first shared key between the encryption end and the decryption end is generated.

[0064] During the verification process, the encryption end generates a first key based on the backpack value of the decryption end, the public key of the authentication center, and the verification public key of the decryption end. Then, the first key is compared with the public key of the decryption end. If the first key is consistent with the public key of the decryption end, it means that the verification of the decryption end is passed, otherwise it fails.

[0065] The encryption end generates a first key according to the backpack value of the decryption end, the public key of the authentication center, and the verification public key of the decryption end according to the following formula:

[0066]

[0067] Where S′ represents the first key, PK B represents the verification public key of the decryption end, Represents the backpack value of the decryption end, PK CA represents the public key of the authentication center; G represents the base point of the elliptic curve; q ax 1 The horizontal axis represents the verification public key of the decryption end, and h() represents the hash function.

[0068] Step 102: Generate a first session key for current data encryption based on the first shared key and random information corresponding to the current data encryption interaction with the decryption end.

[0069] Specifically, in this step, the encryption end generates the first session key according to the first random number of the encryption end and the first shared key. The first session key is used to encrypt information when communicating with the decryption end. In this way, it can be seen that since the generation of the first session key uses a random number, the solution of the embodiment of the present invention can further improve the security of the transmitted information.

[0070] Among them, the encryption end obtains the first random number of the encryption end according to the intermediate random number of the decryption end, the timestamp random number of the encryption end, the first shared key, the timestamp random number of the decryption end and the base point corresponding to the timestamp random number of the decryption end.

[0071] Specifically, the first random number is obtained in the following manner:

[0072] W A =t A T B

[0073] T B =R B -K AB

[0074] R B =K AB +T B

[0075] T B =t B P′

[0076] Among them, W A represents the first random number, t A Indicates the random number of the encryption end timestamp, t B represents the timestamp random number of the decryption end, P′ represents the base point corresponding to the timestamp random number of the decryption end, K AB represents the first shared key, R B Indicates the intermediate random number on the decryption side.

[0077] To improve security, in the embodiment of the present invention, before step 102, the method further includes:

[0078] The encryption end verifies whether the first hash operation value matches the second hash operation value (e.g., whether they are equal), wherein the first hash operation value is calculated by the decryption end and transmitted to the encryption end; the second hash operation value is calculated by the encryption end itself. If the first hash operation value matches the second hash operation value, a first session key for this data encryption is generated.

[0079] The random information includes a first random number of the encryption end. After obtaining the first random number, the second hash operation value is obtained according to the first random number of the encryption end, the backpack value of the encryption end, and the backpack value of the decryption end. For example, the first random number of the encryption end, the backpack value of the encryption end, and the backpack value of the decryption end may be hashed to obtain the second hash operation value.

[0080] The second hash value may be calculated as follows:

[0081]

[0082] Wherein, Auth(2) represents the second hash operation value, is the backpack value of the encryption end, Represents the backpack value of the decryption end, W A represents the first random number, and h() represents the hash function.

[0083] To facilitate the decryption end to verify the encryption, before the encryption end verifies whether the first hash operation value matches the second hash operation value, the method may also include: obtaining the intermediate random number of the encryption end based on the timestamp random number of the encryption end, the base point corresponding to the timestamp random number of the encryption end and the first shared key, and then sending the intermediate random number to the decryption end, and the intermediate random number is used by the decryption end to calculate the first hash operation value.

[0084] The intermediate random number can be calculated as follows:

[0085] T A =t A P

[0086] R A =K AB +T A

[0087] Among them, R A Represents the intermediate random number, K AB represents the first shared key, t A represents the random timestamp number of the encryption end, and P represents the base point corresponding to the random timestamp number of the encryption end.

[0088] Optionally, after generating the first session key, the method may further include: generating a third hash operation value according to the backpack value of the encryption end, the backpack value of the decryption end, and the first session key, and sending the third hash operation value to the decryption end. For example, the backpack value of the encryption end, the backpack value of the decryption end, and the first session key may be hashed to obtain the third hash operation value.

[0089] The third hash value may be calculated as follows:

[0090]

[0091] G AB =W A +K AB

[0092] Wherein, Auth(3) represents the third hash operation value, is the backpack value of the encryption end, Represents the backpack value of the decryption end, G AB represents the first session key, h() represents the hash function, K AB represents the first shared key of the encryption end, W A Represents the first random number.

[0093] Step 103: Encrypt the current data using the backpack public key vector of the decryption end and the first session key to obtain first encrypted information.

[0094] The backpack public key vector of the decryption end is obtained by the authentication center using a backpack algorithm and sent to the decryption end.

[0095] During the encryption process, the current data is encrypted using the backpack public key vector of the decryption end to obtain an information encryption backpack value, and then the information encryption backpack value is encrypted using the first session key to obtain the first encrypted information.

[0096] In the embodiment of the present invention, the encryption end generates a first shared key, and generates a first session key for data encryption based on the first shared key and the random information corresponding to the data encryption interaction with the decryption end. After that, the data is encrypted using the backpack public key vector of the decryption end and the first session key to obtain the first encrypted information. Since the backpack public key vector of the decryption end is obtained by the authentication center using the backpack algorithm and sent to the decryption end, and the session key is obtained based on the first shared key and the random information corresponding to the data encryption interaction with the decryption end, the session key obtained using the embodiment of the present invention is more secure, thereby improving the security of information transmission.

[0097] In addition, before executing the embodiment of the present invention, the encryption end may also perform authentication and registration with the authentication center.

[0098] Specifically, the encryption end obtains the backpack public key vector and the public key of the authentication center from the authentication center. Then, the backpack value of the encryption end is obtained by using the backpack public key vector of the authentication center, the identity information of the encryption end and the device identifier of the encryption end. Among them, the identity information may include name, ID number, telephone number, etc. Then, the backpack value of the encryption end is used to generate the signature file of the encryption end. Finally, the backpack value of the encryption end and the signature file are sent to the authentication center.

[0099] In practical applications, the encryption end may obtain the backpack value of the encryption end by using the backpack public key vector of the authentication center, the identity information of the encryption end, and the device identifier of the encryption end according to the following formula, including:

[0100]

[0101] in, represents the backpack value of the encryption end, is the backpack public key vector of the authentication center, ID A Indicates the identity information of the encryption end, IDA ={id A ‖UID A}, id A Indicates the identity authentication information of the encryption end, UID A The device identifier of the encryption end, (ID A )2=m1,m2…m n ,m i ∈{0,1},(ID A )2 is the identity information ID A The binary n-ary form of .

[0102] Specifically, the encryption end generates the signature file of the encryption end by using the backpack value of the encryption end through the following formula, including:

[0103]

[0104]

[0105] Among them, V A Indicates the signature file of the encryption end, j a Represents a random number, represents the backpack value of the encryption end, G represents the elliptic curve base point, and h() represents the hash function.

[0106] In the embodiment of the present invention, in order to further improve security, the encryption end may also obtain the verification public key of the encryption end and the signature of the encryption end from the authentication center. Then, according to the signature of the encryption end and the backpack value of the encryption end, the private key of the encryption end is generated. Then, the verification public key of the encryption end is verified using the private key of the encryption end.

[0107] Specifically, the private key of the encryption end is generated by using the signature of the encryption end and the backpack value of the encryption end through the following formula, including:

[0108]

[0109] Among them, SK A represents the private key of the encryption end, W A Indicates the signature of the encryption end, j a Represents a random number, represents the backpack value of the encryption end, and h() represents a hash function.

[0110] In the process of verifying the public key of the certification center, the authentication is carried out as follows:

[0111] (1) obtaining a first value by using the private key of the encryption end and the elliptic curve base point obtained from the authentication center;

[0112] The first value is obtained by the following formula:

[0113] S p =SK A ·G

[0114] Among them, S p represents the first value, SK A represents the private key of the encryption end, and G represents the elliptic curve base point.

[0115] (2) Obtain a second value using the verification public key of the encryption end, the backpack value of the encryption end, the vertical coordinate of the verification public key of the encryption end, and the public key of the authentication center.

[0116] The second value is obtained by the following formula:

[0117]

[0118] Wherein, Sq represents the second value, PK A represents the verification public key of the encryption end, G represents the base point of the elliptic curve, q ay represents the ordinate of the authentication public key of the encryption end, represents the backpack value of the encryption end, h() represents the hash function, PK CA Represents the public key of the certification authority.

[0119] (3) Matching the first value and the second value.

[0120] (4) When the first value and the second value match, the verification of the verification public key of the encryption end is successful.

[0121] In the embodiment of the present invention, the encryption end generates a first shared key, and generates a first session key for data encryption based on the first shared key and the random information corresponding to the data encryption interaction with the decryption end. After that, the data is encrypted using the backpack public key vector of the decryption end and the first session key to obtain the first encrypted information. Since the backpack public key vector of the decryption end is obtained by the authentication center using the backpack algorithm and sent to the decryption end, and the session key is obtained based on the first shared key and the random information corresponding to the data encryption interaction with the decryption end, the session key obtained using the embodiment of the present invention is more secure, thereby improving the security of information transmission.

[0122] See also Figure 2 , Figure 2 is a flowchart of a decryption method provided by an embodiment of the present invention, which is applied to a decryption end, such as Figure 2 As shown, the following steps are included:

[0123] Step 201: Generate a second shared key between the decryption end and the encryption end.

[0124] In this step, the second shared key is generated according to the acquired public key of the encryption end and the private key of the decryption end.

[0125] Specifically, the second shared key is calculated using the following formula:

[0126] K AB ′=sK B ×S A

[0127] Among them, K AB ′ represents the second shared key, sK B represents the private key of the decryption end, S A Represents the public key of the encryption end.

[0128] Optionally, to further improve security, the encryption end and the decryption end may also be authenticated before step 201. After mutual authentication is passed, a shared key between the encryption end and the encryption end is generated.

[0129] Specifically, the decryption end performs a second verification on the encryption end according to the obtained backpack value of the encryption end, the public key of the encryption end, the public key of the authentication center, and the verification public key of the encryption end. If the second verification of the encryption end passes, a second shared key between the decryption end and the encryption end is generated.

[0130] During the verification process, the decryption end generates a second key based on the backpack value of the encryption end, the public key of the authentication center, and the verification public key of the encryption end. After that, the second key is compared with the public key of the encryption end. If the second key is consistent with the public key of the encryption end, it means that the verification of the encryption end is passed.

[0131] Specifically, the decryption end may generate the second key according to the backpack value of the encryption end, the public key of the authentication center, and the verification public key of the encryption end according to the following formula:

[0132]

[0133] Where S″ represents the second key, PK A represents the verification public key of the encryption end, Represents the backpack value of the encryption end, PK CA represents the public key of the authentication center; G represents the base point of the elliptic curve; q ax The horizontal axis represents the verification public key of the encryption end, and h() represents the hash function.

[0134] Step 202: Generate a second session key for this data encryption based on the second shared key and the random information corresponding to the data encryption interaction of the encryption end.

[0135] To further improve security, before generating the second session key, the encryption and decryption ends can also perform mutual verification. Specifically, the decryption end verifies whether the third hash operation value matches the fourth hash operation value, wherein the third hash operation value is calculated by the encryption end and transmitted to the decryption end; the fourth hash operation value is calculated by the decryption end itself. If the third hash operation value matches the fourth hash operation value, a second session key for this data encryption is generated.

[0136] The decryption end obtains the second random number of the decryption end according to the intermediate random number of the encryption end, the timestamp random number of the decryption end, the second shared key, the timestamp random number of the encryption end, and the base point corresponding to the timestamp random number of the encryption end, and then obtains the fourth hash operation value according to the second random number of the decryption end, the backpack value of the encryption end, and the backpack value of the decryption end. For example, the second random number of the decryption end, the backpack value of the encryption end, and the backpack value of the decryption end can be hashed to obtain the fourth hash operation value.

[0137] Specifically, the second random number is obtained in the following manner:

[0138]

[0139]

[0140] R A =K AB +T A

[0141] T A =t A P

[0142] Among them, W B represents the second random number, t B Indicates the random number of the timestamp of the decryption end, t A represents the random timestamp number of the encryption end, P represents the base point corresponding to the random timestamp number of the encryption end, K AB ′ represents the second shared key, K AB Represents the first shared key of the encryption end, R A Represents the intermediate random number of the encryption end.

[0143] The fourth hash operation value may be calculated as follows:

[0144]

[0145] Wherein, Auth(4) represents the fourth hash operation value, is the backpack value of the encryption end, Represents the backpack value of the decryption end, W B represents the second random number, and h() represents a hash function.

[0146] To facilitate the decryption end to verify the encryption, before verifying whether the third hash operation value matches the fourth hash operation value, the method also includes: the decryption end obtains the intermediate random number of the decryption end based on the timestamp random number of the decryption end, the base point corresponding to the timestamp random number of the decryption end, and the second shared key, and sends the intermediate random number to the encryption end, and the intermediate random number is used by the decryption end to calculate the second hash operation value.

[0147] The intermediate random number can be calculated as follows:

[0148] T B =t B P′

[0149] R B =K AB ′+T B

[0150] Among them, R B Represents the intermediate random number, K AB ′ represents the second shared key, t B represents the timestamp random number of the decryption end, and P′ represents the base point corresponding to the timestamp random number of the decryption end.

[0151] In the process of generating the second session key, the decryption end generates the second session key according to the second random number of the decryption end and the second shared key.

[0152] In addition, to facilitate the encryption end to verify the decryption end, the decryption end can also obtain a first hash operation value based on the intermediate random number of the encryption end, the second session key, the second shared key, the timestamp random number of the decryption end, the timestamp random number of the encryption end, the base point corresponding to the timestamp random number of the encryption end, the backpack value of the encryption end and the backpack value of the decryption end, and send the first hash operation value to the encryption end.

[0153] The first hash value can be calculated as follows:

[0154]

[0155] GAB ′=W B +K AB '

[0156] Wherein, Auth(1) represents the first hash operation value, is the backpack value of the encryption end, Represents the backpack value of the decryption end, G AB ′ represents the second session key, K AB ′ represents the second shared key at the decryption end, W B represents the second random number, and h() represents a hash function.

[0157] Step 203: Obtain encryption information of this data.

[0158] The decryption end may obtain encryption information from the encryption end, and the encryption information is encryption information of the current data, which may be data, files, etc.

[0159] Step 204: Decrypt the encrypted information using the second session key and the backpack private key vector of the decryption end.

[0160] The decryption end may use the second session key to decrypt the encrypted information to obtain the information encrypted backpack value, and then use the backpack vector private key of the decryption end to decrypt the information encrypted backpack value to obtain the current data.

[0161] In the embodiment of the present invention, the decryption end generates a second shared key, and generates a second session key for data encryption based on the second shared key and random information corresponding to the data encryption interaction with the encryption end, and then obtains the encryption information of the data, and decrypts the encrypted information using the second session key and the backpack private key vector of the decryption end. Since the session key is obtained based on the second shared key and the random information corresponding to the data encryption interaction with the encryption end, the session key obtained using the embodiment of the present invention is more secure, thereby improving the security of information transmission.

[0162] To further ensure security, the decryption end may also register and verify with the authentication center. Specifically, the decryption end obtains the backpack public key vector and the authentication center public key of the authentication center from the authentication center, and then obtains the backpack value of the decryption end using the backpack public key vector of the authentication center, the identity information of the decryption end, and the device identifier of the decryption end. Afterwards, the decryption end may use the backpack value of the decryption end to generate the signature file of the decryption end, and send the backpack value of the decryption end and the signature file to the authentication center.

[0163] The decryption end may obtain the backpack value of the decryption end by using the backpack public key vector of the authentication center, the identity information of the decryption end, and the device identifier of the decryption end according to the following formula:

[0164]

[0165] in, represents the backpack value of the decryption end, is the backpack public key vector of the authentication center, ID B Indicates the identity information of the decryption end, ID B ={id B ‖UID B}, id B Indicates the identity authentication information of the decryption end, UID B The device identifier of the decryption terminal, (ID B )2=m1,m2…m n ,m i ∈{0,1},(ID B )2 is the identity information ID B The binary n-ary form of .

[0166] The signature file of the decryption end is generated using the backpack value of the decryption end according to the following formula:

[0167]

[0168] Among them, V B Indicates the signature file of the encryption end, j b Represents a random number, represents the backpack value of the decryption end, G represents the elliptic curve base point, and h() represents the hash function.

[0169] In addition, the decryption end can also obtain the verification public key of the decryption end and the signature of the decryption end from the authentication center, and generate the private key of the decryption end according to the signature of the decryption end and the backpack value of the decryption end. Afterwards, the verification public key of the decryption end is verified using the private key of the decryption end.

[0170] The step of generating the private key of the decryption end by using the signature of the decryption end and the backpack value of the decryption end includes:

[0171]

[0172] Among them, SK B represents the private key of the decryption end, W B represents the signature of the decryption end, j b Represents a random number, represents the backpack value of the decryption end, and h() represents a hash function.

[0173] In verifying the verification public key of the decryption end using the private key of the decryption end, the decryption end may perform verification in the following manner:

[0174] (1) using the private key of the decryption end and the elliptic curve base point obtained from the authentication center to obtain a third value;

[0175] (2) using the verification public key of the decryption end, the backpack value of the decryption end, the ordinate of the verification public key of the decryption end, and the public key of the authentication center to obtain a fourth value;

[0176] (3) matching the third value and the fourth value;

[0177] (4) If the third value is equal to the fourth value, it means that the verification public key of the decryption end has passed the verification;

[0178] The third value is obtained by the following formula:

[0179] S p =SK B ·G

[0180] Among them, S p represents the third value, SK B represents the private key of the decryption end, and G represents the elliptic curve base point;

[0181] The fourth value is obtained by the following formula:

[0182]

[0183] Wherein, Sq represents the fourth value, PK B represents the verification public key of the decryption end, G represents the base point of the elliptic curve, q ay 1 represents the ordinate of the authentication public key of the decryption end, represents the backpack value of the decryption end, h() represents the hash function, PK CA Represents the public key of the certification authority.

[0184] See also Figure 3 , Figure 3 is a flow chart of the encryption and decryption method provided by an embodiment of the present invention, such as Figure 3 As shown, the following steps are included:

[0185] Step 301: The encryption end generates a first shared key with the decryption end, and the decryption end generates a second shared key with the encryption end.

[0186] Step 302: The encryption end generates a first session key for this data encryption based on the first shared key and the random information corresponding to the data encryption interaction between the decryption end and this data encryption; the decryption end generates a second session key for this data encryption based on the second shared key and the random information corresponding to the data encryption interaction between the encryption end and this data encryption.

[0187] Step 303: The encryption end encrypts the current data using the backpack public key vector of the decryption end and the first session key to obtain first encrypted information.

[0188] Step 304: The decryption end obtains the first encrypted information.

[0189] Step 305: The decryption end root uses the second session key and the backpack private key vector of the decryption end to decrypt the first encrypted information to obtain the current data.

[0190] The process of generating the first shared key and the second shared key, the first session key and the second session key may refer to the description of the aforementioned embodiment.

[0191] Optionally, in order to further improve security, before the encryption end generates a first shared key between the encryption end and the decryption end, and before the decryption end generates a second shared key between the encryption end and the encryption end, the encryption end and the authentication center register and authenticate, and the decryption end and the authentication center register and authenticate.

[0192] Optionally, before the encryption end generates a first shared key between the encryption end and the decryption end, and before the decryption end generates a second shared key between the encryption end and the encryption end, the encryption end and the decryption end perform a first mutual authentication. Then, after the encryption end successfully authenticates the decryption end and the decryption end successfully authenticates the encryption end, a first shared key for this data encryption is generated.

[0193] Optionally, before the encryption end generates the first session key for this data encryption and before the decryption end generates the second session key, the encryption end and the decryption end perform a mutual second authentication. Then, after the encryption end successfully authenticates the decryption end and the decryption end successfully authenticates the encryption end, a second shared key for this data encryption is generated.

[0194] Since the backpack public key vector of the encryption end or the decryption end is obtained by the authentication center using the backpack algorithm and sent to the encryption end or the decryption end, the first session key is obtained based on the first shared key and the random information corresponding to the current data encryption interaction with the decryption end, and the second session key is obtained based on the second shared key and the random information corresponding to the current data encryption interaction with the encryption end. Therefore, the session key obtained using the embodiment of the present invention is more secure, thereby improving the security of information transmission.

[0195] See also Figure 4 , Figure 4 is a flow chart of an authentication method provided by an embodiment of the present invention, which is applied to an authentication center, such as Figure 4 As shown, the following steps are included:

[0196] Step 401: Receive an authentication request from a client.

[0197] Step 402: Generate a backpack public key vector using a backpack algorithm according to the authentication request.

[0198] Step 403: Send the backpack public key vector to the client.

[0199] In this step, a super-increasing backpack vector, a first backpack vector, and a second backpack vector are obtained. Then, the super-increasing backpack vector, the first backpack vector, the second backpack vector, the first constant, and the second constant are operated using the Chinese remainder theorem to generate the backpack public key vector.

[0200] Specifically, the authentication center randomly selects any super-increasing knapsack vector Arbitrarily select two backpack vectors: the first backpack vector Second backpack vector Among them, u i ,v i , are positive integers and satisfy b i =u i +v i ,,i=1,…,n.

[0201] The authentication center chooses the first constant M1 and the second constant M2 as required. And satisfy GCD(M1, M2) = 1. The authentication center uses the Chinese remainder theorem to calculate the vector, that is, the backpack public key vector: Among them, a i =u i (mod M1), a i =v i (mod M2), i=1,...,n.

[0202] Step 404: Receive the backpack value sent by the client, wherein the backpack value is calculated by the client using the backpack public key vector.

[0203] Step 405: Authenticate the client according to the backpack value.

[0204] In this step, a verification public key and a signature are generated according to the backpack value, and the verification public key and the signature are sent to the client.

[0205] Specifically, taking client A as an example, the authentication center uses a random parameter k CA Calculate client A's verification public key Pk A And signature A , calculated as follows:

[0206]

[0207]

[0208] Among them, (q ax ,q ay ) represents the coordinates of the verification public key of client A, V A Indicates the signature file of client A.

[0209] The above scheme of the embodiment of the present invention is described in detail below in conjunction with a specific embodiment. Assume that client A and client B are exchanging data, wherein client A or client B can be used as an encryption end, then the other end is a decryption end. If the identities of client A and client B are exchanged, the implementation principle is the same.

[0210] 1. The process of client registration and verification with the authentication center

[0211] The authentication center selects a large prime number q with a length of more than 224 bits and q Select a secure elliptic curve E(F q ), in E(F q ) selects a base point G of order n on the elliptic curve system, such that n·G=o. Wherein o is the infinite point of the elliptic curve system selected in the embodiment of the present invention. In addition, a one-way collision-free hash function h() is given. Wherein the public key of the authentication center is PK cA , and expose parameters to the client: E(F q ), G, n, PK cA 、h()。

[0212] Specifically, the authentication center selects a random parameter SK CA ∈zq , and SK CA Set to the private key of the certification authority, z q Represents a set of integers. The authentication center calculates the authentication center public key according to the following formula (1).

[0213] PK cA =SK CA ·G (1)

[0214] The authentication center randomly selects any super-increasing knapsack vector Pick any two backpack vectors Among them, u i ,v i , are positive integers and satisfy b i =u i +v i ,,i=1,…,n.

[0215] The authentication center chooses two integers M1 and M2 that satisfy And satisfy GCD(M1, M2) = 1. The certification center uses the Chinese remainder theorem to calculate the vector Among them, a i =u i (mod M1), a i =v i (mod M2), i=1,…,n.

[0216] Afterwards, the authentication center sends the backpack public key vector to the client M1 and M2 are set as the private key of the authentication center. The authentication center itself sets the random identifier UID M .

[0217] Access control is the first step in data security protection. If the stored data can be easily obtained without any identity verification, the data will be exposed to a high-risk environment. Therefore, it is necessary to strengthen the security mechanism in the registration and verification stages. Figure 5 , the process may specifically include:

[0218] First, the client and the authentication center both set up the module of the random backpack that has selected the conditions and the secure elliptic curve module (built-in identification). When client A registers with the authentication center, client A obtains the authentication center's public key and client A's backpack public key vector from the authentication center, and encrypts the identity information id with the backpack public key vector. A and device identifier UID A , calculate the backpack value A signature file is generated, encrypted with the public key of the certification center, and then sent to the certification center.

[0219] The identity information may include name, ID number, phone number, client name, etc. A For: ID A ={id A ‖UID A}.

[0220] Next, client A sends the information ID A Convert to binary n-ary form:

[0221] (ID A )2=m1,m2…m n ,m i ∈{0,1}

[0222] After that, client A will A )2=m1,m2…m n Using Backpack Public Key Vector Encrypt and get the backpack value of client A

[0223]

[0224] The authentication center receives the encrypted After that, calculate ID A , and establish associated parameter registration.

[0225]

[0226]

[0227] Let b = c p +c q , consisting of b and a super-increasing knapsack vector The authentication center can then restore the identity ID A , m1 is the highest bit in binary representation, m n It is the lowest bit in binary representation.

[0228] On the client A side, client A uses the backpack value and a randomly selected parameter j a , generate the signature file V through the one-way collision-free hash function h() A After that, the generated Sent to the authentication center, where V A The calculation method of is as shown in formula (2).

[0229]

[0230] The authentication center uses a random parameter kCA Calculate client A's verification public key Pk A And signature A , calculated as follows:

[0231]

[0232]

[0233] Among them, (q ax ,q ay ) represents the coordinates of client A’s verification public key.

[0234] Afterwards, the certification center will PK A ,W A Sent to client A.

[0235] After receiving the above information, client A calculates the private key of client A, as shown in formula (3):

[0236]

[0237] To verify the encryption end's verification public key, client A performs the following processing:

[0238] Calculate S p , where S p =SK A ·G (4).

[0239] Then use the following formula (5) to calculate SK A G:

[0240]

[0241] Compare the values ​​of formula (4) and formula (5). If they are consistent, the registration and verification with the authentication center are completed by authenticating the verification public key of the encryption end.

[0242] Client A calculates the private key and verifies the legitimacy of the public key, completing the registration and verification operations at the same time. All clients can complete the registration and verification procedures with the authentication center according to the above process and obtain their own (W m ,PK m ), in the subsequent communication stage, both parties can directly complete self-authentication without relying on the authentication center.

[0243] Assume that encrypted information needs to be transmitted between client A and client B. After completing the registration and verification with the authentication center as described above, the communication process between client A and client B is as follows.

[0244] 1. Calculate the common key

[0245] 1. Mutual authentication between client A and client B.

[0246] Combination Figure 6 , client A uses the backpack value Authenticate with client B. Similarly, client B uses its own backpack value Authenticate with client A. Specifically, client A will Send it to client B, and client B will Sent to client A. Taking client B as an example, client B calculates according to the following formula (6): Afterwards, confirm Is it true? If it is true, the verification of client A is successful.

[0247]

[0248] (q ax ,q ay ) is the coordinate of the verification public key of client A, PK CA Represents the public key of the certification center, G represents the elliptic curve base point, PK A represents the verification public key of the client A, Represents the backpack value of client A, S A Represents the public key of client A.

[0249] Similarly, client A can also calculate according to formula (7): And verify Is it true? If it is true, the verification of client B is successful.

[0250]

[0251] (q ax 1 ,q ay 1 ) is the coordinate of the verification public key of client B, PK CA Represents the public key of the certification center, G represents the elliptic curve base point, PK B represents the verification public key of the client B, Represents the backpack value of client B, S B Represents the public key of client B.

[0252] 2. Client A and client B generate shared keys respectively, as shown in formula (8):

[0253] K AB =sK A ×S B , K AB1 =sKB ×S A (8)

[0254] K AB represents the shared key calculated by client A, K AB1 Represents the shared key calculated by client B. Among them, sK A , sK B Represents the private keys of client A and client B respectively.

[0255] 2. Calculate the session key

[0256] When client A and client B have a shared key, they can use the "challenge-response" method to verify each other. Figure 7 , as follows:

[0257] 1. Client A randomly selects a timestamp random number, calculates it according to formulas (9) and (10), and then sends the information to client B.

[0258] Client A randomly selects a timestamp random number t A ∈Z P (Z P represents an integer set), and is calculated according to formulas (9) and (10):

[0259] T A =t A P (10)

[0260] R A =K AB +T A (11)

[0261] Wherein, P represents the base point corresponding to the timestamp random number of client A.

[0262] Afterwards, Client A will Sent to client B, R A Indicates the intermediate random number of client A.

[0263] 2. After receiving the request, client B randomly selects a timestamp random number t B , and use K AB1 With the received R A Verify the identity of client A and generate a session key and verification hash value.

[0264] When client B receives the request, it randomly selects a timestamp random number t B ∈Z P , and calculated according to formulas (12) and (13).

[0265] T B =t BP′ (12)

[0266] R B =K AB1 +T B (13)

[0267] Where P′ represents the base point corresponding to the timestamp parameter of client B, R B Represents the intermediate random number of client B.

[0268] Client B uses K AB1 With the received R A Calculate according to (14).

[0269]

[0270] If the identity of client A is correct, then, since client B has the correct K AB1 ,so, That is, if Then, the identity authentication of client A is successful.

[0271] Next, client B calculates the second random number W B :

[0272]

[0273] Afterwards, client B generates a second session key G AB1 And the hash values ​​Auth(B) and Auth(A) for authentication purposes * , calculated as shown in formulas (15), (16), and (17):

[0274] G AB1 =W B +K AB1 (15)

[0275]

[0276]

[0277] Finally, client B will Sent to client A.

[0278] 3. Client A verifies the received Auth(A) before generating the session key * Is it compatible with self-calculated Auth (B)? * Equal, where Auth(B) * The calculation method of is as follows: Formula (18)-(20).

[0279]

[0280]

[0281]

[0282] W A Represents the first random number of client A.

[0283] If they do not match, client A immediately terminates the communication connection. If they match, client A calculates the first session key G AB and the hash operation value Auth(A), as shown in formulas (21) and (22) respectively:

[0284] G AB =W A +K AB (twenty one)

[0285]

[0286] In addition, client A can also send Auth(A) to client B.

[0287] After receiving it, client B verifies whether the received Auth(A) is equal to the Auth(B) calculated by itself. If they are equal, the communication verification procedure is completed.

[0288] 4. Information encryption and decryption

[0289] When client A and client B generate a session key for their current communication, both parties use the session key as the key for encrypting and decrypting transmitted data, thus forming an efficient hybrid data protection mechanism and solving the key management distribution and identity authentication problems of the cryptographic system.

[0290] Specifically, assume that client B transmits information M to client A. First, client B converts the plaintext M into (M)2, and encrypts it with the backpack public key vector published by client A to obtain the encrypted backpack value C M Client B uses its own session key to M After encryption, it is sent to client A. After receiving it, client A uses its own session key to decrypt it and obtain the information encrypted backpack value C M , encrypt the information into backpack value C M Decrypt it with your own backpack private key vector to get the plaintext M.

[0291] It can be seen from the above description that when clients A and B communicate using the above method, they use the backpack value to verify both parties, and use the common session key generated by the current communication to protect the information data. Since a third party cannot tamper with the backpack value, the above scheme of the embodiment of the present invention can reduce the risk of information being deciphered by a third party, thereby improving the security of the information.

[0292] In order to provide a faster, more efficient and lightweight encryption setting, considering that the amount of information required to be protected by the lightweight device is small and the format is fixed, in an embodiment of the present invention, a hybrid public key cryptographic system based on block encryption for data information protection is also provided.

[0293] Since each plaintext block can be encrypted or decrypted using the same key, in the embodiment of the present invention, after the session key is generated according to the above process, the session key is operated using a hash function according to the following formula (23) to obtain a fixed-length block key K that complies with the PRESENT encryption method:

[0294] K=H(G AB1 ) (twenty three)

[0295] When information needs to be transmitted, the information can be encrypted using the key K. When decrypting, the decryption end can generate the block key in the same way to decrypt the encrypted information.

[0296] The encryption function can be C=E PREENT (P), the decryption function can be P = E PREENT (C).

[0297] When the amount of information that the lightweight device needs to protect is not large, the embodiment of the present invention uses PRESENT block encryption as data information protection. At this time, hardware embedding can be designed to reduce the required application resources and increase computing performance.

[0298] In order to provide a faster, more efficient and lightweight encryption design, it is considered that the information to be protected by the lightweight device needs to be transmitted in real time and the amount of information is uncertain, or the information to be protected may be real-time audio and video encryption information. When the amount of information is not fixed, the embodiment of the present invention uses stream encryption as a hybrid public key cryptographic system for data protection.

[0299] In order to generate a different key for each connection of the streaming key, taking client B as an example, the embodiment of the present invention uses the session key G generated in the manner of the above embodiment. AB1 As a key seed. This key seed is a block key on client B. Client B uses the session key G AB1Sent to the Linear Feedback Shift Register (LFSR) and converted into a streaming key seed S S , and used as the new seed value. Assume that client B needs to encrypt data information. To achieve security mechanism, the streaming key seed S S First, it is mixed with a random random number π (PI) of your choice, and a decimal point is randomly obtained as the starting point through a bit-taking function. Then, the key length is continuously increased and the data information is scrambled to obtain the stream key. After that, the key is used for stream encryption and decryption to ensure that the key for each transmission is different. The specific process is as follows:

[0300] 1. Generate a streaming key seed.

[0301] (1) Obtain the conference key G AB1 : G AB1 :G AB1 =S B

[0302] (2) Select a feedback polynomial and calculate the array S S {i}, where the selected feedback polynomial is as shown in formula (24).

[0303] f(x)=1+C1x+C2x 2 +…C L-1 x L-1 +C L x l (twenty four)

[0304] Among them, C L =1, L is the series of the feedback polynomial, and the feedback coefficient C i The number of non-zero terms in (1≤i≤L-1) is called the number of terms in the feedback polynomial.

[0305] Here, let: L = 256, C 17 , C 47 , C 197 , C 215 , C 219 , C 256 =1, and the other coefficients are all 0, and the expression can be obtained as (25):

[0306] f(x)=1+x 17 +x 47 +x 197 +x 215 +x 219 +x 256 (25)

[0307] Through the above process, multiple S S {i}.

[0308] Finally, we get f(x) = S S {i} and sends it to client A.

[0309] We get f(x) = S S {i}, considering the high probability that the password length is less than the message length, a self-selected random number π (PI) is selected. The self-selected random number is currently known to be calculated to be about 5 megabits, which is approximately an infinite non-repeating decimal. In order to make the length of the stream encryption and decryption key always greater than the message length, and to avoid starting from the first digit after the decimal each time π is used, so that the basis of each operation is different, a bit function π (i) is used to represent the starting position of the number to ensure that the data information is shuffled.

[0310] Afterwards, the key seed is mixed with the bit-selection function π(i):

[0311] i=0:π(L+i)=π(256)=(5) 10 =(0101)2

[0312] i=0:π(L+i)=π(256)=(5) 10 =(0101)2

[0313] …

[0314] i=Len(M)-1:π(L+Len(M)-1)

[0315] S S After performing XOR operation on {i} and π(Len(M)-1), the stream key K can be obtained through LFSR calculation. S2 The specific calculation formula is as follows (26):

[0316]

[0317] In order to enhance the encryption speed and performance, a one-time XOR operation and key encryption are adopted in the embodiment of the present invention. In the stream encryption stage, the encryption method is shown in (27):

[0318]

[0319] Client A may generate its stream key in the same manner as above.

[0320] Client A receives the ciphertext encrypted data from client B. Considering the need to speed up the decryption speed, the embodiment of the present invention only uses a one-time XOR operation to perform the decryption operation, using the stream key K of client A. S1 Decrypt the received encrypted data. Specifically, as shown in formula (28):

[0321]

[0322] By using this formula, data M can be decrypted.

[0323] It should be noted that, in the above embodiment, if the identities of client A and client B are exchanged, the implementation principle is the same as described above.

[0324] From the above description, it can be seen that the hybrid public key cryptographic system based on multiple difficulties in the embodiment of the present invention enables the random backpack cryptographic algorithm to perform public key encryption and decryption calculations in an elliptic curve environment. At the same time, the algorithm of the embodiment of the present invention can complete self-authentication, mutual verification and encryption and decryption operations, with fewer calculation steps and high computational efficiency, and can meet the requirements of confidentiality, integrity, authentication and non-repudiation.

[0325] The embodiment of the present invention also provides an encryption device, which is applied to an encryption terminal. Figure 8 , Figure 8 1 is a structural diagram of an encryption device provided in an embodiment of the present invention. Since the principle of solving the problem by the encryption device is similar to that of the encryption method in the embodiment of the present invention, the implementation of the encryption device can refer to the implementation of the method, and the repeated parts will not be repeated.

[0326] like Figure 8 As shown, the encryption device 800 includes:

[0327] The first generation module 801 is used to generate a first shared key between the encryption end and the decryption end; the second generation module 802 is used to generate a first session key for current data encryption based on the first shared key and random information corresponding to the current data encryption interaction with the decryption end; the first acquisition module 803 is used to encrypt the current data using the backpack public key vector of the decryption end and the first session key to obtain the first encrypted information.

[0328] Optionally, the first generating module 801 is specifically used to generate the first shared key according to the private key of the encryption end and the obtained public key of the decryption end.

[0329] Optionally, the device may further include: a first verification module, configured to perform a first verification on the decryption end according to the obtained backpack value of the decryption end, the public key of the decryption end, the public key of the authentication center, and the verification public key of the decryption end. The first generation module 801 is specifically configured to generate a first shared key between the encryption end and the decryption end if the first verification of the decryption end is passed.

[0330] Optionally, the first verification module includes: a first generation submodule, used to generate a first key based on the backpack value of the decryption end, the public key of the authentication center and the verification public key of the decryption end; a first comparison submodule, used to compare the first key with the public key of the decryption end; and a first verification submodule, used to indicate that the verification of the decryption end is passed if the first key and the public key of the decryption end are consistent.

[0331] Optionally, the process of generating the first key may refer to the description of the aforementioned embodiment.

[0332] Optionally, the device may also include: a second verification module, used to verify whether the first hash operation value and the second hash operation value match, wherein the first hash operation value is calculated by the decryption end and transmitted to the encryption end; the second hash operation value is calculated by the encryption end itself; the second generation module 802 is used to generate a first session key for this data encryption if the first hash operation value and the second hash operation value match.

[0333] Optionally, the device may also include: a first acquisition module, used to obtain an intermediate random number of the encryption end based on the timestamp random number of the encryption end, a base point corresponding to the timestamp random number of the encryption end and the first shared key; a first sending module, used to send the intermediate random number to the decryption end, and the intermediate random number is used by the decryption end to calculate the first hash operation value.

[0334] The random information includes a first random number of the encryption end; the device may also include:

[0335] The first calculation module is used to obtain the first random number of the encryption end according to the intermediate random number of the decryption end, the timestamp random number of the encryption end, the first shared key, the timestamp random number of the decryption end and the base point corresponding to the timestamp random number of the decryption end; the second calculation module is used to obtain the second hash operation value according to the first random number of the encryption end, the backpack value of the encryption end and the backpack value of the decryption end.

[0336] Optionally, the second generating module 802 is specifically used to generate the first session key according to the first random number of the encryption end and the first shared key.

[0337] Optionally, the device also includes: a third generation module, used to generate a third hash operation value according to the backpack value of the encryption end, the backpack value of the decryption end and the first session key, and send the third hash operation value to the decryption end.

[0338] Optionally, the first encryption module is used to encrypt the current data using the backpack public key vector of the decryption end to obtain an information encryption backpack value; and encrypt the information encryption backpack value using the first session key to obtain the first encrypted information.

[0339] Optionally, the device further comprises:

[0340] The second acquisition module is used to obtain the backpack public key vector and the public key of the authentication center from the authentication center; the third acquisition module is used to use the backpack public key vector of the authentication center, the identity information of the encryption end and the device identifier of the encryption end to obtain the backpack value of the encryption end; the fourth generation module is used to use the backpack value of the encryption end to generate the signature file of the encryption end; the second sending module is used to send the backpack value of the encryption end and the signature file to the authentication center.

[0341] Optionally, the third acquisition module is used to obtain the backpack value of the encryption end by using the backpack public key vector of the authentication center, the identity information of the encryption end, and the device identifier of the encryption end according to the following formula:

[0342]

[0343] in, represents the backpack value of the encryption end, is the backpack public key vector of the authentication center, ID A Indicates the identity information of the encryption end, ID A ={id A ‖UID A}, id A Indicates the identity authentication information of the encryption end, UID A The device identifier of the encryption end, (ID A )2=m1,m2…m n ,m i ∈{0,1},(ID A )2 is the identity information ID A The binary n-ary form of .

[0344] Optionally, the fourth generation module is used to generate the signature file of the encryption end by using the backpack value of the encryption end through the following formula:

[0345]

[0346] Among them, V A Indicates the signature file of the encryption end, j a Represents a random number, represents the backpack value of the encryption end, G represents the elliptic curve base point, and h() represents the hash function.

[0347] Optionally, the device may further include:

[0348] The fourth acquisition module is used to obtain the verification public key of the encryption end and the signature of the encryption end from the authentication center; the fourth generation module is used to generate the private key of the encryption end according to the signature of the encryption end and the backpack value of the encryption end; the third verification module is used to verify the verification public key of the encryption end using the private key of the encryption end.

[0349] Among them, the method of generating the private key of the encryption end can refer to the description of the aforementioned embodiment.

[0350] The third verification module may include:

[0351] A first acquisition submodule, used to obtain a first value using the private key of the encryption end and the elliptic curve base point obtained from the authentication center; a second submodule, used to obtain a second value using the verification public key of the encryption end, the backpack value of the encryption end, the ordinate of the verification public key of the encryption end, and the public key of the authentication center; a first matching submodule, used to match the first value with the second value; a first verification submodule, used to indicate that the verification public key of the encryption end has passed the verification if the first value is equal to the second value;

[0352] The first value is obtained by the following formula:

[0353] S p =SK A ·G

[0354] Among them, S p represents the first value, SK A represents the private key of the encryption end, and G represents the elliptic curve base point;

[0355] The second value is obtained by the following formula:

[0356]

[0357] Wherein, Sq represents the second value, PK A represents the verification public key of the encryption end, G represents the base point of the elliptic curve, q ay represents the ordinate of the authentication public key of the encryption end, represents the backpack value of the encryption end, h() represents the hash function, PK CA Represents the public key of the certification authority.

[0358] The device provided in the embodiment of the present invention can execute the above method embodiment, and its implementation principle and technical effect are similar, which will not be repeated in this embodiment.

[0359] The embodiment of the present invention also provides a decryption device, which is applied to a decryption terminal. Fig. 9 , Fig. 9 1 is a structural diagram of a decryption device provided by an embodiment of the present invention. Since the principle of solving the problem by the encryption device is similar to that of the decryption method in the embodiment of the present invention, the implementation of the encryption device can refer to the implementation of the method, and the repeated parts will not be repeated.

[0360] like Fig. 9 As shown, the decryption device 900 includes:

[0361] The first generation module 901 is used to generate a second shared key between the decryption end and the encryption end; the second generation module 902 is used to generate a second session key for current data encryption based on the second shared key and the random information corresponding to the current data encryption interaction of the encryption end; the first acquisition module 903 is used to obtain the encryption information of this data; the first decryption module 904 is used to decrypt the encrypted information using the second session key and the backpack private key vector of the decryption end.

[0362] Optionally, the first generating module 901 is used to generate the second shared key according to the acquired public key of the encryption end and the private key of the decryption end.

[0363] Optionally, the device may further include: a first verification module, configured to perform a second verification on the encryption end according to the obtained backpack value of the encryption end, the public key of the encryption end, the public key of the authentication center and the verification public key of the encryption end. The first generation module 901 is configured to generate a second shared key between the decryption end and the encryption end if the second verification on the encryption end passes.

[0364] Optionally, the first verification module may include:

[0365] The first generation submodule is used to generate a second key based on the backpack value of the encryption end, the public key of the authentication center and the verification public key of the encryption end; the first comparison submodule is used to compare the second key with the public key of the encryption end; the first verification submodule is used to indicate that the verification of the encryption end is passed if the second key is consistent with the public key of the encryption end.

[0366] The method for generating the second key may refer to the description of the aforementioned embodiment.

[0367] Optionally, the device may include: a second verification module, used to verify whether the third hash operation value matches the fourth hash operation value, wherein the third hash operation value is calculated by the encryption end and transmitted to the decryption end; the fourth hash operation value is calculated by the decryption end itself; the second generation module 902 is used to generate a second session key for this data encryption if the third hash operation value matches the fourth hash operation value.

[0368] The random information includes a second random number of the encryption end; the device may also include:

[0369] The first calculation module is used to obtain the second random number of the decryption end according to the intermediate random number of the encryption end, the timestamp random number of the decryption end, the second shared key, the timestamp random number of the encryption end and the base point corresponding to the timestamp random number of the encryption end; the second calculation module is used to obtain the fourth hash operation value according to the second random number of the decryption end, the backpack value of the encryption end and the backpack value of the decryption end.

[0370] Optionally, the second generating module may be used to generate the second session key according to the second random number of the decryption end and the second shared key.

[0371] Optionally, the device may also include: a third calculation module, used to obtain a first hash operation value based on the intermediate random number of the encryption end, the second session key, the second shared key, the timestamp random number of the decryption end, the timestamp random number of the encryption end, the base point corresponding to the timestamp random number of the encryption end, the backpack value of the encryption end and the backpack value of the decryption end, and send the first hash operation value to the encryption end.

[0372] Optionally, the device may further include:

[0373] The fourth calculation module is used to obtain the intermediate random number of the decryption end according to the timestamp random number of the decryption end, the base point corresponding to the timestamp random number of the decryption end and the second shared key; the first sending module is used to send the intermediate random number to the encryption end, and the intermediate random number is used by the decryption end to calculate the second hash operation value.

[0374] Optionally, the encrypted information is the encrypted information of this data. The first decryption module 904 may include: a first decryption submodule, used to decrypt the encrypted information using the second session key to obtain an information encrypted backpack value; and a second decryption submodule, used to decrypt the information encrypted backpack value using the backpack vector private key of the decryption end to obtain the current data.

[0375] Optionally, the device may further include:

[0376] The first acquisition module is used to obtain the backpack public key vector and the public key of the authentication center from the authentication center; the second acquisition module is used to use the backpack public key vector of the authentication center, the identity information of the decryption end and the device identifier of the decryption end to obtain the backpack value of the decryption end; the third generation module is used to use the backpack value of the decryption end to generate the signature file of the decryption end; the second sending module is used to send the backpack value of the decryption end and the signature file to the authentication center.

[0377] The method of obtaining the backpack value of the decryption end and generating the signature file of the decryption end may refer to the description of the aforementioned embodiment.

[0378] Optionally, the device may further include:

[0379] The third acquisition module is used to obtain the verification public key of the decryption end and the signature of the decryption end from the authentication center; the fourth generation module is used to generate the private key of the decryption end according to the signature of the decryption end and the backpack value of the decryption end; the second verification module is used to verify the verification public key of the decryption end using the private key of the decryption end.

[0380] The method of generating the private key of the decryption end may refer to the description of the aforementioned embodiment.

[0381] Optionally, the second verification module may include:

[0382] The first acquisition submodule is used to obtain a third value by using the private key of the decryption end and the elliptic curve base point obtained from the authentication center; the second acquisition submodule is used to obtain a fourth value by using the verification public key of the decryption end, the backpack value of the decryption end, the ordinate of the verification public key of the decryption end, and the public key of the authentication center; the first matching submodule is used to match the third value with the fourth value; the first verification submodule is used to indicate that the verification public key of the decryption end has passed the verification if the third value is equal to the fourth value;

[0383] The third value is obtained by the following formula:

[0384] S p =SK B ·G

[0385] Among them, S p represents the third value, SK B represents the private key of the decryption end, and G represents the elliptic curve base point;

[0386] The fourth value is obtained by the following formula:

[0387]

[0388] Wherein, Sq represents the fourth value, PK B represents the verification public key of the decryption end, G represents the base point of the elliptic curve, q ay 1 represents the ordinate of the authentication public key of the decryption end, represents the backpack value of the decryption end, h() represents the hash function, PK CA Represents the public key of the certification authority.

[0389] The device provided in the embodiment of the present invention can execute the above method embodiment, and its implementation principle and technical effect are similar, which will not be repeated in this embodiment.

[0390] The embodiment of the present invention also provides an encryption and decryption device. Fig.10 , Fig.10 1 is a structural diagram of the encryption and decryption device provided by the embodiment of the present invention. Since the principle of solving the problem by the encryption device is similar to the decryption method in the embodiment of the present invention, the implementation of the encryption and decryption device can refer to the implementation of the method, and the repeated parts will not be repeated.

[0391] like Fig.10 As shown, the encryption and decryption device 1000 includes:

[0392] The first generating module 1001 is used for the encryption end to generate a first shared key between the encryption end and the decryption end, and for the decryption end to generate a second shared key between the encryption end and the encryption end;

[0393] The second generating module 1002 is used for the encryption end to generate a first session key for current data encryption according to the first shared key and the random information corresponding to the current data encryption interaction between the decryption end and the encryption end; the decryption end to generate a second session key for current data encryption according to the second shared key and the random information corresponding to the current data encryption interaction between the encryption end and the encryption end;

[0394] A first acquisition module 1003 is used for the encryption end to encrypt the current data using the backpack public key vector of the decryption end and the first session key to obtain first encrypted information;

[0395] A second acquisition module 1004, configured for the decryption end to acquire the first encrypted information;

[0396] The first decryption module 1005 is used for the decryption end to decrypt the first encrypted information by using the second session key and the backpack private key vector of the decryption end to obtain the current data.

[0397] Optionally, the device may further include at least one of the following modules:

[0398] A first verification module, used for registering and verifying between the encryption end and the authentication center, and registering and verifying between the decryption end and the authentication center before the encryption end generates a first shared key between the encryption end and the decryption end, and before the decryption end generates a second shared key between the encryption end and the encryption end;

[0399] A second verification module, configured to perform a mutual first verification between the encryption end and the decryption end before the encryption end generates a first shared key between the encryption end and the decryption end, and before the decryption end generates a second shared key between the encryption end and the encryption end;

[0400] The third verification module is used to perform a mutual second verification between the encryption end and the decryption end before the encryption end generates a first session key for the current data encryption and before the decryption end generates a second session key.

[0401] The first generation module 1001 is used to generate a first shared key for current data encryption after the encryption end successfully verifies the decryption end and the decryption end successfully verifies the encryption end, and to generate a second shared key for current data encryption after the encryption end successfully verifies the decryption end and the decryption end successfully verifies the encryption end.

[0402] The second generation module 1002 is used to generate a first session key for current data encryption after the encryption end successfully verifies the decryption end and the decryption end successfully verifies the encryption end; and to generate a second session key for current data encryption after the encryption end successfully verifies the decryption end and the decryption end successfully verifies the encryption end.

[0403] The device provided in the embodiment of the present invention can execute the above method embodiment, and its implementation principle and technical effect are similar, which will not be repeated in this embodiment.

[0404] The embodiment of the present invention also provides an authentication device, which is applied to an authentication center. Fig.11 , Fig.11 Since the principle of solving the problem by the encryption device is similar to the authentication in the embodiment of the present invention, the implementation of the authentication device can refer to the implementation of the method, and the repeated parts will not be repeated.

[0405] like Fig.11 As shown, the authentication device 1100 includes:

[0406] The first receiving module 1101 is used to receive an authentication request from a client; the first generating module 1102 is used to generate a backpack public key vector using a backpack algorithm according to the authentication request; the first sending module 1103 is used to send the backpack public key vector to the client; the second receiving module 1104 is used to receive a backpack value sent by the client, wherein the backpack value is calculated by the client using the backpack public key vector; the authentication module 1105 is used to authenticate the client according to the backpack value.

[0407] Optionally, the first generation module may include: a first acquisition submodule, used to obtain a super-increasing backpack vector, a first backpack vector and a second backpack vector; a first generation submodule, used to use the Chinese remainder theorem to operate on the super-increasing backpack vector, the first backpack vector, the second backpack vector, a first constant and a second constant to generate the backpack public key vector.

[0408] Optionally, the authentication module may include: a first generation submodule, used to generate a verification public key and a signature according to the backpack value; and a first sending submodule, used to send the verification public key and the signature to the client.

[0409] The device provided in the embodiment of the present invention can execute the above method embodiment, and its implementation principle and technical effect are similar, which will not be repeated in this embodiment.

[0410] In addition, an embodiment of the present invention further provides an electronic device, comprising: a memory, a processor, and a program stored in the memory and executable on the processor. The processor is configured to read the program in the memory to implement the process of any of the above method embodiments.

[0411] In addition, an embodiment of the present invention further provides a readable storage medium, on which a program is stored, and when the program is executed by a processor, each process of the above-mentioned encryption method or decryption method or encryption / decryption method or authentication method embodiment is implemented, and the same technical effect can be achieved. To avoid repetition, it is not repeated here. The readable storage medium is, for example, a read-only memory (ROM), a random access memory (RAM), a disk or an optical disk, etc.

[0412] It should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the sentence "comprises a ..." does not exclude the existence of other identical elements in the process, method, article or device including the element.

[0413] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course can also be implemented by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present invention, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, disk, CD), and includes a number of instructions for a terminal (which can be a mobile phone, computer, server, air conditioner, or network equipment, etc.) to execute the methods described in each embodiment of the present invention.

[0414] The embodiments of the present invention are described above in conjunction with the accompanying drawings, but the present invention is not limited to the above-mentioned specific implementation modes, which are merely illustrative rather than restrictive. Under the guidance of the present invention, ordinary technicians in this field can also make many forms without departing from the scope of protection of the present invention and the claims, all of which are within the protection of the present invention.

Claims

1. An encryption method, applied to an encryption end, characterized in that: include: Generate a first shared key between the encryption end and the decryption end; Generate a first session key for current data encryption according to the first shared key and random information corresponding to the current data encryption interaction with the decryption end; Encrypting the current data using the backpack public key vector of the decryption end and the first session key to obtain first encrypted information; The random information includes a first random number of the encryption end; the first random number is obtained in the following manner: The first random number of the encryption end is obtained according to the intermediate random number of the decryption end, the timestamp random number of the encryption end, the first shared key, the timestamp random number of the decryption end and the base point corresponding to the timestamp random number of the decryption end.

2. The method according to claim 1, characterized in that: The generating of a first shared key between the encryption end and the decryption end includes: The first shared key is generated according to the private key of the encryption end and the obtained public key of the decryption end.

3. The method according to claim 1, characterized in that Before generating the first shared key between the encryption end and the decryption end, the method further includes: Performing a first verification on the decryption end according to the obtained backpack value of the decryption end, the public key of the decryption end, the public key of the authentication center and the verification public key of the decryption end; The generating of a first shared key between the encryption end and the decryption end includes: If the first verification of the decryption end is passed, a first shared key between the encryption end and the decryption end is generated.

4. The method according to claim 3, characterized in that The first verification of the decryption end according to the obtained backpack value of the decryption end, the public key of the decryption end, the public key of the authentication center and the verification public key of the decryption end includes: Generate a first key according to the backpack value of the decryption end, the public key of the authentication center and the verification public key of the decryption end; Comparing the first key with the public key of the decryption end; If the first key is consistent with the public key of the decryption end, it means that the verification of the decryption end is successful.

5. The method according to claim 4, characterized in that According to the following formula, a first key is generated based on the backpack value of the decryption end, the public key of the authentication center and the verification public key of the decryption end: Where S′ represents the first key, PK B represents the verification public key of the decryption end, Represents the backpack value of the decryption end, PK CA represents the public key of the authentication center; G represents the base point of the elliptic curve; q ax 1 The horizontal axis represents the verification public key of the decryption end, and h() represents the hash function.

6. The method according to claim 1, characterized in that Before the step of generating a first session key for current data encryption according to the first shared key and random information corresponding to the current data encryption interaction with the decryption end, the method further includes: Verify whether a first hash operation value matches a second hash operation value, wherein the first hash operation value is calculated by the decryption end and transmitted to the encryption end; and the second hash operation value is calculated by the encryption end itself; The generating of the first session key for current data encryption comprises: If the first hash operation value matches the second hash operation value, a first session key for current data encryption is generated.

7. The method according to claim 6, characterized in that Before verifying whether the first Hash operation value matches the second Hash operation value, the method further includes: Obtaining an intermediate random number of the encryption end according to the timestamp random number of the encryption end, a base point corresponding to the timestamp random number of the encryption end, and the first shared key; The intermediate random number is sent to the decryption end, and the intermediate random number is used by the decryption end to calculate the first Hash operation value.

8. The method according to claim 6, characterized in that Calculating the second hash operation value includes: Obtaining a first random number of the encryption end according to the intermediate random number of the decryption end, the timestamp random number of the encryption end, the first shared key, the timestamp random number of the decryption end, and a base point corresponding to the timestamp random number of the decryption end; The second Hash operation value is obtained according to the first random number of the encryption end, the backpack value of the encryption end, and the backpack value of the decryption end.

9. The method according to claim 8, characterized in that The generating of the first session key for current data encryption comprises: Generate the first session key according to the first random number of the encryption end and the first shared key.

10. The method according to claim 9, characterized in that After generating the first session key, the method further includes: A third hash operation value is generated according to the backpack value of the encryption end, the backpack value of the decryption end, and the first session key, and the third hash operation value is sent to the decryption end.

11. The method according to claim 1, characterized in that: The step of encrypting the current data using the backpack public key vector of the decryption end and the first session key to obtain the first encrypted information includes: Encrypt the current data using the backpack public key vector of the decryption end to obtain an information encryption backpack value; The information encryption backpack value is encrypted using the first session key to obtain the first encrypted information.

12. The method according to claim 1, characterized in that Before generating the first shared key between the encryption end and the decryption end, the method further includes: Obtaining the backpack public key vector and the public key of the authentication center from the authentication center; Obtaining a backpack value of the encryption end by using the backpack public key vector of the authentication center, the identity information of the encryption end, and the device identifier of the encryption end; Generate a signature file of the encryption end using the backpack value of the encryption end; The backpack value of the encryption end and the signature file are sent to the authentication center.

13. The method according to claim 12, characterized in that According to the following formula, the backpack value of the encryption end is obtained by using the backpack public key vector of the authentication center, the identity information of the encryption end, and the device identifier of the encryption end, including: in, represents the backpack value of the encryption end, is the backpack public key vector of the authentication center, ID A Indicates the identity information of the encryption end, ID A ={id A ‖UID A }, id A Indicates the identity authentication information of the encryption end, UID A The device identifier of the encryption end, (ID A )2=m1,m2…m n ,m i ∈{0,1},(ID A )2 is the identity information ID A The binary n-ary form of .

14. The method according to claim 12, characterized in that The signature file of the encryption end is generated by using the backpack value of the encryption end through the following formula, including: Among them, V A Indicates the signature file of the encryption end, j a Represents a random number, represents the backpack value of the encryption end, G represents the elliptic curve base point, and h() represents the hash function.

15. The method according to claim 12, characterized in that The method further comprises: Obtaining the verification public key of the encryption end and the signature of the encryption end from the authentication center; Generate a private key of the encryption end according to the signature of the encryption end and the backpack value of the encryption end; The encryption end's verification public key is verified using the encryption end's private key.

16. The method according to claim 15, characterized in that The private key of the encryption end is generated by using the signature of the encryption end and the backpack value of the encryption end through the following formula, including: Among them, SK A represents the private key of the encryption end, W A Indicates the signature of the encryption end, j a Represents a random number, represents the backpack value of the encryption end, and h() represents a hash function.

17. The method according to claim 15, characterized in that The using the private key of the encryption end to verify the verification public key of the encryption end includes: Obtaining a first value using the private key of the encryption end and an elliptic curve base point obtained from the authentication center; Obtain a second value using the verification public key of the encryption end, the backpack value of the encryption end, the ordinate of the verification public key of the encryption end, and the public key of the authentication center; Matching the first value and the second value; If the first value is equal to the second value, it means that the verification public key of the encryption end has passed the verification; The first value is obtained by the following formula: S p =SK A ·G Among them, S p represents the first value, SK A represents the private key of the encryption end, and G represents the elliptic curve base point; The second value is obtained by the following formula: Wherein, Sq represents the second value, PK A represents the verification public key of the encryption end, G represents the base point of the elliptic curve, q ay represents the ordinate of the authentication public key of the encryption end, represents the backpack value of the encryption end, h() represents the hash function, PK CA Represents the public key of the certification authority.

18. A decryption method, applied to a decryption end, characterized in that: include: generating a second shared key between the decryption end and the encryption end; Generate a second session key for current data encryption according to the second shared key and the random information corresponding to the current data encryption interaction of the encryption end; Get the encryption information of this data; decrypting the encrypted information using the second session key and the backpack private key vector of the decryption end; The random information includes a second random number of the decryption end; the second random number is obtained in the following manner: The second random number of the decryption end is obtained according to the intermediate random number of the encryption end, the timestamp random number of the decryption end, the second shared key, the timestamp random number of the encryption end and the base point corresponding to the timestamp random number of the encryption end.

19. The method according to claim 18, characterized in that The generating of a second shared key between the decryption end and the encryption end includes: The second shared key is generated according to the obtained public key of the encryption end and the private key of the decryption end.

20. The method according to claim 18, characterized in that Before generating the second shared key between the decryption end and the encryption end, the method further includes: Performing a second verification on the encryption end according to the obtained backpack value of the encryption end, the public key of the encryption end, the public key of the authentication center and the verification public key of the encryption end; The generating of a second shared key between the decryption end and the encryption end includes: If the second verification of the encryption end is passed, a second shared key between the decryption end and the encryption end is generated.

21. The method according to claim 20, characterized in that The second verification of the encryption end according to the obtained backpack value of the encryption end, the public key of the encryption end, the public key of the authentication center and the verification public key of the encryption end comprises: Generate a second key according to the backpack value of the encryption end, the public key of the authentication center and the verification public key of the encryption end; Comparing the second key with the public key of the encryption end; If the second key is consistent with the public key of the encryption end, it means that the authentication of the encryption end is successful.

22. The method according to claim 21, characterized in that The second key is generated according to the backpack value of the encryption end, the public key of the authentication center and the verification public key of the encryption end according to the following formula: Where S″ represents the second key, PK A represents the verification public key of the encryption end, Represents the backpack value of the encryption end, PK CA represents the public key of the authentication center; G represents the base point of the elliptic curve; q ax The horizontal axis represents the verification public key of the encryption end, and h() represents the hash function.

23. The method according to claim 18, characterized in that Before generating a second session key for current data encryption according to the second shared key and the random information corresponding to the current data encryption interaction of the encryption end, the method further includes: Verifying whether a third Hash operation value matches a fourth Hash operation value, wherein the third Hash operation value is calculated by the encryption end and transmitted to the decryption end; and the fourth Hash operation value is calculated by the decryption end itself; The generating of the second session key for current data encryption comprises: If the third Hash operation value matches the fourth Hash operation value, a second session key for current data encryption is generated.

24. The method according to claim 23, characterized in that Calculating the fourth Hash operation value includes: Obtaining a second random number of the decryption end according to the intermediate random number of the encryption end, the timestamp random number of the decryption end, the second shared key, the timestamp random number of the encryption end, and a base point corresponding to the timestamp random number of the encryption end; The fourth Hash operation value is obtained according to the second random number of the decryption end, the backpack value of the encryption end, and the backpack value of the decryption end.

25. The method according to claim 24, characterized in that The generating of the second session key for current data encryption comprises: Generate the second session key according to the second random number of the decryption end and the second shared key.

26. The method according to claim 23, characterized in that Before verifying whether the third Hash operation value matches the fourth Hash operation value, the method further includes: A first hash operation value is obtained according to the intermediate random number of the encryption end, the second shared key, the second session key, the timestamp random number of the decryption end, the timestamp random number of the encryption end, the base point corresponding to the timestamp random number of the encryption end, the backpack value of the encryption end and the backpack value of the decryption end, and the first hash operation value is sent to the encryption end.

27. The method according to claim 23, characterized in that Before verifying whether the third Hash operation value matches the fourth Hash operation value, the method further includes: Obtaining an intermediate random number of the decryption end according to the timestamp random number of the decryption end, a base point corresponding to the timestamp random number of the decryption end, and the second shared key; The intermediate random number is sent to the encryption end, and the intermediate random number is used by the decryption end to calculate a second Hash operation value.

28. The method according to claim 18, characterized in that The encrypted information is the encrypted information of the current data; and decrypting the encrypted information by using the second session key and the backpack private key vector of the decryption end includes: Decrypting the encrypted information using the second session key to obtain an information encryption backpack value; The information encrypted backpack value is decrypted using the backpack vector private key of the decryption end to obtain the current data.

29. The method according to claim 18, characterized in that Before generating the second shared key between the decryption end and the encryption end, the method further includes: Obtaining the backpack public key vector and the public key of the authentication center from the authentication center; Obtaining a backpack value of the decryption end by using the backpack public key vector of the authentication center, the identity information of the decryption end, and the device identifier of the decryption end; Generate a signature file of the decryption end by using the backpack value of the decryption end; The backpack value of the decryption end and the signature file are sent to the authentication center.

30. The method according to claim 29, characterized in that According to the following formula, the backpack value of the decryption end is obtained by using the backpack public key vector of the authentication center, the identity information of the decryption end and the device identifier of the decryption end: in, represents the backpack value of the decryption end, is the backpack public key vector of the authentication center, ID B Indicates the identity information of the decryption end, ID B ={id B ‖UID B }, id B Indicates the identity authentication information of the decryption end, UID B The device identifier of the decryption terminal, (ID B )2=m1,m2…m n ,m i ∈{0,1},(ID B )2 is the identity information ID B The binary n-ary form of .

31. The method according to claim 29, characterized in that The signature file of the decryption end is generated using the backpack value of the decryption end according to the following formula: Among them, V B Indicates the signature file of the encryption end, j b Represents a random number, represents the backpack value of the decryption end, G represents the elliptic curve base point, and h() represents the hash function.

32. The method according to claim 29, characterized in that The method further comprises: Obtaining the verification public key of the decryption terminal and the signature of the decryption terminal from the authentication center; Generate a private key of the decryption end according to the signature of the decryption end and the backpack value of the decryption end; The verification public key of the decryption end is verified using the private key of the decryption end.

33. The method according to claim 32, characterized in that The private key of the decryption end is generated by using the signature of the decryption end and the backpack value of the decryption end through the following formula, including: Among them, SK B represents the private key of the decryption end, W B represents the signature of the decryption end, j b Represents a random number, represents the backpack value of the decryption end, and h() represents a hash function.

34. The method according to claim 32, characterized in that The verifying the verification public key of the decryption end by using the private key of the decryption end includes: Obtaining a third value using the private key of the decryption end and the elliptic curve base point obtained from the authentication center; Obtain a fourth value using the verification public key of the decryption end, the backpack value of the decryption end, the ordinate of the verification public key of the decryption end, and the public key of the authentication center; Matching the third value and the fourth value; If the third value is equal to the fourth value, it means that the verification public key of the decryption end has passed the verification; The third value is obtained by the following formula: S p =SK B ·G Among them, S p represents the third value, SK B represents the private key of the decryption end, and G represents the elliptic curve base point; The fourth value is obtained by the following formula: Wherein, Sq represents the fourth value, PK B represents the verification public key of the decryption end, G represents the base point of the elliptic curve, q ay 1 represents the ordinate of the authentication public key of the decryption end, represents the backpack value of the decryption end, h() represents the hash function, PK CA Represents the public key of the certification authority.

35. An encryption and decryption method, characterized in that: include: The encryption end generates a first shared key with the decryption end, and the decryption end generates a second shared key with the encryption end; The encryption end generates a first session key for current data encryption according to the first shared key and random information corresponding to the decryption end and the current data encryption interaction; The decryption end generates a second session key for current data encryption according to the second shared key and random information corresponding to the encryption end and the current data encryption interaction; The encryption end encrypts the current data using the backpack public key vector of the decryption end and the first session key to obtain first encrypted information; The decryption end obtains the first encrypted information; The decryption end root decrypts the first encrypted information using the second session key and the backpack private key vector of the decryption end to obtain the current data; The random information corresponding to the decryption end and the current data encryption interaction includes the first random number of the encryption end; the random information corresponding to the encryption end and the current data encryption interaction includes the second random number of the decryption end; The first random number is obtained in the following manner: Obtaining a first random number of the encryption end according to the intermediate random number of the decryption end, the timestamp random number of the encryption end, the first shared key, the timestamp random number of the decryption end, and a base point corresponding to the timestamp random number of the decryption end; The second random number is obtained by: The second random number of the decryption end is obtained according to the intermediate random number of the encryption end, the timestamp random number of the decryption end, the second shared key, the timestamp random number of the encryption end and the base point corresponding to the timestamp random number of the encryption end.

36. The method according to claim 35, characterized in that The method further comprises at least one of the following steps: Before the encryption end generates a first shared key between the encryption end and the decryption end, and before the decryption end generates a second shared key between the encryption end and the encryption end, the encryption end and the authentication center perform registration and authentication, and the decryption end and the authentication center perform registration and authentication; Before the encryption end generates a first shared key between the encryption end and the decryption end, and before the decryption end generates a second shared key between the encryption end and the encryption end, the encryption end and the decryption end perform a mutual first authentication; Before the encryption end generates a first session key for current data encryption and before the decryption end generates a second session key, the encryption end and the decryption end perform a mutual second authentication.

37. The method according to claim 36, characterized in that The generating of the first shared key for current data encryption includes: After the encryption end successfully verifies the decryption end and the decryption end successfully verifies the encryption end, generating a first shared key for current data encryption; The generating of the second shared key for current data encryption includes: After the encryption end successfully verifies the decryption end and the decryption end successfully verifies the encryption end, a second shared key for current data encryption is generated.

38. The method according to claim 36, characterized in that The generating of the first session key for current data encryption comprises: After the encryption end successfully verifies the decryption end and the decryption end successfully verifies the encryption end, generating a first session key for current data encryption; The generating of the second session key for current data encryption comprises: After the encryption end successfully verifies the decryption end and the decryption end successfully verifies the encryption end, a second session key for this data encryption is generated.

39. An authentication method, applied to an authentication center, characterized in that: include: Receive the client's authentication request; Generate a backpack public key vector using a backpack algorithm according to the authentication request; Sending the backpack public key vector to the client; Receiving a backpack value sent by the client, wherein the backpack value is calculated by the client using the backpack public key vector; authenticating the client according to the backpack value; Wherein, if the client is an encryption end, the encryption end generates a first session key for current data encryption according to a first shared key between the encryption end and the decryption end and random information corresponding to the current data encryption interaction with the decryption end, and encrypts the current data using the backpack public key vector of the decryption end and the first session key to obtain first encrypted information; wherein the random information includes a first random number of the encryption end; the first random number is obtained in the following manner: Obtaining a first random number of the encryption end according to the intermediate random number of the decryption end, the timestamp random number of the encryption end, the first shared key, the timestamp random number of the decryption end, and a base point corresponding to the timestamp random number of the decryption end; or If the client is a decryption end, the decryption end generates a second session key for current data encryption according to the second shared key between the decryption end and the encryption end and the random information corresponding to the current data encryption interaction of the encryption end, and decrypts the encrypted information obtained by the decryption end by using the second session key and the backpack private key vector of the decryption end; wherein the random information includes the second random number of the decryption end; and the second random number is obtained in the following manner: The second random number of the decryption end is obtained according to the intermediate random number of the encryption end, the timestamp random number of the decryption end, the second shared key, the timestamp random number of the encryption end and the base point corresponding to the timestamp random number of the encryption end.

40. The method according to claim 39, characterized in that The step of generating a backpack public key vector by using a backpack algorithm according to the authentication request includes: Get the super-incrementing backpack vector, the first backpack vector and the second backpack vector; The Chinese remainder theorem is used to operate the super-increasing backpack vector, the first backpack vector, the second backpack vector, a first constant, and a second constant to generate the backpack public key vector.

41. The method according to claim 39, characterized in that The authenticating the client according to the backpack value includes: Generate a verification public key and a signature according to the backpack value; The verification public key and signature are sent to the client.

42. An encryption device, applied to an encryption end, characterized in that: include: A first generating module, used to generate a first shared key between the encryption end and the decryption end; A second generating module, configured to generate a first session key for current data encryption according to the first shared key and random information corresponding to the current data encryption interaction with the decryption end; A first acquisition module, configured to encrypt the current data using the backpack public key vector of the decryption end and the first session key to obtain first encrypted information; The random information includes a first random number of the encryption end; the first random number is obtained in the following manner: The first random number of the encryption end is obtained according to the intermediate random number of the decryption end, the timestamp random number of the encryption end, the first shared key, the timestamp random number of the decryption end and the base point corresponding to the timestamp random number of the decryption end.

43. A decryption device, applied to a decryption terminal, characterized in that: include: A first generating module, used to generate a second shared key between the decryption end and the encryption end; A second generating module, used to generate a second session key for current data encryption according to the second shared key and random information corresponding to the current data encryption interaction of the encryption end; The first acquisition module is used to obtain the encryption information of this data; A first decryption module, configured to decrypt the encrypted information using the second session key and a backpack private key vector of the decryption end; The random information includes a second random number of the decryption end; the second random number is obtained in the following manner: The second random number of the decryption end is obtained according to the intermediate random number of the encryption end, the timestamp random number of the decryption end, the second shared key, the timestamp random number of the encryption end and the base point corresponding to the timestamp random number of the encryption end.

44. An authentication device, used in an authentication center, characterized in that: include: A first receiving module, used to receive an authentication request from a client; A first generating module, configured to generate a backpack public key vector using a backpack algorithm according to the authentication request; A first sending module, configured to send the backpack public key vector to the client; A second receiving module is used to receive a backpack value sent by the client, wherein the backpack value is calculated by the client using the backpack public key vector; A first authentication module, used for authenticating the client according to the backpack value; Wherein, if the client is an encryption end, the encryption end generates a first session key for current data encryption according to a first shared key between the encryption end and the decryption end and random information corresponding to the current data encryption interaction with the decryption end, and encrypts the current data using the backpack public key vector of the decryption end and the first session key to obtain first encrypted information; wherein the random information includes a first random number of the encryption end; the first random number is obtained in the following manner: Obtaining a first random number of the encryption end according to the intermediate random number of the decryption end, the timestamp random number of the encryption end, the first shared key, the timestamp random number of the decryption end, and a base point corresponding to the timestamp random number of the decryption end; or If the client is a decryption end, the decryption end generates a second session key for current data encryption according to the second shared key between the decryption end and the encryption end and the random information corresponding to the current data encryption interaction of the encryption end, and decrypts the encrypted information obtained by the decryption end by using the second session key and the backpack private key vector of the decryption end; wherein the random information includes the second random number of the decryption end; and the second random number is obtained in the following manner: The second random number of the decryption end is obtained according to the intermediate random number of the encryption end, the timestamp random number of the decryption end, the second shared key, the timestamp random number of the encryption end and the base point corresponding to the timestamp random number of the encryption end.

45. An electronic device comprising: A memory, a processor, and a program stored in the memory and executable on the processor; characterized in that the processor is used to read the program in the memory to implement the steps of the encryption method as described in any one of claims 1 to 17; or to implement the steps of the decryption method as described in any one of claims 18 to 34; or to implement the steps of the encryption and decryption method as described in any one of claims 35 to 38; or to implement the steps of the authentication method as described in any one of claims 39 to 41.

46. ​​A readable storage medium for storing a program, characterized in that: When the program is executed by the processor, it implements the steps of the encryption method as described in any one of claims 1 to 17; or implements the steps of the decryption method as described in any one of claims 18 to 34; or implements the steps of the encryption and decryption method as described in any one of claims 35 to 38; or implements the steps of the authentication method as described in any one of claims 39 to 41.