CN109359476B - Hidden input two-party mode matching method and device - Google Patents

Hidden input two-party mode matching method and device Download PDF

Info

Publication number
CN109359476B
CN109359476B CN201811258454.3A CN201811258454A CN109359476B CN 109359476 B CN109359476 B CN 109359476B CN 201811258454 A CN201811258454 A CN 201811258454A CN 109359476 B CN109359476 B CN 109359476B
Authority
CN
China
Prior art keywords
holder
text
pattern
mode
input
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201811258454.3A
Other languages
Chinese (zh)
Other versions
CN109359476A (en
Inventor
王皓
秦红
魏晓超
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Confident Information Co.,Ltd.
Original Assignee
Shandong Normal University
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shandong Normal University filed Critical Shandong Normal University
Priority to CN201811258454.3A priority Critical patent/CN109359476B/en
Publication of CN109359476A publication Critical patent/CN109359476A/en
Application granted granted Critical
Publication of CN109359476B publication Critical patent/CN109359476B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Software Systems (AREA)
  • General Health & Medical Sciences (AREA)
  • Computer Hardware Design (AREA)
  • Computer Security & Cryptography (AREA)
  • Health & Medical Sciences (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Bioethics (AREA)
  • Document Processing Apparatus (AREA)
  • Storage Device Security (AREA)

Abstract

The invention discloses a hidden input two-party mode matching method and a hidden input two-party mode matching device, wherein the method comprises the following steps: a mode holder receives a given mode to be searched by a user, and a text holder receives a text of a database; the mode holder calls a Shamir secret sharing scheme to generate a mode array consisting of number pairs; according to each number pair in the mode array, the mode holder sends a random number for calculating a polynomial value to the text holder, the mode holder and the text holder both run once for 2 and get 1 a disappearing transmission protocol, and the text holder obtains the text array; calculating line by line according to the numerical values in the text array to obtain a group of test data; and (3) judging whether the random numbers input by the text holder are equal to the random numbers input by the pattern holder in sequence according to the test data input by the text holder, forming a bit string by the output of the pattern holder after the test is finished, wherein the position where 1 appears is the position of the given pattern in the text, and failing to match if the string is all 0.

Description

Hidden input two-party mode matching method and device
Technical Field
The disclosure belongs to the technical field of pattern matching, and relates to a hidden-input two-party pattern matching method and device.
Background
The statements in this section merely provide background information related to the present disclosure and may not necessarily constitute prior art.
Pattern matching is an important fundamental problem in the field of computer science, given a pattern, it is required to find all patterns in a certain string that are identical to the pattern. It is essentially a lookup problem, i.e. looking for a given pattern p emIn the text t e ∈ ΣnWhere Σ is a set of characters. If p and t are both binary strings, then ∑ 0, 1. For example, if the pattern p is "0100111001" and the text t is "001", the positions where the text appears in the pattern p are 3 and 8.
The pattern matching is widely applied to the fields of information retrieval, gene matching, face recognition and the like. In current distributed network environments, pattern matching often needs to be performed between different entities. For example, the gene database stores various types of gene data, and a user wishes to search the gene database for the presence of a certain gene fragment. In a conventional search process, a user submits a gene segment (i.e., a pattern) to be searched, a gene database locally runs a pattern matching algorithm, and a search result is returned. However, the conventional search process does not protect the privacy of the user, i.e. the user must inform the database of the searched content. When the entity performing the pattern matching has the privacy protection requirement, the traditional pattern matching method cannot be satisfied.
Disclosure of Invention
Aiming at the defects in the prior art and solving the problem that the traditional mode matching method cannot protect the privacy of the user, one or more embodiments of the disclosure provide a hidden-input two-party mode matching method and device, so that the given mode to be searched by the user is kept secret for the database, the user only obtains the position of the given mode in the database, and cannot obtain any other information about the database, and the privacy of the user and the information of the database are protected.
According to an aspect of one or more embodiments of the present disclosure, there is provided a hidden-input two-way pattern matching method.
A hidden-input two-way schema matching method, the method comprising:
a mode holder receives a given mode to be searched by a user, and a text holder receives a text of a database;
matching the given pattern with the same length as the given pattern in the text until the matching of all the patterns with the same length as the given pattern in the text is completed, wherein the specific matching method comprises the following steps:
the mode holder calls a Shamir secret sharing scheme, selects a random number to set a polynomial, calculates a polynomial value by the random number, and generates a mode array consisting of number pairs according to bit values of corresponding positions in the mode;
according to each number pair in the mode array, the mode holder sends a random number for calculating a polynomial value to the text holder, the input of the text holder is a bit value of a corresponding position of the mode, the mode holder and the text holder both operate once and get 1 out of transmission protocol, and the text holder obtains the text array;
calculating line by line according to the numerical values in the text array to obtain a group of test data;
and (3) judging whether the random numbers input correspondingly to the pattern holder are equal or not by the test data input by the text holder in sequence, if so, outputting 1 by the text holder, otherwise, outputting 0, and after the test is finished, outputting the pattern holder to form a bit string, wherein the position where 1 appears is the position of the given pattern in the text, and if the string is all 0, the matching fails.
Further, in the method, the pattern in the pattern holder is p ∈ {0,1}mM is the length of pattern p; the text in the text holder is t e {0,1}nAnd n is the length of the text t, and n is more than or equal to m, through a pattern matching method, the pattern holder only acquires the position of the pattern appearing in the text, and meanwhile, the pattern keeps secret to the text holder.
Further, in the method, in the matching of a given pattern p in the text holder with the ith m-th pattern in the text, the specific method for generating the pattern array composed of the number pairs comprises the following steps:
the mode holder invokes Shamir secret sharing scheme to randomly choose a random number a in the set {1,2, …, q }i,0,ai,1,ai,2,..,ai,m-1Q is a large prime number, let si=ai,0Setting a polynomial expression:
fi(x)=ai,m-1xm-1+ai,m-2xm-2+...+ai,1x+si mod q;
for j ∈ {1, 2.,. m }, x is randomly chosen from the set {1,2, …, q }i,jCalculating
Figure GDA0002634304090000021
Randomly chosen among the set {1,2, …, q }
Figure GDA0002634304090000022
Wherein, sigma belongs to {0,1} is the bit value of the j bit in the mode p;
the mode holder generates a mode array composed of pairs and uses the mode array as 2 to blank the input information of the mode holder in the transmission protocol, wherein the mode array is as follows:
Figure GDA0002634304090000031
further, in the method, in the matching of a given pattern p in the text holder with the ith m-th long pattern in the text, for each pair of numbers in the pattern array, the pattern holder and the text holder run 2 once, 1 in a disappearing transmission protocol, and run (n-m +1) m times in total.
Further, in the method, in the matching of the given pattern p in the text holder with the ith m-th long pattern in the text, the specific method of 1-out-of-2 perplexing the transmission protocol includes:
the text holder takes 1 at each run of 2 and the input of the transport protocol is: ith m-long mode t in texti=σi,1σi,2...σi,mOf (a) th bit value σi,j
The mode holder takes 1 at each run of 2 and the input of the transmission protocol is the current number pair of the mode array:
Figure GDA0002634304090000032
after the 2-to-1 disappearing transmission protocol is executed once, the text holder is obtained
Figure GDA0002634304090000033
After (n-m +1) m times of execution, 2 and 1 are taken out, the text holder obtains a text array:
Figure GDA0002634304090000034
further, in the method, in the matching of a given pattern p in the text holder and the ith m-th pattern in the text, the following calculation is performed line by line according to the numerical values in the text array:
Figure GDA0002634304090000035
obtain n-m +1 values
Figure GDA0002634304090000036
A set of test data is formed.
Further, in the method, in the matching of a given pattern p in a text holder with an ith m-long pattern in the text, the pattern holder and the text holder jointly execute n-m +1 times of safe two-party equivalent test protocols, wherein the text holder is used as a sender, the pattern holder is used as a receiver, and in the ith time of executing the safe two-party equivalent test protocols, the input of the text holder is
Figure GDA0002634304090000041
The input of the mode holder is si(ii) a Testing the function of the protocol according to the safety equivalence of two parties if
Figure GDA0002634304090000042
The mode holder outputs 1, otherwise 0; the text holder has no output in the protocol;
after the n-m +1 times of safe two-party equivalent test protocol execution is finished, the mode holder combines the output values into a bit string with the length of n-m +1, and the position of 1 in the bit string is the position of the mode in the text; if the string is a full 0 string, the match fails.
Further, the method includes supporting matching with wildcards, and the pattern holder has a pattern p with wildcards, i.e. the pattern p is e {0,1}mIn generating a pattern array composed of pairs, if the jth bit is a wildcard bit,
randomly choosing x in the set {1,2, …, q }i,j
Figure GDA0002634304090000043
Computing
Figure GDA0002634304090000044
Wherein sigma belongs to {0,1} is the bit value of the j th bit in the mode p;
the pattern holder generates the following pairs:
Figure GDA0002634304090000045
further, the method also includes supporting approximate matching, the length of the pattern p of the pattern holder is m, wherein m 'bits (m' ≦ m) are identical to the text pattern, and the matching is successful, and the specific method for generating the pattern array composed of the number pairs includes:
the mode holder invokes Shamir secret sharing scheme to randomly choose a random number a in the set {1,2, …, q }i,0,ai,1,ai,2,..,ai,m'-1Q is a large prime number, let si=ai,0Setting a polynomial expression:
fi(x)=ai,m'-1xm'-1+ai,m'-2xm'-2+...+ai,1x+si mod q;
for j ∈ {1, 2.,. m }, x is randomly chosen from the set {1,2, …, q }i,jCalculating
Figure GDA0002634304090000046
Randomly chosen among the set {1,2, …, q }
Figure GDA0002634304090000051
Wherein, sigma belongs to {0,1} is the bit value of the j bit in the mode p;
the mode holder generates a mode array composed of pairs and uses the mode array as 2 to blank the input information of the mode holder in the transmission protocol, wherein the mode array is as follows:
Figure GDA0002634304090000052
in accordance with another aspect of one or more embodiments of the present disclosure, there is also provided a computer-readable storage medium.
A computer readable storage medium having stored therein a plurality of instructions adapted to be loaded by a processor of a terminal device and to execute said method of hidden input two-way pattern matching.
According to another aspect of one or more embodiments of the present disclosure, there is also provided a terminal device.
A terminal device adopts an internet terminal device and comprises a processor and a computer readable storage medium, wherein the processor is used for realizing instructions; the computer readable storage medium stores instructions adapted to be loaded by a processor and to perform the method for hidden input two-way pattern matching.
The beneficial effect of this disclosure:
(1) according to the hidden input two-party mode matching method and device, the mode holder can acquire the position of the mode appearing in the text, the mode p is kept secret for the text holder, and the mode holder cannot acquire any other information about the text except the position of the mode appearing in the text.
(2) The hidden-input two-party mode matching method and device can be used in a mode matching scene needing privacy protection, such as a patient in a DNA database of a medical research institution to inquire whether a gene fragment of the patient contains a certain cancer gene. In this scenario, the patient does not want to disclose his/her gene segments to the institution for privacy protection, and the institution does not want the patient to obtain additional DNA information for intellectual property.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this application, illustrate embodiments of the application and, together with the description, serve to explain the application and are not intended to limit the application.
FIG. 1 is a flow diagram of a hidden input two-way pattern matching method in accordance with one or more embodiments;
FIG. 2 is a block diagram of a hidden-input two-way schema matching system in accordance with one or more embodiments.
The specific implementation mode is as follows:
technical solutions in one or more embodiments of the present disclosure will be clearly and completely described below with reference to the accompanying drawings in one or more embodiments of the present disclosure, and it is apparent that the described embodiments are only a part of the embodiments of the present disclosure, and not all embodiments. All other embodiments, which can be derived by one of ordinary skill in the art based on one or more embodiments of the disclosure without making any creative effort, shall fall within the protection scope of the present invention.
It should be noted that the following detailed description is exemplary and is intended to provide further explanation of the disclosure. Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs.
It is noted that the terminology used herein is for the purpose of describing particular embodiments only and is not intended to be limiting of example embodiments according to the present application. As used herein, the singular forms "a", "an" and "the" are intended to include the plural forms as well, and it should be understood that when the terms "comprises" and/or "comprising" are used in this specification, they specify the presence of stated features, steps, operations, devices, components, and/or combinations thereof, unless the context clearly indicates otherwise.
It is noted that the flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of methods and systems according to various embodiments of the present disclosure. It should be noted that each block in the flowchart or block diagrams may represent a module, a segment, or a portion of code, which may comprise one or more executable instructions for implementing the logical function specified in the respective embodiment. It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the flowchart illustrations and/or block diagrams, and combinations of blocks in the flowchart illustrations and/or block diagrams, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
In case of conflict, the embodiments and features of the embodiments in the present disclosure may be combined with each other,
the present disclosure provides a hidden-input two-way schema matching method.
Specifically, two participants are included in the protocol — a text holder, and a schema holder.
The text holder holds the text t ∈ ΣnThe mode holder holds a mode p ∈ ΣmWherein n and m represent the lengths of the text t and the pattern p respectively, and n is more than or equal to m. By executing the protocol, the pattern holder can acquire the position of the pattern appearing in the text, and simultaneously satisfy the following security:
1) the mode keeps the text holder secret;
2) the pattern holder cannot obtain any other information about the text t, except for getting the position where p appears in the text t.
A hidden-input two-way schema matching method, the method comprising:
step (1): considering that there are n-m +1 long patterns m in the input t of the text holder, for the ith m long pattern (i ═ 1, …, n-m +1) in the text t,
the mode holder invokes Shamir secret sharing scheme to randomly choose a among a set {1,2, …, q } (q is a large prime number)i,0,ai,1,ai,2,..,ai,m-1Let si=ai,0Setting a polynomial
fi(x)=ai,m-1xm-1+ai,m-2xm-2+...+ai,1x+si mod q
For j ∈ {1, 2.,. m }, x is randomly chosen from the set {1,2, …, q }i,jCalculating
Figure GDA0002634304090000071
And randomly selects from the set {1,2, …, q }
Figure GDA0002634304090000072
Where σ ∈ {0,1} is the bit value of the jth bit in pattern p.
The pattern holder generates the following pairs:
Figure GDA0002634304090000073
these pairs take 1 as the next step 2 to queue up the input information of the sender mode holder in the transport protocol.
Step (2): for each number pair generated in the previous step, the participant text holder and the mode holder need to run a 2-out-of-1 transfer protocol once
Figure GDA0002634304090000074
The operation was performed m times (n-m + 1). In the 2-out-of-1 transfer protocol each time, the text holder acts as the receiver of the protocol and the schema holder acts as the sender of the protocol. The protocol proceeds as follows:
the text holder takes 1 at each run of 2 and the input of the transport protocol is: ith m-long mode t in text ti=σi,1σi,2...σi,mOf (a) th bit value σi,j
In response, the mode holder runs a 2-out-of-1 transfer protocol input
Figure GDA0002634304090000081
After performing the 2-out-of-1 transmission protocol once, the participant text holder will get
Figure GDA0002634304090000082
After all (n-m +1) m times of 2-1-pass-transmission protocols are executed, the text holder can obtain:
Figure GDA0002634304090000083
note: all of and si,jCorresponding to xi,jAre all formed by diesThe formula holder sends directly to the text holder in clear text.
The 2-to-1 obfuscated transfer protocol is a computing protocol involving two participants, one of which is the sender S and the other is the receiver R. The protocol is as follows: the sender S transmits a set of messages to the receiver R, which is able to obtain a certain subset of the set of messages, but the sender does not know which messages he has received. 2-to-1 ubiquitous transmission protocol for use in the present invention
Figure GDA0002634304090000084
In the protocol, the sender S has two secret inputs x0And x1Receiver R has a selection bit i e {0,1 }. After both parties have executed the protocol, the receiver R obtains the output xiAnd the sender S has no output. Safety requirement R cannot simultaneously obtain x1-iAnd S does not know the selection information of R. The function is given below
Figure GDA0002634304090000085
Detailed description of the drawings:
Figure GDA0002634304090000086
the function of the function is that,
inputting: sender S input (x)0,x1) (ii) a The receiver R inputs a selection bit i belongs to {0,1 };
and (3) outputting: receiver output xiAnd the sender has no output.
And (3): the participant text holder calculates line by line based on the values it obtained from step (2):
Figure GDA0002634304090000087
obtain n-m +1 values
Figure GDA0002634304090000088
And (4): the participant text holder and the schema holder jointly executeLine n-m +1 times of safe two-party equivalent test protocol, wherein the text holder is used as the sender and the mode holder is used as the receiver. In the ith execution, the text holder is entered as
Figure GDA0002634304090000091
The input of the mode holder is si. Testing the function of the protocol according to the safety equivalence of two parties if
Figure GDA0002634304090000092
The mode holder outputs 1, otherwise 0. The text holder has no output in the protocol.
After the n-m +1 times of execution of the safety two-party equivalent test protocol is finished, the mode holder combines the output values into a bit string with the length of n-m +1, and the position of 1 in the bit string is the position of the mode in the text. If the string is a full 0 string, the match fails.
A secure two-party equivalence test protocol is a two-party protocol with an input string x0In the following manner with an input string x1The receiver R of (2) interacts: the receiver R can only receive the representation x0=x1Output 1 or represents x0≠x1Output 0 of (a), otherwise no other information is known; the sender S also does not know x1Any of (3). Function F of the testSSETThe description is as follows:
FSSETfunction
Inputting: sender S inputs x0∈{0,1}*Receiver R inputs x1∈{0,1}*
And (3) outputting: the receiver R receives the representation x0=x1Output 1 or represents x0≠x1Output 0, sender S outputs ≠ t.
Through the above 4 steps, the pattern holder can acquire the position where the pattern appears in the text, while the pattern is kept secret from the text holder, and the pattern holder cannot acquire any other information about the text except for getting the position where the pattern appears in the text t.
The method can be used in a pattern matching scene needing privacy protection, such as a patient in a DNA database of a medical research institution to inquire whether the gene segment of the patient contains a certain cancer gene. In this scenario, the patient does not want to disclose his/her gene segments to the institution for privacy protection, and the institution does not want the patient to obtain additional DNA information for intellectual property.
A hidden-input two-way pattern matching method of one or more embodiments of the present disclosure also supports matching of wildcards.
After the scheme is properly expanded, the matching with wildcards can be supported. Wildcard means that it can be replaced by any character in the character set and setting the wildcard bit in the pattern can serve as a bulk lookup. The pattern holder has a pattern p with wildcards, i.e. the pattern p belongs to {0,1, }mCompared with the original scheme, the alternative scheme is different only in the step (1) and specifically comprises the following steps:
step (1), considering that n-m +1 long modes with the length of m exist in the input t of the text holder, aiming at the ith m long mode (i is 1, …, n-m +1) in the text t,
the mode holder invokes Shamir secret sharing scheme to randomly choose a among a set {1,2, …, q } (q is a large prime number)i,0,ai,1,ai,2,..,ai,m-1Let si=ai,0Setting a polynomial
fi(x)=ai,m-1xm-1+ai,m-2xm-2+...+ai,1x+simod q
For j e {1,2,. eta., m },
(1) if the jth bit is a non-wildcard bit, the operation is the same as the original scheme
Randomly choosing x in the set {1,2, …, q }i,jCalculating
Figure GDA0002634304090000101
And randomly selects from the set {1,2, …, q }
Figure GDA0002634304090000102
Where σ ∈ {0,1} is the bit value of the jth bit in pattern p.
(2) If the jth bit is a wildcard bit,
randomly choosing x in the set {1,2, …, q }i,j
Figure GDA0002634304090000103
Computing
Figure GDA0002634304090000104
Where σ ∈ {0,1} is the bit value of the jth bit in pattern p.
The pattern holder generates the following pairs:
Figure GDA0002634304090000105
these pairs take 1 as the next step 2 to queue up the input information of the sender mode holder in the transport protocol.
A hidden-input two-way schema matching method of one or more embodiments of the present disclosure also supports support for approximate matching
Compared with the exact matching in the original scheme, the approximate matching only requires that the pattern string is matched with a plurality of bits of the text pattern, and when the matching bits are higher than a certain proportion, the matching is successful. In the alternative, the pattern string is still m in length, but only m 'bits (m' ≦ m) of the pattern string need to be the same as the text pattern, i.e., the match is successful.
Compared with the original scheme, the method only comprises the following steps (1):
step (1), considering that n-m +1 patterns with the length of m exist in the input t of the text holder, aiming at the ith m-long pattern (i is 1, …, n-m +1) in the text t, the pattern holder calls a Shamir secret sharing scheme, and randomly selects a from a set {1,2, …, q } (q is a large prime number)i,0,ai,1,ai,2,..,ai,m'-1Wherein m' is less than or equal to m.
Let si=ai,0Setting a polynomial
fi(x)=ai,m'-1xm'-1+ai,m'-2xm'-2+...+ai,1x+si modq
For j ∈ {1, 2.,. m }, x is randomly chosen from the set {1,2, …, q }i,jCalculating
Figure GDA0002634304090000111
And randomly selects from the set {1,2, …, q }
Figure GDA0002634304090000112
Where σ ∈ {0,1} is the bit value of the jth bit in pattern p.
The pattern holder generates the following pairs:
Figure GDA0002634304090000113
these pairs take 1 as the next step 2 to queue up the input information of the sender mode holder in the transport protocol.
In accordance with another aspect of one or more embodiments of the present disclosure, there is also provided a computer-readable storage medium.
A computer readable storage medium having stored therein a plurality of instructions adapted to be loaded by a processor of a terminal device and to perform a hidden-input two-way pattern matching method.
According to another aspect of one or more embodiments of the present disclosure, there is also provided a terminal device.
A terminal device adopts an internet terminal device and comprises a processor and a computer readable storage medium, wherein the processor is used for realizing instructions; a computer readable storage medium stores instructions adapted to be loaded by a processor and to perform a hidden-input two-way pattern matching method.
These computer-executable instructions, when executed in a device, cause the device to perform methods or processes described in accordance with various embodiments of the present disclosure.
In the present embodiments, a computer program product may include a computer-readable storage medium having computer-readable program instructions embodied thereon for performing various aspects of the present disclosure. The computer readable storage medium may be a tangible device that can hold and store the instructions for use by the instruction execution device. The computer readable storage medium may be, for example, but not limited to, an electronic memory device, a magnetic memory device, an optical memory device, an electromagnetic memory device, a semiconductor memory device, or any suitable combination of the foregoing. More specific examples (a non-exhaustive list) of the computer readable storage medium would include the following: a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), a Static Random Access Memory (SRAM), a portable compact disc read-only memory (CD-ROM), a Digital Versatile Disc (DVD), a memory stick, a floppy disk, a mechanical coding device, such as punch cards or in-groove projection structures having instructions stored thereon, and any suitable combination of the foregoing. Computer-readable storage media as used herein is not to be construed as transitory signals per se, such as radio waves or other freely propagating electromagnetic waves, electromagnetic waves propagating through a waveguide or other transmission medium (e.g., optical pulses through a fiber optic cable), or electrical signals transmitted through electrical wires.
The computer-readable program instructions described herein may be downloaded from a computer-readable storage medium to a respective computing/processing device, or to an external computer or external storage device over a network, such as the internet, a local area network, a wide area network, and/or a wireless network. The network may include copper transmission cables, fiber optic transmission, wireless transmission, routers, firewalls, switches, gateway computers and/or edge servers. The network adapter card or network interface in each computing/processing device receives computer-readable program instructions from the network and forwards the computer-readable program instructions for storage in a computer-readable storage medium in the respective computing/processing device.
The computer program instructions for carrying out operations of the present disclosure may be assembly instructions, Instruction Set Architecture (ISA) instructions, machine related instructions, microcode, firmware instructions, state setting data, or source or object code written in any combination of one or more programming languages, including an object oriented programming language such as C + + or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The computer-readable program instructions may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet service provider). In some embodiments, the electronic circuitry can execute computer-readable program instructions to implement aspects of the present disclosure by utilizing state information of the computer-readable program instructions to personalize the electronic circuitry, such as a programmable logic circuit, a Field Programmable Gate Array (FPGA), or a Programmable Logic Array (PLA).
The above description is only a preferred embodiment of the present application and is not intended to limit the present application, and various modifications and changes may be made by those skilled in the art. Any modification, equivalent replacement, improvement and the like made within the spirit and principle of the present application shall be included in the protection scope of the present application. Thus, the present invention is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims (8)

