Encryption verification methods, devices, and equipment based on digital signature algorithms

By generating random numbers to select encryption strategies and combining different algorithms and keys, the problem of information security risks in existing technologies is solved, and the security and integrity verification of information transmission is achieved.

CN116881939BActive Publication Date: 2026-11-10SUZHOU UNIONMEMORY INFORMATION SYST LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310830383.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-07-07
Publication Date
2026-11-10
Estimated Expiration
2043-07-07

AI Technical Summary

Technical Problem

Existing digital signature implementations have information security risks, especially those based on HASH and RSA algorithms, which have insufficient security performance.

Method used

By generating random numbers and selecting different encryption algorithms and keys based on the parity of the random numbers, and combining SHA256 hash algorithm and RSA algorithm or SM3 hash algorithm and SM2 algorithm, encryption and verification processes are performed to ensure the security of information transmission.

Benefits of technology

It enhances the security protection capabilities of information transmission, effectively detecting the integrity of data during transmission and preventing tampering.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116881939B_ABST
    Figure CN116881939B_ABST
Patent Text Reader

Abstract

This invention provides an encryption verification method, apparatus, and device based on digital signature algorithm selection. The method is applied to an encryption verification system, which includes a sending end and a receiving end. The method includes: the sending end generating a random number according to a preset random number algorithm; the sending end determining a target encryption strategy based on the random number and a preset algorithm selection strategy; the sending end encrypting preset parameter data according to the target encryption strategy to obtain encrypted information; the sending end sending the encrypted information and the target encryption strategy to the receiving end; the receiving end determining a corresponding target verification strategy based on the target encryption strategy; and the receiving end verifying the encrypted information according to the target verification strategy to obtain a corresponding verification result. This invention can determine the target encryption strategy and the corresponding target verification strategy based on a random number and an algorithm selection strategy, effectively improving the system's security protection capabilities.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of computer technology, and in particular to an encryption verification method, apparatus, and device based on digital signature algorithm selection. Background Technology

[0002] Most mainstream solid-state drives (SSDs) nowadays have encryption mechanisms. To ensure the validity and security of data transmission on SSDs, digital signatures are typically used for verification. A digital signature is a string of numbers that only the sender of the information can generate and that cannot be forged by others. This string of numbers serves as valid proof of the authenticity of the information sent by the sender. Digital signatures are an application of asymmetric key encryption technology and digital digest technology, resulting in a higher level of security.

[0003] Existing digital signature implementations are typically based on HASH and RSA algorithms. The SHA algorithm, a secure hash algorithm proposed by the U.S. National Security Agency, poses information security risks.

[0004] Therefore, existing digital signature implementations pose information security risks. Summary of the Invention

[0005] This invention provides an encryption verification method, apparatus, and device based on digital signature algorithm selection, aiming to solve the information security risks existing in current digital signature implementations.

[0006] In a first aspect, embodiments of the present invention provide an encryption verification method based on digital signature algorithm selection. The method is applied to an encryption verification system, which includes a sending end and a receiving end. The method includes: The sending end generates random numbers according to a preset random number algorithm; The sending end determines the target encryption strategy based on the random number and the preset algorithm selection strategy; The sending end encrypts the preset parameter data according to the target encryption strategy to obtain encrypted information; The sending end sends the encrypted information and the target encryption policy to the receiving end; The receiving end determines the corresponding target verification strategy based on the target encryption strategy; The receiving end verifies the encrypted information according to the target verification strategy and obtains the corresponding verification result.

[0007] Secondly, embodiments of the present invention also provide an encryption verification device based on digital signature algorithm selection. The device includes a generation unit, a first determination unit, an encryption unit, and a sending unit configured at the sending end. The device also includes a second determination unit and a verification unit configured at the receiving end. The generation unit is used by the sending end to generate random numbers according to a preset random number algorithm; The first determining unit is used by the sending end to determine the target encryption strategy based on the random number and a preset algorithm selection strategy; The encryption unit is used by the sending end to encrypt preset parameter data according to the target encryption strategy to obtain encrypted information; The sending unit is used by the sending end to send the encrypted information and the target encryption policy to the receiving end; The second determining unit is used for the receiving end to determine the corresponding target verification strategy according to the target encryption strategy; The verification unit is used by the receiving end to verify the encrypted information according to the target verification strategy and obtain the corresponding verification result.

