Device access method, system and non-volatile computer storage medium
Configuring a unique password for the terminal through asymmetric encryption and using public key verification solves the problem of low device access security in the existing technology and improves the security of terminal identity verification.
Patent Information
- Application Number
- CN202210837641.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-07-15
- Publication Date
- 2024-10-11
- Estimated Expiration
- 2042-07-15
AI Technical Summary
With existing device access methods, usernames and passwords are easily intercepted when the terminal connects to the host, resulting in low security and inability to distinguish authentication issues when multiple terminals use the same ID and password to connect to the host.
Use asymmetric encryption to configure a unique identification corresponding password for each terminal, and verify the password through the public key in the key pair to ensure that each terminal has an independent password. The host can identify and allow or deny through public key verification. connection request.
It improves the security of device access methods, prevents unauthorized terminal connections, ensures the uniqueness of each terminal's identification and password, and enhances host authentication capabilities for multiple terminals using the same identification.
Smart Images

Figure CN115242480B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of device access technology, and in particular to a device access method, system and non-volatile computer storage medium. Background Art
[0002] The device access method is a method for connecting devices to each other. Currently, in order to ensure the security of the connection, security verification is performed when devices (such as terminals and hosts) contact each other.
[0003] In a device access method, a host sends a user name and password to multiple terminals. When these multiple terminals want to connect to the host, they can send the user name and password to the host. The host compares the user name and password with the locally stored user name and password. If the comparison is successful, the host connects to the terminal. If the comparison fails, the host refuses to connect to the terminal.
[0004] However, in the above method, if the password and user name sent by the above terminal are intercepted, it is difficult for the host to know the password and user name after other terminals connect to the host with the password and user name, resulting in low security of the above device access method. Summary of the invention
[0005] The embodiment of the present application provides a device access method, system and non-volatile computer storage medium. The technical solution is as follows:
[0006] According to one aspect of an embodiment of the present application, a device access method is provided, which is used for a host, and the method includes:
[0007] Obtaining a connection request provided by a terminal, wherein the connection request includes an identifier of the terminal and a password corresponding to the identifier, wherein the password is a password generated based on a private key in a key pair and the identifier;
[0008] obtaining a verification result of the password, the password being configured to be verified by a public key in the key pair;
[0009] In response to successful verification, establishing a connection with the terminal;
[0010] In response to a verification failure, the connection request of the terminal is rejected.
[0011] Optionally, obtaining a verification result of the password includes:
[0012] Sending the terminal identification and the password corresponding to the identification to a verification module, wherein the verification module is used to verify the password using the public key in the key pair;
[0013] Receive the verification result fed back by the verification module.
[0014] Optionally, the connection request also includes a user name corresponding to the identifier, and the password is a password generated based on a private key in a key pair, the identifier, and the user name.
[0015] The sending the identifier of the terminal and the password corresponding to the identifier to the verification module includes:
[0016] The terminal identification, the user name corresponding to the identification, and the password corresponding to the identification are sent to the verification module.
[0017] Optionally, obtaining a verification result of the password includes:
[0018] Decrypting the password using the public key in the key pair to obtain decrypted data;
[0019] generating summary data of the identification of the terminal;
[0020] Verifying whether the decrypted data is identical to the summary data;
[0021] In response to the decrypted data being identical to the digest data, determining that the verification is successful;
[0022] In response to the decrypted data being different from the digest data, it is determined that the verification has failed.
[0023] Optionally, before obtaining the connection request provided by the terminal, the method further includes:
[0024] Obtaining an identifier of the terminal;
[0025] generating the password based on the private key in the key pair and the identifier;
[0026] The password is configured in the terminal.
[0027] According to another aspect of an embodiment of the present application, a device access method is provided for a terminal, the method comprising:
[0028] In response to obtaining the login indication signal, sending a connection request to the host, the connection request including the identifier of the terminal and a password corresponding to the identifier, the password being a password generated based on a private key in a key pair and the identifier, and the host being used to verify the password based on a public key in the key pair;
[0029] In response to the verification being successful, a connection is established with the host.
[0030] Optionally, before sending the identifier of the terminal and the password corresponding to the identifier to the host in response to obtaining the login indication signal, the method further includes:
[0031] providing an identification of the terminal to a configuration device;
[0032] The password provided by the configuration device is received.
[0033] According to another aspect of an embodiment of the present application, a device access method is provided for configuring a device, the method comprising:
[0034] Obtaining a key pair, the key pair comprising a private key and a public key corresponding to the private key;
[0035] providing the key pair to a verification module;
[0036] Get the terminal's ID;
[0037] Providing the identifier to the verification module, the verification module being configured to generate a password based on a private key in the key pair and the identifier;
[0038] Obtaining a password provided by the verification module;
[0039] The password is configured in the terminal, and the terminal is used to establish a connection with the host through the password and the identifier.
[0040] Optionally, the verification module is used to generate a user name of the terminal, and generate the password based on the private key in the key pair, the user name and the identifier,
[0041] The obtaining of the password provided by the verification module includes:
[0042] Obtain the user name and the password corresponding to the identification provided by the verification module.
[0043] According to another aspect of an embodiment of the present application, a device access system is provided, the system comprising a host and a terminal;
[0044] The terminal is used to send a connection request to the host, wherein the connection request includes an identifier of the terminal and a password corresponding to the identifier, wherein the password is a password generated based on a private key in a key pair and the identifier;
[0045] The host is used to obtain a verification result of the password, and the password is configured to be verified by a public key in the key pair;
[0046] In response to successful verification, the host establishes a connection with the terminal;
[0047] In response to a verification failure, the host rejects the terminal's connection request.
[0048] Optionally, the system further comprises a verification module,
[0049] The host is used to send the identification of the terminal and the password corresponding to the identification to the verification module;
[0050] The verification module is used to verify the password using the public key in the key pair;
[0051] The host is used to receive the verification result fed back by the verification module.
[0052] Optionally, the verification module is used to:
[0053] Decrypting the password using the public key in the key pair to obtain decrypted data;
[0054] generating summary data of the identification of the terminal;
[0055] Verifying whether the decrypted data is identical to the summary data;
[0056] In response to the decrypted data being identical to the digest data, determining that the verification is successful;
[0057] In response to the decrypted data being different from the digest data, it is determined that the verification has failed.
[0058] According to another aspect of an embodiment of the present application, a non-volatile computer storage medium is provided, wherein at least one instruction, at least one program, a code set or an instruction set is stored in the computer storage medium, and the at least one instruction, the at least one program, the code set or the instruction set is loaded and executed by a processor to implement the method as described above.
[0059] A computer program product or computer program is provided, the computer program product or computer program includes computer instructions, the computer instructions are stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device performs the above method.
[0060] The beneficial effects brought by the technical solution provided by the embodiment of the present application include at least:
[0061] Through asymmetric encryption, a password corresponding to the terminal identification is configured, so that each terminal has an independent password. When the terminal initiates a connection request through the password, the password can be verified based on the public key. Since the identification and password of each terminal are different, when there are multiple terminals using the same identification and password to connect to the host, the host can be informed in time, which solves the problem of low security of the device access method in the related technology and achieves the effect of improving the security of the device access method. BRIEF DESCRIPTION OF THE DRAWINGS
[0062] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0063] Figure 1 It is a structural diagram of a device access system provided in an embodiment of the present application;
[0064] Figure 2 is a method flow chart of a device access method provided by the present application according to an embodiment of the present application;
[0065] Figure 3 is a method flow chart of another device access method provided by the present application according to an embodiment of the present application;
[0066] Figure 4 is a method flow chart of another device access method provided by the present application according to an embodiment of the present application;
[0067] Figure 5 is a method flow chart of another device access method provided by the present application according to an embodiment of the present application;
[0068] Figure 6 is a method flow chart of another device access method provided by the present application according to an embodiment of the present application;
[0069] Figure 7 is a method flow chart of another device access method provided by the present application according to an embodiment of the present application;
[0070] Figure 8 yes Figure 7 A flowchart of verifying a password in the embodiment shown;
[0071] Fig. 9 is a block diagram of a device access apparatus provided by the present application according to an embodiment of the present application;
[0072] Fig.10 is a block diagram of another device access apparatus provided by the present application according to an embodiment of the present application;
[0073] Fig.11 This is a block diagram of another device access apparatus provided by the present application according to an embodiment of the present application.
[0074] 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
[0075] In order to make the objectives, technical solutions and advantages of the present application clearer, the implementation methods of the present application will be further described in detail below with reference to the accompanying drawings.
[0076] The Internet of Things (IoT), or "Internet of Everything Connected", is an extension and expansion of the Internet. It combines various information sensing devices with the Internet to form a huge network, realizing the interconnection of people, machines and things at all times and places.
[0077] The Internet of Things may include a host and multiple terminals, which may include devices with various functions and uses, for example, various sensors, such as sensors for collecting data and information about sound, light, temperature, and electricity. The terminal may establish a connection with the host through various wireless networks and wired networks, and interact with the host, for example, it may transmit the collected data and information to the host.
[0078] The Internet of Things can be applied to a variety of scenarios, such as smart homes, site monitoring, smart transportation, etc.
[0079] When a terminal establishes a connection with a host, the host needs to verify the identity of the terminal to prevent unauthorized terminals from connecting to the host. For multiple terminals in a scenario, the same user name and password are usually used. The host can distribute the user name and password to these multiple terminals, and these multiple terminals can all establish a connection with the host using the user name and password.
[0080] However, if the password and user name are intercepted by a malicious terminal, the malicious terminal can also establish a connection with the host through the password and user name, which may have a serious impact on the security of the Internet of Things.
[0081] The embodiments of the present application provide a device access method, system and non-volatile computer storage medium, which can solve some problems in the above-mentioned technologies.
[0082] Figure 1 It is a structural diagram of a device access system provided in an embodiment of the present application. The device access system may include a terminal 11 and a host 12. The terminal 11 can establish a wired connection or a wireless connection with the host 12.
[0083] The terminal 11 may include various terminals such as smart home devices, smart phones, tablet computers, cameras, etc. The number of terminals 11 may be multiple. Figure 1 The case where the number of terminals 11 is five is shown, but this is not limiting.
[0084] The host 12 may include a device with data processing and transmission functions, and the host 12 may be deployed in a server (such as a Message Queuing Telemetry Transport (MQTT) server, etc.).
[0085] In addition, the device access system may further include a configuration device 13 and a verification module 14. The configuration device 13 may include a terminal used by a configuration personnel, and the configuration device 13 may establish a wired connection or a wireless connection with the terminal 11, the host 12 and the verification module 14.
[0086] The verification module 14 may be combined with a server, or may be combined with a host 12, or the verification module 14 may be an independent device, which is not limited in the embodiment of the present application.
[0087] Figure 2 This is a method flow chart of a device access method provided by the present application according to an embodiment of the present application. The method can be used for Figure 1 The device shown is connected to a host in the system, and the method may include the following steps:
[0088] Step 201: Obtain a connection request provided by a terminal, wherein the connection request includes an identifier of the terminal and a password corresponding to the identifier, and the password is a password generated based on a private key in a key pair and the identifier.
[0089] Step 202: Obtain a verification result of the password, where the password is configured to be verified by a public key in the key pair.
[0090] Step 203: In response to successful verification, establish a connection with the terminal.
[0091] Step 204: In response to the verification failure, reject the terminal's connection request.
[0092] To summarize, the device access method provided in the embodiment of the present application uses asymmetric encryption to configure a password corresponding to an identifier for a terminal, so that each terminal has an independent password. When the terminal initiates a connection request using the password, the password can be verified based on the public key. Since the identifier and password of each terminal are different, when there are multiple terminals connecting to the host with the same identifier and password, the host can be informed in time, which solves the problem of low security of the device access method in the related technology and achieves the effect of improving the security of the device access method.
[0093] Figure 3 This is a method flow chart of another device access method provided by the present application according to an embodiment of the present application. The method can be used for Figure 1The device shown is accessed to a terminal in a system, and the method may include the following steps:
[0094] Step 301, in response to obtaining a login indication signal, a connection request is sent to the host, the connection request includes the terminal identification and the password corresponding to the identification, the password is a password generated based on the private key in the key pair and the identification, and the host is used to verify the password based on the public key in the key pair.
[0095] Step 302: In response to successful verification, establish a connection with the host.
[0096] To summarize, the device access method provided in the embodiment of the present application uses asymmetric encryption to configure a password corresponding to an identifier for a terminal, so that each terminal has an independent password. When the terminal initiates a connection request using the password, the password can be verified based on the public key. Since the identifier and password of each terminal are different, when there are multiple terminals connecting to the host with the same identifier and password, the host can be informed in time, which solves the problem of low security of the device access method in the related technology and achieves the effect of improving the security of the device access method.
[0097] Figure 4 This is a method flow chart of another device access method provided by the present application according to an embodiment of the present application. The method can be used for Figure 1 The device access system shown may include a terminal 410 and a host 420, wherein:
[0098] The terminal 410 is used to send a connection request to the host. The connection request includes the terminal identification and a password corresponding to the identification. The password is a password generated based on the private key in the key pair and the identification.
[0099] The host 420 is used to obtain a verification result of the password, where the password is configured to be verified by a public key in the key pair.
[0100] In response to successful authentication, the host 420 establishes a connection with the terminal 410 .
[0101] In response to the authentication failure, the host 420 rejects the connection request of the terminal 410 .
[0102] To summarize, the device access system provided in the embodiment of the present application uses asymmetric encryption to configure a password corresponding to an identifier for a terminal, so that each terminal has an independent password. When the terminal initiates a connection request using the password, the password can be verified based on the public key. Since the identifier and password of each terminal are different, when there are multiple terminals connecting to the host with the same identifier and password, the host can be informed in time, which solves the problem of low security of the device access method in the related technology and achieves the effect of improving the security of the device access method.
[0103] Figure 5 This is a method flow chart of another device access method provided by the present application according to an embodiment of the present application. The method can be used for Figure 1 The device shown is connected to a configuration device in a system, and the method may include the following steps:
[0104] Step 501: Obtain a key pair, where the key pair includes a private key and a public key corresponding to the private key.
[0105] Step 502: Provide the key pair to the verification module.
[0106] Step 503: Obtain the terminal identification.
[0107] Step 504: Provide the identifier to the verification module, and the verification module is used to generate a password based on the private key in the key pair and the identifier.
[0108] Step 505: Obtain the password provided by the verification module.
[0109] Step 506: configure the password into the terminal, and the terminal is used to establish a connection with the host through the password and the identifier.
[0110] To summarize, the device access method provided in the embodiment of the present application uses asymmetric encryption to configure a password corresponding to an identifier for a terminal, so that each terminal has an independent password. When the terminal initiates a connection request using the password, the password can be verified based on the public key. Since the identifier and password of each terminal are different, when there are multiple terminals connecting to the host with the same identifier and password, the host can be informed in time, which solves the problem of low security of the device access method in the related technology and achieves the effect of improving the security of the device access method.
[0111] Figure 6 This is a method flow chart of another device access method provided by the present application according to an embodiment of the present application. The method can be used for Figure 1 The device access system shown in the figure may include the following steps:
[0112] Step 601: Configure the device to obtain a key pair.
[0113] A key pair includes a private key and a public key corresponding to the private key.
[0114] The configuration device can generate a private key and generate a corresponding public key through the private key. The private key generation algorithm may include the RSA algorithm, the national secret SM2, or some other private key generation algorithms. The embodiments of the present application do not limit this.
[0115] It should be noted that the public key and the private key are a pair of keys, and data encrypted by one of the keys can only be decrypted by the other key.
[0116] Step 602: The configuration device provides the key pair to the verification module.
[0117] In the method provided in the embodiment of the present application, the configuration device can provide the public key and the private key in the key pair to the verification module, and the verification module implements the subsequent verification function.
[0118] In an exemplary embodiment, the verification module may include two submodules, and the two submodules may respectively and securely store the private key and the public key. Exemplarily, the verification module may include a private key generation module and a private key verification module, wherein the private key may be securely stored in the private key generation module, and the public key may be securely stored in the private key verification module.
[0119] Of course, the public key and the private key in the key pair can also be securely stored in other locations (such as a cloud server), and the verification module can access the public key and the private key in the key pair.
[0120] In the embodiment of the present application, the public key is not a public key. The public key is securely stored in a preset storage location (such as a verification module) and can only be accessed by a designated device (such as a verification module or a host, etc.).
[0121] Step 603: The configuration device obtains the terminal identification.
[0122] The configuration device can obtain the terminal's identification in a variety of ways. The identification (ID) can be a unique and non-repetitive identification of the terminal in the device access system, the identification can be the terminal's serial number (Serial Number, SN), or the identification can be the terminal's media access control address (Media Access Control Address, MAC). The identification can be called a device identification (DEVICE_ID).
[0123] In one acquisition method, the configuration device can obtain a large number of terminal identifiers in batches from the terminal manufacturer, so that passwords can be configured for multiple terminals at the same time.
[0124] In another manner, the configuration device may directly obtain the terminal identifier from the terminal.
[0125] Step 604: The configuration device provides an identification to the verification module.
[0126] The configuration device may provide the acquired terminal identification to the verification module storing the key pair.
[0127] Step 605: The verification module generates a password based on the private key in the key pair and the identifier.
[0128] The verification module may generate a password based on the private key in the key pair and the identifier. Specifically, the verification module may first generate summary data of the identifier using a first summary generation method, and then encrypt the summary data using the private key to obtain the password.
[0129] Among them, the first summary generation method can be various summary algorithms, such as SHA-256, MD5, SHA-1, SHA-512 and the national secret SM3 hash algorithm, etc., which is not limited in the embodiments of the present application.
[0130] In addition, the verification module can also generate a username for each terminal (such as randomly generated), and generate the terminal username and identification summary information through a summary algorithm, and encrypt the summary information through a private key to obtain a password. This method can improve the security of the password.
[0131] The corresponding pseudo code can be:
[0132] DEVICE_SECRET=RSA_SIGN(MESSAGE_DIGEST(DEVICE_ID+USER_NAME), PRI_KEY).
[0133] Among them, DEVICE_SECRET is the password, PRI_KEY is the private key, RSA_SIGN (xxx, PRI_KEY) is to encrypt (sign) xxx with the private key, MESSAGE_DIGEST() is to generate summary data for the information in brackets, DEVICE_ID is the terminal identifier, and USER_NAME is the user name corresponding to the terminal identifier.
[0134] In an exemplary embodiment, the verification module may generate passwords corresponding to the identification of each terminal for multiple terminals in batches, so as to improve the efficiency of the method provided in the embodiment of the present application.
[0135] Step 606: The configuration device obtains the password provided by the verification module.
[0136] After obtaining the password, the verification module can send the password to the configuration device. Based on the different ways of generating the password, when the password is generated by a user name and an identifier, the verification module can provide the configuration device with the password and user name corresponding to the terminal identifier.
[0137] Step 607: The configuration device configures the password into the terminal.
[0138] The configuration device can batch configure multiple passwords to the terminal. When the verification module provides the password and user name corresponding to the terminal's identification, the configuration device can batch configure the passwords and user names corresponding to multiple terminal identifications to the terminal. The terminal can try to establish a connection with the host through the password.
[0139] The method provided in the embodiment of the present application is a method for configuring a password (or a password and a user name) for a terminal. This method can be applied before the terminal leaves the factory. On the one hand, passwords (or passwords and user names) can be configured for the terminals in large quantities. On the other hand, the transmission of passwords and key pairs and other data after leaving the factory can be avoided, thereby improving the security of the device access method.
[0140] In addition, the host can also configure the password into the terminal. For example, the host can obtain the terminal identification, generate a password based on the private key and identification in the key pair, and then configure the password into the terminal. The embodiments of the present application do not limit this.
[0141] To summarize, the device access method provided in the embodiment of the present application uses asymmetric encryption to configure a password corresponding to an identifier for a terminal, so that each terminal has an independent password. When the terminal initiates a connection request using the password, the password can be verified based on the public key. Since the identifier and password of each terminal are different, when there are multiple terminals connecting to the host with the same identifier and password, the host can be informed in time, which solves the problem of low security of the device access method in the related technology and achieves the effect of improving the security of the device access method.
[0142] Figure 7 This is a method flow chart of another device access method provided by the present application according to an embodiment of the present application. The method can be used for Figure 1 The device access system shown in the figure may include the following steps:
[0143] Step 701: In response to obtaining a login indication signal, the terminal sends a connection request to the host.
[0144] The terminal may send a connection request to the host under a preset condition, which may be when the terminal is turned on, or when a connection instruction is received, etc., and this embodiment of the present application does not limit this.
[0145] The connection request may include the terminal's identifier and a password corresponding to the identifier, where the password is generated based on the private key in the key pair and the identifier. Figure 6 The embodiments shown in the figure will not be described in detail herein.
[0146] In an exemplary embodiment, the connection request may also include a user name corresponding to the terminal identifier.
[0147] Step 702: The host sends the terminal identification and the password corresponding to the identification to the verification module.
[0148] After receiving the terminal identification and the password corresponding to the identification, the host may send the terminal identification and the password corresponding to the identification to the verification module for verification by the verification module.
[0149] In an exemplary embodiment, if the connection request includes a user name corresponding to the terminal identifier, the host sends the user name corresponding to the terminal identifier and the password corresponding to the identifier to the verification module.
[0150] Step 703: The verification module verifies the password using the public key in the key pair.
[0151] The password is encrypted by the private key corresponding to the public key, and then the verification module can verify the password based on the public key.
[0152] In an exemplary embodiment, please refer to Figure 8 , Figure 8 yes Figure 7 In the embodiment shown, a flowchart of verifying a password is shown, and step 703 may include:
[0153] Sub-step 7031: The verification module decrypts the password using the public key in the key pair to obtain decrypted data.
[0154] The password is encrypted by the private key in the key pair, and can be decrypted by the public key in the key pair to obtain decrypted data.
[0155] The verification module can load the public key into the memory at startup, so that the verification module can complete the verification of the password without accessing the database, which simplifies the process and improves the verification efficiency.
[0156] Sub-step 7032: The verification module generates summary data of the terminal's identification.
[0157] The summary data is generated by the agreed summary generation method, that is, the same as the above Figure 6 The first digest generation method used in the illustrated embodiment is the same digest generation method.
[0158] In an exemplary embodiment, when the password is generated by the terminal identifier and the user name, the verification module may generate summary data of the terminal identifier and the user name.
[0159] Sub-step 7033: The verification module verifies whether the decrypted data is identical to the summary data.
[0160] If the password is a correct password, the decrypted data should be the summary data of the terminal identification (or the summary data of the terminal identification and the user name), and the verification module can verify whether the decrypted data is the same as the summary data.
[0161] Sub-step 7034: In response to the decrypted data being identical to the digest data, the verification module determines that the verification is successful.
[0162] If the decrypted data is the same as the digest data, the password is correct and the verification module determines that the verification is successful.
[0163] Sub-step 7035: In response to the decrypted data being different from the digest data, the verification module determines that the verification has failed.
[0164] If the decrypted data is the same as the digest data, it indicates that the password is incorrect and the verification module determines that the verification has failed.
[0165] At the end of sub-step 7035, the verification module has realized the verification function of the password provided by the terminal.
[0166] In the related art, the host needs to compare the received user name and password with the user name and password in the database, which results in low verification efficiency when a large number of devices attempt to access the host.
[0167] In the method provided in the embodiment of the present application, during the process of the verification module verifying the password, the verification module can verify the passwords provided by multiple terminals based on the public key (the public key can be located in the local storage medium of the verification module, or in a location that is easily accessible to the verification module), without having to compare the password with the password in the database when verifying each password, which greatly reduces the amount of data processing, speeds up the speed and efficiency of password verification, and improves the verification efficiency in high-concurrency access scenarios.
[0168] Figure 7 The flowchart shown is a flow chart of a verification module verifying a password. In an exemplary embodiment, the host can also directly verify the password. In this way, the host can implement:
[0169] 1) Decrypt the password using the public key in the key pair to obtain the decrypted data;
[0170] 2) Generate summary data of the terminal's identification;
[0171] 3) Verify whether the decrypted data is the same as the summary data;
[0172] 4) In response to the decrypted data being identical to the digest data, determining that the verification is successful;
[0173] 5) In response to the decrypted data being different from the digest data, it is determined that the verification has failed.
[0174] Of course, the verification module can also be combined with the host, and this embodiment of the present application does not limit this.
[0175] Step 704: The host receives the verification result fed back by the verification module.
[0176] The verification result is used to indicate whether the password provided by the terminal is correct. When the password provided by the terminal is correct, the host can allow the terminal's connection request. When the password provided by the terminal is incorrect, the host can reject the terminal's connection request.
[0177] Figure 7 A method for the host to obtain the verification result from the verification module is shown, but the host can also directly verify the password to obtain the verification result. The method for the host to verify the password can refer to the method for the verification module to verify the password, and the embodiment of the present application does not limit this. Of course, the verification module can also be combined with the host so that the host can directly verify the password.
[0178] Step 705: In response to successful verification, the host establishes a connection with the terminal.
[0179] When the verification result fed back by the verification module indicates that the verification is successful, it means that the terminal is an authorized user and the host can establish a connection with the terminal.
[0180] Step 706: In response to the verification failure, the host rejects the terminal's connection request.
[0181] When the verification result fed back by the verification module indicates that the verification fails, it indicates that the terminal is an unauthorized user, and the host can refuse to establish a connection with the terminal.
[0182] After rejecting the terminal's connection request, the host can send a prompt to the terminal, such as a prompt that the password is wrong, the login failed, etc., so that the terminal can log in again or send a notification to the management device (which can be controlled by the operator) to avoid password errors caused by program errors, which prevent the terminal from connecting to the host.
[0183] To summarize, the device access method provided in the embodiment of the present application uses asymmetric encryption to configure a password corresponding to an identifier for a terminal, so that each terminal has an independent password. When the terminal initiates a connection request using the password, the password can be verified based on the public key. Since the identifier and password of each terminal are different, when there are multiple terminals connecting to the host with the same identifier and password, the host can be informed in time, which solves the problem of low security of the device access method in the related technology and achieves the effect of improving the security of the device access method.
[0184] Fig. 9 This is a block diagram of a device access device provided by the present application according to an embodiment of the present application. The device can be used for Figure 1 The device access system shown in the figure is a host, and the device access apparatus 900 may include:
[0185] The request acquisition module 910 is used to acquire a connection request provided by a terminal, wherein the connection request includes an identifier of the terminal and a password corresponding to the identifier, and the password is a password generated based on a private key in a key pair and the identifier.
[0186] The result acquisition module 920 is used to obtain the verification result of the password, and the password is configured to be verified by the public key in the key pair.
[0187] The connection establishing module 930 establishes a connection with the terminal in response to successful verification.
[0188] The connection rejection module 940 is configured to reject the connection request of the terminal in response to a verification failure.
[0189] To summarize, the device access apparatus provided in the embodiment of the present application uses asymmetric encryption to configure a password corresponding to an identifier for a terminal, so that each terminal has an independent password. When the terminal initiates a connection request using the password, the password can be verified based on the public key. Since the identifier and password of each terminal are different, when there are multiple terminals connecting to the host with the same identifier and password, the host can be informed in time, thereby solving the problem of low security of the device access method in the related art and achieving the effect of improving the security of the device access method.
[0190] Fig.10 This is a block diagram of another device access device provided by the present application according to an embodiment of the present application. The device can be used for Figure 1 The terminal in the device access system shown in the figure, the device access apparatus 1000 may include:
[0191] The request sending module 1010 is used to send a connection request to the host in response to obtaining a login indication signal. The connection request includes the terminal identification and the password corresponding to the identification. The password is a password generated based on the private key in the key pair and the identification. The host is used to verify the password based on the public key in the key pair.
[0192] The terminal connection establishing module 1020 is used to establish a connection with the host in response to successful verification.
[0193] To summarize, the device access apparatus provided in the embodiment of the present application uses asymmetric encryption to configure a password corresponding to an identifier for a terminal, so that each terminal has an independent password. When the terminal initiates a connection request using the password, the password can be verified based on the public key. Since the identifier and password of each terminal are different, when there are multiple terminals connecting to the host with the same identifier and password, the host can be informed in time, thereby solving the problem of low security of the device access method in the related art and achieving the effect of improving the security of the device access method.
[0194] Fig.11 is a block diagram of another device access device provided by the present application according to an embodiment of the present application, and the device access device can be used for Figure 1 The configuration device in the device access system shown in the figure, the device access apparatus 1100 may include the following steps:
[0195] The key acquisition module 1110 is used to acquire a key pair, where the key pair includes a private key and a public key corresponding to the private key.
[0196] The key providing module 1120 is used to provide a key pair to the verification module.
[0197] The identification acquisition module 1130 is used to acquire the identification of the terminal.
[0198] The identification providing module 1140 is used to provide an identification to the verification module, and the verification module is used to generate a password based on the private key in the key pair and the identification.
[0199] The password providing module 1150 is used to obtain the password provided by the verification module.
[0200] The password configuration module 1160 is used to configure the password into the terminal, and the terminal is used to establish a connection with the host through the password and the identifier.
[0201] To summarize, the device access apparatus provided in the embodiment of the present application uses asymmetric encryption to configure a password corresponding to an identifier for a terminal, so that each terminal has an independent password. When the terminal initiates a connection request using the password, the password can be verified based on the public key. Since the identifier and password of each terminal are different, when there are multiple terminals connecting to the host with the same identifier and password, the host can be informed in time, thereby solving the problem of low security of the device access method in the related art and achieving the effect of improving the security of the device access method.
[0202] An embodiment of the present application also provides a non-volatile computer storage medium, in which at least one instruction, at least one program, code set or instruction set is stored, and the at least one instruction, at least one program, code set or instruction set is loaded and executed by a processor to implement the device access method provided in the above embodiment.
[0203] The embodiment of the present application also provides a computer program product or a computer program, which includes a computer instruction stored in a computer-readable storage medium. The processor of the computer device reads the computer instruction from the computer-readable storage medium, and the processor executes the computer instruction, so that the computer device executes the above-mentioned device access method.
[0204] In the present application, the term "first" is used for descriptive purposes only and should not be understood as indicating or implying relative importance. The term "plurality" refers to two or more than two, unless otherwise clearly defined.
[0205] 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 the units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components 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 through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0206] The units described as separate components may or may not be physically separated, and the components shown as units 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 units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0207] A person skilled in the art will understand that all or part of the steps to implement the above embodiments may be accomplished by hardware or by instructing related hardware through a program, and the program may be stored in a computer-readable storage medium, and the above-mentioned storage medium may be a read-only memory, a disk or an optical disk, etc.
[0208] The above description is only an optional embodiment of the present application and is not intended to limit the present application. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present application shall be included in the protection scope of the present application.
Claims
1. A device access method, characterized in that: For a host, the method comprises: Obtaining a connection request provided by a terminal, the connection request including an identifier of the terminal, a user name corresponding to the identifier, and a password corresponding to the identifier, the password being a password generated by encrypting the digest information of the user name and the identifier using a digest algorithm generated by a verification module and a private key in a key pair by encrypting the digest information; obtaining a verification result of the password, the password being configured to be verified by a public key in the key pair; The obtaining of the verification result of the password includes: Sending the terminal's identification, the user name corresponding to the identification, and the password corresponding to the identification to the verification module, the verification module being used to verify the password using a public key in the key pair, the public key being stored in the verification module, the public key being accessible only to the verification module, and the verification module being used to load the public key into memory at startup; Receive the verification result fed back by the verification module; In response to successful verification, establishing a connection with the terminal; In response to a verification failure, the connection request of the terminal is rejected.
2. The method according to claim 1, characterized in that The obtaining of the verification result of the password includes: Decrypting the password using the public key in the key pair to obtain decrypted data; Generate summary data of the terminal identifier and the user name; Verifying whether the decrypted data is identical to the summary data; In response to the decrypted data being identical to the digest data, determining that the verification is successful; In response to the decrypted data being different from the digest data, it is determined that the verification has failed.
3. The method according to claim 1, characterized in that Before obtaining the connection request provided by the terminal, the method further includes: Obtaining an identifier of the terminal; Generate the password based on the private key in the key pair, the user name corresponding to the identifier, and the identifier; The password is configured in the terminal.
4. A device access method, characterized in that: For a terminal, the method comprises: In response to obtaining a login indication signal, a connection request is sent to a host, wherein the connection request includes an identifier of the terminal, a user name corresponding to the identifier, and a password corresponding to the identifier, wherein the password is a password generated by encrypting the digest information of the user name and the identifier by a verification module using a digest algorithm and a private key in a key pair to generate the digest information, wherein the host is used to send the identifier of the terminal, the user name corresponding to the identifier, and the password corresponding to the identifier to the verification module, wherein the verification module is used to verify the password using a public key in the key pair, wherein the public key is stored in the verification module, and only the verification module can access the public key, wherein the verification module is used to load the public key into a memory at startup, and wherein the host is also used to receive a verification result fed back by the verification module; In response to successful authentication, a connection is established with the host.
5. The method according to claim 4, characterized in that Before sending the terminal identifier, the user name corresponding to the identifier, and the password corresponding to the identifier to the host in response to obtaining the login indication signal, the method further includes: providing an identification of the terminal to a configuration device; The password provided by the configuration device is received.
6. A device access method, characterized in that: For configuring a device, the method comprises: Obtaining a key pair, the key pair comprising a private key and a public key corresponding to the private key; providing the key pair to a verification module; Get the terminal's ID; Providing the identification to the verification module, the verification module is used to generate a user name and summary information of the identification through a digest algorithm, and encrypt the summary information through a private key in a key pair to generate a password; Obtaining a password provided by the verification module; The password is configured in the terminal, and the terminal is used to establish a connection with the host through the password and the identification. The host is used to send the identification of the terminal, the user name corresponding to the identification, and the password corresponding to the identification to the verification module. The verification module is used to verify the password through the public key in the key pair. The public key is stored in the verification module, and only the verification module can access the public key. The verification module is used to load the public key into the memory at startup, and the host is also used to receive the verification result fed back by the verification module.
7. A device access system, characterized in that: The system includes a host and a terminal; The terminal is used to send a connection request to the host, wherein the connection request includes an identifier of the terminal, a user name corresponding to the identifier, and a password corresponding to the identifier, wherein the password is generated by encrypting the digest information of the user name and the identifier generated by the verification module through a digest algorithm and the private key in the key pair by encrypting the digest information; The host is used to send the terminal identification, the user name corresponding to the identification, and the password corresponding to the identification to the verification module, the verification module is used to verify the password by using the public key in the key pair, the public key is stored in the verification module, the public key can only be accessed by the verification module, and the verification module is used to load the public key into the memory at startup; The host is used to receive the verification result fed back by the verification module; In response to successful verification, the host establishes a connection with the terminal; In response to a verification failure, the host rejects the terminal's connection request.
8. The system according to claim 7, characterized in that The verification module is used to: Decrypting the password using the public key in the key pair to obtain decrypted data; Generate summary data of the terminal identifier and the user name; Verifying whether the decrypted data is identical to the summary data; In response to the decrypted data being identical to the digest data, determining that the verification is successful; In response to the decrypted data being different from the digest data, it is determined that the verification has failed.
9. A computer storage medium, characterized in that The computer storage medium stores at least one instruction, at least one program, a code set or an instruction set, and the at least one instruction, the at least one program, the code set or the instruction set is loaded and executed by the processor to implement the method according to any one of claims 1 to 3, or the method according to claim 4 or 5, or the method according to claim 6.
Citation Information
Patent Citations
Anti-counterfeit tax control method and device based on client identifier password
CN105635049A
Supply chain responsibility subject identity authentication method and system
CN112069547A
Methods for providing cryptographic key pairs
DE102009001718A1
Authentication using asymmetric cryptography key pairs
US20200136816A1
National key identification cryptographic algorithm-based private key distribution system
WO2022143030A1