1. A hidden-input two-way schema matching method, the method comprising:
a mode holder receives a given mode to be searched by a user, and a text holder receives a text of a database;
matching the given pattern with the same length as the given pattern in the text until the matching of all the patterns with the same length as the given pattern in the text is completed, wherein the specific matching method comprises the following steps:
the mode holder calls a Shamir secret sharing scheme, selects a random number to set a polynomial, calculates a polynomial value by the random number, and generates a mode array consisting of number pairs according to bit values of corresponding positions in the mode;
according to each number pair in the mode array, the mode holder sends a random number for calculating a polynomial value to the text holder, the input of the text holder is a bit value of a corresponding position of the mode, the mode holder and the text holder both operate once and get 1 out of transmission protocol, and the text holder obtains the text array;
calculating line by line according to the numerical values in the text array to obtain a group of test data;
sequentially judging whether the test data input by the text holder is equal to the random number input by the mode holder, if so, outputting 1 by the text holder, otherwise, outputting 0, and after the test is finished, outputting the mode holder to form a bit string, wherein the position where 1 appears is the position of the given mode in the text, and if the bit string is all 0, the matching fails;
in this method, the pattern in the pattern holder is p ∈ {0,1}mM is the length of pattern p; the text in the text holder is t e {0,1}nN is the length of the text t, and n is more than or equal to m, through a pattern matching method, the pattern holder only obtains the position of the pattern appearing in the text, and meanwhile, the pattern p keeps secret to the text holder;
in the method, in the matching of a given pattern p in a text holder and an ith m-th long pattern in the text, the specific method for generating the pattern array consisting of the number pairs comprises the following steps:
the mode holder invokes Shamir secret sharing scheme to randomly choose a random number a in the set {1,2, …, q }i,0,ai,1,ai,2,..,ai,m-1Q is a large prime number, let si=ai,0Setting a polynomial expression:
fi(x)=ai,m-1xm-1+ai,m-2xm-2+...+ai,1x+simod q;
for j e {1, 2.. multidot.m }, in the set {1,2, …Q } randomly selecting xi,jCalculating
Figure FDA0002634304080000011
Randomly chosen among the set {1,2, …, q }
Figure FDA0002634304080000012
Wherein, sigma belongs to {0,1} is the bit value of the j bit in the mode p;
the mode holder generates a mode array composed of pairs and uses the mode array as 2 to blank the input information of the mode holder in the transmission protocol, wherein the mode array is as follows:
Figure FDA0002634304080000021
2. a hidden-input two-way pattern matching method as claimed in claim 1, wherein in the method, given pattern p in the text holder matches with ith m-long pattern in the text, for each pair of numbers in the pattern array, the pattern holder and the text holder run 1 at a time, 2 at 1 in a perusal transmission protocol, running (n-m +1) m times;
further, in the matching of the given pattern p in the text holder with the ith m-long pattern in the text, the specific method for the 2-to-1 perplexing transmission protocol includes:
the text holder takes 1 at each run of 2 and the input of the transport protocol is: ith m-long mode t in text ti=σi,1σi,2...σi,mOf (a) th bit value σi,j
The mode holder takes 1 at each run of 2 and the input of the transmission protocol is the current number pair of the mode array:
Figure FDA0002634304080000022
after the 2-to-1 disappearing transmission protocol is executed once, the text holder is obtained
Figure FDA0002634304080000023
After (n-m +1) m times of execution, 2 and 1 are taken out, the text holder obtains a text array:
Figure FDA0002634304080000024
3. a hidden-input two-way pattern matching method as claimed in claim 1, characterized in that in the method, given pattern p in the text holder matches with ith m-th pattern in the text, the calculation is performed line by line based on the values in the text array:
Figure FDA0002634304080000025
obtain n-m +1 values
Figure FDA0002634304080000026
A set of test data is formed.
4. A hidden-input two-party pattern matching method as claimed in claim 3, wherein in the method, given pattern p in the text holder matches with ith m-long pattern in the text, the pattern holder and the text holder jointly execute n-m +1 times of safe two-party equivalence test protocol, wherein the text holder is used as the sender, the pattern holder is used as the receiver, and in the ith time of executing the safe two-party equivalence test protocol, the text holder inputs n
Figure FDA0002634304080000027
The input of the mode holder is si(ii) a Testing the function of the protocol according to the safety equivalence of two parties if
Figure FDA0002634304080000031
The mode holder outputs 1, otherwise 0; text holdingParty has no output in the protocol;
after the n-m +1 times of safe two-party equivalent test protocol execution is finished, the mode holder combines the output values into a bit string with the length of n-m +1, and the position of 1 in the bit string is the position of the mode in the text; if the bit string is a full 0 string, the matching fails.
5. A hidden input two-way pattern matching method as claimed in claim 1, characterized in that the method also supports matching with wildcards, the pattern holder's pattern p contains wildcards, i.e. the pattern p e {0,1}mIn generating a pattern array composed of pairs, if the jth bit is a wildcard bit,
randomly choosing x in the set {1,2, …, q }i,j
Figure FDA0002634304080000032
Computing
Figure FDA0002634304080000033
Wherein sigma belongs to {0,1} is the bit value of the j th bit in the mode p;
the pattern holder generates the following pairs:
Figure FDA0002634304080000034
6. the method of claim 1, wherein the method further supports approximate matching, wherein the pattern holder has a pattern p with a length of m, and wherein m 'bits (m' ≦ m) are identical to the text pattern for successful matching, and wherein the method generates the pattern array comprising the pairs by:
the mode holder invokes Shamir secret sharing scheme to randomly choose a random number a in the set {1,2, …, q }i,0,ai,1,ai,2,..,ai,m'-1Q is a large prime number, let si=ai,0Setting a polynomial expression:
fi(x)=ai,m'-1xm'-1+ai,m'-2xm'-2+...+ai,1x+simodq;
for j ∈ {1, 2.,. m }, x is randomly chosen from the set {1,2, …, q }i,jCalculating
Figure FDA0002634304080000035
Randomly chosen among the set {1,2, …, q }
Figure FDA0002634304080000036
Wherein, sigma belongs to {0,1} is the bit value of the j bit in the mode p;
the mode holder generates a mode array composed of pairs and uses the mode array as 2 to blank the input information of the mode holder in the transmission protocol, wherein the mode array is as follows:
Figure FDA0002634304080000041
7. a computer-readable storage medium having stored thereon a plurality of instructions adapted to be loaded by a processor of a terminal device and to perform a hidden-input two-way pattern matching method according to any one of claims 1-6.
8. A terminal device, in particular an Internet terminal device, comprises a processor and a computer readable storage medium, wherein the processor is used for realizing instructions; a computer readable storage medium storing a plurality of instructions adapted to be loaded by a processor and to perform a hidden input two-way pattern matching method according to any of claims 1-6.
CN201811258454.3A 2018-10-26 2018-10-26 Hidden input two-party mode matching method and device Active CN109359476B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811258454.3A CN109359476B (en) 2018-10-26 2018-10-26 Hidden input two-party mode matching method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811258454.3A CN109359476B (en) 2018-10-26 2018-10-26 Hidden input two-party mode matching method and device

