Secure parameterized pattern matching method and system based on oblivious transmission

By combining inadvertent transmission and secret sharing, the data security problem in the parameterized pattern matching process is solved, and secure and efficient string matching is achieved.

CN118740378BActive Publication Date: 2024-11-08UNIV OF JINAN +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411223043.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-09-03
Publication Date
2024-11-08
Estimated Expiration
2044-09-03

AI Technical Summary

Technical Problem

Existing technologies cannot effectively guarantee data security during the parameterized pattern matching process, and are computationally inefficient, failing to support both parameterized pattern matching and wildcard parameterized pattern matching.

Method used

The method combines unintentional transmission and secret sharing. The user client and the server preprocess the parameters respectively, mapping the string to non-negative integers. By constructing tuples and executing the unintentional transmission protocol, the user client selects the share bit by bit for secret reconstruction and determines that the string match is successful.

Benefits of technology

It enables secure parameterized pattern matching without leaking data information, ensuring data security for both parties and improving computational efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118740378B_ABST
    Figure CN118740378B_ABST
Patent Text Reader

Abstract

The present invention relates to the field of pattern matching technology, and in particular to a secure parameterized pattern matching method and system based on oblivious transmission. A user client and a server respectively perform parameter preprocessing on a held string, and map each parameter symbol in the string to a corresponding non-negative integer; both the user client and the server are provided with an original secret; a tuple is constructed, and the server splits the original secret according to the preprocessed string to obtain a number of real shares; for each real share, a corresponding random share is constructed, and both the real share and the random share are stored in the corresponding tuple; the server and the user client perform an oblivious transmission protocol bit by bit, and the user client selects the share in the tuple bit by bit to obtain a share in the tuple; the user client secretly reconstructs all the obtained shares, and if the reconstructed secret is consistent with the original secret, it means that the parameterized pattern matching is completed. The security of the data of both parties is guaranteed.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of pattern matching, and in particular to a secure parameterized pattern matching method and system based on oblivious transmission. Background Art

[0002] The widespread application of cutting-edge technologies such as big data, the Internet of Things, and cloud computing has greatly improved the convenience of daily life. These technologies have brought revolutionary changes in many fields such as education, medical care, and transportation, making it faster and more convenient to obtain information and services. However, while enjoying the many conveniences brought by these technological advances, we also have to face the privacy and security challenges that come with them. Improper use of personal information, frequent cyber attacks, and data leaks have become increasingly prominent and have become serious problems affecting data sharing. Therefore, how to achieve the secure flow of data while protecting the privacy of different entities has become an important issue that needs to be solved urgently.

[0003] Pattern matching refers to finding and locating a given pattern string in a text. Parameterized pattern matching refers to the problem of parameterized string matching on fixed symbols and parameter symbol alphabets. Parameterized pattern matching is widely used in gene sequence detection, code duplication detection, etc. Parameterized pattern matching on plain text will leak the information of the text holder and the pattern holder, and cannot guarantee the data security of both parties. The existing technology has the technical defect of only supporting pattern matching of 0 and 1 strings, and cannot be applied to parameterized pattern matching: the current secure parameterized pattern matching protocol is mainly implemented through bit-parallel algorithms combined with homomorphic encryption, which has low scalability and low computational efficiency. Summary of the invention

[0004] In order to solve the deficiencies of the prior art, the present invention provides a secure parameterized pattern matching method and system based on oblivious transmission; the present invention can determine whether a string matches the parameterized pattern without the user client directly obtaining the server string.

[0005] On the one hand, a secure parameterized pattern matching method based on oblivious transmission is provided, including: a user client holds a first string, a server holds a second string, the user client and the server respectively perform parameter preprocessing on the held strings, and map each parameter symbol in the string to a corresponding non-negative integer; the user client and the server are both provided with an original secret s; a tuple is constructed, and the server splits the original secret according to the preprocessed string to obtain a number of real shares; for each real share, a corresponding random share is constructed, and both the real share and the random share are stored in the corresponding tuple; the server and the user client execute the oblivious transmission protocol bit by bit, and the user client selects the share in the tuple bit by bit to obtain a share in the tuple; the user client secretly reconstructs all the obtained shares, and if the reconstructed secret is consistent with the original secret, it means that the first string and the second string match successfully, and if the match is successful, it means that the parameterized pattern matching is completed.