[0008] Thirdly, embodiments of the present invention also provide an electronic device, which includes a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the method described in the first aspect above.

[0009] Fourthly, embodiments of the present invention also provide a computer-readable storage medium storing a computer program, the computer program including program instructions that, when executed by a processor, can implement the method described in the first aspect.

[0010] This invention provides an encryption verification method, apparatus, and device based on digital signature algorithm selection. The method is applied to an encryption verification system, which includes a sending end and a receiving end. The method includes: the sending end generating a random number according to a preset random number algorithm; the sending end determining a target encryption strategy based on the random number and a preset algorithm selection strategy; the sending end encrypting preset parameter data according to the target encryption strategy to obtain encrypted information; the sending end sending the encrypted information and the target encryption strategy to the receiving end; the receiving end determining a corresponding target verification strategy based on the target encryption strategy; and the receiving end verifying the encrypted information according to the target verification strategy to obtain a corresponding verification result. This invention can determine a target encryption strategy and a corresponding target verification strategy based on a random number and an algorithm selection strategy, effectively improving the system's security protection capabilities. Attached Figure Description

[0011] To more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings used in the following description of the embodiments will be briefly introduced. Obviously, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0012] Figure 1 This is a flowchart illustrating the encryption verification method based on digital signature algorithm selection provided in an embodiment of the present invention. Figure 2 A schematic diagram of a sub-process of an encryption verification method based on digital signature algorithm selection provided in an embodiment of the present invention; Figure 3 A schematic block diagram of an encryption verification device based on digital signature algorithm selection provided in an embodiment of the present invention; Figure 4 This is a schematic block diagram of an electronic device provided in an embodiment of the present invention. Detailed Implementation

[0013] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0014] It should be understood that, when used in this specification and the appended claims, the terms "comprising" and "including" indicate the presence of the described features, integrals, steps, operations, elements and / or components, but do not exclude the presence or addition of one or more other features, integrals, steps, operations, elements, components and / or collections thereof.

[0015] It should also be understood that the terminology used in this specification is for the purpose of describing particular embodiments only and is not intended to limit the invention. As used in this specification and the appended claims, the singular forms “a,” “an,” and “the” are intended to include the plural forms unless the context clearly indicates otherwise.

[0016] It should also be further understood that the term "and / or" as used in this specification and the appended claims refers to any combination and all possible combinations of one or more of the associated listed items, and includes such combinations. Embodiments of this invention provide an encryption verification method, apparatus, and device based on digital signature algorithm selection. The method is applied to an encryption verification system, which includes a sending end and a receiving end.

[0017] Figure 1 This is a flowchart illustrating an encryption verification method based on digital signature algorithm selection, provided in an embodiment of the present invention. Figure 1 As shown, the method includes the following steps S110-S160.

[0018] S110. The sending end generates a random number according to a preset random number algorithm.

[0019] In this embodiment, the sending end generates a random number according to a preset random number algorithm, and selects different algorithm schemes based on the parity of the random number, which can effectively improve the system's security protection capabilities. The random number can be the current date information.

[0020] S120. The sending end determines the target encryption strategy based on the random number and the preset algorithm selection strategy.

[0021] In this embodiment, the target encryption strategy can be determined based on the parity of the random number, or the random number can be moduloed by a preset integer to obtain the remainder result, and the target encryption strategy can be determined based on the remainder result.

[0022] In one implementation, the target encryption strategy includes a target algorithm and a target encryption key corresponding to the target algorithm, and step S120 includes: S1201. Determine the target algorithm based on the parity of the random number; S1202. Determine the target encryption key corresponding to the random number according to the selection strategy corresponding to the target algorithm.