Publications (2)

Publication Number Publication Date
CN109359476A CN109359476A (en) 2019-02-19
CN109359476B true CN109359476B (en) 2020-12-25

Family

ID=65347065

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811258454.3A Active CN109359476B (en) 2018-10-26 2018-10-26 Hidden input two-party mode matching method and device

Country Status (1)

Country Link
CN (1) CN109359476B (en)

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110414567B (en) * 2019-07-01 2020-08-04 阿里巴巴集团控股有限公司 Data processing method and device and electronic equipment
CN110569659B (en) * 2019-07-01 2021-02-05 创新先进技术有限公司 Data processing method and device and electronic equipment
CN112019333B (en) * 2020-09-04 2022-07-19 支付宝(杭州)信息技术有限公司 Data processing method and device for OTA protocol
CN112732776B (en) * 2020-12-25 2022-08-26 山东师范大学 Secure approximate pattern matching method and system and electronic equipment
CN116132029B (en) * 2022-12-22 2023-09-26 泉城省实验室 Wild card symbol pattern matching method and system based on three-choice-one-blank transmission protocol

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103178965A (en) * 2008-01-07 2013-06-26 安全第一公司 Systems and methods for securing data using multi-factor or keyed dispersal
US10108807B2 (en) * 2005-11-18 2018-10-23 Security First Corp. Secure data parser method and system

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10108807B2 (en) * 2005-11-18 2018-10-23 Security First Corp. Secure data parser method and system
CN103178965A (en) * 2008-01-07 2013-06-26 安全第一公司 Systems and methods for securing data using multi-factor or keyed dispersal

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
"一个高效安全三方带通配符模式匹配协议";魏晓超 等;《计算机研究与发展》;20181015;第55卷(第10期);第1-4章 *

