Remote testing method and device, equipment and storage medium

Through the remote testing method, remote connection and key negotiation technology are used to solve the problem of low testing efficiency of terminal equipment security modules in the prior art, and more efficient and accurate test results are achieved.

CN119449291APending Publication Date: 2025-02-14CHINA CONSTRUCTION BANK +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411508041.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-28
Publication Date
2025-02-14

AI Technical Summary

Technical Problem

In the prior art, the testing efficiency of terminal equipment security modules is low, resulting in waste of labor costs and poor testing efficiency.

Method used

The remote testing method is adopted to establish a remote connection with the device under test by obtaining a remote test request, negotiate the key pair and the root key, and test the encryption function of the working key to determine the remote test results of the device under test.

Benefits of technology

Improve the efficiency and accuracy of safety module testing, reduce labor costs, and enhance the automation and efficiency of testing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119449291A_ABST
    Figure CN119449291A_ABST
Patent Text Reader

Abstract

The invention provides a remote testing method and device, equipment and a storage medium. Relates to the technical field of computers. The method comprises the following steps: acquiring a remote test request, wherein the remote test request is used for requesting to carry out remote test on an encryption function of tested equipment; establishing remote connection with the tested equipment according to the remote test request; negotiating a key pair and a root key with the tested equipment, and negotiating at least one working key with the tested equipment according to the key pair and the root key; for any working key, according to the working key, testing the encryption function of the tested equipment on the working key, and testing the key storage capability and signature capability of the tested equipment to obtain a key test result corresponding to the working key; and according to the key test result corresponding to each working key, determining the test result of the remote test of the tested equipment. And the test efficiency is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a remote testing method, device, equipment and storage medium. Background Art

[0002] The terminal device may be provided with a security module for encrypting data. In some scenarios, the security module of the terminal device needs to be tested to ensure that it can effectively encrypt data and that the encrypted data can be decrypted by the receiving device. For example, in a financial scenario, the security module of the financial device needs to be tested.

[0003] In the related art, a field test method is usually used to test the security module. The tester needs to connect the test equipment and the device under test on site and complete the test by sending a test instruction to the security module of the device under test.

[0004] However, in the above method, it is necessary to rely on the experience of the tester to make corresponding adjustments, and the on-site testing method will waste manpower costs, resulting in poor testing efficiency. Summary of the invention

[0005] The present application provides a remote testing method, apparatus, device and storage medium to solve the problem of poor testing efficiency.

[0006] In a first aspect, the present application provides a remote testing method, which is applied to a testing device, and the method comprises:

[0007] Obtain a remote test request, where the remote test request is used to request a remote test of an encryption function of a device under test;

[0008] Establishing a remote connection with the device under test according to the remote test request;

[0009] Negotiate a key pair and a root key with the device under test, and negotiate at least one working key with the device under test based on the key pair and the root key;

[0010] For any working key, according to the working key, test the encryption function of the tested device on the working key to obtain a key test result corresponding to the working key;

[0011] The test result of the remote test of the device under test is determined according to the key test result corresponding to each working key.

[0012] In one possible design, testing the encryption function of the tested device on the working key according to the key pair and the root key to obtain a key test result corresponding to the working key includes:

[0013] Generate first original data corresponding to the working key;

[0014] Generate a first test request according to the first original data and the working key, wherein the first test request includes the first original data and an index number corresponding to the working key;

[0015] Sending the first test request to the device under test;

[0016] receiving a first test response sent by the device under test, where the first test response includes first encrypted data, where the first encrypted data is obtained by the device under test encrypting the first original data according to a working key corresponding to the index number;

[0017] The key test result is determined according to the first test response.

[0018] In one possible design, determining the key test result according to the first test response includes:

[0019] Decrypting the first encrypted data using the working key to obtain second original data;

[0020] If the second original data is the same as the first original data, determining that the key test result is that the working key test has passed;

[0021] If the second original data is different from the first original data, it is determined that the key test result is that the working key test has failed.

[0022] In one possible design, establishing a remote connection with the device under test according to the remote test request includes:

[0023] According to the remote test request, obtaining a device identification and a shared key of the device under test;

[0024] Generate a first message authentication code according to the device identifier and the shared key;

[0025] Sending a connection request to the device under test, wherein the connection request includes the first message verification code;

[0026] A connection response sent by the device under test is received, where the connection response is used to indicate that the test device is successfully connected to the device under test.

[0027] In one possible design, negotiating a key pair with the device under test includes:

[0028] Sending a key pair generation request to the device under test, where the key pair generation request is used to request the device under test to generate a key pair;

[0029] A public key sent by the device under test is received, where the public key is generated by the device under test.

[0030] In one possible design, negotiating a root key with the device under test includes:

[0031] Generate a root key, and encrypt the root key according to the public key in the key pair to obtain an encrypted root key;

[0032] According to the encrypted root key, sending a root key loading request to the device under test, wherein the root key loading request includes the encrypted root key;

[0033] Receiving a first key verification value sent by the device under test, where the first key verification value is obtained by the device under test processing the encryption root key according to the private key in the key pair and a preset encryption algorithm;

[0034] Processing the root key by the preset encryption algorithm to obtain a second key verification value;

[0035] When the first key check value and the second key check value are the same, it is determined that the root key is successfully negotiated with the device under test.

[0036] In a possible design, for any working key, negotiating the working key with the device under test according to the key pair and the root key includes:

[0037] Generate the working key and the index number corresponding to the working key, and store the working key and the index number corresponding to the working key;

[0038] Encrypting the working key to obtain an encrypted working key;

[0039] According to the encrypted working key and the index number, sending a working key loading request to the device under test, wherein the working key loading request includes the encrypted working key and the index number;

[0040] Receiving a third key verification value sent by the device under test, where the third key verification value is obtained by the device under test processing a decryption working key using the root key and a preset encryption algorithm;

[0041] Processing the working key by using the preset encryption algorithm to obtain a fourth key verification value;

[0042] When the third key verification value and the fourth key verification value are the same, it is determined that the working key is successfully negotiated with the device under test.

[0043] In one possible design, the method further includes:

[0044] Generate first data, and generate a signature test request according to the first data, wherein the signature test request includes the first data;

[0045] Sending the signature test request to the device under test;