[0006] On the other hand, a secure parameterized pattern matching system based on oblivious transfer is provided, including: a user client and a server; the user client holds a first string, the server holds a second string, the user client and the server respectively perform parameter preprocessing on the held strings, and map each parameter symbol in the string to a corresponding non-negative integer; the user client and the server are both provided with an original secret s; a tuple is constructed, the server splits the original secret according to the preprocessed string to obtain a number of real shares; for each real share, a corresponding random share is constructed, and both the real share and the random share are stored in the corresponding tuple; the server and the user client execute the oblivious transfer protocol bit by bit, and the user client selects the shares in the tuple bit by bit to obtain a share in the tuple; the user client secretly reconstructs all the obtained shares, if the reconstructed secret is consistent with the original secret, it means that the first string and the second string match successfully, if the match is successful, it means that the parameterized pattern matching is completed.

[0007] The above technical solution has the following advantages or beneficial effects: 1. A secure parameterized pattern matching method and system is proposed based on oblivious transmission, and the protocol can be used for standard parameterized pattern matching and wildcard parameterized pattern matching. 2. By combining secret sharing with oblivious transmission, the server cannot obtain any information of the string held by the user client, and when the match is unsuccessful, the user client does not know the string information held by the server, thereby ensuring the security of the data of both parties. BRIEF DESCRIPTION OF THE DRAWINGS

[0008] The accompanying drawings in the specification, which constitute a part of the present invention, are used to provide a further understanding of the present invention. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute improper limitations on the present invention.

[0009] Figure 1 This is a flow chart of the method of embodiment 1. DETAILED DESCRIPTION

[0010] It should be noted that the following detailed descriptions are exemplary and are intended to provide further explanation of the present invention. Unless otherwise specified, all technical and scientific terms used herein have the same meanings as those commonly understood by those skilled in the art to which the present invention belongs.

[0011] In the absence of conflict, the embodiments of the present invention and the features of the embodiments may be combined with each other.

[0012] In this embodiment, all data is obtained in compliance with laws and regulations and based on the consent of the user client, and is used legally.

[0013] Embodiment 1: Figure 1 As shown, this embodiment provides a secure parameterized pattern matching method based on oblivious transmission, including: S101: a user client holds a first string, a server holds a second string, the user client and the server respectively perform parameter preprocessing on the held strings, and map each parameter symbol in the string to a corresponding non-negative integer; the user client and the server are both provided with an original secret s; S102: a tuple is constructed, the server splits the original secret according to the preprocessed string to obtain a number of real shares; for each real share, a corresponding random share is constructed, and both the real share and the random share are stored in the corresponding tuple; S103: the server and the user client execute the oblivious transmission protocol bit by bit, and the user client selects the shares in the tuple bit by bit to obtain a share in the tuple; S104: the user client secretly reconstructs all the obtained shares, if the reconstructed secret is consistent with the original secret, it means that the first string and the second string match successfully, if the match is successful, it means that the parameterized pattern matching is completed.

[0014] It should be understood that security is ensured by OT (i.e. oblivious transfer) and secret sharing. The client needs all the true shares to reconstruct the secret OT ensures that only when a character of the client and the server is the same can the real share of the tuple corresponding to that character be selected.

[0015] It should be understood that the symbols and basic components are explained first. Strings are written using uppercase letters. Indicates that Represents a string No. bits. The length of the string held by both parties is m ; Safety parameters are The basic components required for the invention include oblivious transfer (OT) and secret sharing (SS).

[0016] Further, in S101: the user client holds a first string, the server holds a second string, and the server inputs the second string as ; The first string entered by the user client is ,in, is a fixed set of symbols, is a set of parameter symbols; when the first string entered by the user client The second string with the server input If the fixed symbols in the string correspond one to one and the parameter symbols are renamed uniquely, then the two string parameterized patterns match; where the parameter symbols are uniquely renamed, it means that there is a unique mapping between the parameter symbols.

[0017] Furthermore, in S101, the user client and the server respectively perform parameter preprocessing on the held character string, and map each parameter symbol in the character string to a corresponding non-negative integer: ; ;in, represents the preprocessing algorithm, Indicates the result of server input string preprocessing. Indicates the result of preprocessing the string input by the user client.