[0023] In this embodiment, the target encryption strategy includes a target algorithm and a target encryption key corresponding to the target algorithm. The target algorithm is determined based on the parity of the random number. The target algorithm can be a first algorithm or a second algorithm. The target encryption key includes a target public key and a target private key. Determining the target algorithm and the target encryption algorithm based on the random number can effectively improve the system's security protection capabilities.

[0024] In one embodiment, step S1201 includes: if the random number is even, configuring the first algorithm as the target algorithm; if the random number is odd, configuring the second algorithm as the target algorithm.

[0025] In this embodiment, if the random number is even, the first algorithm is configured as the target algorithm; if the random number is odd, the second algorithm is configured as the target algorithm. Determining the target algorithm based on the parity of the random number can effectively improve the system's security protection capabilities.

[0026] In one embodiment, step S1202 includes: obtaining a corresponding calculated value from the selection strategy corresponding to the target algorithm; performing a modulo operation on the random number based on the calculated value to obtain a corresponding modulo value; and obtaining a key corresponding to the modulo value from the key set of the selection strategy corresponding to the target algorithm as the target encryption key.

[0027] In this embodiment, a calculated value, a random integer N, is obtained from the selection strategy corresponding to the target algorithm. Based on this calculated value, a key is selected from the key set of the selection strategy corresponding to the target algorithm; that is, a key is selected as the target encryption key from the N sets of keys in the key set. The calculated value is then moduloed on the random number to obtain the corresponding remainder value M. At this point, the Mth key in the N sets of keys is the target encryption key. The remainder value depends on the number of keys in the key set; that is, the calculated value N is not greater than the number of keys in the key set.

[0028] For example, if the target algorithm is the first algorithm and the key set contains three sets of keys, then the corresponding calculated value N=3. If the random number is 5, then the remainder calculation is performed on the random number according to the calculated value, that is, 5 divided by 3, to obtain the corresponding remainder value M=2. At this time, the second set of keys in the key set is the target encryption key.

[0029] S130. The sending end encrypts the preset parameter data according to the target encryption strategy to obtain encrypted information.

[0030] In this embodiment, the sending end encrypts the preset parameter data according to the target encryption strategy to obtain encrypted information. The parameter data can be encrypted data, which can be a version number, or a software or hardware name.

[0031] In one embodiment, step S130 includes: calculating preset parameter data according to the encryption algorithm in the target encryption strategy to obtain data to be verified; signing the data to be verified according to the signature algorithm in the target encryption strategy and the target private key to obtain a digital signature; the target private key is the target private key of the target encryption key in the target encryption strategy; and combining the digital signature and the parameter data to obtain encrypted information.

[0032] In this embodiment, the target algorithm is determined based on the parity of the random number. If the random number is even, the first algorithm is configured as the target algorithm; if the random number is odd, the second algorithm is configured as the target algorithm. The first algorithm includes a first encryption algorithm and a first signature algorithm. The first encryption algorithm can be the SHA256 hash algorithm, and the first signature algorithm can be the RSA algorithm. The SHA algorithm is a secure hash algorithm proposed by the U.S. National Security Agency. To meet the future development needs of the domestic information security market, a second algorithm is proposed. The second algorithm includes a second encryption algorithm and a second signature algorithm. The second encryption algorithm can be the SM3 hash algorithm, and the second signature algorithm can be the SM2 algorithm. The SM3 hash algorithm is a cryptographic hash function standard issued by the State Cryptography Administration. Using the SM3 hash algorithm can better meet the future development needs of the information market.

[0033] If the random number is even, the first algorithm is configured as the target algorithm; the preset parameter data is calculated using the SHA256 hash algorithm to obtain the data to be verified; the data to be verified is signed using the RSA algorithm to obtain a digital signature; the digital signature and the parameter data are combined to obtain encrypted information. If the random number is odd, the second algorithm is configured as the target algorithm; the preset parameter data is calculated using the SM3 hash algorithm to obtain the data to be verified; the data to be verified is signed using the SM2 algorithm to obtain a digital signature; the digital signature and the parameter data are combined to obtain encrypted information.

[0034] S140, The sending end sends the encrypted information and the target encryption policy to the receiving end.