[0046] Receiving first signature data sent by the device under test, where the first signature data is obtained by the device under test signing the first data using a private key in the key pair;

[0047] Verifying the first signature data using a public key to obtain a verification result;

[0048] If the verification result indicates that the verification is successful, determining that the signature test of the device under test has passed;

[0049] If the verification result indicates that the verification fails, it is determined that the signature test on the device under test fails.

[0050] In a second aspect, the present application provides a remote testing device, including: an acquisition module, a remote connection module, a negotiation module, a testing module and a first determination module, wherein:

[0051] The acquisition module is used to acquire a remote test request, where the remote test request is used to request a remote test of the encryption function of the device under test;

[0052] The remote connection module is used to establish a remote connection with the device under test according to the remote test request;

[0053] The negotiation module is used to negotiate a key pair and a root key with the device under test, and negotiate at least one working key with the device under test based on the key pair and the root key;

[0054] The test module is used to test the encryption function of the tested device on any working key according to the working key, and obtain a key test result corresponding to the working key;

[0055] The first determination module is used to determine the test result of the remote test of the device under test according to the key test result corresponding to each working key.

[0056] In a possible design, the test module is specifically used for:

[0057] Generate first original data corresponding to the working key;

[0058] Generate a first test request according to the first original data and the working key, wherein the first test request includes the first original data and an index number corresponding to the working key;

[0059] Sending the first test request to the device under test;

[0060] receiving a first test response sent by the device under test, where the first test response includes first encrypted data, where the first encrypted data is obtained by the device under test encrypting the first original data according to a working key corresponding to the index number;

[0061] The key test result is determined according to the first test response.

[0062] In a possible design, the test module is specifically used for:

[0063] Decrypting the first encrypted data using the working key to obtain second original data;

[0064] If the second original data is the same as the first original data, determining that the key test result is that the working key test has passed;

[0065] If the second original data is different from the first original data, it is determined that the key test result is that the working key test has failed.

[0066] In a possible design, the remote connection module is specifically used for:

[0067] According to the remote test request, obtaining a device identification and a shared key of the device under test;

[0068] Generate a first message authentication code according to the device identifier and the shared key;

[0069] Sending a connection request to the device under test, wherein the connection request includes the first message verification code;

[0070] A connection response sent by the device under test is received, where the connection response is used to indicate that the test device is successfully connected to the device under test.

[0071] In a possible design, the negotiation module is specifically used to:

[0072] Sending a key pair generation request to the device under test, where the key pair generation request is used to request the device under test to generate a key pair;

[0073] A public key sent by the device under test is received, where the public key is generated by the device under test.

[0074] In a possible design, the negotiation module is specifically used to:

[0075] Generate a root key, and encrypt the root key according to the public key in the key pair to obtain an encrypted root key;

[0076] According to the encrypted root key, sending a root key loading request to the device under test, wherein the root key loading request includes the encrypted root key;

[0077] Receiving a first key verification value sent by the device under test, where the first key verification value is obtained by the device under test processing the encryption root key according to the private key in the key pair and a preset encryption algorithm;

[0078] Processing the root key by the preset encryption algorithm to obtain a second key verification value;

[0079] When the first key check value and the second key check value are the same, it is determined that the root key is successfully negotiated with the device under test.

[0080] In a possible design, the negotiation module is specifically used to:

[0081] Generate the working key and the index number corresponding to the working key, and store the working key and the index number corresponding to the working key;

[0082] Encrypting the working key to obtain an encrypted working key;

[0083] According to the encrypted working key and the index number, sending a working key loading request to the device under test, wherein the working key loading request includes the encrypted working key and the index number;

[0084] Receiving a third key verification value sent by the device under test, where the third key verification value is obtained by the device under test processing a decryption working key using the root key and a preset encryption algorithm;

[0085] Processing the working key by using the preset encryption algorithm to obtain a fourth key verification value;

[0086] When the third key verification value and the fourth key verification value are the same, it is determined that the working key is successfully negotiated with the device under test.

[0087] In a possible design, the remote testing device further includes: a generating module, a transceiver module, a verification processing module and a second determining module, wherein:

[0088] The generating module is specifically used to generate first data, and generate a signature test request according to the first data, wherein the signature test request includes the first data;

[0089] The transceiver module is specifically used to send the signature test request to the device under test; receive first signature data sent by the device under test, where the first signature data is obtained by the device under test signing the first data using the private key in the key pair;

[0090] The verification processing module is specifically used to verify the first signature data through a public key to obtain a verification result;

[0091] The second determination module is specifically configured to determine that a signature test on the device under test has passed if the verification result indicates that the verification has succeeded; and determine that a signature test on the device under test has failed if the verification result indicates that the verification has failed.

[0092] In a third aspect, an embodiment of the present application provides an electronic device, comprising: at least one processor and a memory; the memory stores computer execution instructions; at least one processor executes the computer execution instructions stored in the memory, so that the at least one processor executes the remote testing method as described in the first aspect above and various possible designs of the first aspect.

[0093] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, in which computer execution instructions are stored. When a processor executes the computer execution instructions, the remote testing method as described in the first aspect and various possible designs of the first aspect is implemented.

[0094] In a fifth aspect, an embodiment of the present application provides a computer program product, including a computer program. When the computer program is executed by a processor, it implements the remote testing method as described in the first aspect and various possible designs of the first aspect.

[0095] The remote testing method, apparatus, equipment and storage medium provided in the present application can adopt a remote testing method when it is necessary to test the encryption function of the security module of the device under test. The testing device can establish a remote connection with the device under test according to the remote testing request, and can obtain at least one working key according to the negotiated key pair and root key, and test the encryption function of each working key of the device under test in turn, thereby obtaining the remote testing result of the device under test. The above method improves the efficiency of security module testing. BRIEF DESCRIPTION OF THE DRAWINGS

[0096] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.

[0097] Figure 1 A schematic diagram of the system architecture provided for an embodiment of the present application;

[0098] Figure 2 A flowchart of a remote testing method provided in an embodiment of the present application;

[0099] Figure 3 A schematic diagram of a visual operation window of a remote testing system provided in an embodiment of the present application;

[0100] Figure 4 A schematic diagram of the process of negotiating a working key provided in an embodiment of the present application;

[0101] Figure 5 A process diagram of a method for determining a test result provided in an embodiment of the present application;