[0018] Preprocessing Algorithm , map each fixed symbol in the string to itself, and map each parameter symbol to a corresponding non-negative integer. The first occurrence of each parameter symbol is represented by 0, and each subsequent occurrence of the parameter symbol is represented by the position difference of the previous one. , parameter symbol set , string hour, is a parameter symbol, and the first time it appears, it is mapped to 0. is a fixed symbol, mapped to A, is a parameter symbol, and it is not the first time it appears, it is mapped to The position difference is mapped to 3, and finally we get .

[0019] Furthermore, the S102: constructing a tuple specifically includes: constructing a tuple with a length of Array , where the position The positions are filled with fixed symbols, and the remaining positions are filled with filling.

[0020] Furthermore, the step S102: the server splits the original secret according to the preprocessed string to obtain a number of real shares, specifically including: the server uses an XOR secret sharing algorithm to split the original secret shared by both parties according to the preprocessed string Split and generate True share ,in , , the second string input by the server Each bit of corresponds to a real share.

[0021] XOR secret sharing algorithm is divided into two stages: secret distribution stage and secret reconstruction stage. In the secret distribution stage, the input secret value and number of shares ,in Is a security parameter, randomly generated ,in , and calculate ; In the secret reconstruction phase, calculate , if and only if The secret can be reconstructed only when all shares are correct .

[0022] XOR secret sharing algorithm, from: Shamir A. How to share a secret[J]. Communications of the ACM, 1979. DOI:10.1145 / 359168.359176.

[0023] Further, the S102: constructing a corresponding random share for each real share, and storing both the real share and the random share in a corresponding tuple, includes: the server randomly generates a random share for each real share. A random share of the same length as the real share ,in , and according to the random share The generated sequence is arranged into a Tuple.

[0024] The server preprocesses the result according to the server input string ,Will In the tuple Replace with real share ,in Representing characters In the array The corresponding numbers in Indicates the first random shares. Indicates the above Tuple.

[0025] Further, the S103: the server and the user client execute the oblivious transfer protocol bit by bit, and the user client selects the share in the tuple bit by bit to obtain a share in the tuple, specifically including: for protocol, the sender has n-tuples , the tuple elements are strings, and the receiver selects integers , select 1 of the n characters. After the transmission is completed, the receiver gets the output , the sender has no output and cannot know which string the receiver gets.

[0026] For each , the server and the user client call the oblivious transfer protocol once , the server acts as the sender input , the user client acts as the receiver input ,choose Middle shares, the user client gets the output .

[0027] Oblivious transfer protocol, from: Kolesnikov V, Kumaresan R, Rosulek M, et al. Efficient Batched Oblivious PRF with Applications to Private Set Intersection[C] / / Acm Sigsac Conference on Computer&CommunicationsSecurity. ACM, 2016:818-829. DOI:10.1145 / 2976749.2978381.

[0028] Further, the step S104: the user client reconstructs the secret of all the obtained shares. If the reconstructed secret is consistent with the original secret, it means that the first string and the second string match successfully, including: the user client uses the received Calculate the value ,like , then the reconstruction , that is, the second string With the first string Parameterized pattern matching.

[0029] Example 1: Safe Exact Parameterized Pattern Matching: Using a Fixed Set of Symbols , parameter symbol set , string , string As an example, the safe and precise parameterized pattern matching is described. The matching process is as follows Figure 1 shown.

[0030] (11) The server and the user client perform parameter preprocessing on the strings they hold locally to obtain , .

[0031] (12) Construct the corresponding array : .

[0032] (13) The server uses a secret sharing algorithm to generate True share ,in At the same time, for each real share, select A random share of the same length as the real share ,in , and arrange them in order to form a nine-tuple. The server Each bit of Replace with real share .like, , whose corresponding tuple is Without loss of generality, we use Represents the above tuple. Each Represents a share. There is only one real share in a tuple, and the rest are random shares.

[0033] (14) For each , the server and the user client call once , Server input , user client input Make a selection. The user client gets the output .

[0034] (15) The user client attempts to use the received The original secret , reconstruction successful, description string With string Parameterized pattern matching.

