Terminal identity authentication method and system based on edge computing
By converting the authentication data of the terminal device into a target matrix and embedding secret messages, the problem of attackers intercepting information and committing browsing attacks in the edge computing environment is solved, and efficient terminal identity authentication and data security are achieved.
Patent Information
- Application Number
- CN202411424309.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-12
- Publication Date
- 2024-12-17
- Estimated Expiration
- 2044-10-12
AI Technical Summary
In an edge computing environment, an attacker can intercept the ciphertext data and signature values of the IoT terminal, causing the counterfeit terminal to access the edge node and launch an attack, causing immeasurable losses.
The authentication data of the terminal device is converted into a target matrix, and the secret message is embedded through the prediction error histogram, and the target matrix after the embedded secret message is sent to the edge node, so that the edge node can restore the authentication data and extract the secret message to perform terminal device identity authentication.
It realizes tampering verification of authentication data and prevents playback attacks, improves the credibility and security of terminal identity authentication, and increases the difficulty of cracking authentication data.
Smart Images

Figure CN118944984B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of data encryption transmission, and in particular to a terminal identity authentication method and system based on edge computing. Background Art
[0002] With the rapid development of the Internet of Things and edge computing, the number and complexity of terminal devices are increasing rapidly. Edge computing not only improves the response speed but also effectively reduces the dependence on central servers by migrating data processing and storage to edge devices closer to the data source. Therefore, how to achieve efficient and secure terminal identity authentication in the edge computing environment has become an important issue that needs to be solved urgently.
[0003] A Chinese patent document with announcement number CN111083131B discloses a method for lightweight identity authentication of a power Internet of Things sensing terminal, including: step one, the Internet of Things terminal sends ciphertext data and a signature value to an edge Internet of Things agent, and enters step two; step two, the edge Internet of Things agent decrypts the ciphertext data and verifies the signature value, and enters step three; step three, determines whether the ciphertext data decrypted by the edge Internet of Things agent is correct, and determines whether the signature value verified by the edge Internet of Things agent is correct: if the conditions that the ciphertext data decrypted by the edge Internet of Things agent is correct and the signature value verified by the edge Internet of Things agent is correct are met at the same time, then enter step four; if the ciphertext data decrypted by the edge Internet of Things agent is incorrect or the signature value verified by the edge Internet of Things agent is incorrect, then the edge Internet of Things agent sends an alarm to the terminal and enters step five, and defines the number of alarms N, N is an integer, N=N+L, and L is a constant that is not 0.
[0004] In the process of authenticating the terminal using the above method, the attacker can intercept the ciphertext data and signature value sent by the IoT terminal to the edge IoT agent, and use the intercepted information to perform a replay attack, which may cause the counterfeit terminal to access the edge node. The attacker uses the counterfeit terminal as a springboard to launch an attack, causing immeasurable losses. Summary of the invention
[0005] In order to solve the problem that attackers can use intercepted information to perform replay attacks, causing counterfeit terminals to access edge nodes and use the counterfeit terminals as springboards to launch attacks, causing immeasurable losses, the present invention provides a terminal identity authentication method and system based on edge computing.
[0006] In a first aspect, the present invention provides a terminal identity authentication method based on edge computing, comprising the steps of:
[0007] The authentication data of the terminal device is converted into a target matrix; the elements in the target matrix are divided into first elements and second elements, wherein the second elements are located in the four neighborhoods of the first elements; a secret message is embedded into each first element in the target matrix to obtain a first target matrix, including: obtaining a prediction error of each first element according to the difference between each first element and the second elements in its four neighborhoods, and constructing a prediction error histogram; sequentially taking the prediction errors whose number is not 0 in the prediction error histogram as target prediction errors, and embedding the secret message into the target matrix, including: taking all the prediction errors whose number is 0 in the prediction error histogram at this time as candidate prediction errors, respectively, and determining the candidate degree of each candidate prediction error according to the difference between the target prediction error and each candidate prediction error, and the difference between the difference and the change amount of the element embedded with the secret message in the neighborhood of the first element corresponding to the target prediction error; embedding the secret message into each first element corresponding to the target prediction error according to the two candidate prediction errors with the largest candidate degree, and updating the prediction error histogram; embedding the secret message into each second element in the first target matrix to obtain a second target matrix, and sending the second target matrix to the edge node, so that the edge node restores the authentication data and extracts the secret message according to the second target matrix to perform terminal device identity authentication.
[0008] The effect is as follows: the present invention embeds a secret message into a target matrix converted from the authentication data of a terminal device, which can not only realize tampering verification of the authentication data, but also prevent attackers from performing replay attacks, thereby improving the credibility of terminal identity authentication; the present invention calculates the candidate degree of each candidate prediction error, and embeds a secret message into each first element corresponding to the target prediction error according to the two candidate prediction errors with the largest candidate degrees, so that the change amount of the first element after the secret message is embedded is as large as possible, and at the same time, the difference in the change amount of each first element in the local range of the target matrix is as large as possible, thereby destroying the data regularity in the target matrix, making the target matrix after the secret message is embedded very chaotic, increasing the difficulty of cracking the target matrix, and improving the security of the authentication data and the credibility of the terminal device identity authentication.
[0009] Preferably, the authentication data includes a user name of the terminal device, a hash value corresponding to the password, and a MAC address.
[0010] Preferably, the step of converting the authentication data of the terminal device into a target matrix comprises: encoding the authentication data into a binary sequence, converting each of the binary sequences into a bits are divided into a segment, where is the preset division length; each segment obtained by the division is converted into a decimal number, and all the obtained decimal numbers are filled into the empty matrix to obtain the target matrix.
[0011] Preferably, dividing the elements in the target matrix into first elements and second elements includes: taking elements in odd rows and odd columns and even rows and even columns in the target matrix as first elements, and taking elements in odd rows and even columns and even rows and odd columns in the target matrix as second elements.
[0012] Preferably, the secret message is binary data converted from a dynamic verification code sent by an edge node and received by the terminal device.
[0013] The effect is that the present invention embeds the dynamic verification code sent by the edge node into the target matrix, which not only realizes the encryption of the authentication data, but also realizes the tamper-proof of the authentication data, and can resist the replay attack of the attacker, thereby improving the credibility of the terminal device identity authentication.
[0014] Preferably, the method of obtaining the prediction error of each first element according to the difference between each first element and the second elements in its four neighborhoods and constructing a prediction error histogram includes: for each first element, taking the difference between the first element and the second elements in its four neighborhoods located on the right, top, left and bottom of the first element as the first difference, second difference, third difference and fourth difference of the first element respectively; counting the first difference of all first elements. The different values that appear in the difference, where , the number of different values is taken as the The number of types of differences; the difference with the least number of types among the first difference, the second difference, the third difference, and the fourth difference is taken as the prediction error; the number of different numerical values of the prediction errors of all the first elements is counted, and a prediction error histogram is constructed with the prediction error as the horizontal axis and the number of different numerical values of the prediction error as the vertical axis.
[0015] The effect is that the present invention selects the difference with the least number of types among the first difference, the second difference, the third difference, and the fourth difference as the prediction error of the first element, which can make the final prediction error histogram have more prediction errors of 0, so that more secret messages can be embedded subsequently, the encryption effect of the first element in the target matrix is better, the anti-tampering effect is also better, and the credibility of the terminal device identity authentication can be improved.
[0016] Preferably, the candidate degree satisfies the expression: , For the The candidate degree of the candidate prediction error; is the target prediction error; For the candidate prediction errors; is the target prediction error corresponding to the first The first element in the 24 neighborhoods The amount of change after embedding the secret message in the element. is the number of the first element corresponding to the target prediction error in the target matrix; is the target prediction error corresponding to the first The number of elements in the 24-neighborhood of the first element that have the secret message embedded in them; Move the column corresponding to the target prediction error in the prediction error histogram to the When the value of the first element of the target prediction error exceeds The number of the first elements, is the preset division length; is a natural exponential function.
[0017] The effect is that the present invention determines the candidate degree according to the difference between the target prediction error and the candidate prediction error, and the difference between the difference and the change amount of the element in which the secret message has been embedded in the neighborhood of each first element, so that when the secret message is subsequently embedded into the first element corresponding to the target prediction error according to the two candidate prediction errors with the largest candidate degrees, the larger the change amount to the first element, the greater the difference in the change amount of each element in the local range of the target matrix, thereby destroying the data regularity in the target matrix, making the target matrix after the secret message is embedded very chaotic, increasing the difficulty of cracking the target matrix, and improving the security of authentication data and the credibility of terminal device identity authentication.
[0018] Preferably, embedding the secret message into each first element corresponding to the target prediction error comprises: using two candidate prediction errors with the largest candidate degrees as embedding positions of the target prediction error respectively; embedding the secret message into each first element corresponding to the target prediction error, and obtaining a value of each first element corresponding to the target prediction error after the secret message is embedded: , is the target prediction error corresponding to The value of the first element after the secret message is embedded; is the target prediction error corresponding to The value of the first element before embedding the secret message; The prediction error corresponding to the first embedding position of the target prediction error; is the prediction error corresponding to the second embedding position of the target prediction error; is the target prediction error; is the target prediction error corresponding to The embedded information is one bit in the secret message.
[0019] Preferably, the method further includes: taking all prediction errors whose number in the prediction error histogram is not 0 as a prediction error to be embedded; and determining the priority of each prediction error to be embedded: , For the The priority of the prediction errors to be embedded; For the The number of first elements corresponding to the prediction errors to be embedded in the target matrix; For the The prediction error to be embedded corresponds to the first The value of the first element; is the variance function; For the prediction errors to be embedded; in order of priority from large to small, each prediction error to be embedded is taken as the target prediction error, and the secret message is embedded into the target matrix.
[0020] The effect is that the present invention sorts the errors to be embedded by calculating the priority of each prediction error to be embedded. The more first elements corresponding to the errors to be embedded that are ranked higher, and the greater the difference in the values of the first elements, the more secret messages can be embedded when embedding secret messages according to the errors to be embedded. At the same time, the more changes are made to the first elements in the target matrix, which avoids the same amount of changes to the first elements with the same values in the target matrix, destroys the rule of the first elements in the target matrix before and after embedding the secret message, and has a better encryption effect.
[0021] In a second aspect, the present invention provides a terminal identity authentication system based on edge computing, comprising: a processor and a memory, wherein the memory stores computer program instructions, and when the computer program instructions are executed by the processor, the above-mentioned terminal identity authentication method based on edge computing is implemented.
[0022] By adopting the above technical solution, the above-mentioned terminal identity authentication method based on edge computing is generated into a computer program and stored in a memory so as to be loaded and executed by a processor, thereby making a terminal device based on the memory and the processor for easy use.
[0023] The present invention has the following technical effects:
[0024] The present invention not only realizes the tampering verification of authentication data, but also can prevent attackers from performing replay attacks, thereby improving the credibility of terminal identity authentication; the present invention destroys the data regularity in the target matrix, making the target matrix after embedding the secret message very chaotic and irregular, thereby increasing the difficulty of cracking the authentication data, being able to resist statistical analysis attacks, and improving the security of the authentication data and the credibility of the terminal device identity authentication. BRIEF DESCRIPTION OF THE DRAWINGS
[0025] By reading the detailed description below with reference to the accompanying drawings, the above and other purposes, features and advantages of the exemplary embodiments of the present invention will become readily understood. In the accompanying drawings, several embodiments of the present invention are shown in an exemplary and non-restrictive manner, and the same or corresponding reference numerals represent the same or corresponding parts.
[0026] Figure 1 It is a flow chart of a method in a terminal identity authentication method based on edge computing in an embodiment of the present invention;
[0027] Figure 2 is a schematic diagram of the first and second elements in the target matrix;
[0028] Figure 3 is a diagram of the prediction error histogram for the first element in the target matrix. DETAILED DESCRIPTION
[0029] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present invention.
[0030] It should be understood that when the terms "first", "second", etc. are used in the claims, descriptions, and drawings of the present invention, they are only used to distinguish different objects, rather than to describe a specific order. The terms "include" and "comprise" used in the description and claims of the present invention indicate the presence of the described features, wholes, steps, operations, elements, and / or components, but do not exclude the presence or addition of one or more other features, wholes, steps, operations, elements, components, and / or their collections.
[0031] The embodiment of the present invention discloses a terminal identity authentication method based on edge computing, referring to Figure 1 , comprising steps S1 to S8:
[0032] S1: Obtain authentication data and verification data of the terminal device.
[0033] When the terminal device needs to access the edge node for identity authentication, it needs to send an authentication request to the edge node, obtain the dynamic verification code sent back by the edge node, and use the dynamic verification code as verification data. Verification data and authentication data are sent to the edge node. The authentication data includes the user name of the terminal device, the hash value of the password, the MAC address, the manufacturer, the model, the serial number, etc.
[0034] S2: Convert the authentication data of the terminal device into a target matrix.
[0035] It should be noted that in order to ensure the security of terminal device access, the authentication data needs to be encrypted. The present invention converts the authentication data into a target matrix so that the target matrix can be encrypted later.
[0036] Specifically, the authentication data is encoded into a binary sequence using GB2312 encoding. bits are divided into a segment, where is the preset division length. If the length of the last segment is less than N, 0 is added to the end of the last segment to make it reach , record the number of 0s added. Convert each segment obtained by division into decimal numbers, and fill all the decimal numbers obtained in the order of zigzag scanning to a size of In the empty matrix of is the number of all decimal digits obtained, For the position that is still empty after filling in the matrix, fill it randomly The final matrix is recorded as the target matrix. And the number of supplementary 0s recorded as the first supplementary information.
[0037] It should be noted that the length of the division It is set by the implementer according to the actual implementation situation, for example , but in order to ensure the complexity of the target matrix, It must be greater than 5. The present invention only takes GB2312 encoding and zigzag scanning as examples for description. The implementer can select the method for encoding the authentication data and the order for filling the empty matrix according to the actual implementation situation. For example, the encoding method is UTF-8 encoding, GBK encoding, etc., and the filling order is serpentine scanning, zigzag scanning, Hilbert scanning, etc.
[0038] At this point, the target matrix is obtained.
[0039] S3: Convert the verification data into a secret message.
[0040] It should be noted that, in order to ensure the security of terminal device access and prevent the authentication data of the terminal device from being tampered with, the present invention embeds the verification data as a secret message into the target matrix obtained by converting the authentication data. Since the verification data contains numbers and characters, and the secret message is usually binary data, the present invention converts the verification data to obtain the secret message.
[0041] Specifically, the verification data is ASCII-encoded, and the result is converted into binary form as a secret message. It should be noted that the present invention is described only by taking ASCII encoding as an example, and the implementer can set the encoding method according to the actual implementation situation, such as GB2312 encoding, UTF-8 encoding, etc.
[0042] S4: Divide the elements in the target matrix into first elements and second elements, where the second elements are located in the four neighborhoods of the first elements, obtain the prediction error of each first element based on the difference between each first element and the second elements in its four neighborhoods, and construct a prediction error histogram of the first elements.
[0043] In one embodiment, dividing the elements in the target matrix into first elements and second elements includes: taking elements in odd rows and odd columns and even rows and even columns in the target matrix as first elements, and taking elements in odd rows and even columns and even rows and odd columns in the target matrix as second elements. Figure 2 Schematic diagram of the first element and the second element.
[0044] In other embodiments, the implementer may swap the order of the first element and the second element, for example, using the elements of odd rows and even columns and even rows and odd columns in the target matrix as the first element, and using the elements of odd rows and odd columns and even rows and even columns in the target matrix as the second element.
[0045] In one embodiment, obtaining the prediction error of each first element according to the difference between each first element and the second elements in its four neighborhoods, and constructing the prediction error histogram of the first element, includes:
[0046] For each first element, the difference between the first element and the second element located to the right of the first element within its four neighborhoods is taken as the first difference of the first element; the difference between the first element and the second element located above the first element within its four neighborhoods is taken as the second difference of the first element; the difference between the first element and the second element located to the left of the first element within its four neighborhoods is taken as the third difference of the first element; the difference between the first element and the second element located below the first element within its four neighborhoods is taken as the fourth difference of the first element.
[0047] Count all the first elements The different values that appear in the difference, , the number of different values is taken as the The number of types of differences, for example, when the first differences of all first elements include -2, 1, 0, 0, 3, 3, 5, there are 5 different values: -2, 1, 0, 3, 5, then the number of types of the first difference is 5. It should be noted that some first elements do not have the first difference. Difference, then do not participate in A count of the different values that appear in the diff.
[0048] The difference with the least number of types among the first difference, the second difference, the third difference, and the fourth difference is taken as the prediction error. The number of different numerical values of the prediction errors of all first elements is counted, and the prediction error is used as the horizontal axis and the number of different numerical values of the prediction error is used as the vertical axis to construct a prediction error histogram of the first elements. It should be noted that if some first elements do not have a prediction error, they will not be included in the statistics of the number of different numerical values of the prediction error. Figure 3 Schematic diagram of the prediction error histogram of the first element in the target matrix.
[0049] It should be noted that, in this embodiment, the difference with the least number of types among the first difference, the second difference, the third difference, and the fourth difference is selected as the prediction error of the first element, so that more prediction errors of 0 appear in the final prediction error histogram, and more secret messages can be embedded subsequently, and the encryption effect of the first element in the target matrix is better, and the anti-tampering effect is also better, which can improve the credibility of the terminal device identity authentication.
[0050] In another embodiment, obtaining the prediction error of each first element according to the difference between each first element and the second elements in its four neighborhoods, and constructing the prediction error histogram of the first element, includes:
[0051] For each first element, the difference between the first element and the minimum value of all second elements in its four neighborhoods is taken as the prediction error of the first element. The number of different values of the prediction errors of all first elements is counted, with the prediction error as the horizontal axis and the number of different values of the prediction error as the vertical axis, to construct a prediction error histogram of the first element.
[0052] In other embodiments, implementers may select a method for calculating the prediction error according to actual implementation conditions, such as taking the difference between the first element and the maximum value of all second elements in its four neighborhoods as the prediction error of the first element, or rounding the difference between the first element and the mean of all second elements in its four neighborhoods as the prediction error of the first element.
[0053] At this point, the construction of the prediction error histogram of the first element is achieved.
[0054] S5: Sort the prediction errors whose number is not 0 in the prediction error histogram.
[0055] In one embodiment, the prediction errors whose number is not 0 in the prediction error histogram are sorted, including: taking all the prediction errors whose number is not 0 in the prediction error histogram as a prediction error to be embedded, and sorting the prediction errors to be embedded in order from left to right.
[0056] In another embodiment, the prediction errors whose number is not zero in the prediction error histogram are sorted, including:
[0057] Take all the prediction errors whose number in the prediction error histogram is not 0 as a prediction error to be embedded, and calculate the priority of the target prediction error:
[0058] ;
[0059] in, For the The priority of the prediction errors to be embedded; For the The number of first elements corresponding to the prediction errors to be embedded in the target matrix; For the The sequence number of the first element corresponding to the prediction error to be embedded in the target matrix; For the The prediction error to be embedded corresponds to the first The value of the first element; is the variance function, For the The variance of the first element corresponding to the prediction error to be embedded in the target matrix; For the The prediction error to be embedded.
[0060] When When the number of first elements corresponding to the prediction errors to be embedded is large, the first element in the prediction error histogram is moved first. When the column corresponding to the prediction error to be embedded embeds the secret message, the more secret messages can be embedded and the more changes are made to the first element in the target matrix, the better the encryption effect. The larger the variance of the first element corresponding to the prediction error to be embedded, the larger the variance of the first element. The greater the difference in the values of the first elements corresponding to the prediction errors to be embedded, the greater the value of the first element in the prediction error histogram will be. When the column corresponding to the prediction error to be embedded embeds the secret message, the changes in the first elements of the target matrix with different values may be the same, which avoids the same changes in the first elements of the target matrix with the same values, destroying the rule of the first elements in the target matrix before and after embedding the secret message, and the encryption effect is better; when the The larger the prediction error to be embedded, the larger the The greater the difference between the first element corresponding to the prediction error to be embedded and the corresponding second element in its four neighborhoods, the greater the difference between the first element corresponding to the prediction error to be embedded and the corresponding second element in its four neighborhoods. The first element corresponding to the prediction error to be embedded is more likely to contain important features of the authentication data, and the first element in the prediction error histogram is moved first. When the secret message is embedded in the column corresponding to the prediction error to be embedded, the encryption of important features can be achieved, and the encryption effect is better. The number of first elements in the target matrix corresponding to the prediction errors to be embedded The larger the The variance of the first element of the prediction error to be embedded in the target matrix The larger the Prediction error to be embedded The larger the The greater the priority of the prediction error to be embedded.
[0061] Similarly, the priority of each prediction error to be embedded is obtained, and the prediction errors to be embedded are sorted in descending order of priority.
[0062] At this point, the sorting of the prediction errors whose number is not 0 in the prediction error histogram is achieved.
[0063] S6: According to the sorted order of the prediction errors whose number is not zero in the prediction error histogram, the prediction errors whose number is not zero in the prediction error histogram are taken as target prediction errors in turn, and the secret message is embedded into the first element in the target matrix to obtain a first target matrix.
[0064] It should be noted that the reversible information hiding algorithm based on the prediction error histogram shift can embed secret messages into the target matrix, but the conventional reversible information hiding algorithm based on the prediction error histogram shift has a very small change amount for the target matrix, making it difficult to achieve encryption of authentication data. Therefore, the present invention determines the embedding position of the prediction error whose number is not 0 in the prediction error histogram, and embeds the secret message according to the embedding position, so that the change amount of each first element in the target matrix is as large as possible, and the difference in the change amount of each element in the local range of the target matrix is as large as possible, thereby destroying the data regularity in the target matrix, making the target matrix after the secret message is embedded very chaotic, thereby achieving encryption of authentication data.
[0065] Specifically, according to the sorted order of the prediction errors whose number is not zero in the prediction error histogram, the prediction errors whose number is not zero in the prediction error histogram are sequentially used as target prediction errors, and the secret message is embedded into the first element in the target matrix to obtain a first target matrix, including:
[0066] All prediction errors with a number of 0 in the prediction error histogram at this time are respectively used as a candidate prediction error of the target prediction error, and the candidate degree of each candidate prediction error of the target prediction error is calculated:
[0067] ;
[0068] in, For the The candidate degree of the candidate prediction error; is the target prediction error; For the candidate prediction errors; is the target prediction error corresponding to the first The first element in the 24 neighborhoods The amount of change after embedding the secret message in the element. is the number of the first element corresponding to the target prediction error in the target matrix; is the target prediction error corresponding to the first The number of elements in the 24-neighborhood of the first element that have the secret message embedded in them; Move the column corresponding to the target prediction error in the prediction error histogram to the When the value of the first element of the target prediction error exceeds the number of the first element of the range, is the preset division length; is the natural exponential function; is the absolute value symbol.
[0069] It should be noted that when the target prediction error corresponds to the If there is no element with a secret message embedded in the 24-neighborhood of the first element, then , when there is no element with embedded secret message in the 24 neighborhoods of all the first elements corresponding to the target prediction error, then The present invention only takes 24 neighborhoods as an example for explanation, and the implementer can set the size of the area according to the actual implementation situation.
[0070] In the formula, Indicates that the corresponding column of the target prediction error in the prediction error histogram moves to the When the position of the candidate prediction error is the absolute value of the change of each first element corresponding to the target prediction error, The larger the value, the greater the difference between the first elements of the target prediction error before and after embedding the secret message, and the better the encryption effect. Indicates that the corresponding column of the target prediction error in the prediction error histogram moves to the When the position of the candidate prediction error is , the difference between the change amount of each first element corresponding to the target prediction error and the change amount of the element embedded with the secret message in the neighborhood of each first element 24 is When the value is larger, after the secret message is embedded, the difference in the change of each element in the local position of the target matrix is greater, the change is more chaotic and irregular, and the encryption effect is better; when the corresponding column of the target prediction error in the prediction error histogram moves to the When the candidate prediction error position exceeds The number of the first element in the range The smaller the value, the less information needs to be recorded later, and the better the encryption effect. The bigger, The bigger, The smaller the target prediction error is, the The larger the candidate degree of the candidate prediction error, the greater the candidate degree of the candidate prediction error.
[0071] The two candidate prediction errors with the largest candidate degrees are used as the embedding positions of the target prediction error. The secret message is embedded in each first element corresponding to the target prediction error to obtain the value of each first element corresponding to the target prediction error after embedding the secret message:
[0072] ;
[0073] in, is the target prediction error corresponding to The value of the first element after the secret message is embedded; is the target prediction error corresponding to The value of the first element before embedding the secret message; The prediction error corresponding to the first embedding position of the target prediction error; is the prediction error corresponding to the second embedding position of the target prediction error; is the target prediction error; is the target prediction error corresponding to The embedded information of the first element.
[0074] After the secret message is embedded in each first element corresponding to the target prediction error, the prediction error histogram is updated, and the number corresponding to the target prediction error in the updated prediction error histogram becomes 0, and the numbers corresponding to the two embedding positions of the target prediction error are no longer 0. At this time, the secret message is embedded into the target matrix according to the next prediction error.
[0075] The method for acquiring the embedded information of the first element is: sorting all first elements corresponding to all prediction errors whose number is not zero in the prediction error histogram according to the sorted order of the prediction errors whose number is not zero in the prediction error histogram. According to the order of the first elements, each bit in the secret message is sequentially allocated to each first element as the embedded information of each first element, and when all bits in the secret message have been allocated, reallocation is performed starting from the first bit of the secret message.
[0076] In the process of embedding the secret message into the first element in the target matrix by sequentially taking the prediction errors whose number in the prediction error histogram is not 0 as the target prediction errors, if the candidate prediction error of the target prediction error does not exist, then stop embedding the secret message into the target matrix according to the target prediction error.
[0077] The final target matrix is recorded as the first target matrix.
[0078] It should be noted that the first target matrix may contain the value of the first element after the secret message is embedded Beyond Range, then for the first element, the value of the first element in the first target matrix is adjusted to ,in is the remainder symbol. The position of the first element and As supplementary data to the first element, The value of the first target matrix after embedding the secret message exceeds The supplementary data of all first elements of the range is used as the second supplementary information to ensure that the authentication data can be restored later and the secret message can be extracted.
[0079] S7: Embed a secret message into each second element in the first target matrix to obtain a second target matrix.
[0080] Using the method in steps S4-S6, construct a prediction error histogram of the second element in the first target matrix, embed the secret message into the second element in the first target matrix, obtain a second target matrix, and record the value of the second target matrix after the secret message is embedded that exceeds The supplementary data of all second elements of the range as the third supplementary information.
[0081] S8: Send the second target matrix to the edge node so that the edge node can restore the authentication data and extract the secret message according to the second target matrix to perform terminal device identity authentication.
[0082] In order to ensure that the authentication data can be restored and the secret message can be extracted, the first supplementary information, the second supplementary information, the third supplementary information, the order and embedding position of each prediction error to be embedded in the prediction error histogram of the first element, and the order and embedding position of each prediction error to be embedded in the prediction error histogram of the second element are encrypted using an asymmetric encryption algorithm to obtain a supplementary ciphertext.
[0083] It should be noted that the present invention does not limit the asymmetric encryption used, which is set by the implementer according to the actual implementation situation, such as RSA encryption algorithm, elliptic curve cryptography (ECC), etc.
[0084] The second target matrix is the ciphertext of the authentication data. When the second target matrix is sent to the edge node, the supplementary ciphertext is sent.
[0085] The edge node restores the authentication data and extracts the secret message according to the second target matrix, including:
[0086] (1) Decrypt the supplementary ciphertext to obtain the first supplementary information, the second supplementary information, the third supplementary information, the order and embedding position of each prediction error to be embedded in the prediction error histogram of the first element, and the order and embedding position of each prediction error to be embedded in the prediction error histogram of the second element.
[0087] (2) The elements in the second target matrix are divided into first elements and second elements according to the method in step S4. The third supplementary information records that the value of the second target matrix after the secret message is embedded exceeds The supplementary data of all the second elements in the range, the value after restoring the embedded secret message in the second target matrix according to the third supplementary information exceeds All second elements of a range.
[0088] Obtaining the prediction error of the second element in the second target matrix, extracting the embedding information of the second element corresponding to the prediction error to be embedded in sequence according to the reverse order of the order of the prediction errors to be embedded in the prediction error histogram of the second element obtained by decrypting the supplementary ciphertext, and restoring the second element corresponding to the prediction error to be embedded, including:
[0089] The prediction error of each second element in the second target matrix is judged: when the prediction error of the second element is the prediction error corresponding to the first embedding position of the current prediction error to be embedded, the embedding information of the second element is 0, and the difference between the prediction error corresponding to the first embedding position and the current prediction error to be embedded is subtracted from the value of the second element to restore the second element; when the prediction error of the second element is the prediction error corresponding to the second embedding position of the current prediction error to be embedded, the embedding information of the second element is 1, and the difference between the prediction error corresponding to the second embedding position and the current prediction error to be embedded is subtracted from the value of the second element to restore the second element.
[0090] By restoring all second elements of the prediction error corresponding to the first embedding position or the second embedding position of the prediction error to be currently embedded in the second target matrix, the second target matrix is updated once. The embedding information of the second element corresponding to the next prediction error to be embedded is extracted according to the updated second target matrix, and the second element corresponding to the next prediction error to be embedded is restored.
[0091] After the restoration of the second element and the extraction of the embedded information are achieved according to all the prediction errors to be embedded in the prediction error histogram of the second element, the obtained second target matrix is used as the first target matrix.
[0092] (3) Using the method in step (2), the first target matrix is restored to the target matrix, and the embedding information of the first element corresponding to each prediction error to be embedded in the prediction error histogram of the first element is extracted.
[0093] (4) Expand the target matrix into a one-dimensional sequence according to the order in step S2, and replace the first Convert the values into a binary sequence and put the 0 is removed, and the binary sequence is decoded into authentication data using the encoding method in step S2. is the number of decimal digits recorded in the first supplementary information, The number of supplementary 0s recorded in the first supplementary information.
[0094] (5) All the embedded information extracted is formed into a binary sequence in the reverse order of the order in which the embedded information is extracted, which is used as the secret message. The secret message is decoded into verification data using the encoding method in step S3.
[0095] The terminal device identity authentication includes:
[0096] In response to the verification data not matching the dynamic verification code sent by the edge node, the authentication data of the terminal device has been tampered with, and the identity of the terminal device is untrustworthy, so the terminal device is denied access to the edge node. In response to the verification data matching the dynamic verification code sent by the edge node, but the authentication data not matching the data information of the terminal device stored in the edge node, it may be that the authentication data of the terminal device is entered incorrectly, or the attacker may have intercepted the dynamic verification code sent by the edge node and forged the authentication data sent by the terminal device. At this time, the terminal device is prompted to re-enter the authentication data for identity authentication. When the authentication data does not match the data information of the terminal device stored in the edge node for three consecutive times, the terminal device is denied access to the edge node.
[0097] It should be noted that the present invention is described only by taking 3 times as an example, and the implementer can set the number of times allowed for authentication according to the actual implementation situation, for example, 5.
[0098] An embodiment of the present invention also discloses a terminal identity authentication system based on edge computing, including a processor and a memory, wherein the memory stores computer program instructions, and when the computer program instructions are executed by the processor, a terminal identity authentication method based on edge computing according to the present invention is implemented.
[0099] The above system also includes other components well known to those skilled in the art, such as a communication bus and a communication interface, and their configuration and functions are known in the art, so they will not be described in detail here.
[0100] Although this specification has shown and described a number of embodiments of the present invention, it will be apparent to those skilled in the art that such embodiments are provided by way of example only. Those skilled in the art will conceive of many modifications, changes and alternatives without departing from the ideas and spirit of the present invention. It should be understood that in the practice of the present invention, various alternatives to the embodiments of the present invention described herein may be employed.
[0101] The above are all preferred embodiments of the present invention, and are not intended to limit the protection scope of the present invention. Therefore, any equivalent changes made based on the structure, shape, and principle of the present invention should be included in the protection scope of the present invention.
Claims
1. A terminal identity authentication method based on edge computing, characterized in that: include: Convert the authentication data of the terminal device into a target matrix; Dividing the elements in the target matrix into first elements and second elements, including: taking the elements in odd rows and odd columns and even rows and even columns in the target matrix as first elements, taking the elements in odd rows and even columns and even rows and odd columns in the target matrix as second elements, wherein the second elements are located in four neighborhoods of the first elements; Embed a secret message into each first element in the target matrix to obtain a first target matrix, wherein the secret message is binary data converted from a dynamic verification code sent by an edge node and received by a terminal device, including: obtaining a prediction error of each first element according to a difference between each first element and a second element in its four neighborhoods, and constructing a prediction error histogram, including: for each first element, taking the difference between the first element and the second element in its four neighborhoods located on the right, top, left, and bottom of the first element as the first difference, second difference, third difference, and fourth difference of the first element, respectively; counting the first difference of all first elements The different values that appear in the difference, where , the number of different values is taken as the The number of types of differences; taking the difference with the least number of types among the first difference, the second difference, the third difference, and the fourth difference as the prediction error; counting the number of different numerical values of the prediction errors of all first elements, with the prediction error as the horizontal axis and the number of different numerical values of the prediction error as the vertical axis, to construct a prediction error histogram; sequentially taking the prediction errors whose number is not 0 in the prediction error histogram as the target prediction error, and embedding the secret message into the target matrix, including: taking all the prediction errors whose number is 0 in the prediction error histogram at this time as candidate prediction errors, respectively, and determining the candidate degree of each candidate prediction error according to the difference between the target prediction error and each candidate prediction error, and the difference between the difference and the change amount of the element embedded with the secret message in the neighborhood of the first element corresponding to the target prediction error, wherein the candidate degree satisfies the expression: , For the The candidate degree of the candidate prediction error; is the target prediction error; For the candidate prediction errors; is the target prediction error corresponding to the first The first element in the 24 neighborhoods The amount of change after embedding the secret message in the element. is the number of the first element corresponding to the target prediction error in the target matrix; is the target prediction error corresponding to the first The number of elements in the 24-neighborhood of the first element that have the secret message embedded in them; Move the column corresponding to the target prediction error in the prediction error histogram to the When the value of the first element of the target prediction error exceeds The number of the first elements, is the preset division length; is a natural exponential function; embedding a secret message into each first element corresponding to the target prediction error according to the two candidate prediction errors with the largest candidate degrees, and updating the prediction error histogram; A secret message is embedded into each second element in the first target matrix to obtain a second target matrix, and the second target matrix is sent to the edge node so that the edge node can restore the authentication data and extract the secret message according to the second target matrix to perform terminal device identity authentication.
2. The terminal identity authentication method based on edge computing according to claim 1 is characterized in that: The authentication data includes the user name of the terminal device, the hash value corresponding to the password, and the MAC address.
3. The terminal identity authentication method based on edge computing according to claim 1 is characterized in that: The step of converting the authentication data of the terminal device into a target matrix comprises: Encode the authentication data into a binary sequence. bits are divided into a segment, where is the preset division length; each segment obtained by the division is converted into a decimal number, and all the obtained decimal numbers are filled into the empty matrix to obtain the target matrix.
4. The terminal identity authentication method based on edge computing according to claim 1 is characterized in that: The embedding of the secret message into each first element corresponding to the target prediction error comprises: The two candidate prediction errors with the largest candidate degrees are used as the embedding positions of the target prediction error respectively; the secret message is embedded into each first element corresponding to the target prediction error to obtain the value of each first element corresponding to the target prediction error after embedding the secret message: , is the target prediction error corresponding to The value of the first element after the secret message is embedded; is the target prediction error corresponding to The value of the first element before embedding the secret message; The prediction error corresponding to the first embedding position of the target prediction error; is the prediction error corresponding to the second embedding position of the target prediction error; is the target prediction error; is the target prediction error corresponding to The embedded information is one bit in the secret message.
5. The terminal identity authentication method based on edge computing according to any one of claims 1 to 4, characterized in that: Also includes: All the prediction errors whose number in the prediction error histogram is not 0 are respectively regarded as a prediction error to be embedded; Determine the priority of each prediction error to be embedded: , For the The priority of the prediction errors to be embedded; For the The number of first elements corresponding to the prediction errors to be embedded in the target matrix; For the The prediction error to be embedded corresponds to the first The value of the first element; is the variance function; For the prediction errors to be embedded; In order of priority from large to small, each prediction error to be embedded is taken as the target prediction error in turn, and the secret message is embedded into the target matrix.
6. A terminal identity authentication system based on edge computing, characterized in that: include: A processor and a memory, wherein the memory stores computer program instructions, and when the computer program instructions are executed by the processor, the terminal identity authentication method based on edge computing according to any one of claims 1 to 5 is implemented.
Citation Information
Patent Citations
A method for lightweight identity authentication of sensing terminals in the power Internet of Things
CN111083131B
Ciphertext domain reversible-data-hiding (RDH) method based on left and right shifting of histogram
CN109617682A
Reversible data hiding method and system based on prediction errors
CN112333348A
Identity authentication method, system and device and computer readable storage medium
CN112468293A
Method for realizing trusted real name authentication
CN115952481A