[0102] Figure 6 A schematic diagram of an interactive process for establishing a remote connection between a test device and a device under test provided in an embodiment of the present application;

[0103] Figure 7 A schematic diagram of the interactive process of negotiating a key pair and a root key between a test device and a device under test provided in an embodiment of the present application;

[0104] Figure 8 A schematic diagram of the interactive process of generating a working key between a test device and a device under test provided in an embodiment of the present application;

[0105] Fig. 9 A schematic diagram of the interactive process of generating a working key between a test device and a device under test provided in an embodiment of the present application;

[0106] Fig.10 A schematic diagram of the structure of a remote testing device provided in an embodiment of the present application;

[0107] Fig.11 A schematic diagram of the structure of another remote testing device provided in an embodiment of the present application;

[0108] Fig.12 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application.

[0109] The above drawings have shown clear embodiments of the present application, which will be described in more detail later. These drawings and text descriptions are not intended to limit the scope of the present application in any way, but to illustrate the concept of the present application to those skilled in the art by referring to specific embodiments. DETAILED DESCRIPTION

[0110] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The implementations described in the following exemplary embodiments do not represent all implementations consistent with the present application. Instead, they are merely examples of devices and methods consistent with some aspects of the present application as detailed in the appended claims.

[0111] In the technical solution of this application, the collection, storage, use, processing, transmission, provision and disclosure of information such as financial data or user data involved shall comply with the provisions of relevant laws and regulations and shall not violate public order and good morals.

[0112] It should be noted that in the embodiments of the present application, certain software, components, models and other existing solutions in the industry may be mentioned, and they should be regarded as exemplary. Their purpose is only to illustrate the feasibility of implementing the technical solution of the present application, but it does not mean that the applicant has or will necessarily use the solution.

[0113] For ease of understanding, the following Figure 1 , the system architecture applicable to the embodiments of the present application is described.

[0114] Figure 1 This is a schematic diagram of the system architecture provided by the embodiment of this application. Figure 1 , including a test device 101 and a device under test 102. The test device 101 may be a local terminal device of a user, and is used to test the encryption capability of the device under test 102. The device under test 102 may be a remote terminal device, and a security module may be provided in the device under test 102, and the security module may be used to encrypt information.

[0115] In the related art, the security module is usually tested by on-site testing. The tester needs to connect the test equipment and the device under test on site, and send a test instruction to the security module of the device under test through the test equipment to complete the test. However, in the above method, it is necessary to rely on the experience of the tester to make corresponding adjustments, and the on-site testing method will waste manpower costs, resulting in poor test efficiency.

[0116] In response to the above technical problems, in an embodiment of the present application, when it is necessary to test the encryption function of the security module of the device under test, a remote testing method can be adopted. The testing device can establish a remote connection with the device under test according to the remote testing request, and can obtain at least one working key according to the negotiated key pair and root key. The encryption function of the device under test for each working key and the storage capacity and signing capacity of the working key are tested in turn, thereby obtaining the remote test result of the device under test. The above method improves the efficiency of security module testing.

[0117] The technical solution of the present application and how the technical solution of the present application solves the above-mentioned technical problems are described in detail below with specific embodiments. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments. The embodiments of the present application will be described below in conjunction with the accompanying drawings.

[0118] Figure 2 A flowchart of a remote testing method provided in an embodiment of the present application. Figure 2 As shown, the method may include the following steps:

[0119] S201. Obtain a remote test request.

[0120] The execution subject of the embodiment of the present application can be a test device, or a remote test device set in the test device, wherein the test device can refer to a user's terminal device. The remote test device can be implemented by software, or by a combination of software and hardware.

[0121] A remote test system may be provided in the test device. The visual operation interface of the remote test system may have a "test" control. The user may generate a remote test request by clicking the "test" control. The remote test request is used to request a remote test of the encryption function of the device under test.

[0122] Next, combine Figure 3 ,Through specific examples, the visual operation window of the remote testing system is explained.

[0123] Figure 3 For a schematic diagram of a visual operation window of a remote test system provided in an embodiment of the present application, see Figure 3 , including the device under test address input module, the device under test port number input module and the "Test" control of the remote test system. The user can input the Internet Protocol Address (IP address) field information of the device under test in the device under test address input module, the user can input the port number field information of the device under test in the device under test port number module, and the user can generate a remote test request by clicking the "Test" control.

[0124] S202: Establish a remote connection with the device under test according to the remote test request.

[0125] The remote test request may include a device identification and a shared key of the device under test.

[0126] The device identification of the device under test may include the IP address of the device under test and the port number of the device under test. The device under test may be identified through the identification of the device under test and a remote connection may be established with the device under test. The shared key may refer to a key agreed upon in advance between the test device and the device under test.

[0127] The successful remote connection between the test device and the device under test can be determined in the following manner: according to the remote test request, obtain the device identification and shared key of the device under test; generate a first message verification code according to the device identification and the shared key; send a connection request to the device under test, the connection request including the first message verification code; receive a connection response sent by the device under test, the connection response is used to indicate that the test device and the device under test are successfully connected.

[0128] The connection response includes a second message verification code. When the test device determines that the first message verification code is consistent with the second message verification code, it can be determined that the test device is successfully connected to the device under test and both parties share the same shared key.

[0129] The first message authentication code may be generated in the following manner: determining a shared key, converting a remote test request into a first message, where the first message may be a message represented by multiple binary digits, applying a preset encryption algorithm to the first message, and obtaining a first message authentication code, wherein the preset encryption algorithm may refer to a message authentication code algorithm based on a hash function.

[0130] The second message authentication code may be generated in the following manner: determining a shared key, converting a connection request into a second message, where the second message may be a message represented by multiple binary digits, and applying a preset encryption algorithm to the second message to obtain a second message authentication code.

[0131] S203: Negotiate a key pair and a root key with the device under test, and negotiate at least one working key with the device under test based on the key pair and the root key.

[0132] A key pair refers to a pair of keys used for encryption and decryption. It belongs to an asymmetric cryptographic system. A key pair consists of a public key and a private key. The public key can be used to encrypt data, and the private key can be used to decrypt data encrypted with the public key. Optionally, the private key can also be used to sign data, and the public key can be used to verify the correctness of the signature.