[0035] In this embodiment, the receiving end can determine the corresponding target verification strategy based on the received target encryption strategy, and the receiving end can verify the encrypted information according to the target verification strategy to obtain a verification result. The verification result can verify the integrity of the information.

[0036] S150, The receiving end determines the corresponding target verification strategy according to the target encryption strategy.

[0037] In this embodiment, if the encryption algorithm in the target encryption strategy is the SHA256 hash algorithm, then the encryption algorithm in the target verification strategy is also the SHA256 hash algorithm; if the signature algorithm in the target encryption strategy is the RSA algorithm, then the signature algorithm in the target verification algorithm is also the RSA algorithm.

[0038] If the encryption algorithm in the target encryption strategy is the SM3 hash algorithm, then the encryption algorithm in the target verification strategy is also the SM3 hash algorithm; if the signature algorithm in the target encryption strategy is the SM2 algorithm, then the signature algorithm in the target verification algorithm is also the SM2 algorithm.

[0039] S160. The receiving end verifies the encrypted information according to the target verification strategy and obtains the corresponding verification result.

[0040] In this embodiment, the receiving end verifies the encrypted information according to the target verification strategy to obtain the corresponding verification result. The verification result can verify the integrity of the information and detect whether the transmitted data has been tampered with.

[0041] In one implementation, step S160 includes: parsing the encrypted information to obtain first data to be verified and second data to be verified; calculating the first data to be verified according to the encryption algorithm in the target verification strategy to obtain a first feature sequence; signing and designing the second data to be verified according to the signature algorithm in the target verification strategy and the target public key to obtain a second feature sequence; the target public key is the target public key of the target encryption key in the target encryption strategy; comparing the first feature sequence and the second feature sequence to obtain a verification result.

[0042] In this embodiment, the first data to be verified corresponds to the parameter data in the encrypted information sent by the sending end, and the second data to be verified corresponds to the digital signature in the encrypted information sent by the sending end.

[0043] If the target algorithm is the first algorithm, the encryption algorithm in the target verification strategy is the SHA256 hash algorithm, and the signature algorithm in the target verification strategy is the RSA algorithm, then the first feature sequence is obtained by calculating the first data to be verified using the SHA256 hash algorithm; the second data to be verified is signed using the RSA algorithm and the target public key to obtain the second feature sequence; the target public key is the target public key of the target encryption key in the target encryption strategy; the first feature sequence and the second feature sequence are compared to obtain the verification result. If the comparison results are the same, it proves that the data has not been tampered with during transmission; if the comparison results are different, it proves that the data has been modified during transmission.

[0044] If the target algorithm is the second algorithm, the encryption algorithm in the target verification strategy is the SM3 hash algorithm, and the signature algorithm in the target verification strategy is the SM2 algorithm. The first feature sequence is obtained by calculating the first data to be verified using the SM3 hash algorithm; the second data to be verified is signed and designed using the SM2 algorithm and the target public key to obtain the second feature sequence; the target public key is the target public key of the target encryption key in the target encryption strategy; the first feature sequence and the second feature sequence are compared to obtain the verification result. If the comparison result is the same, it proves that the data has not been tampered with during transmission; if the comparison result is different, it proves that the data has been modified during transmission.

[0045] In summary, the embodiments of the present invention can determine the target encryption strategy and the target verification strategy corresponding to the target encryption strategy based on random numbers and algorithm selection strategies, which can effectively improve the system's security protection capabilities.

[0046] Figure 3 This is a schematic block diagram of an encryption verification device based on digital signature algorithm selection provided in an embodiment of the present invention. Figure 3 As shown, corresponding to the above encryption verification method based on digital signature algorithm selection, the present invention also provides an encryption verification device based on digital signature algorithm selection. The device is configured in an encryption verification system, which includes a sending end and a receiving end. Specifically, please refer to... Figure 3 The device 700 includes a generation unit 701, a first determination unit 702, an encryption unit 703 and a sending unit 704 configured at the sending end. The device 700 also includes a second determination unit 705 and a verification unit 706 configured at the receiving end.