Also Published As

Publication number Publication date
CN109359476A (en) 2019-02-19

Similar Documents

Publication Publication Date Title
CN109359476B (en) Hidden input two-party mode matching method and device
US11354656B2 (en) Smart contract whitelists
US20140233727A1 (en) Method for secure substring search
CN110516462B (en) Method and apparatus for encrypting data
CN107291861B (en) Encryption graph-oriented approximate shortest distance query method with constraints
US9729525B1 (en) Secure data analytics
CN114175572B (en) System and method for performing equal and less operations on encrypted data using a quasi-group operation
CN111832067B (en) Data processing method and device and data processing device
CN111125727A (en) Confusion circuit generation method, prediction result determination method, device and electronic equipment
US11528125B2 (en) Electronic device for sorting homomorphic ciphertext using shell sorting and operating method thereof
US20230186049A1 (en) Training method and apparatus for a neural network model, device and storage medium
CN111444547A (en) Method, apparatus and computer storage medium for data integrity attestation
CN115580390A (en) Multi-scene mode calculation method and system under safe multi-party calculation
CN113722739B (en) Gradient lifting tree model generation method and device, electronic equipment and storage medium
US10673627B2 (en) Encryption device, search device, computer readable medium, encryption method, and search method
CN111046431B (en) Data processing method, query method, device, electronic equipment and system
CN111740821B (en) Method and device for establishing shared secret key
CN111339547B (en) Method for generating data tag, electronic device and computer storage medium
US9722780B2 (en) Complex format-preserving tokenization scheme
CN115757624A (en) Data processing method and device, electronic equipment and storage medium
CN112559497B (en) Data processing method, information transmission method, device and electronic equipment
CN115481440A (en) Data processing method, device, electronic equipment and medium
Chakraborti et al. {Distance-Aware} Private Set Intersection
CN111447072A (en) Method, apparatus and storage medium for generating data equivalent zero knowledge proof
CN112836239A (en) Method and device for cooperatively determining target object data by two parties for protecting privacy

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
TR01 Transfer of patent right
TR01 Transfer of patent right

Effective date of registration: 20220411

Address after: 250102 floor 17, building 4, future entrepreneurship Plaza, north section of Gangxing Third Road, Jinan area, China (Shandong) pilot Free Trade Zone, Jinan City, Shandong Province

Patentee after: Confident Information Co.,Ltd.

Address before: No.1 Daxue Road, University Science Park, Changqing District, Jinan City, Shandong Province

Patentee before: SHANDONG NORMAL University