[0133] The root key may refer to a key used for encryption or decryption and belongs to a symmetric cryptographic system. For example, the root key may encrypt a working key.

[0134] The working key may refer to a key used directly to encrypt or decrypt data, and belongs to a symmetric cryptographic system.

[0135] The key pair may be negotiated in the following manner: sending a key pair generation request to the device under test, the key pair generation request being used to request the device under test to generate a key pair; and receiving a public key sent by the device under test, the public key being generated by the device under test.

[0136] The root key can be negotiated in the following manner: generate a root key, and encrypt the root key according to the public key in the key pair to obtain an encrypted root key; send a root key loading request to the device under test according to the encrypted root key, the root key loading request including the encrypted root key; receive a first key verification value sent by the device under test, the first key verification value being obtained by the device under test by processing the encrypted root key according to the shared key and a preset encryption algorithm; process the root key by using a preset encryption algorithm to obtain a second key verification value; when the first key verification value and the second key verification value are the same, determine that the root key has been successfully negotiated with the device under test.

[0137] The test device can generate a working key and, based on the root key, determine whether the working key is negotiated successfully.

[0138] After confirming that the working key negotiation is successful, the test device is formatted.

[0139] S204. For any working key, test the encryption function of the tested device on the working key according to the working key to obtain a key test result corresponding to the working key.

[0140] For any working key, the key test result corresponding to the working key may include two types: the working key test passed and the working key test failed.

[0141] The encryption function of the working key can be tested in the following manner: generate first original data corresponding to the working key; generate a first test request based on the first original data and the working key; send the first test request to the device under test; receive a first test response sent by the device under test; and determine the encryption function of the device under test based on the first test response.

[0142] The first test request includes the first original data and the index number corresponding to the working key. The first test response includes the first encrypted data, which is obtained by encrypting the first original data according to the working key corresponding to the index number by the device under test.

[0143] S205: Determine a first test response of the device under test according to the key test result corresponding to each working key.

[0144] The test result of the remote test of the device under test may include that the remote test of the device under test passed or failed.

[0145] The test result of the remote test of the device under test can be determined in the following way: obtain the key test result corresponding to each working key, and determine whether the key test result corresponding to any working key is a working key test pass; if so, determine whether the signature test of the device under test is passed; if so, determine that the test result of the remote test of the device under test is a test pass; if not, determine that the test result of the remote test of the device under test is a test failure; if the key test result corresponding to any working key is a working key test failure, determine that the test result of the remote test of the device under test is a test failure.

[0146] In an embodiment of the present application, when it is necessary to test the encryption function of the security module of the device under test, the test device can establish a remote connection with the device under test based on a remote test request; negotiate a key pair and a root key with the device under test, and determine at least one negotiated working key based on the negotiated key pair and root key; test the encryption function of any working key to obtain a key test result corresponding to the working key; determine the remote test result of the device under test based on the key test result corresponding to each working key, and the above method improves the efficiency and accuracy of security module testing.

[0147] Based on any of the above embodiments, Figure 4 , the process of negotiating the working key ( Figure 2 S203) in the embodiment is described in detail.

[0148] Figure 4 A schematic diagram of the process of negotiating a working key provided in an embodiment of the present application. Figure 4 , the method may include:

[0149] S401: Generate a working key and an index number corresponding to the working key, and store the working key and the index number corresponding to the working key.

[0150] The test device may generate a working key and an index number corresponding to the working key, and store the working key and the index number corresponding to the working key in a first storage space, wherein the first storage space may be located in a storage device of the test device.

[0151] The corresponding working key can be determined in the first storage space according to the index number corresponding to the working key.

[0152] S402: Encrypt the working key to obtain an encrypted working key.

[0153] The encryption process may be to encrypt data using an encryption algorithm, and the encryption algorithm may be a symmetric encryption algorithm.

[0154] The encryption process can be performed in the following manner: the test device obtains the root key negotiated with the device under test, performs a preset round of digital operations on the working key and the root key, and obtains the encrypted working key. The preset rounds can be a value preset by the user in the test device in advance, and the digital operations can include XOR operations, replacement operations, and permutation operations.

[0155] S403: Send a working key loading request to the device under test.

[0156] The working key loading request includes an encrypted working key obtained by encrypting the working key and an index number corresponding to the working key.

[0157] The device under test receives the working key loading request and can obtain the encrypted working key and index number.

[0158] S404: Receive a third key verification value sent by the device under test.

[0159] The third key check value can be used to verify the integrity and correctness of the working key to ensure that the working key has not been tampered with during transmission.

[0160] The third key verification value may refer to a value obtained by the device under test by processing the decryption working key using the root key and a preset encryption algorithm.

[0161] The third key verification value can be determined in the following manner: the device under test obtains the encryption working key, decrypts the encryption working key using the root key to obtain the decryption working key, and processes the encryption working key using the root key and a preset encryption algorithm to obtain the third key verification value.

[0162] S405. Process the working key using a preset encryption algorithm to obtain a fourth key verification value.

[0163] The fourth key verification value may refer to a value obtained by the test device by processing the working key using the root key and a preset encryption algorithm.

[0164] The fourth key verification value may be determined in the following manner: the test device obtains a working key, and processes the working key using a root key and a preset encryption algorithm to obtain the fourth key verification value.

[0165] S406: Determine whether the third key check value and the fourth key check value are the same.

[0166] If yes, execute S407.

[0167] If not, execute S408.

[0168] S407: Determine that a working key is successfully negotiated with the device under test.

[0169] The device under test obtains the decryption working key, determines the decryption working key as the working key, and stores the working key and the index number in the second storage space. The device under test can obtain the index number sent by the test device, and can search for the corresponding working key in the second storage space according to the index number. The second storage space can be located in the storage device of the device under test.

[0170] S408: Determine whether the working key has been tampered with during transmission, and discard the working key.