[0035] Example 2: Safe wildcard parameterized pattern matching: with a fixed set of symbols , parameter symbol set , string , string ★ , describes safe wildcard parameterized pattern matching, where the wildcard ★ can match any character in a string.

[0036] (21) The server sets each bit of the string it holds to the wildcard character ★, and obtains ★ , ★ ,……, ★. The server and the user client perform parameter preprocessing on the strings they hold locally. The wildcard 0A0B2A is still considered a wildcard after preprocessing. The server gets ★ , 0★ ,……, ★. The user client gets ★ .

[0037] (22) Construct the corresponding array : .

[0038] (23) The server uses a secret sharing algorithm to generate True share ,in , ,Right now Each bit of corresponds to a real share. At the same time, for each real share, select A random share of the same length as the real share ,in , and arrange them in order to form a ten-tuple. When the preprocessing result is not a wildcard ★, the Server Each bit of Replace with real share ; When the preprocessing result is a wildcard ★, replace the last digit of the tuple with the actual share Without loss of generality, we use Represents the above tuple.

[0039] (24) For each , , Server and User call once , Server input , user client input Make a selection. The user client gets the output .

[0040] (25) The user client attempts to reconstruct the secret using the received value ,when When the received values ​​can successfully reconstruct the secret , description string With string Parameterized pattern matching.

[0041] Since the main cost of the protocol comes from the OT protocol, we consider reducing the complexity by extending the oblivious transfer. Length is , Length is When the program needs to be executed indivual Example. This solution was tested mainly based on the libOTe library.

[0042] Table 1 shows the protocol when the alphabet size is The test results are shown in Figure 2. All running times are the average of 20 experiments. The pattern lengths are set to , the text lengths are , among which , When, due to , so there is no experimental result.

[0043] Table 1 Protocol running time (unit )

[0044]

[0045] Secret Sharing (SS): Secret sharing was proposed by Shamir and Blakley in 1979 based on Lagrange interpolation theorem and projective geometry theory respectively. The protocol consists of two stages: secret sharing and secret reconstruction. In the secret sharing stage, the secret is split into n shares, each share is distributed to the corresponding participant; in the secret reconstruction phase, a single participant cannot reconstruct the secret, and only a specified number of participants can successfully reconstruct the secret, where the minimum number of participants τ required to reconstruct the secret is called the threshold value. The present invention adopts an XOR secret sharing scheme, in which the secret recovery algorithm needs to use all the shares to recover the original secret.

[0046] Oblivious transfer (OT): The oblivious transfer protocol was proposed by Rabin in 1981. The protocol involves two participants, the sender and the receiver. In the standard two-choice oblivious transfer protocol, the sender enters a secret value , , the receiver inputs the selection bit σ∈{0,1}, after the protocol is completed, the sender Sender has no output, and the receiver Receiver gets the output , the receiver and sender cannot obtain other additional information.

[0047] Embodiment 2: This embodiment provides a secure parameterized pattern matching system based on oblivious transmission, including: a user client and a server; the user client holds a first string, the server holds a second string, the user client and the server respectively perform parameter preprocessing on the held strings, and map each parameter symbol in the string to a corresponding non-negative integer; the user client and the server are both provided with an original secret s; a tuple is constructed, and the server splits the original secret according to the preprocessed string to obtain a number of real shares; for each real share, a corresponding random share is constructed, and both the real share and the random share are stored in the corresponding tuple; the server and the user client execute the oblivious transmission protocol bit by bit, and the user client selects the shares in the tuple bit by bit to obtain a share in the tuple; the user client secretly reconstructs all the obtained shares, and if the reconstructed secret is consistent with the original secret, it means that the first string and the second string match successfully, and if the match is successful, it means that the parameterized pattern matching is completed.

[0048] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. For those skilled in the art, the present invention may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.

Claims