[0047] The generation unit 701 is used by the sending end to generate random numbers according to a preset random number algorithm; The first determining unit 702 is used by the sending end to determine the target encryption strategy based on the random number and the preset algorithm selection strategy; The encryption unit 703 is used by the sending end to encrypt preset parameter data according to the target encryption strategy to obtain encrypted information; The sending unit 704 is used by the sending end to send the encrypted information and the target encryption policy to the receiving end; The second determining unit 705 is used for the receiving end to determine the corresponding target verification strategy according to the target encryption strategy; The verification unit 706 is used by the receiving end to verify the encrypted information according to the target verification strategy and obtain the corresponding verification result.

[0048] In some embodiments, the target encryption strategy includes a target algorithm and a target encryption key corresponding to the target algorithm; the first determining unit 702 includes: a first determining subunit, configured to determine the target algorithm based on the parity of the random number; and a second determining subunit, configured to determine the target encryption key corresponding to the random number based on a selection strategy corresponding to the target algorithm.

[0049] In some embodiments, when the first determining unit 702 performs the target determination algorithm step based on the parity of the random number, it is specifically used for: If the random number is even, the first algorithm is configured as the target algorithm; if the random number is odd, the second algorithm is configured as the target algorithm.

[0050] In some embodiments, when the second determining unit 705 performs the step of determining the target encryption key corresponding to the random number according to the selection strategy corresponding to the target algorithm, it is specifically used for: Obtain the corresponding calculated value from the selection strategy corresponding to the target algorithm; perform a modulo operation on the random number based on the calculated value to obtain the corresponding modulo value; obtain the key corresponding to the modulo value from the key set of the selection strategy corresponding to the target algorithm as the target encryption key.

[0051] In some embodiments, when the encryption unit 703 performs the step of encrypting preset parameter data according to the target encryption policy at the sending end to obtain encrypted information, it is specifically used for: The preset parameter data is calculated according to the encryption algorithm in the target encryption strategy to obtain the data to be verified; the data to be verified is signed according to the signature algorithm in the target encryption strategy and the target private key to obtain a digital signature; the target private key is the target private key of the target encryption key in the target encryption strategy; the digital signature and the parameter data are combined to obtain encrypted information.

[0052] In some embodiments, when the verification unit 706 performs the step of verifying the encrypted information according to the target verification strategy and obtaining the corresponding verification result, it is specifically used for: The encrypted information is parsed to obtain first data to be verified and second data to be verified; the first data to be verified is calculated according to the encryption algorithm in the target verification strategy to obtain a first feature sequence; the second data to be verified is signed and designed according to the signature algorithm in the target verification strategy and the target public key to obtain a second feature sequence; the target public key is the target public key of the target encryption key in the target encryption strategy; the first feature sequence and the second feature sequence are compared to obtain a verification result.

[0053] It should be noted that those skilled in the art can clearly understand that the specific implementation process of the encryption verification device and each unit selected based on the digital signature algorithm can be referred to the corresponding description in the foregoing method embodiments. For the sake of convenience and brevity, it will not be repeated here.

[0054] The aforementioned encryption verification device based on digital signature algorithms can be implemented as a computer program, which can, for example, Figure 4 It runs on the computer device shown.

[0055] Please see Figure 4 , Figure 4 This is a schematic block diagram of an electronic device provided in an embodiment of the present invention. The computer device 800 can be a terminal or a server. The terminal can be an electronic device with communication functions, such as a smartphone, tablet computer, laptop computer, desktop computer, personal digital assistant, or wearable device. The server can be a standalone server or a server cluster composed of multiple servers.

[0056] See Figure 4 The electronic device 800 includes a processor 802, a memory, and a network interface 805 connected via a system bus 801. The memory may include a non-volatile storage medium 803 and internal memory 804.

[0057] The non-volatile storage medium 803 may store an operating system 8031 ​​and a computer program 8032. The computer program 8032 includes program instructions that, when executed, cause the processor 802 to perform an encryption verification method based on a digital signature algorithm.

[0058] The processor 802 provides computing and control capabilities to support the operation of the entire electronic device 800.