[0171] In an embodiment of the present application, when it is necessary to remotely test the encryption function of the security module of the device under test, the test device can first negotiate at least one working key based on the root key negotiated with the device under test. The test device can generate a working key and an index number corresponding to the working key, and store them in the first storage space; the test device can encrypt the working key to obtain an encrypted working key; the test device can send a working key loading request to the device under test, the working key loading request includes the encrypted working key and the index number, and the device under test can use the root key to decrypt the encrypted working key to obtain a decrypted working key; the device under test uses a preset encryption algorithm to decrypt the working key, and can obtain a third key check value, and send it to the test device; the test device receives the third key check value, and uses the preset encryption algorithm on the working key to obtain a fourth key check value, and determines whether the third key check value and the fourth key check value are the same. If so, it indicates that the working key is successfully negotiated with the device under test, and if not, it indicates that the working key has been tampered with during the transmission process, and the working key is discarded. The above method improves the efficiency and accuracy of security module testing.

[0172] Based on any of the above embodiments, Figure 5 , the process of determining the test results of the remote test of the device under test is described in detail.

[0173] Figure 5 This is a process diagram of the method for determining the test results provided in the embodiment of the present application. Figure 5 , the method may include:

[0174] S501. For any working key, generate first original data corresponding to the working key.

[0175] The first original data may refer to data used to test the encryption capability of the working key, that is, the first original data is original data that has not been encrypted.

[0176] The first original data may be data represented by binary numbers, randomly generated by the test device, or retrieved from a preset test database by the test device, wherein the preset test database may be located in a storage device of the test device.

[0177] S502: Send a first test request to the device under test.

[0178] The first test request may include the first original text data and an index number corresponding to the working key.

[0179] For any working key, the testing device may determine the index number corresponding to the working key from the first storage space.

[0180] S503: Receive a first test response sent by the device under test.

[0181] The first test response includes first encrypted data, where the first encrypted data is obtained by encrypting the first original data according to the working key corresponding to the index number by the device under test.

[0182] The first encrypted data can be determined in the following manner: the device under test receives the first test request sent by the test device, obtains the first original data and the index number corresponding to the working key; according to the index number corresponding to the working key, determines the working key corresponding to the index number in the second storage space; uses the working key to encrypt the first original data to obtain the first encrypted data

[0183] S504: Determine second original data according to the first test response.

[0184] The second original data may be data represented by a binary number. The second original data may refer to data obtained after the test device decrypts the first encrypted data using the working key.

[0185] The second original data may be determined in the following manner: after receiving the first test response sent by the device under test, the test device determines the first encrypted data; and decrypts the first encrypted data using the working key to obtain the second original data.

[0186] S505: Determine whether the first original data and the second original data are the same.

[0187] Whether the first original data and the second original data are the same can be determined in the following manner: using a preset comparison function on the first original data to obtain a first comparison value; using a preset comparison function on the second original data to obtain a second comparison value; judging whether the first comparison value and the second comparison value are the same, if so, it can be determined that the first original data and the second original data are the same; if not, it can be determined that the first original data and the second original data are not the same. The preset comparison function can be a hash function.

[0188] If yes, execute S506.

[0189] If not, execute S507.

[0190] S506: Determine that the key test result is that the working key test has passed.

[0191] Execute S508.

[0192] S507: Determine that the key test result is that the working key test fails.

[0193] Execute S517.

[0194] S508: Determine whether the key test results of all working keys are working key test passed.

[0195] If yes, execute S509.

[0196] If not, execute S501.

[0197] S509: In response to the key test result of any working key being that the working key test passes, generate first data.

[0198] In response to the key test result of any working key being that the working key test passes, the test device randomly generates first data. The first data may be data represented by a binary number.

[0199] S510: Send a signature test request to the device under test.

[0200] The signature test request may include first data.

[0201] S511. Receive first signature data sent by the device under test.

[0202] The first signature data is obtained by the device under test signing the first data using the private key in the key pair. After the device under test determines the first signature data, it can send the first signature data to the test device.

[0203] The first signature data can be determined in the following manner: the device under test receives a signature test request sent by the test device to obtain first data; the first data is processed using a preset encryption algorithm to obtain a first encrypted value; the first encrypted value is signed using a private key to obtain first signature data.

[0204] S512: Verify the first signature data using the public key to obtain a verification result.

[0205] The verification result may be determined in the following manner: the test device uses a signature verification algorithm on the first signature data, the public key, and the first data to obtain a verification result; the verification result may be used to indicate verification success or verification failure.

[0206] S513: Determine whether the verification result indicates that the verification is successful.

[0207] If yes, execute S514.

[0208] If not, execute S515.

[0209] S514: Determine whether the signature test of the device under test passes.

[0210] S515: Determine that the signature test of the device under test fails.

[0211] S516: Determine that the test result of the remote test of the device under test is that the test passed.

[0212] S517: Determine that the test result of the remote test of the device under test is that the test fails.

[0213] In an embodiment of the present application, when it is necessary to determine the test result of the encryption function of the security module of the device under test, the test device can generate first original data, and send the first original data and the index number corresponding to the working key to the device under test; the device under test can determine the working key in the second storage space according to the index number, encrypt the first original data using the working key to obtain the first encrypted data, and send a first test response including the first encrypted data to the test device; the test device obtains the first encrypted data, decrypts the first encrypted data using the working key, and obtains the second original data; it is determined whether the first original data and the second original data are the same, and if so, it is determined that the working key test is passed; if not, it is determined that the working key test is not passed; In response to the key test result of any working key being a working key test pass, first data is generated, and a signature test request including the first data is sent to the device under test; the device under test performs a signature process on the first data to obtain first signature data, and sends the first signature data to the test device; the test device uses the public key to verify the first signature data to obtain a verification result, and determines whether the verification result indicates that the verification is successful. If so, it is determined that the signature test of the device under test has passed; if not, it is determined that the signature test of the device under test has failed; in response to the signature test passing, it is determined that the test result of the remote test of the device under test is a test pass; in response to the signature test failing, it is determined that the test result of the remote test of the device under test is a test failure. The above method improves the efficiency and accuracy of security module testing.

[0214] Based on any of the above embodiments, Figure 6 , describes in detail the interactive process of establishing a remote connection between the test equipment and the device under test.

[0215] Figure 6 Schematic diagram of the interactive process of establishing a remote connection between the test device and the device under test provided in the embodiment of the present application. Figure 6 , the method may include:

[0216] S601: The test device obtains a remote test request.

[0217] S602: The testing device generates a first message authentication code according to the identification of the device under test and the shared key.

[0218] S603: The testing device sends a verification request to the device under test.

