Algorithm security detection method and system for cryptographic card, and storage medium
By receiving the ciphertext and signature values output by the encryption card, the security of the encryption card algorithm is detected using the plaintext and private key recovery function. Combined with hook functions and interface specifications, the security of the API is detected, which solves the problem of insufficient security detection of the encryption card algorithm and achieves comprehensive and accurate security detection.
Patent Information
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Filing Date
- 2024-10-10
- Publication Date
- 2026-03-12
AI Technical Summary
Existing technologies lack sufficient methods for detecting the security of encryption card algorithms, especially for detecting the security of the algorithms implemented on the encryption card itself, resulting in incomplete security verification.
By receiving the ciphertext and signature value output by the encryption card, setting the random private key value to allow key reuse, and using plaintext restoration function and private key restoration function to perform encryption card algorithm security detection, combined with hook function to detect API function interface security, and in accordance with specifications to detect interface compliance and random number quality.
It enables comprehensive testing of the security of asymmetric encryption and signature on encrypted cards, identifies potential security risks, ensures interface compliance and random number quality, and improves the accuracy and comprehensiveness of encrypted card security testing.
Smart Images

Figure CN2024123953_12032026_PF_FP_ABST
Abstract
Description
Algorithm security detection method and system for password encryption card and storage medium
[0001] The present application claims priority to the Chinese patent application No. 202410985641.0, filed on July 23, 2024, and entitled "Algorithm security detection method and system for password encryption card and storage medium", the whole content of which is incorporated herein by reference. TECHNICAL FIELD
[0002] The present application relates to the field of information security, in particular to an algorithm security detection method and system for password encryption card and storage medium. BACKGROUND
[0003] Commercial password encryption card is a hardware device that provides commercial password services, usually with the functions of generating, storing and managing digital keys, performing encryption and decryption operations, providing digital signature and authentication, etc. Encryption card is a basic infrastructure for building a security system, which can be integrated into information security devices through built-in or plug-in methods, etc.
[0004] The security detection of encryption card is a test method to ensure that the card can continuously and effectively protect the channel and data. The detection content involves: cryptography function detection, physical security test, protocol implementation test, identity verification and authorization, etc.
[0005] When selecting or producing the whole device, the encryption card test link usually focuses on the correctness of the algorithm, the performance of the interface, the pressure test performance and other functional indicators of the card. However, as the cornerstone of the whole password security system, the security detection of the algorithm implemented by the encryption card itself is often neglected, mainly due to the following reasons:
[0006] (1) Limited to the test interface of the encryption card supplier, these interfaces usually only contain the algorithm correctness and performance related content.
[0007] (2) The tester lacks the test experience and tools for detecting the security of the algorithm.
[0008] (3) The identification process of the password module mainly focuses on compliance detection.
[0009] (4) It is difficult to find problems from the callback results, whether the hardware has safely implemented the algorithm needs to be verified by formula.
[0010] In the related art, the patent application document with the publication number CN114244503A proposes a cryptographic device performance test method, which only verifies the "correctness" of the algorithm interface of the encryption card and does not verify the security of the algorithm implemented by the encryption card itself. The patent application document with the publication number CN115525564A proposes a test method for the PCIe cryptographic card kernel state drive interface, which is a functional test for the server cryptographic machine, not for the encryption card, and does not verify the security of the hardware algorithm. In the document "Research on Key Technologies of PCIe High-performance Cryptographic Card, Master's Thesis, Li Ming", the quality of random numbers is detected, i.e. whether the occurrence probability of 0 and 1 is balanced, but only the probability of 0 and 1 is detected to meet the requirements, and the randomness of the sequence cannot be completely proved.
[0011] SUMMARY
[0012] The technical problem to be solved by the present application is how to implement security detection of the algorithm implemented by the encryption card itself.
[0013] The present application solves the above technical problems by the following technical means:
[0014] In a first aspect, the present application proposes a cryptographic encryption card algorithm security detection method, which comprises:
[0015] Receiving the first ciphertext and the second ciphertext output by the encryption card, the first ciphertext being obtained by encrypting a known plaintext message, and the second ciphertext being obtained by encrypting an attacked target;
[0016] Setting a random private key value to exist key reuse, and determining whether the second ciphertext can be restored to plaintext according to the plaintext message and the first ciphertext
[0017] If yes, it is determined that the encryption card algorithm security detection result is a security risk;
[0018] If no, it is determined that the encryption card algorithm security detection result is normal.
[0019] Further, the setting of the random private key value to exist key reuse and the determination of whether the second ciphertext can be restored to the attacked target according to the plaintext message and the first ciphertext comprise:
[0020] Determining the ciphertext segment containing plaintext information in the first ciphertext and the ciphertext segment containing plaintext information in the second ciphertext based on the random private key value and the encryption public key;
[0021] According to the plaintext message, the ciphertext segment containing plaintext information in the first ciphertext and the ciphertext segment containing plaintext information in the second ciphertext, a plaintext restoration function is used to attempt to restore the plaintext corresponding to the second ciphertext, wherein the plaintext restoration function is:
[0022] M' b =C a2 xor M a xor C b2
[0023] In the formula, M' b represents the cracked plaintext, M a represents the plaintext message, C a2 represents the ciphertext segment containing plaintext information in the first ciphertext, C b2 represents the ciphertext segment containing plaintext information in the second ciphertext.
[0024] Further, the method further comprises:
[0025] Receiving the first signature value and the second signature value output by the encryption card, wherein the first signature value and the second signature value are respectively obtained by signing two groups of known plaintext messages;
[0026] Setting a random private key value to exist key reuse, and judging whether the signature private key can be successfully restored according to the first signature value and the second signature value;
[0027] If yes, it is determined that the algorithm security detection result of the encryption card is a security risk;
[0028] If no, it is determined that the algorithm security detection result of the encryption card is normal.
[0029] Further, the setting of the random private key value to exist key reuse and the judgment of whether the signature private key can be successfully restored according to the first signature value and the second signature value comprise:
[0030] According to the first signature value and the second signature value, a private key restoration function is used to attempt to restore the signature private key, wherein the private key restoration function is:
[0031] d' = (S a -S b ) / (r a -r b )-1
[0032] In the formula, d' represents the restored signature private key, (r a , S a ) represents the first signature value, and (r b , S b ) represents the second signature value.
[0033] According to the derivation result P' of the signature public key calculated based on the restored signature private key, when the derivation result P' of the signature public key is equal to the real signature public key P, it is determined that the signature private key is successfully restored.
[0034] Further, the method further comprises:
[0035] Traverse the key management and algorithm interface in the encrypted card API function interface, add the interface name of the key management and algorithm interface recorded by the hook function to the detection list file together with the corresponding hook function;
[0036] When the detection list file is empty, directly output the test result, otherwise call the random number interface of the API to collect data of a set size and pass it into the random number sieve function to obtain each detection result of the random number sieve function;
[0037] Generate a random plaintext message M;
[0038] Loop to perform encryption on the message M N times, and record the content of each ciphertext C1 segment to the detection list file;
[0039] Perform a deduplication operation on the ciphertext C1 segment content in the detection list file, and modify the return value of the hook function;
[0040] According to the hook function recording number, each detection result of the random number sieve function, and whether there is repetition in the deduplication operation, the security of the API function interface is detected.
[0041] Further, the method of detecting the security of the API function interface according to the hook function recording number, each detection result of the random number sieve function, and whether there is repetition in the deduplication operation, comprises:
[0042] When the hook function recording number is zero, it is determined that the API function interface state is normal;
[0043] When the hook function recording number is nonzero and each detection result of the random number sieve function has no failed item and the deduplication operation has no repetition, it is determined that the API function interface state is low risk;
[0044] When the hook function recording number is nonzero and each detection result of the random number sieve function has a failed item and the deduplication operation has no repetition, it is determined that the API function interface state is medium risk;
[0045] When the hook function recording number is nonzero and each detection result of the random number sieve function has a failed item and the deduplication operation has a repetition, it is determined that the API function interface state is high risk.
[0046] Further, the method further comprises:
[0047] The interface compliance is detected according to the requirements of the Cipher Device Application Interface Specification GM / T 0018-2012, wherein the interface types of the compliance detection include a device management type interface, a key management type interface, an asymmetric algorithm type interface, a symmetric algorithm type interface, a hash algorithm type interface and a file operation type interface;
[0048] When at least one type of interface in the interface types of the compliance detection fails to be called or does not exist, it is determined that the cryptographic card interface is non-compliant.
[0049] Further, the method further comprises:
[0050] The random number generation interface of the cryptographic card is called to collect a random sequence file of a set size;
[0051] A test thread is created to test the random sequence file, wherein the test items include a poker algorithm test item, a frequency test item, a block frequency test item, an overlap template matching test item, a run total test item, a run distribution test item, a fast in maximum run test item, a binary derivation test item, an autocorrelation test item, a cumulative sum test item, an approximate entropy test item, a discrete Fourier transform test item, a matrix rank test item, a linear complexity test item and a compression test item;
[0052] According to the test results of the test items, the random number compliance is detected.
[0053] In a second aspect, the application further provides an algorithm security detection system of a cryptographic encryption card, the system comprising: a container manager, a test container and an encryption card driving module, the container manager being configured to provide a running environment of a test container image and to run a daemon process to the test container through an unshare command;
[0054] The test container comprises a random private key detection container, and the random private key detection container comprises an encryption test module, wherein:
[0055] The encryption test module is configured to determine that the cryptographic card has a security risk when a set random private key value has key reuse and a second ciphertext can be restored to plaintext according to a plaintext message output by the cryptographic card and a first ciphertext, wherein the first ciphertext is obtained by encrypting a known plaintext message, and the second ciphertext is obtained by encrypting an attacked target.
[0056] Further, the random private key detection container further comprises a signature test module, and the signature test module is configured to determine that the cryptographic card has a security risk when a set random private key value has key reuse and a signature private key can be successfully restored according to a first signature value and a second signature value output by the cryptographic card, wherein the first signature value and the second signature value are obtained by respectively signing two groups of known plaintext messages.
[0057] Further, the encryption test module is configured to restore the plaintext of the second ciphertext by using a plaintext restoration function.
[0058] The plaintext restoration function is:
[0059] M' b =C a2 xor M a xor C b2
[0060] In the formula, M' b represents the cracked plaintext, M a represents the plaintext message, C a2 represents the ciphertext segment containing plaintext information in the first ciphertext, C b2 represents the ciphertext segment containing plaintext information in the second ciphertext.
[0061] Further, the signature test module is configured to restore the signature private key by using a private key restoration function.
[0062] The private key restoration function is:
[0063] d' = (S a -S b ) / (r a -r b )-1
[0064] In the formula, d' represents the restored signature private key, (r a , S a ) represents the first signature value, and (r b , S b ) represents the second signature value.
[0065] Further, the test container further comprises an API security detection container, the API security detection container comprising an API security detection program, a security detection library, and a hook function library, the API security detection program being configured to call an asymmetric algorithm interface of the encryption card and record a trace call interface of the API using the security detection library when loaded.
[0066] The hook function library is configured to perform hooking operation on a basic function and modify a return value of the hook function, so that the return value has a characteristic rule.
[0067] Further, the test container further comprises a compliance test container, the compliance test container comprising an interface test module and a random number abstraction test module, wherein:
[0068] The interface test module is used for detecting interface compliance according to requirements of the cryptographic device application interface specification GM / T 0018-2012, wherein the interface types for compliance detection include device management type interface, key management type interface, asymmetric algorithm type interface, symmetric algorithm type interface, hash algorithm type interface and file operation type interface; and when at least one type of interface fails to be called or does not exist in the interface types for compliance detection, it is determined that the cryptographic card interface is non-compliant.
[0069] The random number abstract test module is used for calling a random number generation interface of the cryptographic card, extracting a random number sequence of a set size, and performing quality detection on the random number sequence according to requirements of the cryptographic product random number detection requirement GM / T 0062-2018.
[0070] Further, the test container includes a random private key detection container, an API security detection container and a compliance test container, and each of the containers is provided with a cryptographic card API interface library, and the cryptographic card API interface library is used for providing a cryptographic service interface.
[0071] In a third aspect, the present application provides a computing processing device, comprising: a memory, wherein the memory stores computer readable code; and one or more processors, when the computer readable code is executed by the one or more processors, the computing processing device executes the algorithm security detection method of the cryptographic encryption card according to the first aspect.
[0072] In a fourth aspect, the present application provides a computer program, comprising computer readable code, when the computer readable code is executed on a computing processing device, causing the computing processing device to execute the algorithm security detection method of the cryptographic encryption card according to the first aspect.
[0073] In a fifth aspect, the present application further provides a computer readable storage medium, which stores a computer program, when the computer program is executed by a processor, the algorithm security detection method of the cryptographic encryption card is realized.
[0074] The present application has the following advantages:
[0075] (1) When receiving several groups of ciphertext output by the encryption card, assuming that the random private key value exists key reuse, the ciphertext can be directly restored to plaintext without the encryption private key, i.e., the receiver private key, if it is successfully restored, it indicates that the random private key of the encryption card is a non-random entropy value, and the encryption card has a security risk; when receiving several groups of signature values output by the encryption card, assuming that the random private key value exists key reuse, the signature private key can be directly calculated only with the signature value and the signature public key, if the signature private key is successfully restored, it indicates that the random private key of the encryption card is a non-random entropy value, and the encryption card has a serious security vulnerability; the application thereby realizes asymmetric algorithm encryption security detection and asymmetric algorithm signature security detection, and detects whether the asymmetric algorithm implemented by the encryption card itself has a security risk.
[0076] (2) The API dynamic library matched with the encryption card is tested for vulnerabilities by a detection method based on a hook function.
[0077] (3) The service interface compliance and correctness of the encryption card are verified according to the interface definition of device management, key management, algorithm (asymmetric / symmetric / hybrid algorithm), and file operation described in the "Cryptographic Device Application Interface Specification GM / T 0018-2012".
[0078] (4) The quality of random numbers is detected according to the quality of random numbers of the E-class product described in the "Cryptographic Product Random Number Detection Requirements GM / T 0062-2018", the quality of random numbers is comprehensively judged from the test results of distribution, autocorrelation, run, compression, etc., the quality judgment of the random number sequence generated in the cryptographic card is more strict, and the judgment result is more accurate.
[0079] Additional aspects and advantages of the application will be in part apparent and in part pointed out hereinafter. BRIEF DESCRIPTION OF DRAWINGS
[0080] Fig. 1 is a flowchart of an algorithm security detection method of a cryptographic encryption card according to an embodiment of the application;
[0081] Fig. 2 is a structural diagram of an algorithm security detection system of a cryptographic encryption card according to an embodiment of the application;
[0082] Fig. 3 is a structural diagram of a computing processing device of an algorithm security detection method of a cryptographic encryption card according to another embodiment of the application;
[0083] Fig. 4 is a structural diagram of a computer program of an algorithm security detection method of a cryptographic encryption card according to another embodiment of the application. DETAILED EMBODIMENTS
[0084] In order to make the purposes, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be described clearly and completely below in conjunction with the embodiments of the present application. Obviously, the described embodiments are some but not all of the embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative work fall within the scope of protection of the present application.
[0085] As shown in FIG. 1, the present application provides an algorithm security detection method of a password encryption card, which comprises the following steps:
[0086] S10, receiving first ciphertext and second ciphertext output by the encryption card, wherein the first ciphertext is obtained by encrypting a known plaintext message, and the second ciphertext is obtained by encrypting an attacked target;
[0087] S20, setting a random private key value to exist key reuse, judging whether the second ciphertext can be restored to the attacked target according to the plaintext message and the first ciphertext, if yes, executing step S30, and if no, executing step S40;
[0088] S30, determining that the encryption card algorithm security detection result is a security risk;
[0089] S40, determining that the encryption card algorithm security detection result is normal.
[0090] It should be noted that in the present embodiment, the encryption card is taken as a sender, and the detection system is taken as a receiver, data encryption means that the sender sends the ciphertext to the receiver after encrypting by using the encryption public key PUB_B of the receiver, and the receiver decrypts the ciphertext by using the encryption private key PRI_B of itself; data signature means that the sender sends the signature value to the receiver after signing by using the signature private key PRI_A of itself, and the receiver decrypts the signature value by using the signature public key PUB_A of the sender.
[0091] So when receiving several groups of ciphertext output by the encryption card, assuming that the random private key value exists key reuse, i.e. the random private key value is set to a fixed value, the ciphertext can be directly restored to plaintext without the encryption private key PRI_B, i.e. the receiver private key, if the successful restoration indicates that the random private key of the encryption card is a non-random entropy value, and the encryption card has a security risk; when receiving several groups of signature values output by the encryption card, assuming that the random private key value exists key reuse, the signature private key PRI_A can be directly calculated only with the signature value and the signature public key PUB_A, if the signature private key PRI_A is successfully restored, it indicates that the random private key of the encryption card is a non-random entropy value, and the encryption card has a serious security vulnerability; accordingly, the application realizes asymmetric algorithm encryption security detection and asymmetric algorithm signature security detection, and detects whether the asymmetric algorithm implemented by the encryption card itself has a security risk.
[0092] As a further preferred technical solution, the step S20 of setting the random private key value to exist key reuse and determining whether the second ciphertext can be restored to the attacked target according to the plaintext message and the first ciphertext comprises the following steps:
[0093] Based on the random private key value and the encryption public key, determine the ciphertext segment containing plaintext information in the first ciphertext and the ciphertext segment containing plaintext information in the second ciphertext;
[0094] According to the plaintext message, the ciphertext segment containing plaintext information in the first ciphertext and the ciphertext segment containing plaintext information in the second ciphertext, use a plaintext restoration function to attempt to restore the plaintext corresponding to the second ciphertext, wherein the plaintext restoration function is:
[0095] M' b =C 22 xor M2 xor C b2
[0096] In the formula, M' b represents the cracked plaintext, M a represents the known plaintext message, C a2 represents the ciphertext segment containing plaintext information in the first ciphertext, C b2 represents the ciphertext segment containing plaintext information in the second ciphertext
[0097] Further, there are two groups of plaintext messages (M a , M b ), wherein the plaintext message M a is known, and the plaintext message M b is the attacked target, and the two groups of plaintext messages (M a , M b) into the encryption card for SM2 algorithm encryption processing, and the callback can obtain the first ciphertext (C a1 ,C a2 ,C a3 ) corresponding to the plaintext message M b and the second ciphertext (C b1 ,C b2 ,C b3 ) corresponding to the plaintext message M a :
[0098] (M a1 )-->(C a2 ,C a3 )
[0099] (M b )-->(C b1 ,C b2 ,C b3 )
[0100] The ciphertext segments in the first ciphertext sequence and the second ciphertext sequence are compared respectively, assuming that the random private key value k is a constant value (that is, the random private key value is reused), P b is the encryption public key, that is, the public key of the receiver, then the S in the ciphertext segment in the first ciphertext sequence and the ciphertext segment in the second ciphertext sequence are equal, S represents the point multiplication result between the random private key k and the public key P b of the receiver, the key KDF(S) derived from S encrypts the plaintext message to obtain the content of C2 segment. Since both ciphertexts are encrypted using the public key P b of the receiver, when k value reuse occurs, the S value used in the two encryption processes is equal, for example, S in C a2 is equal to S in C b2 :
[0101] S b =kP b =S a
[0102] In the formula, S a represents the S value when the plaintext M a is encrypted, and S b represents the S value when the plaintext M b is encrypted.
[0103] Then, according to the evaluation formula "C2=KDF(S)xor M" of C2, the following can be obtained:
[0104] C a2 =KDF(S a )xor M a
[0105] C b2 =KDF(Sb xor M b
[0106] then the reduction function of M is derived as: b
[0107] M′ b =C a2 xor M a xor C b2
[0108] It should be noted that when the ciphertext corresponding to the attacked target is reduced in the embodiment, only the ciphertext segment containing the plaintext information needs to be cracked, for example, when the SM2 algorithm is used for encryption of the plaintext message, the obtained ciphertext includes three ciphertext segments C1, C2 and C3, wherein the segment C2 contains the plaintext information.
[0109] As a further preferred technical solution, the method further comprises the following steps:
[0110] S1, receiving the first signature value and the second signature value output by the encryption card, wherein the first signature value and the second signature value are obtained by signing two known plaintext messages respectively;
[0111] S2, setting a random private key value to exist key reuse, judging whether the signature private key can be successfully restored according to the first signature value and the second signature value, if yes, executing step S3, if not, executing step S4;
[0112] S3, determining that the algorithm security detection result of the encryption card is a security risk;
[0113] S4, determining that the algorithm security detection result of the encryption card is normal.
[0114] As a further preferred technical solution, in step S2, the random private key value is set to exist key reuse, and it is judged whether the signature private key can be successfully restored according to the first signature value and the second signature value, comprising the following steps:
[0115] According to the first signature value and the second signature value, the signature private key is successfully restored by using a private key reduction function, wherein the private key reduction function is:
[0116] d′=(S a -S b ) / (r a -r b )-1
[0117] In the formula, d' represents the restored signature private key, (r a ,S a ) represents the first signature value, and (r b S b ) represents the second signature value, S a and S b represent a part of the signature, which is calculated by combining the information of the private key d and the random private key k value, r a and r b represent a part of the signature, which is calculated by the hash value of the message and the horizontal coordinate x of the elliptic curve point;
[0118] S32, calculate the derivation result P' of the signature public key according to the restored signature private key, and determine that the encryption card has a security risk when the derivation result P' of the signature public key is equal to the real signature public key P.
[0119] Further, there are two sets of plaintext messages (M a , M b ), two sets of signature values (r a , S a ) and (r b , S b ) are obtained, assuming that the signature private key d in the encryption card is the attack target, and the random private key value is k, in the signature algorithm formula, S is evaluated as:
[0120] S = [(1+d)-1×(k-r×d)] mod n
[0121] In the formula, n represents the order of the elliptic curve, such as n value is a 256-bit constant (prime number) in SM2 algorithm.
[0122] It should be noted that in the signature value calculation process of the plaintext message M a , S a is calculated according to r a , and in the signature value calculation process of the plaintext message M b , S b is calculated according to r b .
[0123] Assuming that the random private key value k exists key reuse, that is, k is a fixed value, the signature private key can be directly calculated under the condition of only the signature value and the signature public key. In a given test period, if the signature private key d is successfully restored, it indicates that the random private key of the encryption card is a non-random entropy value, and the encryption card has a serious security vulnerability.
[0124] Assuming that the random private key value k is a fixed value, first transform the evaluation formula of S to:
[0125] S×(1+d)+r×d=k mod n
[0126] When k value is reused, the following equation is obtained:
[0127] S ax(1+d)+r a x d=S b x(1+d)+r b x d
[0128] After the equation transformation, the private key restoration function can be obtained as follows:
[0129] d'=(S a -S b ) / (r a -r b )-1
[0130] As a further preferred technical solution, the method further comprises a security detection step of the API function interface:
[0131] Traverse the key management and algorithm interface in the encryption card API function interface, and add the interface name of the key management and algorithm interface recorded by the hook function to the detection list file together with the corresponding hook function;
[0132] When the detection list file is empty, directly output the test result, otherwise call the random number interface of the API to collect data of a set size and pass it into the random number sieve function to obtain each detection result of the random number sieve function;
[0133] Generate a random plaintext message M;
[0134] Encrypt the message M for N times in a loop, and record the content of each ciphertext C1 segment to the detection list file;
[0135] Perform a deduplication operation on the content of the ciphertext C1 segment in the detection list file, and modify the return value of the hook function;
[0136] According to the number of hook function records, each detection result of the random number sieve function, and whether there is repetition in the deduplication operation, the security of the API function interface is detected.
[0137] It should be noted that the embodiment tracks the API interface implementation of the encryption card by hooking the commonly used related functions of the base library, observes whether the password and random number related operations in the API are strictly implemented through the hardware encryption card, and modifies the return value of the hook function to present regularity or characteristic value, and observes whether it will have a security impact on the output of the API interface, thereby detecting the security of the API function interface.
[0138] The security detection of the API function interface in the embodiment means that the password implementation of the encryption card is more secure than the password service interface of the operating system or open source software. The purpose of the detection is to ensure that the API of the manufacturer only calls the underlying implementation of the encryption card in the operation process, and does not use the password related interface of the operating system.
[0139] Through the hook operation in the operating system and the software implementation of the open source software running in the container, if the API calls the software implementation interface, the record is triggered at the time of calling, and it can be judged through the record whether the API strictly executes the password service of the cryptographic card or the third-party software.
[0140] As a further preferred technical solution, the security of the API function interface is detected according to the hook function record number, each detection result of the random number sieve function, and whether there is repetition in the deduplication operation, including the following steps:
[0141] When the hook function record number is zero, it is determined that the API function interface state is normal;
[0142] When the hook function record number is nonzero and each detection result of the random number sieve function has no failed item and the deduplication operation has no repetition, it is determined that the API function interface state is low risk;
[0143] When the hook function record number is nonzero and each detection result of the random number sieve function has a failed item and the deduplication operation has no repetition, it is determined that the API function interface state is medium risk;
[0144] When the hook function record number is nonzero and each detection result of the random number sieve function has a failed item and the deduplication operation has a repetition, it is determined that the API function interface state is high risk.
[0145] As a further preferred technical solution, the method further includes the step of cryptographic card interface compliance detection:
[0146] According to the requirements of the “Cryptographic Device Application Interface Specification GM / T 0018-2012”, the interface compliance is detected, wherein the interface types of the compliance detection include device management class interface, key management class interface, asymmetric algorithm class interface, symmetric algorithm class interface, hash algorithm class interface and file operation class interface;
[0147] When at least one type of interface fails to call or does not exist in the interface type of the compliance detection, it is determined that the cryptographic card interface is not compliant.
[0148] It should be noted that since the cryptographic card is the basis of security services, all security devices using the national cryptographic function will follow “0018-2012” to design their own upper cryptographic interface calls, and therefore it is necessary to verify that the API provided by the manufacturer fully complies with this standard and can be normally executed. This embodiment realizes the verification of the service interface compliance and correctness of the cryptographic card according to the interface definition of the device management, key management, algorithm (asymmetric / symmetric / hash algorithm), and file operation described in the “Cryptographic Device Application Interface Specification GM / T 0018-2012”.
[0149] As a further preferred technical solution, the method further comprises the step of random number compliance detection:
[0150] Calling the random number generation interface of the encryption card to collect a random sequence file of a set size;
[0151] Creating a test thread to test the random sequence file, wherein the test items include poker algorithm test items, frequency test items, block frequency test items, overlapping template matching test items, run total test items, run distribution test items, fast inner maximum run test items, binary derivation test items, autocorrelation test items, cumulative sum test items, approximate entropy test items, discrete Fourier transform test items, matrix rank test items, linear complexity test items, and compression test items;
[0152] According to the test results of each test item, the random number compliance is detected.
[0153] The embodiment realizes detection of the quality of random numbers according to the E-class product described in the 'Cryptographic Product Random Number Detection Requirements GM / T 0062-2018', accurately converts the mathematical formulas related to use cases into code processes, comprehensively judges the quality of random numbers from multiple test results such as distribution, autocorrelation, run, and compression, and is more strict and accurate in judging the quality of random number sequences generated in the cryptographic card.
[0154] In addition, as shown in FIG. 2, the embodiment of the application provides an algorithm security detection system of a cryptographic encryption card, the system comprises a container manager, a test container, and an encryption card driving module, the container manager is used to provide a running environment of a test container image, and a daemon process is run to the test container through an unshare command;
[0155] The test container comprises a random private key detection container, and the random private key detection container comprises an encryption test module, wherein:
[0156] The encryption test module is configured to determine that the cryptographic encryption card has a security risk when a set random private key value has key reuse and a second ciphertext can be restored to plaintext according to a plaintext message output by the cryptographic encryption card and a first ciphertext, wherein the first ciphertext is obtained by encrypting a known plaintext message, and the second ciphertext is obtained by encrypting an attacked target.
[0157] As a further preferred technical solution, the random private key detection container further comprises a signature test module, and the signature test module is configured to determine that the cryptographic encryption card has a security risk when a set random private key value has key reuse and a signature private key can be successfully restored according to a first signature value and a second signature value output by the cryptographic encryption card, wherein the first signature value and the second signature value are obtained by respectively signing two groups of known plaintext messages.
[0158] Further, the encryption card driving module includes a VFIO driving architecture and an encryption card driving group, which are used to drive the encryption card to perform encryption processing. The container manager can be used to manage a daemon process, and realize operations such as creation, starting, stopping and the like of a test container of the encryption card. The container manager can be used to manage a client, and communicate with the daemon process through a REST API, so as to realize control operations of the test container by a user. The container manager can be used to manage an unshare command, and run the daemon process to an independent test container, so as to isolate a main system and test resources.
[0159] As a further preferred technical solution, the encryption test module is configured to restore the plaintext of the second ciphertext by using a plaintext restoration function.
[0160] The plaintext restoration function is:
[0161] M' b =C a2 xor M a xor C b2
[0162] In the formula, M' b represents a cracked plaintext, M a represents the plaintext message, C a2 represents a ciphertext segment containing plaintext information in the first ciphertext, C b2 represents a ciphertext segment containing plaintext information in the second ciphertext.
[0163] It should be noted that the encryption test module is configured to attempt plaintext cracking on the basis of the ciphertext output by the encryption card without receiving a private key of a receiver, so as to realize detection of security of the asymmetric algorithm encryption.
[0164] As a further preferred technical solution, the signature test module is configured to restore the signature private key by using a private key restoration function.
[0165] The private key restoration function is:
[0166] d'=(S a -S b ) / (r a -r b )-1
[0167] In the formula, d' represents the restored signature private key, (r a ,S a ) represents the first signature value, and (r b ,S b ) represents the second signature value.
[0168] It should be noted that the signature test module is used to generate an asymmetric key, and to collect a plurality of groups of encryption and signature results output by the encryption card, to observe whether there is regularity in the encryption results, and if there is regularity, to use the signature value to derive the signature private key, and to verify through the G point whether the derived value is the signature private key, so as to realize the security detection of the asymmetric algorithm signature.
[0169] It should be noted that the derivation process of the plaintext restoration function and the private key restoration function is described in the above method embodiment, which will not be repeated here.
[0170] As a further preferred technical solution, the test container further includes an API security detection container, the API security detection container includes an API security detection program, a security detection library and a hook function library, the API security detection program is used to call the asymmetric algorithm interface of the encryption card, and the security detection library is used to record the tracking call interface of the API when loaded;
[0171] The hook function library is used to hook the basic function, and the return value of the hook function is modified so that the return value is a constant or a regular range value.
[0172] As a further preferred technical solution, the test container further includes a compliance test container, the compliance test container includes an interface test module and a random number abstraction test module, wherein:
[0173] The interface test module is used to detect the interface compliance according to the requirements of the “Cryptographic Device Application Interface Specification GM / T 0018-2012”, wherein the interface types of the compliance detection include device management class interface, key management class interface, asymmetric algorithm class interface, symmetric algorithm class interface, hash algorithm class interface and file operation class interface; and when at least one interface type of the compliance detection fails or does not exist, it is determined that the cryptographic card interface is not compliant.
[0174] The random number abstraction test module is used to call the random number generation interface of the encryption card, extract a random number sequence of a certain size, and perform quality detection on the random number sequence according to the requirements of the “Cryptographic Product Random Number Detection Requirements GM / T 0062-2018”.
[0175] As a further preferred technical solution, the test container includes a random private key detection container, an API security detection container and a compliance test container, and each of the random private key detection container, the API security detection container and the compliance test container is provided with an encryption card API interface library, and the encryption card API interface library is used to provide a cryptographic service interface.
[0176] As a further preferred technical solution, the test container includes a random private key detection container, an API security detection container and a compliance test container, and each of the random private key detection container, the API security detection container and the compliance test container is provided with a basic library.
[0177] It should be noted that in the operating system and open source software, there are software implementations that provide basic cryptographic algorithms, which are integrated into the operating system through a base software library, which provides cryptographic service interfaces for various upper layer applications, and the operation process is executed on the local CPU and memory.
[0178] Specifically, after the encryption card is inserted into the detection system, the process of detecting the security of the encryption card by the detection system includes:
[0179] (1) Asymmetric algorithm encryption security detection
[0180] a1: Call the management interface of the detection system to check whether the encryption card is hardware-enabled. If it is hardware-enabled, execute step a2, otherwise terminate the detection process.
[0181] a2: Create a plaintext message M, call the encryption card SM2 encryption interface to encrypt the plaintext message M, and obtain the ciphertext A.
[0182] a3: Start loop execution of asymmetric algorithm detection sub-process (default 100000 times):
[0183] a3-1: Randomly generate a 128-byte string, recorded as message plaintext N;
[0184] a3-2: Call the encryption card SM2 encryption interface to encrypt the message plaintext N, and obtain the ciphertext B;
[0185] a3-3: Compare the C1 segment content in the ciphertext A and B sequence. If the values are the same, jump to process a3-4; otherwise, jump to a3-1.
[0186] a3-4: Pass the message M, C2 segment of the ciphertext A and B into the plaintext restoration formula function, and return the cracked plaintext N'.
[0187] a3-5: Record the loop value, timestamp, message plaintext N, and cracked plaintext N' to the test log.
[0188] a4: End of loop, print the encryption security detection test result.
[0189] According to the encryption security detection test result, the asymmetric algorithm encryption security is as shown in Table 1:
[0190] Table 1 Asymmetric algorithm encryption security detection result
[0191] (2) Asymmetric algorithm signature security detection
[0192] b1: Call device management interface, check if encryption card is hardware in place, if hardware in place, execute step b2, otherwise terminate detection process.
[0193] b2: Create 32-byte summary message M.
[0194] b3: Start loop to execute asymmetric algorithm detection sub-process (default 100000 times)
[0195] b3-1: Call encryption card SM2 signature interface to obtain signature S of message M.
[0196] b3-2: Traverse the signature in the detection list, pass S and S' (not S) to the private key restoration function, and return the derived private key d'.
[0197] b3-3: Calculate public key P' using d', and compare P' with public key P.
[0198] b3-4: If not equal, save signature S to the list, jump to b3-1, if equal, output d' and exit the loop.
[0199] b4: Record timestamp, loop value, signature S, signature S', and d' to the log file.
[0200] According to the signature security detection test results, the asymmetric algorithm signature security is as shown in Table 2:
[0201] Table 2 Asymmetric algorithm signature security detection results
[0202] (3) API security detection
[0203] c1: Load hook function library to test process space.
[0204] c2: Traverse API key management and algorithm (asymmetric / symmetric / hybrid algorithm) class interface.
[0205] c2-1: Execute a function call interface.
[0206] c2-2: Check if there is a hook function record output.
[0207] c2-3: If there is output, add the interface name and corresponding hook to the detection list file, otherwise, jump to c2-1.
[0208] c4: If the detection list file is empty, jump to c11; otherwise, jump to c5.
[0209] c5: Call API random number generation interface to collect 20MB data.
[0210] c6: Incoming data to random number sieve function.
[0211] c7: Print each detection result of the random number sieve.
[0212] c8: Generate a random plaintext message M
[0213] c9: Loop to perform SM2 encryption on message M (100,000 times), record each piece of ciphertext C1 content to the list.
[0214] c10: The list is de-duplicated, and the return value is printed.
[0215] c11: Print test results and exit the process.
[0216] According to the API security detection test results, the API security is as shown in Table 3:
[0217] Table 3 API security detection results
[0218] The function categories in the hook function library are as shown in Table 4:
[0219] Table 4 Hook function library
[0220] (4) Interface compliance detection
[0221] Detect whether the interface form meets the requirements of "Cryptographic Device Application Interface Specification GM / T 0018-2012", and detect six types of interfaces. Judgment standard: if more than one interface call fails or does not exist, determine that the interface is not compliant.
[0222] Among them, the six types of interfaces are:
[0223] Device management class, used to manage encryption card devices, operation permissions and sessions.
[0224] Key management class, used for key pair generation, key import and export, and digital envelope function.
[0225] Asymmetric algorithm class, used for RSA / ECC operation, signature and verification.
[0226] Symmetric algorithm class, used for symmetric encryption, symmetric decryption and MAC calculation.
[0227] Hash algorithm class, used for three-piece interface of hash operation
[0228] File operation class, used for file creation, reading, writing and deleting operations in the encryption card.
[0229] (5) Random number compliance detection
[0230] The random number detection standard of the cryptographic device in China is very strict. The NIST general test adopted in the present embodiment cannot meet the requirements, and the random number quality detection should be performed according to the E-class product of the “Random Number Detection Requirements for Cryptographic Products GM / T 0062-2018”.
[0231] d1: Automatically call the encryption card “random number interface” to collect 128 MB random sequence.
[0232] d2: Input the random sequence file, and create a unit test thread for each test item.
[0233] d3: Execute the test thread in parallel, and record the test data of each unit.
[0234] d4: Automatically count the unit test, and output the detection result.
[0235] Judgment standard: if none of the test sub-items is qualified, the test item is determined to be unqualified; when the unqualified items are greater than three, the randomness test is determined to be failed.
[0236] Among them, the random number unit detection item is shown in Table 5:
[0237] Table 5 Random number unit detection item
[0238] The test output is as follows:
[0239]
[0012] Discrete Fourier (algorithm time-consuming: 1835812us)
[0240] : Unqualified 0 (including retest 0); qualified rate 100.00%; 9 value distribution 0.468120. Result YES
[0241]
[0013] Matrix rank (algorithm time-consuming: 374029us)
[0242] m, q = 32: unqualified 2 (including retest 0); qualified rate 97.01%; 9 value distribution 0, 680539. Result YES
[0243]
[0014] Maurer statistics (algorithm time-consuming: 8601S)
[0244] l = 7, q = 1280: unqualified 1 (including retest 0); qualified rate 98.51%; q value distribution 0.468120. Result YES
[0245]
[0015] Linear complexity (algorithm time-consuming: 740045us)
[0246] m = 500: fail 0 (including recheck 0); qualified rate 100.00%; q value distribution 0.13164 2. Result YES
[0247] m = 1000: fail 1 (including recheck 0); qualified rate 98.51%; q value distribution 0.998785. Result YES
[0248]
[0249] Significance level: p value 0.01, q value distribution 0.0001
[0250] Maximum number of failures: 3 (threshold value 3)
[0251] Group bit length: 1000000
[0252] Number of valid individuals: 67
[0253] Number of rechecks: 0
[0254] Algorithm time consumption: 4419155 US
[0255] Detection result: pass
[0256]
[0257] It should be noted that other embodiments of the algorithm security detection system of the cryptographic card described in the present application or the implementation method can refer to the above-mentioned method embodiments, which will not be repeated here.
[0258] The device embodiments described above are only schematic, wherein the units described as separate components can or can not be physically separate, and the components displayed as units can or can not be physical units, i.e. can be located in one place, or can be distributed on multiple network units. According to actual needs, part or all of the modules can be selected to achieve the purpose of the present embodiment scheme. Those skilled in the art can understand and implement without creative labor.
[0259] The various component embodiments of the present application can be implemented in hardware, or as software modules running in one or more processors, or combinations thereof. Those skilled in the art will appreciate that some or all of the functions of some or all of the components of the computing processing device according to embodiments of the present application can be implemented using a microprocessor or a digital signal processor (DSP) in practice. The present application can also be implemented as a device or apparatus program (e.g., a computer program and a computer program product) for performing part or all of the methods described herein. Such a program implementing the present application can be stored on a computer readable medium, or can be in the form of one or more signals. Such signals can be downloaded from an Internet website, or provided on a carrier medium, or in any other form.
[0260] For example, Fig. 3 shows a computing processing device which can implement the methods according to the present application. The computing processing device conventionally comprises a processor 1010 and a computer program product or computer readable medium in the form of a memory 1020. The memory 1020 can be an electronic memory such as a flash memory, EEPROM (electrically erasable programmable read-only memory), EPROM, hard disk, or ROM. The memory 1020 has a storage space 1030 for program code 1031 for performing any of the method steps in the methods described above. For example, the storage space 1030 for program code can comprise individual program codes 1031 for implementing the various steps in the methods described above, respectively. These program codes can be read from or written to one or more computer program products. These computer program products include program code carriers such as hard disks, compact disks (CDs), memory cards, or floppy disks. Such computer program products are typically portable or stationary memory units as described with reference to Fig. 4. The memory unit can have a storage section, storage space, etc. arranged similarly to the memory 1020 in the computing processing device of Fig. 3. The program code can be compressed, for example, in a suitable form. Typically, the memory unit comprises computer readable code 1031', i.e. code which can be read by a processor such as 1010, which, when run by the computing processing device, causes the computing processing device to perform the various steps in the methods described above.
[0261] It should be understood that portions of the present application can be realized with a hardware, software, firmware or a combination thereof. In the above-described embodiments, a plurality of steps or methods can be realized with software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if realized with hardware, and as in another embodiment, it can be realized with any one or a combination of the following technologies known in the art: discrete logic circuit having logic gates for implementing logic functions on data signals, application specific integrated circuits having appropriate combinational logic gates, programmable gate arrays (PGA), field programmable gate arrays (FPGA), etc.
[0262] In the description of the present specification, the description of the terms "one embodiment", "some embodiments", "an example", "a specific example", or "some examples" and the like means that the specific features, structures, materials or characteristics described in connection with the embodiment or example are included in at least one embodiment or example of the present application. In the present specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Also, the specific features, structures, materials or characteristics described can be combined in any one or more embodiments or examples in a suitable manner.
[0263] In addition, the terms "first", "second", are used only for the purpose of description, and cannot be understood as indicating or implying relative importance or implicitly indicating the number of the technical features indicated. Therefore, the features defined with "first", "second" can explicitly or implicitly include at least one of the features. In the description of the present application, the meaning of "a plurality of" is at least two, for example, two, three, etc., unless otherwise explicitly specified.
[0264] Although the embodiments of the present application have been shown and described above, it is understood that the above-described embodiments are exemplary and cannot be construed as limiting the present application, and those skilled in the art can make changes, modifications, replacements and variations to the above-described embodiments within the scope of the present application.
Claims
1. A method for detecting the algorithm security of a cryptographic card, wherein, The method comprises: receiving first and second ciphertexts output by the encryption card, the first ciphertext being obtained by encrypting a known plaintext message, and the second ciphertext being obtained by encrypting an attack target; setting a random private key value to exist key reuse, and determining whether the second ciphertext can be restored to the attack target according to the plaintext message and the first ciphertext; if yes, determining that the encryption card algorithm security detection result is a security risk; if no, determining that the encryption card algorithm security detection result is normal.
2. The method of claim 1, wherein the algorithm security of the password encryption card is detected by using a predetermined algorithm. The setting of the random private key value to exist key reuse and the determination of whether the second ciphertext can be restored to the attack target according to the plaintext message and the first ciphertext comprise: determining, based on the random private key value and an encryption public key, a ciphertext segment containing plaintext information in the first ciphertext and a ciphertext segment containing plaintext information in the second ciphertext; attempting to restore the plaintext corresponding to the second ciphertext according to the plaintext message, the ciphertext segment containing plaintext information in the first ciphertext, and the ciphertext segment containing plaintext information in the second ciphertext, using a plaintext restoration function, wherein the plaintext restoration function is: M' b = C a2 xor M a xor C b2 where M' = M b represents the plaintext message, C a represents the plaintext message, C a2 represents the ciphertext segment of the first ciphertext that contains plaintext information, C b2 represents the ciphertext segment of the second ciphertext that contains plaintext information.
3. The algorithm security detection method for the cryptographic encryption card as described in claim 1, wherein, The method further comprises: receiving first and second signature values output by the encryption card, the first and second signature values being obtained by signing two groups of known plaintext messages, respectively; setting a random private key value to exist key reuse, and determining whether the signature private key can be successfully restored according to the first and second signature values; if yes, determining that the encryption card algorithm security detection result is a security risk; if no, determining that the encryption card algorithm security detection result is normal.
4. The algorithm security detection method for the cryptographic encryption card as described in claim 3, wherein, The setting of the random private key value to exist key reuse and the determination of whether the signature private key can be successfully restored according to the first and second signature values comprise: attempting to restore the signature private key according to the first and second signature values, using a private key restoration function, wherein the private key restoration function is: calculating a derivation result P' of a signature public key according to the restored signature private key, and determining that the signature private key is successfully restored when the derivation result P' of the signature public key is equal to the real signature public key P. d' = (S a - S b ) / (r a - r b )-1 wherein d' represents the reduced signature private key, (r a , S a ) represents the first signature value, (r b , S b ) represents the second signature value; The method further comprises:
5. The algorithm security detection method for the cryptographic encryption card as described in claim 1, wherein, traversing key management and algorithm interfaces in an encryption card API function interface, adding the interface names of the key management and algorithm interfaces and the corresponding hook functions to a detection list file; when the detection list file is empty, directly outputting a test result, otherwise calling a random number interface of the API to collect data of a set size and inputting the data into a random number sieve function to obtain each detection result of the random number sieve function; generating a random plaintext message M; encrypting the message M N times in a loop, and recording the content of each ciphertext C1 segment to the detection list file; performing a deduplication operation on the content of the ciphertext C1 segment in the detection list file, and modifying the return value of the hook function; detecting the security of the API function interface according to the number of hook function records, each detection result of the random number sieve function, and whether there is repetition in the deduplication operation. 6. The method for detecting the algorithm security of a password encryption card according to claim 5, wherein, The security of the API function interface is detected according to the number of hook functions, each detection result of the random number sieve function, and whether there is repetition in the deduplication operation, including: When the number of hook functions is zero, it is determined that the API function interface state is normal; When the number of hook functions is nonzero and each detection result of the random number sieve function has no failed item and the deduplication operation has no repetition, it is determined that the API function interface state is low risk; When the number of hook functions is nonzero and each detection result of the random number sieve function has a failed item and the deduplication operation has no repetition, it is determined that the API function interface state is medium risk; When the number of hook functions is nonzero and each detection result of the random number sieve function has a failed item and the deduplication operation has a repetition, it is determined that the API function interface state is high risk.
7. The algorithm security detection method for the cryptographic encryption card as described in claim 1, wherein, The method further includes: According to the requirements of the "Cryptographic Device Application Interface Specification GM / T 0018-2012", the interface compliance is detected, wherein the interface types of compliance detection include device management interface, key management interface, asymmetric algorithm interface, symmetric algorithm interface, hash algorithm interface and file operation interface; When at least one type of interface fails to call or does not exist in the interface types of compliance detection, it is determined that the cryptographic card interface is not compliant.
8. The method of claim 1, wherein the algorithm security of the password encryption card is detected by using a predetermined algorithm. The method further includes: Calling the random number generation interface of the encryption card to collect a random sequence file of a set size; Creating a test thread to test the random sequence file, wherein the test items include poker algorithm test item, frequency test item, block frequency test item, overlapping template matching test item, run total test item, run distribution test item, fast inner maximum run test item, binary derivation test item, autocorrelation test item, cumulative sum test item, approximate entropy test item, discrete Fourier transform test item, matrix rank test item, linear complexity test item and compression test item; According to the test results of each test item, the random number compliance is detected.
9. A system for detecting algorithmic security of a cryptographic card, wherein, The system includes a container manager, a test container and an encryption card driver module, the container manager is used to provide a running environment for a test container image, and a daemon process is run to the test container through an unshare command; The test container includes a random private key detection container, and the random private key detection container includes an encryption test module, wherein: The encryption test module is configured to determine that the encryption card has a security risk when a set random private key value exists key reuse and the second ciphertext can be restored to plaintext according to the plaintext message output by the encryption card and the first ciphertext, wherein the first ciphertext is obtained by encrypting the known plaintext message, and the second ciphertext is obtained by encrypting the target under attack.
10. The algorithm security detection system of the cryptographic card of claim 9, wherein, The random private key detection container further includes a signature test module, and the signature test module is configured to determine that the encryption card has a security risk when a set random private key value exists key reuse and the signature private key can be successfully restored according to the first signature value and the second signature value output by the encryption card, wherein the first signature value and the second signature value are obtained by signing two groups of known plaintext messages, respectively.
11. The algorithm security detection system of the cryptographic card of claim 9, wherein, The encryption test module is configured to restore the plaintext of the second ciphertext by using a plaintext restoration function. The plaintext restoration function is: M' b = C a2 xor M a xor C b2 where M' = M - C b represents the plaintext message, C a represents the known plaintext message, C a2 represents the ciphertext segment of the first ciphertext that contains plaintext information, C b2 represents the ciphertext segment of the second ciphertext that contains plaintext information.
12. The algorithm security detection system of the cryptographic card of claim 10, wherein, The signature test module is configured to restore the signature private key by using a private key restoration function. The private key restoration function is: d' = (S a - S b ) / (r a - r b )-1 where d' represents the reduced private key, (r a , S a ) represents the first signature value, and (r b , S b ) represents the second signature value.
13. The algorithm security detection system of the cryptographic card of claim 9, wherein, The test container further comprises an API security detection container, which comprises an API security detection program, a security detection library, and a hook function library. The hook function library is configured to perform hooking operation on a basic function and modify the return value of the hook function, so that the return value has a characteristic rule.
14. The algorithm security detection system of the cryptographic card of claim 9, wherein, The test container further comprises a compliance test container, which comprises an interface test module and a random number abstraction test module. The interface test module is configured to detect the interface compliance according to the requirements of the “Cryptographic Device Application Interface Specification GM / T 0018-2012”, wherein the interface types for compliance detection include device management interfaces, key management interfaces, asymmetric algorithm interfaces, symmetric algorithm interfaces, hash algorithm interfaces, and file operation interfaces. The random number abstraction test module is configured to call the random number generation interface of the cryptographic card, extract a random number sequence of a set size, and perform quality detection on the random number sequence according to the requirements of the “Cryptographic Product Random Number Detection Requirements GM / T 0062-2018”.
15. The algorithm security detection system of the cryptographic card of claim 9, wherein, The test container comprises a random private key detection container, an API security detection container, and a compliance test container, each of which is provided with a cryptographic card API interface library. 16. A computing processing device, wherein, comprises: a memory in which computer readable code is stored; one or more processors, when the computer readable code is executed by the one or more processors, the computing processing device performs the algorithm security detection method of the cryptographic encryption card according to any one of claims 1-8.
17. A computer program comprising computer readable code which, when run on a computing processing device, causes the computing processing device to perform the algorithm security detection method of the cryptographic encryption card according to any one of claims 1-8.
18. A computer readable storage medium having stored thereon a computer program, wherein, The computer program is executed by the processor to implement the algorithm security detection method of the cryptographic encryption card according to any one of claims 1-8.