[0059] The internal memory 804 provides an environment for the execution of the computer program 8032 in the non-volatile storage medium 803. When the computer program 8032 is executed by the processor 802, the processor 802 can execute an encryption verification method based on a digital signature algorithm.

[0060] This network interface 805 is used for network communication with other devices. Those skilled in the art will understand that... Figure 4 The structure shown is merely a block diagram of a portion of the structure related to the present invention and does not constitute a limitation on the electronic device 800 to which the present invention is applied. The specific electronic device 800 may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.

[0061] The encryption verification method is applied in an encryption verification system, which includes a sending end and a receiving end. The processor 802 is used to run a computer program 8032 stored in the memory to perform the following steps: The sending end generates a random number according to a preset random number algorithm; the sending end determines a target encryption strategy based on the random number and a preset algorithm selection strategy; the sending end encrypts preset parameter data according to the target encryption strategy to obtain encrypted information; the sending end sends the encrypted information and the target encryption strategy to the receiving end; the receiving end determines a corresponding target verification strategy based on the target encryption strategy; the receiving end verifies the encrypted information according to the target verification strategy to obtain a corresponding verification result.

[0062] In some embodiments, the target encryption strategy includes a target algorithm and a target encryption key corresponding to the target algorithm; when the processor 802 implements the step of determining the target encryption strategy based on the random number and the preset algorithm selection strategy, it specifically implements the following steps: The target algorithm is determined based on the parity of the random number; the target encryption key corresponding to the random number is determined based on the selection strategy corresponding to the target algorithm.

[0063] In some embodiments, when implementing the algorithm step of determining the target based on the parity of the random number, the processor 802 specifically implements the following steps: If the random number is even, the first algorithm is configured as the target algorithm; if the random number is odd, the second algorithm is configured as the target algorithm.

[0064] In some embodiments, when the processor 802 implements the step of determining the target encryption key corresponding to the random number according to the selection strategy corresponding to the target algorithm, it specifically implements the following steps: Obtain the corresponding calculated value from the selection strategy corresponding to the target algorithm; perform a modulo operation on the random number based on the calculated value to obtain the corresponding modulo value; obtain the key corresponding to the modulo value from the key set of the selection strategy corresponding to the target algorithm as the target encryption key.

[0065] In some embodiments, when the processor 802 implements the step of encrypting preset parameter data according to the target encryption policy at the sending end to obtain encrypted information, the specific implementation steps are as follows: The preset parameter data is calculated according to the encryption algorithm in the target encryption strategy to obtain the data to be verified; the data to be verified is signed according to the signature algorithm in the target encryption strategy and the target private key to obtain a digital signature; the target private key is the target private key of the target encryption key in the target encryption strategy; the digital signature and the parameter data are combined to obtain encrypted information.

[0066] In some embodiments, when the processor 802 performs the step of verifying the encrypted information according to the target verification strategy and obtaining the corresponding verification result, it specifically implements the following steps: The encrypted information is parsed to obtain first data to be verified and second data to be verified; the first data to be verified is calculated according to the encryption algorithm in the target verification strategy to obtain a first feature sequence; the second data to be verified is signed and designed according to the signature algorithm in the target verification strategy and the target public key to obtain a second feature sequence; the target public key is the target public key of the target encryption key in the target encryption strategy; the first feature sequence and the second feature sequence are compared to obtain a verification result.

[0067] It should be understood that, in this embodiment of the invention, the processor 802 may be a Central Processing Unit (CPU), or it may be other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or any conventional processor.

[0068] It will be understood by those skilled in the art that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program includes program instructions and can be stored in a storage medium, which is a computer-readable storage medium. The program instructions are executed by at least one processor in the computer system to implement the process steps of the embodiments of the above methods.

[0069] Therefore, the present invention also provides a storage medium. This storage medium can be a computer-readable storage medium. The storage medium stores a computer program, wherein the computer program includes program instructions. When executed by a processor, the program instructions cause the processor to perform the following steps: The sending end generates a random number according to a preset random number algorithm; the sending end determines a target encryption strategy based on the random number and a preset algorithm selection strategy; the sending end encrypts preset parameter data according to the target encryption strategy to obtain encrypted information; the sending end sends the encrypted information and the target encryption strategy to the receiving end; the receiving end determines a corresponding target verification strategy based on the target encryption strategy; the receiving end verifies the encrypted information according to the target verification strategy to obtain a corresponding verification result.