[0219] S604: The device under test generates a second message authentication code according to the shared key and the connectivity authentication request, and determines whether the first message authentication code is consistent with the second message authentication code.

[0220] S605: The device under test sends a connection response to the testing device.

[0221] A remote testing method provided in an embodiment of the present application can execute the technical solution shown in the above method embodiment, and its implementation principle and beneficial effects are similar, so they will not be repeated here.

[0222] Based on any of the above embodiments, Figure 7 , describes in detail the interactive process between the test device and the device under test to negotiate the key pair and root key.

[0223] Figure 7 Schematic diagram of the interactive process of negotiating a key pair and a root key between a test device and a device under test provided in an embodiment of the present application. Figure 7 , the method may include:

[0224] S701. The test device generates a key pair generation request.

[0225] S702: The testing device sends a key pair generation request to the device under test.

[0226] S703: The device under test generates a key pair according to the key pair generation request.

[0227] S704: The device under test sends a public key to the testing device.

[0228] S705: The test device receives the public key, generates a root key, encrypts the root key using the public key to obtain the encrypted root key, and generates a root key loading request.

[0229] S706: The testing device sends a root key loading request to the device under test.

[0230] S707. The test device determines the encryption root key according to the root key loading request, uses the private key to decrypt the encryption root key to obtain the decryption root key, and uses a preset encryption algorithm on the decryption root key to obtain a first key verification value.

[0231] S708: The device under test sends a first key verification value to the testing device.

[0232] S709. The test device processes the root key using a preset encryption algorithm to obtain a second key verification value, and determines whether the first key verification value and the second key verification value are the same. If so, the root key negotiation is successful.

[0233] A remote testing method provided in an embodiment of the present application can execute the technical solution shown in the above method embodiment, and its implementation principle and beneficial effects are similar, so they will not be repeated here.

[0234] Based on any of the above embodiments, Figure 8, the interactive process between the test device and the device under test to generate the working key is described in detail.

[0235] Figure 8 Schematic diagram of the interactive process of generating a working key between the test device and the device under test provided in the embodiment of the present application. Figure 8 , the method may include:

[0236] S801. The test device generates a working key and an index number corresponding to the working key, stores the work key in a first storage space, encrypts the working key using a root key to obtain an encrypted working key, and generates a working key loading request.

[0237] S802: The testing device sends a working key loading request to the device under test.

[0238] S803: The device under test uses the root key to decrypt the encryption working key to obtain a decryption working key, and processes the encryption working key using the root key and a preset encryption algorithm to obtain a third key verification value.

[0239] S804: The device under test sends a third key verification value to the testing device.

[0240] S805. The testing device processes the working key using a preset encryption algorithm to obtain a fourth key verification value, and determines whether the third key verification value and the fourth key verification value are the same.

[0241] S806: If they are the same, the testing device sends a successful negotiation message to the device under test.

[0242] S807: The device under test determines the decrypted working key as the working key, and stores the index number corresponding to the working key in the second storage space.

[0243] A remote testing method provided in an embodiment of the present application can execute the technical solution shown in the above method embodiment, and its implementation principle and beneficial effects are similar, so they will not be repeated here.

[0244] Based on any of the above embodiments, Fig. 9 , which describes in detail the interaction process of remote testing between the test equipment and the equipment under test.

[0245] Fig. 9 Schematic diagram of the interactive process of generating a working key between the test device and the device under test provided in the embodiment of the present application. Fig. 9 , the method may include:

[0246] S901. The testing device generates first original data corresponding to a working key, and generates a first test request.

[0247] S902: The testing device sends a first test request to the device under test.

[0248] S903: The device under test obtains a working key from the second storage space according to the index number, and uses the working key to encrypt the first original data to obtain first encrypted data.

[0249] S904: The device under test sends a first test response to the testing device.

[0250] S905. The test device receives the first encrypted data, and uses the working key to decrypt the first encrypted data to obtain the second original data. The test device determines whether the first original data and the second original data are the same.

[0251] S906: If they are the same, the testing device generates first data and generates a signature test request.

[0252] S907: The testing device sends a signature test request to the device under test.

[0253] S908: The device under test signs the first data using the private key to obtain first signature data.

[0254] S909: The device under test sends first signature data to the testing device.

[0255] S910. The test device uses the public key to verify the first signature data, obtains a verification result, and determines whether the verification result indicates that the verification is successful. If so, it is determined that the test result of the remote test of the device under test is that the test passed.

[0256] A remote testing method provided in an embodiment of the present application can execute the technical solution shown in the above method embodiment, and its implementation principle and beneficial effects are similar, so they will not be repeated here.

[0257] Fig.10 This is a schematic diagram of the structure of a remote testing device provided in an embodiment of the present application. Fig.10 The remote testing device 10 includes: an acquisition module 11, a remote connection module 12, a negotiation module 13, a testing module 14 and a first determination module 15, wherein:

[0258] The acquisition module 11 is used to acquire a remote test request, where the remote test request is used to request a remote test of the encryption function of the device under test;

[0259] The remote connection module 12 is used to establish a remote connection with the device under test according to the remote test request;

[0260] The negotiation module 13 is used to negotiate a key pair and a root key with the device under test, and negotiate at least one working key with the device under test based on the key pair and the root key;

[0261] The test module 14 is used to test the encryption function of the tested device on any working key according to the working key, and obtain a key test result corresponding to the working key;

[0262] The first determination module 15 is used to determine the test result of the remote test of the device under test according to the key test result corresponding to each working key.

[0263] A remote testing device provided in an embodiment of the present application can execute the technical solution shown in the above method embodiment, and its implementation principle and beneficial effects are similar, which will not be repeated here.

[0264] In a possible design, the testing module 14 is specifically used for:

[0265] Generate first original data corresponding to the working key;

[0266] Generate a first test request according to the first original data and the working key, wherein the first test request includes the first original data and an index number corresponding to the working key;

[0267] Sending the first test request to the device under test;

[0268] receiving a first test response sent by the device under test, where the first test response includes first encrypted data, where the first encrypted data is obtained by the device under test encrypting the first original data according to a working key corresponding to the index number;

[0269] The key test result is determined according to the first test response.

[0270] In a possible design, the testing module 14 is specifically used for:

[0271] Decrypting the first encrypted data using the working key to obtain second original data;

