Information processing method
By pre -testing the password algorithm of the USIM card chip in the detection application, the problem of repeated inspection and detection cycle extension in existing technologies has been solved, and a more efficient and more accurate detection process is achieved.
Patent Information
- Application Number
- CN202411345539.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-25
- Publication Date
- 2025-01-24
- Estimated Expiration
- 2044-09-25
AI Technical Summary
In the prior art, there are problems of repeated inspection and extended detection cycles during the detection process of USIM card chips, resulting in waste of resources and inefficiency.
By implementing pre-detection of the chip's preset cryptographic algorithms in detection applications, and using preset detection data and standard results, the cryptographic algorithm of the target chip can be pre-detected, thereby reducing the probability of repeated inspections and shortening the inspection cycle.
Effectively reduce the probability of not passing the USIM card chip detection, reducing the risk of repeated check -up, shortening the detection cycle, and improving the detection efficiency and accuracy.
Smart Images

Figure CN119363359A_ABST
Abstract
Description
Technical Field
[0001] The present application belongs to the field of security detection technology, and in particular, relates to an information processing method. Background Art
[0002] With the development of communication technology, people are enjoying the convenience of the Internet, but they are also aware of the importance of network and information security. In the process of communication, data can be encrypted to improve the security of information.
[0003] The chip in the Universal Subscriber Identity Module (USIM) card is usually pre-installed with multiple cryptographic algorithms. During the communication process using a smartphone, the chip can encrypt the data. Therefore, in order to meet the requirements of network and information security, it is usually necessary to send the USIM card to a professional testing agency to test the cryptographic algorithm of the chip in the USIM card.
[0004] However, in the existing inspection process, the queuing inspection cycle is usually long. If the chip fails the inspection, it needs to be returned to the card manufacturer for research and re-inspection. This leads to repeated inspections and further extension of the inspection cycle. Summary of the invention
[0005] The embodiments of the present application provide an information processing method, apparatus, device, computer storage medium and computer program product, which can pre-detect the cryptographic algorithm preset in the chip, thereby reducing the probability of repeated inspections and shortening the inspection cycle.
[0006] In a first aspect, an embodiment of the present application provides an information processing method, which is applied to a detection application, where the detection application stores multiple sets of detection data corresponding to multiple cryptographic algorithms; the method includes:
[0007] receiving a detection instruction, the detection instruction including a target selection value and a target detection value, wherein the target selection value is used to select a target cryptographic algorithm;
[0008] Determining target detection data corresponding to the detection instruction from the multiple sets of detection data, the target detection data including target algorithm parameters of the target cryptographic algorithm and a standard result, wherein the standard result is a first calculation result obtained by calculating the target detection value with the target algorithm parameters as the algorithm parameters of the target cryptographic algorithm;
[0009] Sending a target selection value, a target detection value, and a target algorithm parameter to a target chip, so that the target chip selects a target cryptographic algorithm through the target selection value, and calculates the target detection value using the target algorithm parameter as an algorithm parameter to obtain a second calculation result;
[0010] receiving a second calculation result sent by the target chip;
[0011] A detection result of a target cryptographic algorithm in a target chip is generated according to the second calculation result and the standard result.
[0012] In an optional implementation, before receiving the detection instruction, the method further includes:
[0013] Upon receiving an application selection instruction sent by the USIM card, entering the target working state;
[0014] When the detection application is in a target working state, a detection instruction is received.
[0015] In an optional implementation, in the case of receiving an application selection instruction sent by the USIM card, after entering the target working state, the method further includes:
[0016] The first feedback information is sent to the USIM card, so that the USIM card sends a detection instruction according to the first feedback information, wherein the first feedback information includes version information of the detection application and execution information of the selection instruction.
[0017] In an optional implementation, the detection application is a USIM card application, and the target chip and the detection application are integrated into the same USIM card.
[0018] In an optional implementation, before receiving the detection instruction, the method further includes:
[0019] Obtain a preset application file, the application file including multiple sets of detection data corresponding to multiple cryptographic algorithms;
[0020] Store application files;
[0021] In response to the status detection instruction sent by the USIM card, second feedback information is sent to the USIM card, and the second feedback information is used to feed back the application file to be stored in the detection application.
[0022] In an optional implementation, before sending the target selection value, the target detection value, and the target algorithm parameter to the target chip, the method further includes:
[0023] Determine the target application programming interface API corresponding to the target cryptographic algorithm;
[0024] Send target selection values, target detection values, and target algorithm parameters to the target chip, including:
[0025] The target selection value, target detection value, and target algorithm parameters are sent to the target chip through the target API.
[0026] In an optional implementation, after receiving the second calculation result sent by the target chip, the method further includes:
[0027] Obtaining a third calculation result obtained by the target detection mechanism calculating the target detection value using the target algorithm parameters as the algorithm parameters of the target cryptographic algorithm;
[0028] Compare the third calculation result with the second calculation result to obtain a verification result;
[0029] Send the verification results to the target detection agency.
[0030] In an optional embodiment, the multiple cryptographic algorithms include at least one of SM4's electronic code book ECB mode encryption algorithm, SM4's ECB mode decryption algorithm, SM4's cipher block chaining CBC mode encryption algorithm, SM4's CBC mode decryption algorithm, SM4's message authentication MAC algorithm, SM3, SM2 signature algorithm, and SM2 signature verification algorithm.
[0031] In an optional implementation, generating a detection result of a target cryptographic algorithm in a target chip according to the second calculation result and the standard result includes:
[0032] comparing the second calculation result with the standard result;
[0033] When the second calculation result is consistent with the standard result, a first detection result is generated, and the first detection result is used to indicate that the target cryptographic algorithm in the target chip has passed the detection.
[0034] In an optional implementation, after comparing the second calculation result with the standard result, the method further includes:
[0035] When the second calculation result is inconsistent with the standard result, a second detection result is generated, and the second detection result is used to indicate that the target cryptographic algorithm in the target chip fails the detection;
[0036] Output prompt information, where the prompt information includes the second detection result and the second calculation result.
[0037] In a second aspect, an embodiment of the present application provides an information processing device, which is applied to a detection application, wherein the detection application stores multiple sets of detection data corresponding to multiple cryptographic algorithms; the device includes:
[0038] A receiving module, used for receiving a detection instruction, the detection instruction including a target selection value and a target detection value, wherein the target selection value is used for selecting a target cryptographic algorithm;
[0039] A determination module, used to determine target detection data corresponding to the detection instruction from multiple sets of detection data, the target detection data including target algorithm parameters and a standard result of a target cryptographic algorithm, wherein the standard result is a first calculation result obtained by calculating the target detection value with the target algorithm parameters as the algorithm parameters of the target cryptographic algorithm;
[0040] a sending module, configured to send a target selection value, a target detection value, and a target algorithm parameter to a target chip, so that the target chip selects a target cryptographic algorithm through the target selection value, calculates the target detection value with the target algorithm parameter as an algorithm parameter, and obtains a second calculation result;
[0041] The receiving module is further used to receive the second calculation result sent by the target chip;
[0042] The generating module is used to generate the detection result of the target cryptographic algorithm in the target chip according to the second calculation result and the standard result.
[0043] In a third aspect, an embodiment of the present application provides an electronic device, the device comprising: a processor and a memory storing computer program instructions;
[0044] When the processor executes the computer program instructions, it implements the information processing method as described in any optional implementation manner of the first aspect of the present application.
[0045] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, on which computer program instructions are stored. When the computer program instructions are executed by a processor, an information processing method as in any optional implementation manner of the first aspect of the present application is implemented.
[0046] In a fifth aspect, an embodiment of the present application provides a computer program product. When the instructions in the computer program product are executed by a processor of an electronic device, the electronic device executes an information processing method as described in any optional implementation of the first aspect of the present application.
[0047] The information processing method, device, equipment, computer storage medium and computer program product of the embodiment of the present application can be applied to a detection application, which stores multiple groups of detection data corresponding to multiple cryptographic algorithms. The embodiment of the present application can receive a detection instruction, and the detection instruction includes a target selection value and a target detection value. Among them, the target selection value is used to select a target cryptographic algorithm. Then, the target detection data corresponding to the detection instruction is determined from the multiple groups of detection data, and the target detection data includes a target algorithm parameter and a standard result of the target cryptographic algorithm. Among them, the standard result is a first calculation result obtained by calculating the target detection value with the target algorithm parameter as the algorithm parameter of the target cryptographic algorithm. Then, the target selection value, the target detection value and the target algorithm parameter are sent to the target chip, so that the target chip selects the target cryptographic algorithm through the target selection value, and calculates the target detection value with the target algorithm parameter as the algorithm parameter to obtain a second calculation result. In this way, the second calculation result is a calculation result obtained by calculating the same detection value using the same calculation process as the standard result. Then, the second calculation result sent by the target chip can be received. According to the second calculation result and the standard result, the detection result of the target cryptographic algorithm in the target chip is generated. In this way, the correctness of the second calculation result can be detected by using the standard result preset by the detection application, so that the target cryptographic algorithm preset by the target chip can be pre-tested. In this way, if the pre-test is passed, the USIM card can be sent to a professional institution for testing, thereby reducing the probability of failure of the test, thereby reducing the risk of repeated testing and shortening the testing cycle. BRIEF DESCRIPTION OF THE DRAWINGS
[0048] In order to more clearly illustrate the technical solution of the embodiments of the present application, the following is a brief introduction to the drawings required for use in the embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.
[0049] Figure 1 It is a flowchart of an information processing method provided by an embodiment of the present application;
[0050] Figure 2 is a flowchart of an information processing method provided by another embodiment of the present application;
[0051] Figure 3 is a structural diagram of an information processing device provided by yet another embodiment of the present application;
[0052] Figure 4 It is a structural diagram of an electronic device provided by yet another embodiment of the present application. DETAILED DESCRIPTION
[0053] The features and exemplary embodiments of various aspects of the present application will be described in detail below. In order to make the purpose, technical solutions and advantages of the present application clearer, the present application will be further described in detail below in conjunction with the accompanying drawings and specific embodiments. It should be understood that the specific embodiments described herein are only intended to explain the present application, rather than to limit the present application. For those skilled in the art, the present application can be implemented without the need for some of these specific details. The following description of the embodiments is only to provide a better understanding of the present application by illustrating the examples of the present application.
[0054] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the statement "include..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.
[0055] With the development of communication technology, people are enjoying the convenience of the Internet, but they are also aware of the importance of network and information security. In the process of communication, data can be encrypted to improve the security of information.
[0056] At present, card vendors generally integrate their self-developed card operating system (COS) and chips into USIM cards. The chip is pre-set with a variety of cryptographic algorithms. In the process of using a smartphone for communication, the chip can encrypt the data. In order to meet the requirements of network and information security, it is usually necessary to send the USIM card to a professional testing agency to test the cryptographic algorithm of the chip in the USIM card.
[0057] However, in the existing inspection process, the queuing cycle is usually long. If the chip fails the inspection, it needs to be returned to the card dealer for research and re-inspection. On the one hand, the card dealer needs a long time to research, and on the other hand, re-inspection still takes a long queuing cycle. This leads to repeated inspections and further extension of the inspection cycle.
[0058] In view of this, the inventor, after in-depth thinking, cleverly proposed an information processing method, device, equipment, computer storage medium and computer program product.
[0059] In the embodiment of the present application, the information processing method can be implemented based on the relevant architecture of the USIM card.
[0060] The USIM card can be an integrated carrier of the card application, card COS, chip, and chip API. Among them, the chip is the hardware part of the USIM card, and the chip can integrate cryptographic algorithms such as the national secret algorithm to provide hardware computing capabilities. The chip API can be an API provided for external calls and can be called by the card COS or card application.
[0061] The detection application can be used to detect the correctness of the cryptographic algorithm integrated in the chip hardware. Exemplarily, the detection application can be a card application preset in the USIM card. The detection application can execute the application protocol data unit (APDU) instruction and can also call the chip API. Exemplarily, the detection application can also be integrated in the mobile terminal to execute the detection process in the form of a mobile terminal application (APP). In the process of detecting the correctness of the cryptographic algorithm integrated in the chip hardware, the USIM card can send an APDU instruction to the detection application through the Trusted Service Manager (TSM) tool so that the detection application executes the operation corresponding to the instruction.
[0062] The following is an introduction to the information processing method provided by the embodiment of the present application through specific embodiments and their application scenarios in conjunction with the accompanying drawings. The information processing method provided by the embodiment of the present application, the device that executes the sending may be an information processing device, or a partial module in the information processing device for executing the information processing method. In the embodiment of the present application, the information processing method provided by the embodiment of the present application is described in detail by taking the information processing device executing the information processing method as an example.
[0063] The following is combined with Figure 1 The information processing method provided in the embodiments of the present application is described in detail.
[0064] Figure 1 The flowchart of the information processing method provided by one embodiment of the present application is shown. The information processing method can be specifically applied to a detection application, and the detection application stores multiple sets of detection data corresponding to multiple cryptographic algorithms. The detection data can be pre-set detection data, or detection data written into the detection application using dynamic installation data, which is not limited here. Figure 1 As shown, the information processing method may include the following steps S110 to S150.
[0065] S110, receiving a detection instruction, where the detection instruction includes a target selection value and a target detection value, wherein the target selection value is used to select a target cryptographic algorithm.
[0066] In step S110, the target detection value may represent an input value for executing the target cryptographic algorithm. For example, when the target cryptographic algorithm is an encryption algorithm, the target detection value may be plaintext data to be encrypted; when the target cryptographic algorithm is a decryption algorithm, the target detection value may be ciphertext data to be decrypted.
[0067] S120, determining the target detection data corresponding to the detection instruction from multiple groups of detection data, the target detection data including target algorithm parameters of the target cryptographic algorithm and a standard result, wherein the standard result is a first calculation result obtained by calculating the target detection value with the target algorithm parameters as the algorithm parameters of the target cryptographic algorithm.
[0068] In step S120, determining the target detection data corresponding to the detection instruction from the multiple sets of detection data may include: determining the detection data corresponding to the target cryptographic algorithm according to the target selection value as the above-mentioned target detection data. In one example, a cryptographic algorithm may correspond to multiple sets of detection data, and each set of detection data may include different detection values, algorithm parameters, and standard results. Determining the target detection data corresponding to the detection instruction from the multiple sets of detection data may include: determining the multiple sets of detection data corresponding to the target cryptographic algorithm according to the target selection value, and determining the target detection data from the multiple sets of detection data corresponding to the target cryptographic algorithm according to the target detection value.
[0069] In step S120, the detection data can be generated by an algorithm tool. In one example, after the detection data is generated, the correctness of the detection data can be verified, and then stored in the detection application after the verification. In this way, it can be considered that the standard result of step S120 is to use the target algorithm parameters as the algorithm parameters of the target cryptographic algorithm, and calculate the target detection value to obtain the correct result.
[0070] S130, sending a target selection value, a target detection value and a target algorithm parameter to a target chip, so that the target chip selects a target cryptographic algorithm through the target selection value, calculates the target detection value with the target algorithm parameter as an algorithm parameter, and obtains a second calculation result.
[0071] Accordingly, the target chip can receive the target selection value, the target detection value and the target algorithm parameter, select the target cryptographic algorithm from the cryptographic algorithms preset in the chip according to the target selection value, calculate the target detection value with the target algorithm parameter as the algorithm parameter, and obtain the second calculation result.
[0072] S140, receiving a second calculation result sent by the target chip.
[0073] S150, generating a detection result of a target cryptographic algorithm in a target chip according to the second calculation result and the standard result.
[0074] The information processing method of the embodiment of the present application can be applied to a detection application, which stores multiple groups of detection data corresponding to multiple cryptographic algorithms. The embodiment of the present application can receive a detection instruction, and the detection instruction includes a target selection value and a target detection value. Among them, the target selection value is used to select a target cryptographic algorithm. Then, the target detection data corresponding to the detection instruction is determined from the multiple groups of detection data, and the target detection data includes a target algorithm parameter and a standard result of the target cryptographic algorithm. Among them, the standard result is a first calculation result obtained by calculating the target detection value with the target algorithm parameter as the algorithm parameter of the target cryptographic algorithm. Then, the target selection value, the target detection value and the target algorithm parameter are sent to the target chip, so that the target chip selects the target cryptographic algorithm through the target selection value, and calculates the target detection value with the target algorithm parameter as the algorithm parameter to obtain a second calculation result. In this way, the second calculation result is a calculation result obtained by calculating the same detection value using the same calculation process as the standard result. Then, the second calculation result sent by the target chip can be received. According to the second calculation result and the standard result, the detection result of the target cryptographic algorithm in the target chip is generated.
[0075] In one embodiment, before receiving the detection instruction, the method may further include:
[0076] When receiving the application selection instruction sent by the USIM card, the target working state is entered.
[0077] When the detection application is in a target working state, a detection instruction is received.
[0078] In the above implementation, the application selection instruction (SELECT instruction) can be used to select the detection application. After receiving the application selection instruction, the detection application can be selected and enter the target working state. The target working state includes a working state that can detect the correctness of the cryptographic algorithm in the chip.
[0079] According to the above implementation, before the detection application detects the cryptographic algorithm built into the chip, the detection application can be activated by a SELECT instruction to ensure that the detection application is in a normal working state. This is conducive to the detection application responding to subsequent detection instructions in a timely manner and improving the efficiency of detection.
[0080] In one embodiment, in the case of receiving an application selection instruction sent by a USIM card, after entering the target working state, the method may further include:
[0081] The first feedback information is sent to the USIM card, so that the USIM card sends a detection instruction according to the first feedback information, wherein the first feedback information includes version information of the detection application and execution information of the selection instruction.
[0082] According to the above embodiment, after the detection application is selected and successfully activated, the first feedback information can be sent to the USIM card. The first feedback information includes the version information of the detection application and the execution information of the selection instruction. In this way, it is helpful for the USIM card to confirm the status of the detection application according to the feedback information, and to generate or select a suitable detection instruction, thereby improving the efficiency and accuracy of the detection.
[0083] In one embodiment, the detection application may be a USIM card application, and the target chip and the detection application are integrated into the same USIM card.
[0084] According to the above embodiment, the detection application is a card application integrated with the target chip in the same USIM card. Compared with other integration methods, the card application can be applied to detect various types of chips, for example, it can be applied to all JAVA cards (Java Card). In this way, the flexibility of detection can be improved. In addition, the detection application is pre-set in the USIM card, which is also conducive to quickly receiving and executing APDU instructions, and sending corresponding data to the target chip, thereby helping to improve detection efficiency.
[0085] In one embodiment, before receiving the detection instruction, the method may further include:
[0086] Obtain a preset application file, which includes multiple sets of detection data corresponding to multiple cryptographic algorithms.
[0087] Stores application files.
[0088] In response to the status detection instruction sent by the USIM card, second feedback information is sent to the USIM card, and the second feedback information is used to feed back the application file to be stored in the detection application.
[0089] In the above embodiment, the plurality of groups of detection data may be detection data generated by a tool. As an example, after the detection data is generated, the detection data may be verified by a verification tool or by manual review to ensure the correctness of the detection data.
[0090] According to the above implementation, the preset application file can be stored in the detection application. After the storage is successful, the second feedback information can be sent to the USIM card in response to the status detection instruction sent by the USIM card. In this way, it is beneficial for the USIM card to monitor the status of the detection application and reduce the risk of the detection application not being able to work properly.
[0091] In one embodiment, before sending the target selection value, the target detection value, and the target algorithm parameter to the target chip, the method may further include:
[0092] Determine the target application programming interface API corresponding to the target cryptographic algorithm.
[0093] Sending target selection values, target detection values, and target algorithm parameters to the target chip may include:
[0094] The target selection value, target detection value, and target algorithm parameters are sent to the target chip through the target API.
[0095] According to the above implementation, when detecting the correctness of different target cryptographic algorithms, different chip APIs can be called to send target selection values, target detection values and target algorithm parameters to the target chip, thereby ensuring the correct processing and efficient transmission of the target selection values, target detection values and target algorithm parameters.
[0096] In one embodiment, after receiving the second calculation result sent by the target chip, the method may further include:
[0097] A third calculation result is obtained by obtaining a target detection mechanism by calculating a target detection value using the target algorithm parameters as the algorithm parameters of the target cryptographic algorithm.
[0098] The third calculation result is compared with the second calculation result to obtain a verification result.
[0099] Send the verification results to the target detection agency.
[0100] In the above implementation, the target detection agency can be a testing agency or other third-party testing agency. According to the above implementation, the calculation result of the target chip can be compared with the calculation result of the target detection agency, so as to realize the third party verification of the target cryptographic algorithm built into the target chip. In this way, the detection result can be verified to improve the credibility of the detection result.
[0101] In one embodiment, after receiving the second calculation result sent by the target chip, the method may further include:
[0102] The second calculation result is sent to the target detection agency so that the target detection agency compares the third calculation result with the second calculation result to obtain a verification result, wherein the third calculation result is the calculation result obtained by the target detection agency using the target algorithm parameters as the algorithm parameters of the target cryptographic algorithm and calculating the target detection value.
[0103] According to the above implementation, the calculation result of the target chip can be sent to the target detection agency, so that the target detection agency can compare the calculation result of the target chip with the calculation result of the target detection agency, thereby realizing the third party verification of the target cryptographic algorithm built into the target chip. In this way, the detection result can be verified and the credibility of the detection result can be improved.
[0104] In one embodiment, the multiple cryptographic algorithms may include SM4's Electronic Codebook ECB mode (SM4-ECB) encryption algorithm, SM4's ECB mode (SM4-ECB) decryption algorithm, SM4's Cipher Block Chaining CBC mode (SM4-CBC) encryption algorithm, SM4's CBC mode (SM4-CBC) decryption algorithm, SM4's Message Authentication MAC (SM4-MAC) algorithm, SM3, SM2 signature algorithm, and at least one of the SM2 signature verification algorithm.
[0105] According to the above implementation, the detection card application stores detection data corresponding to multiple national secret algorithms, so that multiple national secret algorithms in the target chip can be detected to improve the comprehensiveness of the detection.
[0106] In one embodiment, the multiple groups of detection data corresponding to the multiple cryptographic algorithms may include multiple groups of detection data generated in advance using an algorithm tool.
[0107] Taking a cryptographic algorithm corresponding to a set of test data as an example, according to the type of cryptographic algorithm, the algorithm tool can be used to generate the test data sets corresponding to each type of cryptographic algorithm, and the test data corresponding to each cryptographic algorithm can be extracted from the test data sets.
[0108] As an example, the detection data sets of the SM4 algorithm, the SM3 algorithm, and the SM2 algorithm can be generated respectively by the algorithm tool.
[0109] Exemplarily, the detection data set of the SM4 algorithm may include a random number key of the SM4-CBC, SM4-ECB and SM4-MAC algorithms, an initial vector of a random number, plaintext data of the SM4-CBC and SM4-ECB algorithms, ciphertext data of the SM4-CBC and SM4-ECB algorithms, and SM4-MAC result data. Among them, the random numbers are not all 0, and the padding of the SM4-MAC result data is not mandatory.
[0110] From the detection data set of the SM4 algorithm, detection data corresponding to the SM4-ECB encryption algorithm, detection data corresponding to the SM4-ECB decryption algorithm, detection data corresponding to the SM4-CBC encryption algorithm, detection data corresponding to the SM4-CBC decryption algorithm, and detection data corresponding to the SM4-MAC algorithm can be extracted. Among them, the detection data corresponding to the SM4-ECB encryption algorithm may include plaintext data as a detection value; the SM4-ECB algorithm key and the SM4-ECB algorithm initial vector as algorithm parameters; and the ciphertext data of the SM4-ECB algorithm as a standard result. The detection data corresponding to the SM4-ECB decryption algorithm may include ciphertext data as a detection value; the SM4-ECB algorithm key and the SM4-ECB algorithm initial vector as algorithm parameters; and the plaintext data of the SM4-ECB algorithm as a standard result. The detection data corresponding to the SM4-CBC encryption algorithm may include plaintext data as a detection value; the SM4-CBC algorithm key and the SM4-CBC algorithm initial vector as algorithm parameters; and the ciphertext data of the SM4-CBC algorithm as a standard result. The detection data corresponding to the SM4-CBC decryption algorithm may include ciphertext data as the detection value; the SM4-CBC algorithm key and the SM4-CBC algorithm initial vector as the algorithm parameters; and the plaintext data of the SM4-CBC algorithm as the standard result. The detection data corresponding to the SM4-MAC algorithm may include plaintext data as the detection value; the SM4-MAC algorithm key as the algorithm parameter; and the SM4-MAC result data as the standard result.
[0111] Exemplarily, the detection data set of the SM3 algorithm may include plain text data of the SM3 algorithm and HASH data corresponding to the SM3 algorithm. The detection data corresponding to SM3 may include plain text data as the detection value and HASH data as the standard result. The algorithm parameters may be empty, that is, the algorithm parameters do not need to be sent to the chip.
[0112] Exemplarily, the detection data set of the SM2 algorithm may include a pair of random SM2 public and private key pairs, SM2 plaintext data, SM2 private key signature data, and SM2 public key signature verification data. Among them, the SM2 private key signature data may include pre-processing values (E value and Z value).
[0113] The detection data corresponding to the SM2 signature algorithm and the detection data corresponding to the SM2 signature verification algorithm can be extracted from the detection data set of the SM2 algorithm. Among them, the detection data corresponding to the SM2 signature algorithm may include plaintext data as the detection value; the SM2 signature algorithm public key and the SM2 signature algorithm private key (SM2 public-private key pair) as algorithm parameters; and the SM2 private key signature data as the standard result. The detection data corresponding to the SM2 signature verification algorithm may include plaintext data as the detection value; the SM2 signature verification algorithm public key and the SM2 signature verification algorithm private key (SM2 public-private key pair) as algorithm parameters; and the SM2 public key verification data as the standard result.
[0114] In one embodiment, generating a detection result of a target cryptographic algorithm in a target chip according to the second calculation result and the standard result may specifically include:
[0115] The second calculation result is compared with the standard result.
[0116] When the second calculation result is consistent with the standard result, a first detection result is generated, and the first detection result is used to indicate that the target cryptographic algorithm in the target chip has passed the detection.
[0117] According to the above implementation, the second calculation result can be compared with the standard result. When the second calculation result is consistent with the standard result, it is determined that the target cryptographic algorithm in the target chip has passed the test. In this way, the correctness of the second calculation result can be detected using the standard result preset by the detection application, so that the target cryptographic algorithm preset in the target chip can be pre-tested. In this way, if the pre-test passes, the USIM card can be sent to a professional institution for testing, thereby reducing the probability of failure of the test, thereby reducing the risk of repeated inspections and shortening the inspection cycle.
[0118] In one embodiment, after comparing the second calculation result with the standard result, the method may further include:
[0119] When the second calculation result is inconsistent with the standard result, a second detection result is generated, and the second detection result is used to indicate that the target cryptographic algorithm in the target chip fails the detection.
[0120] Output prompt information, where the prompt information includes the second detection result and the second calculation result.
[0121] According to the above implementation, when the second calculation result is inconsistent with the standard result, it can be determined that the target cryptographic algorithm in the target chip fails the test, and the corresponding prompt information is output. In this way, the card dealer can use the prompt information to analyze and study the cryptographic algorithm built into the chip, thereby shortening the research cycle. In this way, in the case of a pre-test failure, timely research and adjustment can be carried out, thereby reducing the probability of repeated inspections.
[0122] In order to better describe the entire solution, based on the above embodiments, a specific example is given to illustrate the information processing method of the embodiment of the present application. This is explained in detail below. It should be noted that the following examples are only for explaining the embodiment of the present application, and do not constitute a limitation on the embodiment of the present application.
[0123] In an embodiment of the present application, the detection application may be a card application pre-set in the USIM card, or it may be a mobile APP. The detection application stores multiple groups of detection data corresponding to multiple cryptographic algorithms, and one cryptographic algorithm may correspond to one group of detection data, or may correspond to multiple groups of detection data. The detection application may detect the correctness of the cryptographic algorithm in response to the detection instruction. For ease of description, the following takes the detection card application pre-set in the USIM card as an example, stipulates that one cryptographic algorithm corresponds to a group of detection data, and illustrates the information processing method of the embodiment of the present application. Exemplarily, the instructions described below may be APDU instructions. The APDU instruction may be sent by the USIM card through the tool provided by TSM.
[0124] In one example, before executing the information processing method of the embodiment of the present application, it is necessary to first install the detection card application on the USIM card. The installation process may include steps (1) to (2).
[0125] (1) Generate the Converted Applet Package (cap) file for the test card application.
[0126] Step (1) may specifically include: generating detection data. Packing the detection data and presetting it in a cap file to obtain a detection card application cap file. The detection data may include detection data corresponding to the SM4-ECB encryption algorithm, the SM4-ECB decryption algorithm, the SM4-CBC encryption algorithm, the SM4-CBC decryption algorithm, the SM4-MAC algorithm, the SM3, SM2 signature algorithm, and the SM2 signature verification algorithm. In this way, a complete set of detection data corresponding to the SM2, SM3, and SM4 algorithms can be preset when the detection card application is initialized.
[0127] (2) Install the generated detection card application cap file to the USIM card.
[0128] Exemplary, the process of installing the generated detection card application cap file to the USIM card may include: selecting the main security domain of the USIM card, completing external authentication, and completing the detection card application installation using preset loading parameters and installation parameters. Then, sending an APDU instruction to the detection card application, according to the status word (Status word, SW) returned by the detection card application, verifying whether the detection card application is successfully installed.
[0129] After the detection card application is successfully installed, the detection card application can determine one or more national secret algorithms of the detection chip according to the parameter field of the custom APDU instruction after receiving the custom APDU instruction. The custom APDU instruction can include a SELECT instruction for activating and selecting the installed detection card application, and a parameter detection instruction (ALDO DETECTION instruction) for selecting different input detection values and returning the detection results during the detection process. The following briefly introduces some examples of the relevant formats of the SELECT instruction and the ALDO DETECTION instruction. For the sake of simplicity, the English involved in the relevant format is explained here.
[0130] TLV is the abbreviation of "Tag-Length-Value". It is a data representation format commonly used to encode data units in communication protocols.
[0131] CLA: The full name is Class type, which can indicate the grade type.
[0132] INS: The full name is Instruction type, which can indicate the instruction type.
[0133] P1: The full name is Parameter 1, which can represent parameter 1.
[0134] P2: The full name is Parameter 2, which can represent parameter 2.
[0135] LC: The full name is Length Coding, which can indicate the coding length.
[0136] LE: The full name is Length Encoding, which can represent length encoding.
[0137] DATA: data.
[0138] AID: The full name is Application Identifier, which can represent the application identifier.
[0139] In one example, the SELECT instruction format may be as shown in Table 1.
[0140] Table 1: SELECT instruction format
[0141] data describe CLA 00 INS A4 P1 04 P2 00 LC Application instance AID length DATA Application Instance AID LE 00
[0142] In one example, the SELECT command response format may be as shown in Table 2.
[0143] Table 2: SELECT command response format
[0144]
[0145] In one example, the SELECT instruction response status code format may be as shown in Table 3.
[0146] Table 3: SELECT command response status code format
[0147] SW describe 9000 Execution Success 6A82 File not found 6A86 P1P2 parameter error
[0148] In one example, the ALDO DETECTION instruction format may be as shown in Table 4.
[0149] Table 4: ALDO DETECTION instruction format
[0150] data describe CLA 00 INS A2 P1 xx P2 00 LC Data field length DATA Data Field LE 00
[0151] In an example, the P1 parameter format description may be as shown in Table 5. In Table 5, b8 to b1 may respectively identify each bit (Binary digit, BIT) of the P1 parameter.
[0152] Table 5: P1 parameter format description
[0153] b8 b7 b6 b5 b4 b3 b2 b1 illustrate 0 1 - - - - - - Not the last instruction 1 0 - - - - - - The last instruction or all data - - 0 1 - - - - Get the first set or all data - - 1 0 - - - - Get the next set of data
[0154] In an example, the format of the DATA data field may be as shown in Table 6. In Table 6, 0x may represent a binary flag. The fields in the DATA data field may be combined arbitrarily.
[0155] Table 6: DATA field format
[0156]
[0157] In one example, the ALDO DETECTION command response format may be as shown in Table 7.
[0158] Table 7: ALDO DETECTION command response format
[0159]
[0160]
[0161] In one example, the ALDO DETECTION instruction response status code format may be as shown in Table 8.
[0162] Table 8: ALDO DETECTION command response status code format
[0163] SW describe 9000 Execution Success 6310 There is subsequent data reading 6A86 P1P2 parameter error
[0164] Next, based on the above instruction-related formats, the information processing method is illustrated by example. Figure 2 As shown, the information processing method may include the following steps S210 to S280.
[0165] S210, the USIM card sends a SELECT command to the detection card application.
[0166] Accordingly, the detection card application responds to the SELECT instruction and activates the detection card application.
[0167] S220, after the detection card application is activated, the detection card application returns version information and SW status word to the USIM card.
[0168] For example, the AID of the detection card application is: D156000101800000000000009B0069D02. Referring to the format of Table 1, the SELECT instruction can be: 00A4040010D15600010180000000000009B0069D0200. The detection card application response format can be: 4403010000. The SW status word of the detection card application response can be: 9000 (indicating that the card application is selected).
[0169] S230, the USIM card sends an ALDO DETECTIO instruction to the detection card application.
[0170] Exemplarily, the ALDO DETECTIO instruction may include a selection value and a detection value. The selection value may be used to indicate the national secret algorithm to be detected. The detection value may be used for the chip to calculate the detection value based on the preset national secret algorithm. The selection values may be arbitrarily combined, that is, one algorithm may be selected for detection, or multiple algorithms may be selected for detection.
[0171] S240, the detection card application responds to the ALDO DETECTIO instruction and starts the algorithm detection function of the detection card application.
[0172] S250, the detection card application calls the chip API corresponding to the selection value according to the selection value in the ALDO DETECTIO instruction, and sends the selection value, the detection value and the algorithm parameters to the chip.
[0173] Take the ALDO DETECTIO instruction corresponding to the SM4-ECB encryption algorithm as an example. The AID of the detection card application is: D15600010180000000000009B0069D02. The plaintext data (i.e. the detection value) is: 091CAA18794C5AE5FF8396761C177061. The algorithm parameters may include the SM4-ECB algorithm key: 3AB4BED9F22C406AB1C579847B9A444F, and the SM4-ECB algorithm initial vector: 7D9F159E9A66C677A6E1C13F42964F8E. Referring to the formats of Table 4, Table 5 and Table 6, the ALDO DETECTIO instruction can be: 00A28000120310091CAA18794C5AE5FF8396761C177061. In this instruction, Tag=0x03 in the DATA data field, that is, Tag=0x03 is the selected value, and the plaintext data is: 091CAA18794C5AE5FF8396761C177061, which is the detection value, that is, the SM4-ECB encryption algorithm is selected for detection.
[0174] S260, the chip calculates the detection value based on the received selection value, detection value and algorithm parameters using the national secret algorithm preset in the chip hardware to obtain a calculation result.
[0175] For example, if the ALDO DETECTIO instruction is: 00A28000120310091CAA18794C5AE5FF8396761C177061, the chip receives the plaintext data (i.e., the detection value): 091CAA18794C5AE5FF8396761C177061; the received algorithm parameters include the SM4-ECB algorithm key: 3AB4BED9F22C406AB1C579847B9A444F, and the SM4-ECB algorithm initial vector: 7D9F159E9A66C677A6E1C13F42964F8E. In this way, the chip can select the SM4-ECB encryption algorithm, use the received SM4-ECB algorithm key and SM4-ECB algorithm initial vector as algorithm parameters, calculate the plaintext data, and obtain the calculation result.
[0176] S270, the chip calls the chip API to return the calculation result to the detection card application.
[0177] S280, the detection card application compares the received operation result with the preset correct result, and determines the correctness of the Chinese encryption algorithm of the chip hardware according to the comparison result.
[0178] In step S280, the detection card application can compare the detection data preset in the detection card application according to the selected value and the detection value. If it is consistent with the result value of the chip API response, the output result of the detection card application is 00, that is, the test passes (refer to Table 7 for definition); if it is inconsistent with the result value of the chip API response, the output result of the detection card application is 01, that is, the test fails (refer to Table 7 for definition).
[0179] Based on the same inventive concept as the information processing method, an embodiment of the present application also provides an information processing device, which is applied to a detection application, and the detection application stores multiple groups of detection data corresponding to multiple cryptographic algorithms.
[0180] like Figure 3 As shown, the information processing device 300 may include a receiving module 301 , a determining module 302 , a sending module 303 and a generating module 304 .
[0181] The receiving module 301 is used to receive a detection instruction, where the detection instruction includes a target selection value and a target detection value, wherein the target selection value is used to select a target cryptographic algorithm.
[0182] The determination module 302 is used to determine the target detection data corresponding to the detection instruction from multiple groups of detection data, the target detection data including the target algorithm parameters of the target cryptographic algorithm and the standard result, wherein the standard result is the first calculation result obtained by calculating the target detection value with the target algorithm parameters as the algorithm parameters of the target cryptographic algorithm.
[0183] The sending module 303 is used to send a target selection value, a target detection value and a target algorithm parameter to the target chip, so that the target chip selects a target cryptographic algorithm according to the target selection value, calculates the target detection value with the target algorithm parameter as the algorithm parameter, and obtains a second calculation result;
[0184] The receiving module 301 is further used to receive the second calculation result sent by the target chip;
[0185] The generating module 304 is used to generate a detection result of the target cryptographic algorithm in the target chip according to the second calculation result and the standard result.
[0186] The information processing device of the embodiment of the present application can be applied to a detection application, which stores multiple groups of detection data corresponding to multiple cryptographic algorithms. The embodiment of the present application can receive a detection instruction, and the detection instruction includes a target selection value and a target detection value. Among them, the target selection value is used to select a target cryptographic algorithm. Then, the target detection data corresponding to the detection instruction is determined from the multiple groups of detection data, and the target detection data includes a target algorithm parameter and a standard result of the target cryptographic algorithm. Among them, the standard result is a first calculation result obtained by calculating the target detection value with the target algorithm parameter as the algorithm parameter of the target cryptographic algorithm. Then, the target selection value, the target detection value and the target algorithm parameter are sent to the target chip, so that the target chip selects the target cryptographic algorithm through the target selection value, and calculates the target detection value with the target algorithm parameter as the algorithm parameter to obtain a second calculation result. In this way, the second calculation result is a calculation result obtained by calculating the same detection value using the same calculation process as the standard result. Then, the second calculation result sent by the target chip can be received. According to the second calculation result and the standard result, the detection result of the target cryptographic algorithm in the target chip is generated. In this way, the correctness of the second calculation result can be detected by using the standard result preset by the detection application, so that the target cryptographic algorithm preset by the target chip can be pre-tested. In this way, if the pre-test is passed, the USIM card can be sent to a professional institution for testing, thereby reducing the probability of failure of the test, thereby reducing the risk of repeated testing and shortening the testing cycle.
[0187] In one embodiment, the apparatus may further include:
[0188] The entry module is used to enter the target working state when receiving the application selection instruction sent by the universal user authentication module USIM card before receiving the detection instruction.
[0189] The receiving module is specifically used to: receive a detection instruction when the detection application is in a target working state.
[0190] In one embodiment, the sending module can also be used to send first feedback information to the USIM card after entering the target working state when receiving an application selection instruction sent by the USIM card, so that the USIM card sends a detection instruction according to the first feedback information, wherein the first feedback information includes version information of the detection application and execution information of the selection instruction.
[0191] In one embodiment, the detection application may be a USIM card application, and the target chip and the detection application are integrated into the same USIM card.
[0192] In one embodiment, the apparatus may further include:
[0193] The acquisition module is used to acquire a preset application file before receiving a detection instruction, and the application file includes multiple groups of detection data corresponding to multiple cryptographic algorithms.
[0194] The storage module is used to store application files.
[0195] The sending module may also be used to send second feedback information to the USIM card in response to the status detection instruction sent by the USIM card, where the second feedback information is used to feed back the application file to be stored in the detection application.
[0196] In one embodiment, the determination module may also be used to determine a target application programming interface API corresponding to the target cryptographic algorithm before sending the target selection value, the target detection value and the target algorithm parameters to the target chip.
[0197] The sending module is used to send the target selection value, target detection value and target algorithm parameters to the target chip, which may specifically include:
[0198] The sending module is used to send the target selection value, the target detection value and the target algorithm parameters to the target chip through the target API.
[0199] In one embodiment, the apparatus may further include:
[0200] The acquisition module is used to obtain a third calculation result obtained by the target detection mechanism by calculating the target detection value with the target algorithm parameters as the algorithm parameters of the target cryptographic algorithm after receiving the second calculation result sent by the target chip.
[0201] The comparison module is used to compare the third calculation result with the second calculation result to obtain a verification result.
[0202] The sending module is used to send the verification result to the target detection agency.
[0203] In one embodiment, the multiple cryptographic algorithms may include at least one of SM4's electronic code book ECB mode cryptographic algorithm, SM4's ECB mode decryption algorithm, SM4's cipher block chaining CBC mode cryptographic algorithm, SM4's CBC mode decryption algorithm, SM4's message authentication MAC algorithm, SM3, SM2 signature algorithm, and SM2 signature verification algorithm.
[0204] In one embodiment, the generation module may be specifically used to:
[0205] comparing the second calculation result with the standard result;
[0206] When the second calculation result is consistent with the standard result, a first detection result is generated, and the first detection result is used to indicate that the target cryptographic algorithm in the target chip has passed the detection.
[0207] In one embodiment, the generation module may also be used to: generate a second detection result when the second calculation result is inconsistent with the standard result, and the second detection result is used to indicate that the target cryptographic algorithm in the target chip fails the detection.
[0208] The device may further include: an output module, configured to output prompt information, wherein the prompt information includes the second detection result and the second calculation result.
[0209] The information processing device provided in the embodiment of the present application can realize Figure 1 To avoid repetition, the various processes implemented by the method embodiment are not described here.
[0210] Figure 4 A schematic diagram of the hardware structure of an electronic device provided in an embodiment of the present application is shown.
[0211] The electronic device may include a processor 401 and a memory 402 storing computer program instructions.
[0212] Specifically, the processor 401 may include a central processing unit (CPU), or an application specific integrated circuit (ASIC), or may be configured to implement one or more integrated circuits of the embodiments of the present application.
[0213] Memory 402 may include a large capacity memory for data or instructions. By way of example and not limitation, memory 402 may include a hard disk drive (HDD), a floppy disk drive, a flash memory, an optical disk, a magneto-optical disk, a magnetic tape, or a universal serial bus (USB) drive or a combination of two or more of these. In appropriate cases, memory 402 may include a removable or non-removable (or fixed) medium. In appropriate cases, memory 402 may be inside or outside of an integrated gateway disaster recovery device. In a specific embodiment, memory 402 is a non-volatile solid-state memory.
[0214] The memory may include read-only memory (ROM), random access memory (RAM), magnetic disk storage media devices, optical storage media devices, flash memory devices, electrical, optical or other physical / tangible memory storage devices. Thus, typically, the memory includes one or more tangible (non-transitory) computer-readable storage media (e.g., memory devices) encoded with software including computer-executable instructions, and when the software is executed (e.g., by one or more processors), it is operable to perform the operations described with reference to the method according to an aspect of the present disclosure.
[0215] The processor 401 implements any one of the information processing or information processing methods in the above embodiments by reading and executing computer program instructions stored in the memory 402 .
[0216] As an example, the electronic device may further include a communication interface 403 and a bus 410. Figure 4 As shown, the processor 401, the memory 402, and the communication interface 403 are connected via a bus 410 and communicate with each other.
[0217] The communication interface 403 is mainly used to implement communication between various modules, devices, units and / or equipment in the embodiments of the present application.
[0218] Bus 410 includes hardware, software or both, and the parts of online data flow billing equipment are coupled to each other. For example, but not limitation, bus may include accelerated graphics port (AGP) or other graphics bus, enhanced industrial standard architecture (EISA) bus, front-side bus (FSB), hypertransport (HT) interconnection, industrial standard architecture (ISA) bus, infinite bandwidth interconnection, low pin count (LPC) bus, memory bus, micro channel architecture (MCA) bus, peripheral component interconnection (PCI) bus, PCI-Express (PCI-X) bus, serial advanced technology attachment (SATA) bus, video electronics standard association local (VLB) bus or other suitable bus or two or more of these combinations. In appropriate cases, bus 410 may include one or more buses. Although the present application embodiment describes and shows a specific bus, the present application considers any suitable bus or interconnection.
[0219] The electronic device can execute the information processing method in the embodiment of the present application, thereby realizing the combination Figure 1 and Figure 3 Described information processing method and device.
[0220] In addition, in combination with the information processing method in the above embodiments, the embodiments of the present application may provide a computer storage medium for implementation. The computer storage medium stores computer program instructions; when the computer program instructions are executed by a processor, any one of the information processing methods in the above embodiments is implemented.
[0221] An embodiment of the present application also provides a computer program product, including a computer program, which implements any one of the information processing methods in the above embodiments when the computer program is processed and executed.
[0222] It should be clear that the present application is not limited to the specific configuration and processing described above and shown in the figures. For the sake of simplicity, a detailed description of the known method is omitted here. In the above embodiments, several specific steps are described and shown as examples. However, the method process of the present application is not limited to the specific steps described and shown, and those skilled in the art can make various changes, modifications and additions, or change the order between the steps after understanding the spirit of the present application.
[0223] The functional blocks shown in the above-described block diagram can be implemented as hardware, software, firmware or a combination thereof. When implemented in hardware, it can be, for example, an electronic circuit, an application specific integrated circuit (ASIC), appropriate firmware, a plug-in, a function card, etc. When implemented in software, the elements of the present application are programs or code segments that are used to perform the required tasks. The program or code segment can be stored in a machine-readable medium, or transmitted on a transmission medium or a communication link by a data signal carried in a carrier wave. "Machine-readable medium" can include any medium capable of storing or transmitting information. Examples of machine-readable media include electronic circuits, semiconductor memory devices, ROM, flash memory, erasable ROM (EROM), floppy disks, CD-ROMs, optical disks, hard disks, optical fiber media, radio frequency (RF) links, etc. The code segment can be downloaded via a computer network such as the Internet, an intranet, etc.
[0224] It should also be noted that the exemplary embodiments mentioned in this application describe some methods or systems based on a series of steps or devices. However, this application is not limited to the order of the above steps, that is, the steps can be performed in the order mentioned in the embodiment, or in a different order from the embodiment, or several steps can be performed simultaneously.
[0225] Aspects of the present disclosure are described above with reference to the flowchart and / or block diagram of the method, device (system) and computer program product according to the embodiment of the present disclosure. It should be understood that each box in the flowchart and / or block diagram and the combination of each box in the flowchart and / or block diagram can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device to produce a machine so that these instructions executed by the processor of the computer or other programmable data processing device enable the implementation of the function / action specified in one or more boxes of the flowchart and / or block diagram. Such a processor can be, but is not limited to, a general-purpose processor, a special-purpose processor, a special application processor, or a field programmable logic circuit. It can also be understood that each box in the block diagram and / or flowchart and the combination of boxes in the block diagram and / or flowchart can also be implemented by dedicated hardware that performs a specified function or action, or can be implemented by a combination of dedicated hardware and computer instructions.
[0226] The above is only a specific implementation of the present application. Those skilled in the art can clearly understand that for the convenience and simplicity of description, the specific working processes of the systems, modules and units described above can refer to the corresponding processes in the aforementioned method embodiments, and will not be repeated here. It should be understood that the protection scope of the present application is not limited to this. Any technician familiar with the technical field can easily think of various equivalent modifications or replacements within the technical scope disclosed in this application, and these modifications or replacements should be included in the protection scope of this application.
Claims
1. An information processing method, characterized in that: Applied to a detection application, the detection application stores multiple sets of detection data corresponding to multiple cryptographic algorithms; the method comprises: Receiving a detection instruction, the detection instruction including a target selection value and a target detection value, wherein the target selection value is used to select a target cryptographic algorithm; Determining target detection data corresponding to the detection instruction from the multiple groups of detection data, the target detection data including target algorithm parameters of the target cryptographic algorithm and a standard result, wherein the standard result is a first calculation result obtained by calculating the target detection value with the target algorithm parameters as the algorithm parameters of the target cryptographic algorithm; Sending the target selection value, the target detection value, and the target algorithm parameter to a target chip, so that the target chip selects the target cryptographic algorithm by the target selection value, and calculates the target detection value by using the target algorithm parameter as an algorithm parameter to obtain a second calculation result; receiving a second calculation result sent by the target chip; A detection result of a target cryptographic algorithm in the target chip is generated according to the second calculation result and the standard result.
2. The method according to claim 1, characterized in that Before receiving the detection instruction, the method further includes: Upon receiving an application selection instruction sent by a universal user authentication module USIM card, entering a target working state; When the detection application is in a target working state, a detection instruction is received.
3. The method according to claim 2, characterized in that In the case of receiving the application selection instruction sent by the USIM card, after entering the target working state, the method further includes: Sending first feedback information to the USIM card, so that the USIM card sends the detection instruction according to the first feedback information, wherein the first feedback information includes version information of the detection application and execution information of the selection instruction.
4. The method according to claim 1, characterized in that: The detection application is a USIM card application, and the target chip and the detection application are integrated into the same USIM card.
5. The method according to claim 4, characterized in that Before receiving the detection instruction, the method further includes: Obtaining a preset application file, wherein the application file includes multiple groups of detection data corresponding to the multiple cryptographic algorithms; storing the application file; In response to the status detection instruction sent by the USIM card, second feedback information is sent to the USIM card, where the second feedback information is used to feed back the application file to be stored in the detection application.
6. The method according to claim 1, characterized in that Before sending the target selection value, the target detection value, and the target algorithm parameter to the target chip, the method further includes: Determine a target application programming interface API corresponding to the target cryptographic algorithm; The sending the target selection value, the target detection value, and the target algorithm parameter to the target chip includes: The target selection value, the target detection value and the target algorithm parameter are sent to the target chip through the target API.
7. The method according to claim 1, characterized in that After receiving the second calculation result sent by the target chip, the method further includes: Obtaining a third calculation result obtained by a target detection mechanism calculating the target detection value using the target algorithm parameters as the algorithm parameters of the target cryptographic algorithm; Comparing the third calculation result with the second calculation result to obtain a verification result; The verification result is sent to the target detection mechanism.
8. The method according to claim 1, characterized in that The multiple cryptographic algorithms include at least one of SM4's electronic code book ECB mode encryption algorithm, SM4's ECB mode decryption algorithm, SM4's cipher block chaining CBC mode encryption algorithm, SM4's CBC mode decryption algorithm, SM4's message authentication MAC algorithm, SM3, SM2 signature algorithm, and SM2 signature verification algorithm.
9. The method according to claim 1, characterized in that: The step of generating a detection result of a target cryptographic algorithm in the target chip according to the second calculation result and the standard result includes: comparing the second calculation result with the standard result; When the second calculation result is consistent with the standard result, a first detection result is generated, and the first detection result is used to indicate that the target cryptographic algorithm in the target chip has passed the detection.
10. The method according to claim 9, characterized in that After comparing the second calculation result with the standard result, the method further includes: In the case where the second calculation result is inconsistent with the standard result, generating a second detection result, wherein the second detection result is used to indicate that the target cryptographic algorithm in the target chip fails the detection; Output prompt information, where the prompt information includes the second detection result and the second calculation result.
Citation Information
Patent Citations
Intelligent card national cryptographic algorithm testing method and device
CN110188011A
Data processing method based on password card, electronic equipment and storage medium
CN112532381A
Test method and device for USIM card file system, and medium
CN113220568A
Algorithm test method, device and system for security chip
CN118585439A
Method to detect an OTA (over the air) standard message affected by an error
US20170310646A1