[0070] In one embodiment, the target encryption strategy includes a target algorithm and a target encryption key corresponding to the target algorithm; when the processor executes the step of determining the target encryption strategy based on the random number and a preset algorithm selection strategy, it specifically implements the following steps: The target algorithm is determined based on the parity of the random number; the target encryption key corresponding to the random number is determined based on the selection strategy corresponding to the target algorithm.

[0071] In one embodiment, when the processor executes the algorithm step of determining the target based on the parity of the random number, it specifically implements the following steps: If the random number is even, the first algorithm is configured as the target algorithm; if the random number is odd, the second algorithm is configured as the target algorithm.

[0072] In one embodiment, when the processor performs the step of determining the target encryption key corresponding to the random number according to the selection strategy corresponding to the target algorithm, it specifically implements the following steps: Obtain the corresponding calculated value from the selection strategy corresponding to the target algorithm; perform a modulo operation on the random number based on the calculated value to obtain the corresponding modulo value; obtain the key corresponding to the modulo value from the key set of the selection strategy corresponding to the target algorithm as the target encryption key.

[0073] In one embodiment, when the processor performs the step of encrypting preset parameter data according to the target encryption policy at the sending end to obtain encrypted information, the specific implementation steps are as follows: The preset parameter data is calculated according to the encryption algorithm in the target encryption strategy to obtain the data to be verified; the data to be verified is signed according to the signature algorithm in the target encryption strategy and the target private key to obtain a digital signature; the target private key is the target private key of the target encryption key in the target encryption strategy; the digital signature and the parameter data are combined to obtain encrypted information.

[0074] In one embodiment, when the processor performs the step of verifying the encrypted information according to the target verification strategy and obtaining the corresponding verification result, it specifically implements the following steps: The encrypted information is parsed to obtain first data to be verified and second data to be verified; the first data to be verified is calculated according to the encryption algorithm in the target verification strategy to obtain a first feature sequence; the second data to be verified is signed and designed according to the signature algorithm in the target verification strategy and the target public key to obtain a second feature sequence; the target public key is the target public key of the target encryption key in the target encryption strategy; the first feature sequence and the second feature sequence are compared to obtain a verification result.

[0075] The storage medium can be any computer-readable storage medium capable of storing program code, such as a USB flash drive, portable hard drive, read-only memory (ROM), magnetic disk, or optical disk.

[0076] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of the various examples have been generally described in terms of functionality in the foregoing description. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementations should not be considered beyond the scope of this invention.

[0077] In the several embodiments provided by this invention, it should be understood that the disclosed apparatus and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative. For example, the division of each unit is merely a logical functional division, and there may be other division methods in actual implementation. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed.

[0078] The steps in the method of this invention can be adjusted, merged, or reduced in order according to actual needs. The units in the device of this invention can be merged, divided, or reduced according to actual needs. Furthermore, the functional units in the various embodiments of this invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.

[0079] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, a terminal, or a network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention.

[0080] The above description is merely a specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any person skilled in the art can easily conceive of various equivalent modifications or substitutions within the technical scope disclosed in the present invention, and these modifications or substitutions should all be covered within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be determined by the scope of the claims.

Claims