[0272] If the second original data is the same as the first original data, determining that the key test result is that the working key test has passed;

[0273] If the second original data is different from the first original data, it is determined that the key test result is that the working key test has failed.

[0274] In a possible design, the remote connection module 12 is specifically used for:

[0275] According to the remote test request, obtaining a device identification and a shared key of the device under test;

[0276] Generate a first message authentication code according to the device identifier and the shared key;

[0277] Sending a connection request to the device under test, wherein the connection request includes the first message verification code;

[0278] A connection response sent by the device under test is received, where the connection response is used to indicate that the test device is successfully connected to the device under test.

[0279] In a possible design, the negotiation module 13 is specifically configured to:

[0280] Sending a key pair generation request to the device under test, where the key pair generation request is used to request the device under test to generate a key pair;

[0281] A public key sent by the device under test is received, where the public key is generated by the device under test.

[0282] In a possible design, the negotiation module 13 is specifically configured to:

[0283] Generate a root key, and encrypt the root key according to the public key in the key pair to obtain an encrypted root key;

[0284] According to the encrypted root key, sending a root key loading request to the device under test, wherein the root key loading request includes the encrypted root key;

[0285] Receiving a first key verification value sent by the device under test, where the first key verification value is obtained by the device under test processing the encryption root key according to the private key in the key pair and a preset encryption algorithm;

[0286] Processing the root key by the preset encryption algorithm to obtain a second key verification value;

[0287] When the first key check value and the second key check value are the same, it is determined that the root key is successfully negotiated with the device under test.

[0288] In a possible design, the negotiation module 13 is specifically configured to:

[0289] Generate the working key and the index number corresponding to the working key, and store the working key and the index number corresponding to the working key;

[0290] Encrypting the working key to obtain an encrypted working key;

[0291] According to the encrypted working key and the index number, sending a working key loading request to the device under test, wherein the working key loading request includes the encrypted working key and the index number;

[0292] Receiving a third key verification value sent by the device under test, where the third key verification value is obtained by the device under test processing a decryption working key using the root key and a preset encryption algorithm;

[0293] Processing the working key by using the preset encryption algorithm to obtain a fourth key verification value;

[0294] When the third key verification value and the fourth key verification value are the same, it is determined that the working key is successfully negotiated with the device under test.

[0295] Fig.11 A schematic diagram of the structure of another remote testing device provided in an embodiment of the present application. Fig.10 Based on the examples shown, see Fig.11 The remote testing device 10 further includes: a generating module 16, a transceiver module 17, a verification processing module 18 and a second determining module 19, wherein:

[0296] The generating module 16 is specifically used to generate first data, and generate a signature test request according to the first data, wherein the signature test request includes the first data;

[0297] The transceiver module 17 is specifically used to send the signature test request to the device under test; receive the first signature data sent by the device under test, where the first signature data is obtained by the device under test signing the first data using the private key in the key pair;

[0298] The verification processing module 18 is specifically used to verify the first signature data through the public key to obtain a verification result;

[0299] The second determination module 19 is specifically configured to determine that the signature test on the device under test has passed if the verification result indicates that the verification has succeeded; and determine that the signature test on the device under test has failed if the verification result indicates that the verification has failed.

[0300] A remote testing device provided in an embodiment of the present application can execute the technical solution shown in the above method embodiment, and its implementation principle and beneficial effects are similar, which will not be repeated here.

[0301] Fig.12 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. Fig.12As shown, the electronic device 20 may include: a transceiver 21 , a processor 22 , and a memory 23 .

[0302] The processor 22 executes the computer execution instructions stored in the memory, so that the processor 22 executes the scheme in the above embodiment. The processor 22 can be a general-purpose processor, including a central processing unit CPU, a network processor (NP), etc.; it can also be a digital signal processor DSP, an application-specific integrated circuit ASIC, a field programmable gate array FPGA or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components.

[0303] The memory 23 is connected to the processor 22 via a system bus and completes communication between them. The memory 23 is used to store computer program instructions.

[0304] The transceiver 21 may be used to obtain tasks to be executed and configuration information of the tasks to be executed.

[0305] The system bus can be a peripheral component interconnect (PCI) bus or an extended industry standard architecture (EISA) bus, etc. The system bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, only one thick line is used in the figure, but it does not mean that there is only one bus or one type of bus. The transceiver is used to realize the communication between the database access device and other computers (such as clients, read-write libraries, and read-only libraries). The memory may include random access memory (RAM) and may also include non-volatile memory.

[0306] The electronic device provided in the embodiment of the present application may be the terminal device of the above embodiment.

[0307] An embodiment of the present application also provides a chip for running instructions, which is used to execute the technical solution of the remote testing method in the above embodiment.

[0308] An embodiment of the present application further provides a computer-readable storage medium, in which computer instructions are stored. When the computer instructions are executed on a computer, the computer executes the technical solution of the remote testing method in the above embodiment.

[0309] An embodiment of the present application also provides a computer program product, which includes a computer program stored in a computer-readable storage medium. At least one processor can read the computer program from the computer-readable storage medium. When at least one processor executes the computer program, the technical solution of the remote testing method in the above embodiment can be implemented.

[0310] In the several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic, for example, the division of modules is only a logical function division, and there may be other division methods in actual implementation, such as multiple modules can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interfaces, devices or modules, which can be electrical, mechanical or other forms.

[0311] The modules described as separate components may or may not be physically separated, and the components shown as modules may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the modules may be selected according to actual needs to implement the solution of this embodiment.

[0312] In addition, each functional module in each embodiment of the present application can be integrated into one processing unit, or each module can exist physically separately, or two or more modules can be integrated into one unit. The above-mentioned module-composed unit can be implemented in the form of hardware or in the form of hardware plus software functional units.

[0313] The above-mentioned integrated module implemented in the form of a software function module can be stored in a computer-readable storage medium. The above-mentioned software function module is stored in a storage medium, including a number of instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) or a processor to perform some steps of the methods of various embodiments of the present application.

[0314] It should be understood that the above processor can be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), etc. A general-purpose processor can be a microprocessor or any conventional processor. The steps of the method disclosed in the invention can be directly embodied as being executed by a hardware processor, or can be executed by a combination of hardware and software modules in the processor.