1. A secure parameterized pattern matching method based on oblivious transfer, characterized in that: include: The user client holds a first string, and the server holds a second string. The user client and the server respectively perform parameter preprocessing on the held strings, and map each parameter symbol in the string to a corresponding non-negative integer; the user client and the server are both provided with an original secret s; Construct a tuple. The server splits the original secret according to the preprocessed string to obtain several real shares. For each real share, construct the corresponding random share, and store both the real share and the random share in the corresponding tuple; The server and the user client execute the oblivious transfer protocol bit by bit, and the user client selects the share in the tuple bit by bit to obtain a share in the tuple; The user client reconstructs the secret of all the obtained shares. If the reconstructed secret is consistent with the original secret, it means that the first string and the second string match successfully. If the match is successful, it means that the parameterized pattern matching is completed; The user client holds the first string, the server holds the second string, and the server input string is ; The user client input string is ,in, is a fixed set of symbols, is a set of parameter symbols, The length of the string held by both parties; When the first string entered by the user client The second string with the server input If the fixed symbols in the string correspond to each other one by one and the parameter symbols are renamed uniquely, then the two string parameterized patterns are said to match; where the parameter symbols are uniquely renamed, it means that there is a unique mapping between the parameter symbols; The user client and server perform parameter preprocessing on the held string respectively, mapping each parameter symbol in the string to a corresponding non-negative integer: ; ; in, represents the preprocessing algorithm, Indicates the result of server input string preprocessing. Indicates the result of preprocessing the string input by the user client; Preprocessing Algorithm , map each fixed symbol in the string to itself, and map each parameter symbol to a corresponding non-negative integer; the first occurrence of each parameter symbol is represented by 0, and each subsequent occurrence of the parameter symbol is represented by the position difference of the previous one; Among them, constructing a tuple includes: constructing a tuple with a length of Array , where the position The positions are filled with fixed symbols, and the remaining positions are filled with filling; The server splits the original secret according to the preprocessed string to obtain several real shares, including: The server uses the XOR secret sharing algorithm based on the preprocessed string to generate the original secret shared by both parties. Split and generate True share ,in , , the string input by the server Each bit of corresponds to a real share; For each real share, a corresponding random share is constructed, and both the real share and the random share are stored in corresponding tuples, including: The server randomly generates a A random share of the same length as the real share ,in , and according to the random share The generated sequence is arranged into a Tuple; The server preprocesses the result according to the server input string ,Will In the tuple Replace with real share ,in, Representing characters In the array The corresponding numbers in Indicates the first random shares; Indicates the above Tuple; The server and the user client execute the oblivious transfer protocol bit by bit, and the user client selects the share in the tuple bit by bit to obtain a share in the tuple, specifically including: for protocol, the sender has n-tuples , the tuple elements are strings, and the receiver selects integers , select 1 of n characters; after the transmission is completed, the receiver gets the output ; For each , the server and the user client call the oblivious transfer protocol once , the server acts as the sender input , the user client acts as the receiver input ,choose Middle shares, the user client gets the output ; The user client will reconstruct the secret of all the shares obtained. If the reconstructed secret is consistent with the original secret, it means that the string With string A successful match includes: The user client receives Calculate the value ,like , then the reconstruction , that is, the string With string Parameterized pattern matching.

2. The secure parameterized pattern matching method based on oblivious transmission as claimed in claim 1, characterized in that: XOR secret sharing algorithm is divided into two stages: secret distribution stage and secret reconstruction stage. In the secret distribution stage, the input secret value and number of shares ,in Is a security parameter, randomly generated ,in , and calculate ; In the secret reconstruction phase, calculation , if and only if The secret can be reconstructed only when all shares are correct .

3. A security parameterization pattern matching system based on oblivious transmission using the security parameterization pattern matching method based on oblivious transmission as claimed in claim 1 or 2, characterized in that: include: User clients and servers; The user client holds a first string, and the server holds a second string. The user client and the server respectively perform parameter preprocessing on the held strings, and map each parameter symbol in the string to a corresponding non-negative integer; the user client and the server are both provided with an original secret s; Construct a tuple. The server splits the original secret according to the preprocessed string to obtain several real shares. For each real share, construct the corresponding random share, and store both the real share and the random share in the corresponding tuple; The server and the user client execute the oblivious transfer protocol bit by bit, and the user client selects the share in the tuple bit by bit to obtain a share in the tuple; The user client reconstructs the secret of all the shares obtained. If the reconstructed secret is consistent with the original secret, it means that the first string and the second string match successfully. If the match is successful, it means that the parameterized pattern matching is completed.