1. An encryption verification method based on digital signature algorithm selection, the method being applied in an encryption verification system, the encryption verification system comprising a sending end and a receiving end, characterized in that, The method includes: The sending end generates random numbers according to a preset random number algorithm; The sending end determines the target encryption strategy based on the random number and the preset algorithm selection strategy; The sending end encrypts the preset parameter data according to the target encryption strategy to obtain encrypted information; The sending end sends the encrypted information and the target encryption policy to the receiving end; The receiving end determines the corresponding target verification strategy based on the target encryption strategy; The receiving end verifies the encrypted information according to the target verification strategy and obtains the corresponding verification result; The target encryption strategy includes a target algorithm and a target encryption key corresponding to the target algorithm; the step of determining the target encryption strategy based on the random number and a preset algorithm selection strategy includes: The target algorithm is determined based on the parity of the random number. The target encryption key corresponding to the random number is determined according to the selection strategy corresponding to the target algorithm; The step of determining the target encryption key corresponding to the random number according to the selection strategy corresponding to the target algorithm includes: Obtain the corresponding calculated value from the selection strategy corresponding to the target algorithm; The random number is then subjected to a remainder calculation based on the calculated value to obtain the corresponding remainder value. Based on the remainder value, obtain the key corresponding to the remainder value from the key set of the selection strategy corresponding to the target algorithm, and use it as the target encryption key.

2. The encryption verification method based on digital signature algorithm selection according to claim 1, characterized in that, The algorithm for determining the target based on the parity of the random number includes: If the random number is even, the first algorithm will be configured as the target algorithm; If the random number is odd, the second algorithm is configured as the target algorithm.

3. The encryption verification method based on digital signature algorithm selection according to claim 1, characterized in that, The sending end encrypts the preset parameter data according to the target encryption strategy to obtain encrypted information, including: The preset parameter data is calculated based on the encryption algorithm in the target encryption strategy to obtain the data to be verified; The data to be verified is signed according to the signature algorithm and target private key in the target encryption strategy to obtain a digital signature; the target private key is the target private key of the target encryption key in the target encryption strategy. The digital signature and the parameter data are combined to obtain encrypted information.

4. The encryption verification method based on digital signature algorithm selection according to claim 3, characterized in that, The step of verifying the encrypted information according to the target verification strategy to obtain the corresponding verification result includes: The encrypted information is parsed to obtain the first data to be verified and the second data to be verified. The first feature sequence is obtained by calculating the first data to be verified according to the encryption algorithm in the target verification strategy; The second data to be verified is signed and decrypted according to the signature algorithm and target public key in the target verification strategy to obtain the second feature sequence; the target public key is the target public key of the target encryption key in the target encryption strategy. The first feature sequence and the second feature sequence are compared to obtain the verification result.

5. An encryption verification device based on digital signature algorithm selection, the device being configured in an encryption verification system, the encryption verification system comprising a sending end and a receiving end, characterized in that, The apparatus includes a generation unit, a first determination unit, an encryption unit, and a transmission unit configured at the transmitting end; the apparatus also includes a second determination unit and a verification unit configured at the receiving end. The generation unit is used by the sending end to generate random numbers according to a preset random number algorithm; The first determining unit is used by the sending end to determine the target encryption strategy based on the random number and a preset algorithm selection strategy; The encryption unit is used by the sending end to encrypt preset parameter data according to the target encryption strategy to obtain encrypted information; The sending unit is used by the sending end to send the encrypted information and the target encryption policy to the receiving end; The second determining unit is used for the receiving end to determine the corresponding target verification strategy according to the target encryption strategy; The verification unit is used by the receiving end to verify the encrypted information according to the target verification strategy and obtain the corresponding verification result. The first determining unit includes: The first determining subunit is used to determine the target algorithm based on the parity of the random number; The second determining subunit is used to determine the target encryption key corresponding to the random number according to the selection strategy corresponding to the target algorithm; The second determining subunit is further configured to: obtain a corresponding calculated value from the selection strategy corresponding to the target algorithm; perform a modulo operation on the random number based on the calculated value to obtain a corresponding modulo value; and obtain a key corresponding to the modulo value from the key set of the selection strategy corresponding to the target algorithm as the target encryption key.

6. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the encryption verification method based on digital signature algorithm selection as described in any one of claims 1-4.

7. A computer-readable storage medium, characterized in that, The storage medium stores a computer program, which includes program instructions that, when executed by a processor, cause the processor to perform the encryption verification method based on digital signature algorithm selection as described in any one of claims 1-4.

Citation Information

Patent Citations

  • Method, device and network system for secure algorithm negotiation

    CN101242630A

  • Digital signature method and device, mobile device and storage medium

    CN108933670A