[0315] The memory may include a high-speed RAM memory, and may also include a non-volatile storage NVM, such as at least one disk memory, and may also be a USB flash drive, a mobile hard disk, a read-only memory, a magnetic disk or an optical disk, etc.

[0316] The bus can be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus, etc. The bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, the bus in the drawings of this application is not limited to only one bus or one type of bus.

[0317] The above storage medium can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk. The storage medium can be any available medium that can be accessed by a general or special purpose computer.

[0318] An exemplary storage medium is coupled to a processor so that the processor can read information from the storage medium and write information to the storage medium. Of course, the storage medium can also be a component of the processor. The processor and the storage medium can be located in an application specific integrated circuit (ASIC). Of course, the processor and the storage medium can also exist as discrete components in an electronic control unit or a main control device.

[0319] Those skilled in the art can understand that all or part of the steps of implementing the above-mentioned method embodiments can be completed by hardware related to program instructions. The aforementioned program can be stored in a computer-readable storage medium. When the program is executed, the steps of the above-mentioned method embodiments are executed; and the aforementioned storage medium includes: ROM, RAM, disk or optical disk and other media that can store program codes.

[0320] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit it. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or replace some or all of the technical features therein with equivalents. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present application.

Claims

1. A remote testing method, characterized in that: Applied to testing equipment, the method comprises: Obtain a remote test request, where the remote test request is used to request a remote test of an encryption function of a device under test; Establishing a remote connection with the device under test according to the remote test request; Negotiate a key pair and a root key with the device under test, and negotiate at least one working key with the device under test based on the key pair and the root key; For any working key, according to the working key, test the encryption function of the tested device on the working key to obtain a key test result corresponding to the working key; The test result of the remote test of the device under test is determined according to the key test result corresponding to each working key.

2. The method according to claim 1, characterized in that Testing the encryption function of the tested device on the working key according to the key pair and the root key to obtain a key test result corresponding to the working key includes: Generate first original data corresponding to the working key; Generate a first test request according to the first original data and the working key, wherein the first test request includes the first original data and an index number corresponding to the working key; Sending the first test request to the device under test; receiving a first test response sent by the device under test, where the first test response includes first encrypted data, where the first encrypted data is obtained by the device under test encrypting the first original data according to a working key corresponding to the index number; The key test result is determined according to the first test response.

3. The method according to claim 2, characterized in that Determining the key test result according to the first test response includes: Decrypting the first encrypted data using the working key to obtain second original data; If the second original data is the same as the first original data, determining that the key test result is that the working key test has passed; If the second original data is different from the first original data, it is determined that the key test result is that the working key test has failed.

4. The method according to any one of claims 1 to 3, characterized in that: Establishing a remote connection with the device under test according to the remote test request includes: According to the remote test request, obtaining a device identification and a shared key of the device under test; Generate a first message authentication code according to the device identifier and the shared key; Sending a connection request to the device under test, wherein the connection request includes the first message verification code; A connection response sent by the device under test is received, where the connection response is used to indicate that the test device is successfully connected to the device under test.

5. The method according to any one of claims 1 to 4, characterized in that: Negotiating a key pair with the device under test, including: Sending a key pair generation request to the device under test, where the key pair generation request is used to request the device under test to generate a key pair; A public key sent by the device under test is received, where the public key is generated by the device under test.

6. The method according to any one of claims 1 to 5, characterized in that: Negotiating a root key with the device under test, including: Generate a root key, and encrypt the root key according to the public key in the key pair to obtain an encrypted root key; According to the encrypted root key, sending a root key loading request to the device under test, wherein the root key loading request includes the encrypted root key; Receiving a first key verification value sent by the device under test, where the first key verification value is obtained by the device under test processing the encryption root key according to the private key in the key pair and a preset encryption algorithm; Processing the root key by the preset encryption algorithm to obtain a second key verification value; When the first key check value and the second key check value are the same, it is determined that the root key is successfully negotiated with the device under test.

7. The method according to any one of claims 1 to 6, characterized in that: For any working key; according to the key pair and the root key, negotiating the working key with the device under test, including: Generate the working key and the index number corresponding to the working key, and store the working key and the index number corresponding to the working key; Encrypting the working key to obtain an encrypted working key; According to the encrypted working key and the index number, sending a working key loading request to the device under test, wherein the working key loading request includes the encrypted working key and the index number; Receiving a third key verification value sent by the device under test, where the third key verification value is obtained by the device under test processing a decryption working key using the root key and a preset encryption algorithm; Processing the working key by using the preset encryption algorithm to obtain a fourth key verification value; When the third key verification value and the fourth key verification value are the same, it is determined that the working key is successfully negotiated with the device under test.

8. The method according to any one of claims 1 to 7, characterized in that: The method further comprises: Generate first data, and generate a signature test request according to the first data, wherein the signature test request includes the first data; Sending the signature test request to the device under test; Receiving first signature data sent by the device under test, where the first signature data is obtained by the device under test signing the first data using a private key in the key pair; Verifying the first signature data using a public key to obtain a verification result; If the verification result indicates that the verification is successful, determining that the signature test of the device under test has passed; If the verification result indicates that the verification fails, it is determined that the signature test on the device under test has failed.

9. A remote testing device, characterized in that: include: An acquisition module, a remote connection module, a negotiation module, a test module and a first determination module, wherein: The acquisition module is used to acquire a remote test request, where the remote test request is used to request a remote test of the encryption function of the device under test; The remote connection module is used to establish a remote connection with the device under test according to the remote test request; The negotiation module is used to negotiate a key pair and a root key with the device under test, and negotiate at least one working key with the device under test based on the key pair and the root key; The test module is used to test the encryption function of the tested device on any working key according to the working key, and obtain a key test result corresponding to the working key; The first determination module is used to determine the test result of the remote test of the device under test according to the key test result corresponding to each working key.

10. An electronic device, characterized in that: include: A processor, and a memory communicatively connected to the processor; The memory stores computer-executable instructions; The processor executes the computer-executable instructions stored in the memory to implement the method according to any one of claims 1 to 8.

11. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-executable instructions, which are used to implement the method according to any one of claims 1 to 8 when executed by a processor.

12. A computer program product, characterized in that The invention comprises a computer program, which implements the method according to any one of claims 1 to 8 when being executed by a processor.