CN104123503A - CNF formula data protection method in SAT problem solving outsourcing process - Google Patents

CNF formula data protection method in SAT problem solving outsourcing process Download PDF

Info

Publication number
CN104123503A
CN104123503A CN201410292502.6A CN201410292502A CN104123503A CN 104123503 A CN104123503 A CN 104123503A CN 201410292502 A CN201410292502 A CN 201410292502A CN 104123503 A CN104123503 A CN 104123503A
Authority
CN
China
Prior art keywords
formula
clause
variable
cnf
word
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.)
Granted
Application number
CN201410292502.6A
Other languages
Chinese (zh)
Other versions
CN104123503B (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.)
National University of Defense Technology
Original Assignee
National University of Defense Technology
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 National University of Defense Technology filed Critical National University of Defense Technology
Priority to CN201410292502.6A priority Critical patent/CN104123503B/en
Publication of CN104123503A publication Critical patent/CN104123503A/en
Application granted granted Critical
Publication of CN104123503B publication Critical patent/CN104123503B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

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/10Protecting distributed programs or content, e.g. vending or licensing of copyrighted material ; Digital rights management [DRM]
    • G06F21/12Protecting executable software
    • G06F21/14Protecting executable software against software analysis or reverse engineering, e.g. by obfuscation

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Multimedia (AREA)
  • Technology Law (AREA)
  • Computer Hardware Design (AREA)
  • Computer Security & Cryptography (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)
  • Machine Translation (AREA)

Abstract

The invention discloses a CNF formula data protection method in the SAT problem solving outsourcing process. The method includes the following implementation steps that a Husk formula S2 and a Husk solution Hr are generated; an original CNF formula S1 and an original CNF formula S2 are mixed to generate a novel CNF formula S and a variable mapping table M on the premise that solution space is kept unchanged; data to be solved are converted into CNF formula data through the novel CNF formula S to be outsourced to a far-end server, and the received CNF formula data are solved through the far-end server to acquire a mixed solution Or; the mixed solution Or is de-mapped based on the variable mapping table M, an actual variable which is marked and mapped to the original CNF formula S1 in the variable mapping table M in the de-mapping process is filled into an original solution R to conduct correctness verification, and finally the original solution R corresponding to the mixed solution Or is acquired. By means of the CNF formula data protection method, any CNF formula S1 can be mixed so as to hide the structural information included in the CNF formula S1, it is guaranteed that the mixed CNF formula S can use an original SAT solver for solving, and correctness verification can further be conducted on outsourcing computational results.

Description

CNF formula data guard method in the outer packet procedures of SAT problem solving
Technical field
The present invention relates to calculate under cloud computing environment the data-privacy resist technology of outsourcing, be specifically related to the CNF formula data guard method in the outer packet procedures of a kind of SAT problem solving.
Background technology
Solving at present of SAT (proposition can meet) problem is used widely in software and hardware checking field.In recent years, on the one hand along with the expanding day of software and hardware scale, the SAT problem scale of serving hardware verification also sharply expands thereupon, thereby user's computing basic facility has been formed to stern challenge.On the other hand, ripe cloud computing and grid computing pattern can provide flexible computational resource according to application scale at present, thereby becomes the effective means of this challenge of reply.Therefore, with cloud computing or grid computing, SAT problem is distributed in to the parallel scale that solves that solves to improve problem in the multicomputer system of far-end, thereby utilizes the calculating outsourcing of the computing basic facility such as cloud or grid becoming a kind of new trend.
Under cloud computing and grid computing pattern, SAT solver is deployed on the node server or Cloud Server of far-end, the CNF formula data transmission that hardware circuit is transformed is positioned to existence on the server of far-end, is solved by the SAT solver operating on server; And obtain solving result.CNF formula is some clauses' conjunction; Clause is extracting of some words; Word is the anti-of Boolean variable or its.In lower routine formula (1) it is a typical CNF formula.
In formula (1), comprise 4 variable x1, x2, x3, x4 and four clauses wherein x2 is called the text word of variable x2, be called the negative word of variable x2; The quantity of the word comprising in clause is called clause's length, and the length note of clause C is done | C|, clause comprise two words, its length
The target that SAT solves is exactly to find the assignment of one group of variable, make arbitrary clause all value be true (T); Be true and make a clause, it is true requiring to have a word value at least in clause.In if clause all words all value be false (F), this clause's value is false; If arbitrary clause's value is false in CNF formula, this CNF formula value is false, and true (T) available digital 1 represents, false (F) available 0 expression.In upper routine formula (1), one group of assignment x1=1, and x2=1, x3=0, it is true that x4=0} can make each clause's value, therefore this group assignment is a solution of SAT; Another group assignment x1=1, and x2=1, x3=0, it is true that x4=1} also can make each clause, therefore this group assignment is also a solution of CNF formula.These two groups of assignment can combined statement be shown x3=0}, shows x1 for x1=1, x2=1, x2, x3 is under such assignment, no matter x4 gets very or false, all can make CNF formula value is true.If existing and making CNF formula is genuine assignment, just claim that this CNF formula is satiable (SAT); Otherwise, just claim that this CNF formula is unsatisfiable (UNSAT).Obviously, the formula in formula (1) be satiable, and formula ψ in lower routine formula (2) is unsatisfiable.
In formula (2), explanation referring to formula (1) is known, formula ψ comprises 5 clauses, from the truth table shown in table one, no matter how value of the variable x1 in clause and x2, front 4 clauses can not be true simultaneously, cause ψ can not get very, and therefore ψ is a unsatisfiable CNF formula.What these 4 clauses of contradiction were just called formula ψ each other can not meet core.
Table one: truth table:
Arbitrarily circuit be all with (AND) or (OR), non-(NOT), XOR, with or etc. the combination of elementary gate.These doors have characteristic of correspondence function, formula (3)~(7) below to provide the fundamental function of conventional elementary gate.
z = NOT ( x ) ≡ ( x + z ) ( x ‾ + z ‾ ) - - - ( 3 )
z = AND ( x 1 , · · · , x j ) ≡ [ Π i = 1 j ( x i + z ‾ ) ] ( Σ i = 1 j x ‾ i + z ) - - - ( 4 )
z = OR ( x 1 , · · · , x j ) ≡ [ Π i = 1 j ( x ‾ i + z ) ] ( Σ i = 1 j x i + z ‾ ) - - - ( 5 )
z = NAND ( x 1 , · · · , x j ) ≡ [ Π i = 1 j ( x i + z ) ] ( Σ i = 1 j x ‾ i + z ‾ ) - - - ( 6 )
z = NOR ( x 1 , · · · , x j ) ≡ [ Π i = 1 j ( x ‾ i + z ‾ ) ] ( Σ i = 1 j x i + z ) - - - ( 7 )
In formula (3)~(7), formula (3) is the fundamental function of not gate NOT, formula (4) is and the fundamental function of door AND, formula (5) be or door OR fundamental function, formula (6) is the fundamental function of Sheffer stroke gate NAND, and formula (7) is the fundamental function of rejection gate NOR; Wherein x irepresent the input variable of door, j represents the number of the input variable of door, and z represents output variable.
In example, in hardware chemical examination card, before use SAT solver solves, need first hardware circuit and attribute to be verified are converted into CNF formula, this process is called Tseitin coding.Because any circuit all can be decomposed into the combination of two inputs and door (AND2) and not gate (NOT), so only provide the Tseitin coding of AND2 and NOT here.For not gate z=NOT (x), the CNF formula being produced by Tseitin coding is: and for two inputs and door z=AND2 (x 1, x 2), the CNF formula being produced by Tseitin coding is:
Have the door of the other types of any input and function, their Tseitin coding can similarly obtain.
For a complicated circuit being formed by the elementary gate such as AND2 and NOT, the conjunction of the CNF formula that the CNF formula that Tseitin coding produces is all these elementary gates.Exemplary circuit shown in Figure 1, this exemplary circuit comprise one with door & and one or |, variable a and b carry out obtaining intermediate variable d after " | " exclusive disjunction, and intermediate variable d is output variable e after carrying out " & " and computing with variable c.Tseitin coding by use intermediate variable set d}, by the functional representation of these two doors is respectively or the Tseitin coding of door: tseitin coding with door: totally two short sentence set.The conjunction of these two short sentence set, has just represented the function of whole circuit.For any circuit C, can be converted to corresponding CNF formula through Tseitin coding be designated as software code is also encoded based on Tseitin to the mapping ruler of CNF formula, is similar to the checking of hardware logic.
Particular door is called this CNF mark by the encode CNF formula that obtains of Tseitin.Each clause in mark is called the feature clause of door.Comprise the crucial clause that the clause of all variablees in door is called door.In CNF mark, a represents the variable of output, is called output variable.Taking three value and gate (AND3) as example, three value and gate (AND3) is through Tseitin coding, and the clause who is converted to formula (8) gathers C.
In formula (8), C is called the CNF mark of AND3 door; c 1~c 4clause is called feature clause; Wherein clause c 1(a, b, c, d), be called the crucial clause of AND3 door to have comprised all variablees in AND3 door; A is called the output variable of AND3 door.Under a kind of coding rule, the door with same characteristic features function will inevitably be coded as identical clause's set.In existing threat model, potential assailant is all by exploring this architectural feature with restoring circuit structure, and the algorithm that they use is based on undefined hypergraph, Directed Hypergraph and bipartite graph concept.
Taking the clause in CNF formula as node, variable is limit, the figure of formation is called hypergraph (Hypergraph).
In hypergraph G (V, E):
◆ a clause in the corresponding CNF of each node in V;
◆ a variable in every corresponding CNF in limit in E.
If two clauses comprise identical variable, between two clauses, connect a limit, mark with variable.Under the expression mode of hypergraph, there is following situation, two doors have different CNF marks, but that hypergraph represents is identical, as AND3 and OR3.
On the basis of hypergraph, according to clause's Chinese word positive and negative, be limit add mark, the figure of formation is called Directed Hypergraph (Directed Hypergraph).
Clause and variable are all considered as to node, variable and clause's subordinate relation are considered as to limit simultaneously, the figure of formation is called bipartite graph (Bipartite Graph).In bipartite graph G (V, E):
◆ clause in V in the corresponding CNF in summit or variable, i.e. V=V cls∪ V var.Wherein V clsfor clause's set, V varfor node set.
◆ the corresponding clause/variable pair in limit in E.If occurrences, in clause, just connects a limit between variable and clause; Variable be negative value corresponding one marginal, otherwise be positive limit.
Taking AND3 door as example, represent by the CNF mark of formula (8), can obtain corresponding hypergraph (as shown in Figure 2), Directed Hypergraph (as shown in Figure 3, just wherein use ↑ represent, ┼ represents to bear), bipartite graph (as shown in Figure 4).Because cloud computing and grid computing need to store data in the server of far-end, the node server of Cloud Server and grid computing is used by multiple users share, on server, carry out, in the process of SAT problem solving, existing undelegated third party user to access the possibility of CNF formula data.And on the other hand, be in the SAT example procedure representing with CNF formula in the hardware circuit code conversion that net table is represented, circuit structure information can't be lost thereupon, and this is just for potential assailant provides chance.At present, prior art has openly been inquired into the method that recovers circuit structure from CNF formula data, and wherein part prior art also gives complete circuit recovery algorithms.
For example, the people such as Jarrod A.Roy have provided the electric circuit inspection algorithm for CNF in " Restoring Circuit Structure from SAT Instances " literary composition, the concept of algorithm based on gate circuit CNF mark, and carry out extraction circuit structure with pattern match and Subgraph Isomorphism, basic step is as follows:
1) CNF example is converted into a undirected hypergraph G;
2) the CNF mark of door is converted into subgraph g, in undirected hypergraph G, mates;
3) CNF example is converted to bipartite graph, utilizes Subgraph Isomorphism to mate the example of each;
4) make node of each correspondence, if door incompatible (sharing same clause) just connects a limit; Maximum circuit problem corresponding to structure CNF is converted into maximum independent set and closes (MIS) problem solving.MIS problem is NP-hard problem, but exists heuristic preferably for this problem.
In addition, Zhaohui Fu.Sharad Malik has introduced CNF2CKT algorithm in " Extracting Logic Circuit Structure from ConjunctiveNormal Form Descriptions " literary composition, in CNF2CKT algorithm, continue to use the concept of CNF mark, and introduce crucial clause's concept, to dwindle matching range, the efficiency that improves coupling, basic step is as follows:
1) by crucial clause's pattern match, the circuit structure of detecting gate from CNF;
2) construct maximum acyclic covering, the maximized circuit structure that extracts from any CNF example.
In sum, the recovery of these gate structures of prior art is attempted being based upon on the basis of the mature technology such as Subgraph Isomorphism and pattern match, the graph structure characteristic of having utilized CNF formula to carry, potential menace can extract door by above-mentioned technological means from CNF, obtains circuit structure information; Therefore the circuit structure that hiding CNF comprises is to solve in outsourcing the problem that SAT problem must solve.
Summary of the invention
The technical problem to be solved in the present invention is: for the problems referred to above, provide a kind of can distortion it before CNF formula data are outsourced to grid node or cloud computing server to obscure to hide the structural information comprising and the problem that does not affect SAT normally solves, can ensure that CNF formula after obscuring can also use the SAT problem that original SAT solver solves to calculate the CNF formula data guard method in outsourcing.
In order to solve the problems of the technologies described above, the technical solution used in the present invention is:
SAT problem is calculated the CNF formula data guard method in outsourcing, and implementation step is as follows:
1) generate Husk formula S 2, described Husk formula S 2for the CNF formula that only has can meet solution, and described Husk formula S 2the assignment of separating variable is not full 0 or complete 1;
2) original CNF formula S to be solved in outsourcing will be calculated 1, described Husk formula S 2both with keep solution space do not become prerequisite obscure generate have and original CNF formula S 1the new CNF formula S of different CNF structures, and generation is used for recording original CNF formula S 1, Husk formula S 2the variable mapping table M of mapping relations between both and variable thereof, each list item in described variable mapping table M comprises var territory and Gong Liangge territory, formula territory, wherein var territory is used for storing original CNF formula S 1or Husk formula S 2in original variable name, the source of the corresponding variable name of formula domain representation; The original CNF formula S of the constant finger of described solution space 1, new CNF formula S can adopt identical SAT solver to solve and both solution between there is following relation: original CNF formula S 1can not meet new CNF formula S can not meet, otherwise new CNF formula S can not meet original CNF formula S 1can not meet, if original CNF formula S 1can meet new CNF formula S can meet, original CNF formula S 1solution can be by the solution of new CNF formula in original CNF formula S 1variables set on projection obtain; Described different CNF structure refers to original CNF formula S 1, the clause's set between new CNF formula S and the word set in clause all different;
3) use new CNF formula S be converted to CNF formula data and be outsourced to far-end server data to be solved, utilize existing SAT solver on far-end server to solve and obtain obscuring solution Or the CNF formula data of receiving;
4) for obscuring each the solution word lit separating in Or, take out and separate variable var corresponding to word lit, and from variable mapping table M, take out corresponding real variable rvar according to separating variable var corresponding to word lit, if this real variable rvar is labeled mapping from original CNF formula S in variable mapping table M 1, this real variable is filled to primitive solution R, finally obtain obscuring primitive solution R corresponding to solution Or.
Preferably, described step 1) also comprise and generate Husk formula S 2husk separate the step of Hr; Described step 4) in when separating variable var corresponding to word lit take out corresponding real variable rvar from variable mapping table M, if this real variable rvar is labeled mapping from Husk formula S in variable mapping table M 2, this real variable rvar is separated to assignment Hr[rvar corresponding in Hr with described Husk] and compare checking, if verify inconsistently, judge that far-end server solves and makes mistakes CNF formula data, output error is also exited.
Preferably, described step 1) the middle Husk formula S that generates 2detailed step as follows:
1.1) generate a prime number, adopt the form of binary vector to represent described prime number;
1.2) prime number described employing binary vector being represented is squared;
1.3) value after squared described prime number is as the output variable of multiplier and forbid that the input variable of multiplier equals 1, described multiplier is converted to CNF formula, this CNF formula be generate obtain only have one can meet that to separate and separate the assignment of variable be not the Husk formula S of full 0 or complete 1 2.
Preferably, described step 4) detailed step as follows:
4.1) from described obscure to separate Or take out a untreated solution word lit as current solution word, judge whether current solution word lit is greater than 0, if be greater than 0, using the initial value of current solution word lit as variable var corresponding to current solution word lit, otherwise using after current solution word lit negate as variable var corresponding to current solution word lit;
4.3) use variable var that described current solution word lit the is corresponding index as var territory in variable mapping table M, from described variable mapping table M, take out corresponding real variable rvar;
4.4) judge described real variable rvar value M[rvar in formula territory in Corresponding matching list item in variable mapping table M] whether .formula be original CNF formula S 1, if it is represent that described real variable rvar is labeled in variable mapping table M to map to original CNF formula S 1, redirect execution step 4.5); Otherwise represent that this real variable rvar is labeled and maps to Husk formula S in variable mapping table M 2, redirect execution step 4.6);
4.5) judge whether current solution word lit is greater than 0, if be greater than 0, described real variable rvar is filled to assignment R[rvar corresponding to real variable rvar in primitive solution R], otherwise will after described real variable rvar negate, be filled to assignment R[rvar corresponding to real variable rvar in primitive solution R]; Redirect execution step 4.8);
4.6) judge whether current solution word lit is greater than 0, if current solution word lit is greater than 0, judge that described real variable rvar, real variable rvar separate assignment Hr[rvar corresponding in Hr at described Husk] whether consistent, redirect execution step 4.7); If current solution word lit is not more than 0, judge that value-rvar, the real variable rvar after described real variable rvar negate separates assignment Hr[rvar corresponding in Hr at described Husk] whether consistent, redirect execution step 4.7);
4.7) if separate assignment Hr[rvar corresponding in Hr with real variable rvar at described Husk] consistent, redirect execution step 4.8); Otherwise judge that far-end server, to CNF formula data solving result mistake, reports an error and exits;
4.8) described in judgement, obscure and separate all solution words of Or and whether be disposed, if be not yet disposed, redirect execution step 4.1), otherwise it is complete to represent that primitive solution R has filled, and obtains obscuring separating primitive solution R corresponding to Or.
As optional tactful one, described step 2) detailed step as follows:
A2.1) receive original CNF formula S to be solved 1, Husk formula S 2separate Hr with the Husk of Husk formula, obtain original CNF formula S 1in clause's average length AL;
A2.2) from original CNF formula S 1untreated clause C of middle taking-up is as current clause;
A2.3) separate Hr and obtain at random a word lit from described Husk, will after described word lit negate, add original CNF formula S to 1current clause C in;
A2.4) judge original CNF formula S 1all clauses whether be disposed, if be not yet disposed, redirect continue execution step A2.2); Otherwise, the CNF formula S that obtains all clauses and added word 1, redirect execution step A2.5);
A2.5) added the CNF formula S of word from described all clauses 1untreated clause C of middle taking-up is as current clause;
A2.6) judge the length of current clause C | whether C| is less than described original CNF formula S 1in clause's average length AL, if be less than described clause's average length AL, redirect execution step A2.7), otherwise redirect execution step A2.8);
A2.7) separate and Hr, obtain at random one and instead do not belong to the word lit in current clause C from described Husk, by the CNF formula S of adding described all clauses to after described word lit negate and having added word 1in current clause C in;
A2.8) judge that described all clauses have added the CNF formula S after word 1all clauses whether be disposed, if be not yet disposed, redirect continue execution step A2.5); Otherwise the CNF formula S that obtains all clauses and again add word 1, redirect execution step A2.9);
A2.9) described all clauses are added again to the CNF formula S of word 1in variable var, Husk formula S 2in the variable var mixing of resequencing, recorded variable var and variable var affiliated original CNF formula S before rearrangement mixes for each variable var generates one 1or Husk formula S 2the list item of both mapping relations, finally obtains variable mapping table M;
A2.10) described all clauses are added again to the CNF formula S of word 1, Husk formula S 2in clause's hybrid-sorting obtain having and original CNF formula S 1the new CNF formula S of different CNF structures;
A2.11) by variable mapping table M and new CNF formula S output.
As optional tactful two, described step 2) detailed step as follows:
B2.1) receive original CNF formula S to be solved 1, Husk formula S 2separate Hr with the Husk of Husk formula; Detect and mark original CNF formula S 1in crucial clause and output variable, initialization clause S set 3for sky;
B2.2) from original CNF formula S 1untreated clause C of middle taking-up is as current clause;
B2.3) judge whether current clause C is crucial clause, if current clause C is crucial clause, redirect continues execution step B2.4); Otherwise redirect execution step B2.2);
B2.4) separate Hr and obtain at random a word lit from described Husk, will after described word lit negate, add original CNF formula S to 1current clause C in;
B2.5) obtain the output character olit of current clause C, by the new clause nC of value-olit combination results after the output character olit negate of described word lit, current clause C, described new clause nC is put into clause's S set 3in;
B2.6) judge original CNF formula S 1all clauses whether be disposed, if be not yet disposed, redirect continue execution step B2.2), otherwise, obtain all clauses and added the CNF formula S after word 1with the clause's S set being formed by new clause nC 3, redirect execution step B2.7);
B2.7) obtain Husk formula S 2in clause's average length AL;
B2.8) added the CNF formula S word from described all clauses 1with the clause's S set being formed by new clause nC 3in the merging set forming, take out a untreated clause C as current clause;
Whether the length that B2.9) judges current clause C is less than described Husk formula S 2in clause's average length AL, if be less than described clause's average length AL, redirect continue execution step B2.10); Otherwise redirect execution step B2.8);
B2.10) from described Husk solution Hr, obtain at random one and instead do not belong to the word lit in current clause C, added the CNF formula S after word by adding respectively all clauses after described word lit negate to 1, clause's S set of being formed by new clause nC 3in corresponding current clause C;
B2.11) judge that described all clauses have added the CNF formula S after word 1with the clause's S set being formed by new clause nC 3whether all clauses in the merging set forming are disposed, if be not yet disposed, redirect continues execution step B2.8), otherwise the CNF formula S that obtains all clauses and again add word 1clause's S set of having added word with clause 3, redirect execution step B2.12);
B2.12) described all clauses are added again to the CNF formula S of word 1in variable var, Husk formula S 2in the variable var mixing of resequencing, recorded variable var and variable var affiliated original CNF formula S before rearrangement mixes for each variable var generates one 1or Husk formula S 2the list item of both mapping relations, finally obtains variable mapping table M;
B2.13) described all clauses are added again to the CNF formula S of word 1, Husk formula S 2, clause's clause's S set of having added word 3in clause's hybrid-sorting obtain having and original CNF formula S 1the new CNF formula S of different CNF structures;
B2.14) by variable mapping table M and new CNF formula S output.
As optional tactful three, described step 2) detailed step as follows:
C2.1) receive original CNF formula S to be solved 1, Husk formula S 2separate Hr with the Husk of Husk formula; Detect and mark original CNF formula S 1in crucial clause and output variable, initialization clause S set 3for sky;
C2.2) from original CNF formula S 1untreated clause C of middle taking-up is as current clause;
C2.3) separate Hr and obtain at random a word lit from described Husk, will after described word lit negate, add original CNF formula S to 1current clause C in;
C2.4) judge whether current clause C is crucial clause, if current clause C is crucial clause, obtain the output character olit of current clause C, by the new clause nC of value-olit combination results after the output character olit negate of described word lit, current clause C, described new clause nC is put into clause's S set 3in;
C2.5) judge original CNF formula S 1all clauses whether be disposed, if be not yet disposed, redirect continue execution step C2.2), otherwise, obtain all clauses and added the CNF formula S after word 1with the clause's S set being formed by new clause nC 3, redirect execution step C2.6);
C2.6) obtain Husk formula S 2in clause's average length AL;
C2.7) added the CNF formula S word from described all clauses 1with the clause's S set being formed by new clause nC 3in the merging set forming, take out a untreated clause C as current clause;
Whether the length that C2.8) judges current clause C is less than described Husk formula S 2in clause's average length AL, if be less than described clause's average length AL, redirect continue execution step C2.9); Otherwise redirect execution step C2.7);
C2.9) from described Husk solution Hr, obtain at random one and instead do not belong to the word lit in current clause C, added the CNF formula S after word by adding respectively all clauses after described word lit negate to 1, clause's S set of being formed by new clause nC 3in corresponding current clause C;
C2.10) judge that described all clauses have added the CNF formula S after word 1with the clause's S set being formed by new clause nC 3whether all clauses in the merging set forming are disposed, if be not yet disposed, redirect continues execution step C2.7), otherwise the CNF formula S that obtains all clauses and again add word 1clause's S set of having added word with clause 3, redirect execution step C2.11);
C2.11) described all clauses are added again to the CNF formula S of word 1in variable var, Husk formula S 2in the variable var mixing of resequencing, recorded variable var and variable var affiliated original CNF formula S before rearrangement mixes for each variable var generates one 1or Husk formula S 2the list item of both mapping relations, finally obtains variable mapping table M;
C2.12) described all clauses are added again to the CNF formula S of word 1, Husk formula S 2, clause's clause's S set of having added word 3in clause's hybrid-sorting obtain having and original CNF formula S 1the new CNF formula S of different CNF structures;
C2.13) by variable mapping table M and new CNF formula S output.
The CNF formula data guard method that SAT problem disclosed by the invention is calculated in outsourcing has following advantage: this CNF formula data guard method, and by original CNF formula S 1husk formula S of middle embedding 2, generate new CNF formula S, keeping, under the constant prerequisite of solution space, hiding original CNF formula S 1in structural information, can avoid SAT problem to calculate the leakage of the structural information in outer packet procedures.Data after method disclosed by the invention is obscured can directly be used original SAT algorithm and SAT solver to calculate, and do not need to decipher rear calculating, make far-end server not know to provide calculation services in the situation of the actual content calculating, thereby can help user fast application deployment to be calculated in the new model of outsourcing to cloud computing and grid computing etc.
Brief description of the drawings
Fig. 1 is the logical organization schematic diagram of the exemplary circuit of Tseitin coding principle explanation.
Fig. 2 is the AND3 hypergraph of the exemplary circuit shown in Fig. 1.
Fig. 3 is the AND3 Directed Hypergraph of the exemplary circuit shown in Fig. 1.
Fig. 4 is bis-points of hypergraphs of AND3 of the exemplary circuit shown in Fig. 1.
Fig. 5 is the basic implementing procedure schematic diagram of embodiment of the present invention method.
Fig. 6 is the system principle structural representation of application embodiment of the present invention method.
Fig. 7 is the schematic flow sheet that generates Husk formula in the embodiment of the present invention.
Fig. 8 is embodiment of the present invention step 2) schematic flow sheet of optional implementation strategy one.
Fig. 9 is embodiment of the present invention step 2) schematic flow sheet of optional implementation strategy two.
Figure 10 is embodiment of the present invention step 2) schematic flow sheet of optional implementation strategy three.
Figure 11 is embodiment of the present invention step 4) implementing procedure schematic diagram.
Embodiment
As shown in Figure 5, the implementation step of the CNF formula data guard method in the present embodiment SAT problem calculating outsourcing is as follows:
1) generate Husk formula S 2, Husk formula S 2for the CNF formula that only has can meet solution, and Husk formula S 2separate the assignment of variable and be not full 0 or complete 1, can meet solution is to instigate CNF formula for really separating;
2) original CNF formula S to be solved in outsourcing will be calculated 1, Husk formula S 2both, with keep solution space do not become prerequisite obscure generate have and original CNF formula S 1the new CNF formula S of different CNF structures, and generation is used for recording original CNF formula S 1, Husk formula S 2the variable mapping table M of mapping relations between both and variable thereof, each list item in variable mapping table M comprises var territory and Gong Liangge territory, formula territory, wherein var territory is used for storing original CNF formula S 1or Husk formula S 2in original variable name, the source of the corresponding variable name of formula domain representation;
3) use new CNF formula S be converted to CNF formula data and be outsourced to far-end server data to be solved, utilize existing SAT solver on far-end server to solve and obtain obscuring solution Or the CNF formula data of receiving;
4) for obscuring each the solution word lit separating in Or, take out and separate variable var corresponding to word lit, and from variable mapping table M, take out corresponding real variable rvar according to separating variable var corresponding to word lit, if this real variable rvar is labeled mapping from original CNF formula S in variable mapping table M 1, this real variable is filled to primitive solution R, finally obtain obscuring primitive solution R corresponding to solution Or.
The present embodiment step 2) in obscure generate have and original CNF formula S 1when the new CNF formula S of different CNF structures, need to follow two principles: (1) original CNF formula S 1, new CNF formula S both keep solution space constant; (2) original CNF formula S 1, new CNF formula S both there are different CNF structures.The original CNF formula S of the constant finger of solution space 1, new CNF formula S can adopt identical SAT solver to solve and both solution between there is following relation: original CNF formula S 1can not meet new CNF formula S can not meet, otherwise new CNF formula S can not meet original CNF formula S 1can not meet, if original CNF formula S 1can meet new CNF formula S can meet, original CNF formula S 1solution can be by the solution of new CNF formula in original CNF formula S 1variables set on projection obtain; Different CNF structures refer to original CNF formula S 1, the clause's set between new CNF formula S and the word set in clause all different.Based on above-mentioned two principles, can CNF formula data are outsourced to far-end server (for example Cloud Server or grid service server) before it is out of shape obscure to hide the structural information comprising, the problem that does not affect SAT normally solves, can ensure that the CNF formula after obscuring can also use original SAT solver to solve.
From cryptographic angle, Husk formula S 2be a secret key, be used to encrypt original CNF formula S to be solved 1.Husk formula S 2be only to have a CNF formula that can meet solution, and the assignment of solution variable is non-specific (not being full 0 or complete 1).Husk formula S 2in the variable that comprises be called Husk variable.Husk formula S 2in the clause that comprises be called Husk clause.Those words that composition Husk separates, are called Husk word.For example expression formula in, be the simplest Husk formula, wherein comprise x1, two Husk variablees of x2, comprise x1 and two clauses, and { x1=1, x2=0} are expressed as solution written form to only have a solution in the present embodiment, adopt based on prime factor decomposition method and generate Husk formula S 2, as shown in Figure 7, the present embodiment step 1) the middle Husk formula S that generates 2detailed step as follows:
1.1) generate a prime number p, prime number p is adopted to binary vector X=<x 1, x 2, x nthe form of > represents;
1.2) to adopting binary vector X=<x 1, x 2, x nthe prime number p squared (O=p*p) that > represents;
1.3) the value O after prime number is squared is as the output variable of multiplier and forbid that (that is: the input variable of multiplier equals 1 by multiplier be converted to CNF formula (use Tseitin coding that multiplier is converted to CNF formula, this CNF formula be generate obtain only have one can meet that to separate and separate the assignment of variable be not the Husk formula S of full 0 or complete 1 2.
In the present embodiment, step 1) also comprise and generate Husk formula S 2husk separate the step of Hr, specifically by Hr=p|p to adopting binary vector X=<x 1, x 2, x nthe prime number p that > represents calculates Husk and separates Hr; Step 4) in when separating variable var corresponding to word lit take out corresponding real variable rvar from variable mapping table M, if this real variable rvar is labeled mapping from Husk formula S in variable mapping table M 2, this real variable rvar and Husk are separated to assignment Hr[rvar corresponding in Hr] and compare checking, if verify inconsistently, judge that far-end server solves and makes mistakes CNF formula data, output error is also exited.
Suppose original CNF formula S 1comprise 3 variable a, b, c, Husk formula S 2the d that comprises 2 variablees, e, original CNF formula S 1, Husk formula S 2mix the new CNF formula S generating and can comprise 5 variablees.The present embodiment, before will data be solved using new CNF formula S to be converted to CNF formula data and be outsourced to far-end server, uses variable mapping table M to shine upon variable name, that is: these variablees are renamed, for example a, b, c, d, e=>3,5,2, Isosorbide-5-Nitrae, what see off is exactly 1,2, and 3,4,5 is the formula of variable name.The variable mapping table M now generating as shown in Table 2.
Table two: the contents table of the variable mapping table M of generation.
Obscure rear variable name Var territory Formula territory
1 d S 2
2 c S 1
3 a S 1
4 e S 2
5 b S 1
It should be noted that, be only that the content of variable mapping table M is illustrated herein.
Because original CNF formula S 1, Husk formula S 2between the clause that do not occur simultaneously, namely do not exist clause both to comprise original CNF formula S 1in variable, comprise again Husk formula S 2in variable.If do not pass through step 2 in the present embodiment) obscure, the mode only remapping by variable name mixes the variable of two formula, conventionally just can be by original CNF formula S with a very simple subregion (partition) algorithm 1, Husk formula S 2make a distinction, will cause so original CNF formula S 1intactly expose under third party's environment.In the present embodiment through step 2) obscure, in original CNF formula S 1clause in added Husk formula S 2variable, and utilize original CNF formula S 1in variable and Husk formula S 2in variable constructed new clause, the CNF formula S after obscuring 1clause, Husk formula S 2and between the clause of neotectonics, can exist a large amount of variablees to occur simultaneously, original like this CNF formula S 1with Husk formula S 2figure (hypergraph, bipartite graph) with regard to seamless having mixed, use partitioning algorithm just both can not be made a distinction.
As shown in Figure 6, the client of application the present embodiment, calculating before outsourcing, first will perform step 1 by generator), generate Husk formula S 2and generation Husk formula S 2husk separate Hr; Then original CNF formula S to be solved in outsourcing will be calculated by obfuscator 1, Husk formula S 2both have and original CNF formula S to keep solution space not become prerequisite mixing generation 1the new CNF formula S of different CNF structures, and generation is used for recording original CNF formula S 1, Husk formula S 2the variable mapping table M of mapping relations between both and variable thereof; Again data to be solved used new CNF formula S to be converted to CNF formula data and are outsourced to far-end server (for example Cloud Server or grid service server), utilizing existing SAT solver (SAT Solver) on far-end server to solve and obtain obscuring solution Or the CNF formula data of receiving; Finally, client is passed through de-mapping device, for obscuring each the solution word lit separating in Or, take out and separate variable var corresponding to word lit, and from variable mapping table M, take out corresponding real variable rvar according to separating variable var corresponding to word lit, if being labeled in variable mapping table M, this real variable rvar maps to original CNF formula S 1, this real variable is filled to primitive solution R, finally shine upon and obtain obscuring primitive solution R corresponding to solution Or by de-mapping device.Wherein, SAT solver (SAT Solver) is for example positioned at, on far-end server (Cloud Server or grid service server), generator, obfuscator, de-mapping device are all positioned in client, for calculating outsourcing service device, its input be the CNF formula data S after obscuring, output obscure separate Or.
In the present embodiment, the Obfuscating Algorithms that obfuscator is used is followed 4 rules that the embedding method table of table three provides, in original CNF formula S 1middle embedding Husk formula S 2in clause and variable, thereby change original CNF formula S 1clause set and clause's word set, generate new CNF formula S.In the present embodiment, comprise altogether embedding method 1.~4. totally 4 basic embedding methods of embedding method, specifically as shown in Table 3.
Table three: embedding method table.
In the present embodiment, 4 the basic embedding methods of obfuscator based in embedding method table, above-mentioned 4 basic embedding methods can not use separately and must be used in combination, and just can reach the object that keeps solution space.For efficiency and the consideration of obscuring effect, the present embodiment can adopt following three kinds of strategies as required.Three kinds of strategies all can change original CNF formula S 1cNF structure, comprise and the CNF mark, crucial clause's form of door can effectively stop the attack of the circuit structure recovery algorithms based on pattern match and Subgraph Isomorphism technology.And no matter any embedding strategy, it is by step 2) time input be original CNF formula S 1, Husk formula S 2, the solution Hr of Husk formula; Output obscure after new CNF formula S and variable mapping table M.
Strategy one: strategy one adopted embedding method 1., embedding method 3. with embedding method 4..Following embedding method 1., is original CNF formula S to be solved 1each clause adds word, and ensures original CNF formula S 1each clause's length is substantially suitable; Follow embedding method and 3. obtain new CNF formula S; Follow embedding method and 4. obtain variable mapping table M.
As shown in Figure 8, based on strategy one step 2) detailed step as follows:
A2.1) receive original CNF formula S to be solved 1, Husk formula S 2separate Hr with the Husk of Husk formula, obtain original CNF formula S 1in clause's average length AL;
A2.2) from original CNF formula S 1untreated clause C of middle taking-up is as current clause;
A2.3) separate Hr and obtain at random a word lit from Husk, will after word lit negate, add original CNF formula S to 1current clause C in;
A2.4) judge original CNF formula S 1all clauses whether be disposed, if be not yet disposed, redirect continue execution step A2.2); Otherwise, the CNF formula S that obtains all clauses and added word 1, redirect execution step A2.5);
A2.5) added the CNF formula S of word from all clauses 1untreated clause C of middle taking-up is as current clause;
A2.6) judge the length of current clause C | whether C| is less than original CNF formula S 1in clause's average length AL, if be less than clause's average length AL, redirect execution step A2.7), otherwise redirect execution step A2.8);
A2.7) separate and obtain at random one Hr and instead do not belong to the word lit in current clause C from Husk, by the CNF formula S of adding all clauses to after word lit negate and having added word 1in current clause C in;
A2.8) judge that all clauses have added the CNF formula S after word 1all clauses whether be disposed, if be not yet disposed, redirect continue execution step A2.5); Otherwise the CNF formula S that obtains all clauses and again add word 1, redirect execution step A2.9);
A2.9) all clauses are added again to the CNF formula S of word 1in variable var, Husk formula S 2in the variable var mixing of resequencing, recorded variable var and variable var affiliated original CNF formula S before rearrangement mixes for each variable var generates one 1or Husk formula S 2the list item of both mapping relations, finally obtains variable mapping table M;
A2.10) all clauses are added again to the CNF formula S of word 1, Husk formula S 2in clause's hybrid-sorting obtain having and original CNF formula S 1the new CNF formula S of different CNF structures;
A2.11) by variable mapping table M and new CNF formula S output.
Referring to abovementioned steps A2.1)~A2.11) known, strategy one adopted embedding method 1., embedding method 3. with embedding method 4., strategy one is a kind of method of obscuring of blindness, by add at random positive and negative word mode, revise randomly each clause, changed original CNF formula S 1the CNF mark of middle same class door, the inevitable identical fact, can effectively stop the attack of the circuit structure recovery algorithms detecting based on Subgraph Isomorphism, and it realizes simple, obscures expense little, is only linear complexity.It is fuzzy that strategy one shortcoming changes graph structure, not as strategy two and strategy three accurate, but a tactful advantage is that to obscure the spent time shorter, and can prevent from attacking based on the pattern match of CNF mark.
Strategy two: strategy two adopted embedding method 1., embedding method 2., embedding method 3. with embedding method 4..First in original CNF formula S 1crucial clause and output variable that middle detection is gone out; Follow embedding method 1., in original CNF formula S to be solved 1crucial clause in add Husk formula S 2variable var; Follow embedding method 2., for variable var and output character corresponding to crucial clause generate new clause, the written form of output character in new clause determined according to crucial clause; Follow embedding method and 3. obtain new CNF formula S; Follow embedding method and 4. obtain variable mapping table M.
As shown in Figure 9, based on strategy two step 2) detailed step as follows:
B2.1) receive original CNF formula S to be solved 1, Husk formula S 2separate Hr with the Husk of Husk formula; Detect and mark original CNF formula S 1in crucial clause and output variable, initialization clause S set 3for sky;
B2.2) from original CNF formula S 1untreated clause C of middle taking-up is as current clause;
B2.3) judge whether current clause C is crucial clause, if current clause C is crucial clause, redirect continues execution step B2.4); Otherwise redirect execution step B2.2);
B2.4) separate Hr and obtain at random a word lit from Husk, will after word lit negate, add original CNF formula S to 1current clause C in;
B2.5) obtain the output character olit of current clause C, by the new clause nC of value-olit combination results after the output character olit negate of word lit, current clause C, new clause nC is put into clause's S set 3in;
B2.6) judge original CNF formula S 1all clauses whether be disposed, if be not yet disposed, redirect continue execution step B2.2), otherwise, obtain all clauses and added the CNF formula S after word 1with the clause's S set being formed by new clause nC 3, redirect execution step B2.7);
B2.7) obtain Husk formula S 2in clause's average length AL;
B2.8) added the CNF formula S word from all clauses 1with the clause's S set being formed by new clause nC 3in the merging set forming, take out a untreated clause C as current clause;
Whether the length that B2.9) judges current clause C is less than Husk formula S 2in clause's average length AL, if be less than clause's average length AL, redirect continue execution step B2.10); Otherwise redirect execution step B2.8);
B2.10) from Husk solution Hr, obtain at random one and instead do not belong to the word lit in current clause C, added the CNF formula S after word by adding respectively all clauses after word lit negate to 1, clause's S set of being formed by new clause nC 3in corresponding current clause C;
B2.11) judge that all clauses have added the CNF formula S after word 1with the clause's S set being formed by new clause nC 3whether all clauses in the merging set forming are disposed, if be not yet disposed, redirect continues execution step B2.8), otherwise the CNF formula S that obtains all clauses and again add word 1clause's S set of having added word with clause 3, redirect execution step B2.12);
B2.12) all clauses are added again to the CNF formula S of word 1in variable var, Husk formula S 2in the variable var mixing of resequencing, recorded variable var and variable var affiliated original CNF formula S before rearrangement mixes for each variable var generates one 1or Husk formula S 2the list item of both mapping relations, finally obtains variable mapping table M;
B2.13) all clauses are added again to the CNF formula S of word 1, Husk formula S 2, clause's clause's S set of having added word 3in clause's hybrid-sorting obtain having and original CNF formula S 1the new CNF formula S of different CNF structures;
B2.14) by variable mapping table M and new CNF formula S output.
Referring to abovementioned steps B2.1)~B2.14) known, strategy two adopted embedding method 1., embedding method 2., embedding method 3. with embedding method 4., the CNF mark of a kind of is changed into another legal CNF mark pattern by strategy two, construct corresponding new clause for crucial clause, former CNF formula is changed into different but legal CNF formula is a kind of method that changes accurately graph structure; Owing to will analyze the architectural characteristic of CNF formula to be obscured, to determine crucial clause and output variable, greatly improve the detection difficulty of door in CNF, can realize door CNF mark amendment accurately.
Strategy three: strategy three also adopted embedding method 1., embedding method 2., embedding method 3. with embedding method 4., it be strategy one and strategy two mixing realization.First in original CNF formula S to be solved 1crucial clause and output variable that middle detection is gone out; Follow embedding method 1., sequentially toward original CNF formula S 1clause add word; In original CNF formula S 1in crucial clause in; According to crucial clause's type, follow embedding method 2. for adding original CNF formula S 1in variable var and output corresponding to keyword phrase C literary composition olit generate new clause, output character is determined according to crucial clause at new clause's written form; Follow embedding method 1., in formula S 1in clause and newly-generated clause, add word, until clause's length is substantially suitable; Follow embedding method and 3. obtain formula S; Follow embedding method and 4. obtain variable mapping table.
As shown in figure 10, based on strategy three step 2) detailed step as follows:
C2.1) receive original CNF formula S to be solved 1, Husk formula S 2separate Hr with the Husk of Husk formula; Detect and mark original CNF formula S 1in crucial clause and output variable, initialization clause S set 3for sky;
C2.2) from original CNF formula S 1untreated clause C of middle taking-up is as current clause;
C2.3) separate Hr and obtain at random a word lit from Husk, will after word lit negate, add original CNF formula S to 1current clause C in;
C2.4) judge whether current clause C is crucial clause, if current clause C is crucial clause, obtain the output character olit of current clause C, by the new clause nC of value-olit combination results after the output character olit negate of word lit, current clause C, new clause nC is put into clause's S set 3in;
C2.5) judge original CNF formula S 1all clauses whether be disposed, if be not yet disposed, redirect continue execution step C2.2), otherwise, obtain all clauses and added the CNF formula S after word 1with the clause's S set being formed by new clause nC 3, redirect execution step C2.6);
C2.6) obtain Husk formula S 2in clause's average length AL;
C2.7) added the CNF formula S word from all clauses 1with the clause's S set being formed by new clause nC 3in the merging set forming, take out a untreated clause C as current clause;
Whether the length that C2.8) judges current clause C is less than Husk formula S 2in clause's average length AL, if be less than clause's average length AL, redirect continue execution step C2.9); Otherwise redirect execution step C2.7);
C2.9) from Husk solution Hr, obtain at random one and instead do not belong to the word lit in current clause C, added the CNF formula S after word by adding respectively all clauses after word lit negate to 1, clause's S set of being formed by new clause nC 3in corresponding current clause C;
C2.10) judge that all clauses have added the CNF formula S after word 1with the clause's S set being formed by new clause nC 3whether all clauses in the merging set forming are disposed, if be not yet disposed, redirect continues execution step C2.7), otherwise the CNF formula S that obtains all clauses and again add word 1clause's S set of having added word with clause 3, redirect execution step C2.11);
C2.11) all clauses are added again to the CNF formula S of word 1in variable var, Husk formula S 2in the variable var mixing of resequencing, recorded variable var and variable var affiliated original CNF formula S before rearrangement mixes for each variable var generates one 1or Husk formula S 2the list item of both mapping relations, finally obtains variable mapping table M;
C2.12) all clauses are added again to the CNF formula S of word 1, Husk formula S 2, clause's clause's S set of having added word 3in clause's hybrid-sorting obtain having and original CNF formula S 1the new CNF formula S of different CNF structures;
C2.13) by variable mapping table M and new CNF formula S output.
Referring to abovementioned steps C2.1)~C2.13), strategy three also adopted embedding method 1., embedding method 2., embedding method 3. with embedding method 4., construct corresponding new clause for crucial clause, strategy three is one of the accurate change of a kind of handle and fuzzy change combination, it organically combines strategy one and strategy two, can make full use of the effect of obscuring of strategy one and strategy two, except construct new CNF formula for crucial clause, to all corrects of all clauses, the effect of obscuring is best, but the most time-consuming.
As shown in figure 11, the present embodiment performs step 4 by de-mapping device) detailed step as follows:
4.1) take out a untreated solution word lit as current solution word from obscuring to separate Or, judge whether current solution word lit is greater than 0, if be greater than 0, using the initial value of current solution word lit as variable var corresponding to current solution word lit, otherwise using after current solution word lit negate, as variable var corresponding to current solution word lit, (judgment expression is var=lit>0? lit:-lit);
4.3) use variable var that current solution word lit the is corresponding index as var territory in variable mapping table M, from variable mapping table M, take out corresponding real variable rvar, i.e. rvar=M[var] .var;
4.4) judge real variable rvar value M[rvar in formula territory in Corresponding matching list item in variable mapping table M] whether .formula be original CNF formula S 1(judge M[rvar] .formula==S 1whether set up), if (be M[rvar] .formula==S 1set up) represent that real variable rvar is labeled in variable mapping table M and map to original CNF formula S 1, redirect execution step 4.5); Otherwise (be M[rvar] .formula==S 1be false) represent that this real variable rvar is labeled and maps to Husk formula S in variable mapping table M 2, redirect execution step 4.6);
4.5) judge whether current solution word lit is greater than 0, if be greater than 0, real variable rvar is filled to assignment R[rvar corresponding to real variable rvar in primitive solution R] (be R[rvar]=rvar), otherwise will after real variable rvar negate, be filled to assignment R[rvar corresponding to real variable rvar in primitive solution R] (be R[rvar]=-rvar), the expression formula of above-mentioned judgement can be expressed as (R[rvar]=(lit>0? rvar:-rvar)); Redirect execution step 4.8);
4.6) judge whether current solution word lit is greater than 0, if current solution word lit is greater than 0, judge that real variable rvar, real variable rvar separate assignment Hr[rvar corresponding in Hr at Husk] whether consistent, redirect execution step 4.7); If current solution word lit is not more than 0, judge that value-rvar, the real variable rvar after real variable rvar negate separates assignment Hr[rvar corresponding in Hr at Husk] whether consistent, redirect execution step 4.7); The expression formula of above-mentioned judgement can be expressed as (Hr[rvar]==(lit>0? rvar:-rvar));
4.7) if separate assignment Hr[rvar corresponding in Hr with real variable rvar at Husk] consistent, redirect execution step 4.8); Otherwise judge that far-end server, to CNF formula data solving result mistake, reports an error (printout " erroneous results ") and exits;
4.8) judge whether all solution words of obscuring solution Or are disposed, if be not yet disposed, redirect execution step 4.1), otherwise it is complete to represent that primitive solution R has filled, and obtains obscuring primitive solution R corresponding to solution Or.
Above-mentioned steps 4.1)~4.8) be that a kind of demapping algorithm is specially the MAPPER algorithm with result verification, recover the solution vector R of primitive solution reality for the solution vector Or providing from cloud server.Wherein, step 4.6)~4.7) for the sampling Detection of carrying out to Partial Variable assignment, real variable rvar, real variable rvar are separated to assignment Hr[rvar corresponding in Hr at Husk] carry out sampling Detection, thereby realize the verification of correctness of cloud server result of calculation, guarantee that data are reliable.
The above is only the preferred embodiment of the present invention, and protection scope of the present invention is also not only confined to above-described embodiment, and all technical schemes belonging under thinking of the present invention all belong to protection scope of the present invention.It should be pointed out that for those skilled in the art, some improvements and modifications without departing from the principles of the present invention, these improvements and modifications also should be considered as protection scope of the present invention.

Claims (7)

1. SAT problem is calculated the CNF formula data guard method in outsourcing, it is characterized in that implementation step is as follows:
1) generate Husk formula S 2, described Husk formula S 2for the CNF formula that only has can meet solution, and described Husk formula S 2the assignment of separating variable is not full 0 or complete 1;
2) original CNF formula S to be solved in outsourcing will be calculated 1, described Husk formula S 2both with keep solution space do not become prerequisite obscure generate have and original CNF formula S 1the new CNF formula S of different CNF structures, and generation is used for recording original CNF formula S 1, Husk formula S 2the variable mapping table M of mapping relations between both and variable thereof, each list item in described variable mapping table M comprises var territory and Gong Liangge territory, formula territory, wherein var territory is used for storing original CNF formula S 1or Husk formula S 2in original variable name, the source of the corresponding variable name of formula domain representation; The original CNF formula S of the constant finger of described solution space 1, new CNF formula S can adopt identical SAT solver to solve and both solution between there is following relation: original CNF formula S 1can not meet new CNF formula S can not meet, otherwise new CNF formula S can not meet original CNF formula S 1can not meet, if original CNF formula S 1can meet new CNF formula S can meet, original CNF formula S 1solution can be by the solution of new CNF formula in original CNF formula S 1variables set on projection obtain; Described different CNF structure refers to original CNF formula S 1, the clause's set between new CNF formula S and the word set in clause all different;
3) use new CNF formula S be converted to CNF formula data and be outsourced to far-end server data to be solved, utilize existing SAT solver on far-end server to solve and obtain obscuring solution Or the CNF formula data of receiving;
4) for obscuring each the solution word lit separating in Or, take out and separate variable var corresponding to word lit, and from variable mapping table M, take out corresponding real variable rvar according to separating variable var corresponding to word lit, if this real variable rvar is labeled mapping from original CNF formula S in variable mapping table M 1, this real variable is filled to primitive solution R, finally obtain obscuring primitive solution R corresponding to solution Or.
2. SAT problem according to claim 1 is calculated the CNF formula data guard method in outsourcing, it is characterized in that described step 1) also comprise and generate Husk formula S 2husk separate the step of Hr; Described step 4) in when separating variable var corresponding to word lit take out corresponding real variable rvar from variable mapping table M, if this real variable rvar is labeled mapping from Husk formula S in variable mapping table M 2, this real variable rvar is separated to assignment Hr[rvar corresponding in Hr with described Husk] and compare checking, if verify inconsistently, judge that far-end server solves and makes mistakes CNF formula data, output error is also exited.
3. SAT problem according to claim 2 is calculated the CNF formula data guard method in outsourcing, it is characterized in that described step 1) the middle Husk formula S that generates 2detailed step as follows:
1.1) generate a prime number, adopt the form of binary vector to represent described prime number;
1.2) prime number described employing binary vector being represented is squared;
1.3) value after squared described prime number is as the output variable of multiplier and forbid that the input variable of multiplier equals 1, described multiplier is converted to CNF formula, this CNF formula be generate obtain only have one can meet that to separate and separate the assignment of variable be not the Husk formula S of full 0 or complete 1 2.
4. SAT problem according to claim 3 is calculated the CNF formula data guard method in outsourcing, it is characterized in that described step 4) detailed step as follows:
4.1) from described obscure to separate Or take out a untreated solution word lit as current solution word;
4.2) judge whether current solution word lit is greater than 0, if be greater than 0, using the initial value of current solution word lit as variable var corresponding to current solution word lit, otherwise using after current solution word lit negate as variable var corresponding to current solution word lit;
4.3) use variable var that described current solution word lit the is corresponding index as var territory in variable mapping table M, from described variable mapping table M, take out corresponding real variable rvar;
4.4) judge described real variable rvar value M[rvar in formula territory in Corresponding matching list item in variable mapping table M] whether .formula be original CNF formula S 1, if it is represent that described real variable rvar is labeled in variable mapping table M to map to original CNF formula S 1, redirect execution step 4.5); Otherwise represent that this real variable rvar is labeled and maps to Husk formula S in variable mapping table M 2, redirect execution step 4.6);
4.5) judge whether current solution word lit is greater than 0, if be greater than 0, described real variable rvar is filled to assignment R[rvar corresponding to real variable rvar in primitive solution R], otherwise will after described real variable rvar negate, be filled to assignment R[rvar corresponding to real variable rvar in primitive solution R]; Redirect execution step 4.8);
4.6) judge whether current solution word lit is greater than 0, if current solution word lit is greater than 0, judge that described real variable rvar, real variable rvar separate assignment Hr[rvar corresponding in Hr at described Husk] whether consistent, redirect execution step 4.7); If current solution word lit is not more than 0, judge that value-rvar, the real variable rvar after described real variable rvar negate separates assignment Hr[rvar corresponding in Hr at described Husk] whether consistent, redirect execution step 4.7);
4.7) if separate assignment Hr[rvar corresponding in Hr with real variable rvar at described Husk] consistent, redirect execution step 4.8); Otherwise judge that far-end server, to CNF formula data solving result mistake, reports an error and exits;
4.8) described in judgement, obscure and separate all solution words of Or and whether be disposed, if be not yet disposed, redirect execution step 4.1), otherwise it is complete to represent that primitive solution R has filled, and obtains obscuring separating primitive solution R corresponding to Or.
5. SAT problem according to claim 4 is calculated the CNF formula data guard method in outsourcing, it is characterized in that described step 2) detailed step as follows:
A2.1) receive original CNF formula S to be solved 1, Husk formula S 2separate Hr with the Husk of Husk formula, obtain original CNF formula S 1in clause's average length AL;
A2.2) from original CNF formula S 1untreated clause C of middle taking-up is as current clause;
A2.3) separate Hr and obtain at random a word lit from described Husk, will after described word lit negate, add original CNF formula S to 1current clause C in;
A2.4) judge original CNF formula S 1all clauses whether be disposed, if be not yet disposed, redirect continue execution step A2.2); Otherwise, the CNF formula S that obtains all clauses and added word 1, redirect execution step A2.5);
A2.5) added the CNF formula S of word from described all clauses 1untreated clause C of middle taking-up is as current clause;
A2.6) judge the length of current clause C | whether C| is less than described original CNF formula S 1in clause's average length AL, if be less than described clause's average length AL, redirect execution step A2.7), otherwise redirect execution step A2.8);
A2.7) separate and Hr, obtain at random one and instead do not belong to the word lit in current clause C from described Husk, by the CNF formula S of adding described all clauses to after described word lit negate and having added word 1in current clause C in;
A2.8) judge that described all clauses have added the CNF formula S after word 1all clauses whether be disposed, if be not yet disposed, redirect continue execution step A2.5); Otherwise the CNF formula S that obtains all clauses and again add word 1, redirect execution step A2.9);
A2.9) described all clauses are added again to the CNF formula S of word 1in variable var, Husk formula S 2in the variable var mixing of resequencing, recorded variable var and variable var affiliated original CNF formula S before rearrangement mixes for each variable var generates one 1or Husk formula S 2the list item of both mapping relations, finally obtains variable mapping table M;
A2.10) described all clauses are added again to the CNF formula S of word 1, Husk formula S 2in clause's hybrid-sorting obtain having and original CNF formula S 1the new CNF formula S of different CNF structures;
A2.11) by variable mapping table M and new CNF formula S output.
6. SAT problem according to claim 4 is calculated the CNF formula data guard method in outsourcing, it is characterized in that described step 2) detailed step as follows:
B2.1) receive original CNF formula S to be solved 1, Husk formula S 2separate Hr with the Husk of Husk formula; Detect and mark original CNF formula S 1in crucial clause and output variable, initialization clause S set 3for sky;
B2.2) from original CNF formula S 1untreated clause C of middle taking-up is as current clause;
B2.3) judge whether current clause C is crucial clause, if current clause C is crucial clause, redirect continues execution step B2.4); Otherwise redirect execution step B2.2);
B2.4) separate Hr and obtain at random a word lit from described Husk, will after described word lit negate, add original CNF formula S to 1current clause C in;
B2.5) obtain the output character olit of current clause C, by the new clause nC of value-olit combination results after the output character olit negate of described word lit, current clause C, described new clause nC is put into clause's S set 3in;
B2.6) judge original CNF formula S 1all clauses whether be disposed, if be not yet disposed, redirect continue execution step B2.2), otherwise, obtain all clauses and added the CNF formula S after word 1with the clause's S set being formed by new clause nC 3, redirect execution step B2.7);
B2.7) obtain Husk formula S 2in clause's average length AL;
B2.8) added the CNF formula S word from described all clauses 1with the clause's S set being formed by new clause nC 3in the merging set forming, take out a untreated clause C as current clause;
Whether the length that B2.9) judges current clause C is less than described Husk formula S 2in clause's average length AL, if be less than described clause's average length AL, redirect continue execution step B2.10); Otherwise redirect execution step B2.8);
B2.10) from described Husk solution Hr, obtain at random one and instead do not belong to the word lit in current clause C, added the CNF formula S after word by adding respectively all clauses after described word lit negate to 1, clause's S set of being formed by new clause nC 3in corresponding current clause C;
B2.11) judge that described all clauses have added the CNF formula S after word 1with the clause's S set being formed by new clause nC 3whether all clauses in the merging set forming are disposed, if be not yet disposed, redirect continues execution step B2.8), otherwise the CNF formula S that obtains all clauses and again add word 1clause's S set of having added word with clause 3, redirect execution step B2.12);
B2.12) described all clauses are added again to the CNF formula S of word 1in variable var, Husk formula S 2in the variable var mixing of resequencing, recorded variable var and variable var affiliated original CNF formula S before rearrangement mixes for each variable var generates one 1or Husk formula S 2the list item of both mapping relations, finally obtains variable mapping table M;
B2.13) described all clauses are added again to the CNF formula S of word 1, Husk formula S 2, clause's clause's S set of having added word 3in clause's hybrid-sorting obtain having and original CNF formula S 1the new CNF formula S of different CNF structures;
B2.14) by variable mapping table M and new CNF formula S output.
7. SAT problem according to claim 4 is calculated the CNF formula data guard method in outsourcing, it is characterized in that described step 2) detailed step as follows:
C2.1) receive original CNF formula S to be solved 1, Husk formula S 2separate Hr with the Husk of Husk formula; Detect and mark original CNF formula S 1in crucial clause and output variable, initialization clause S set 3for sky;
C2.2) from original CNF formula S 1untreated clause C of middle taking-up is as current clause;
C2.3) separate Hr and obtain at random a word lit from described Husk, will after described word lit negate, add original CNF formula S to 1current clause C in;
C2.4) judge whether current clause C is crucial clause, if current clause C is crucial clause, obtain the output character olit of current clause C, by the new clause nC of value-olit combination results after the output character olit negate of described word lit, current clause C, described new clause nC is put into clause's S set 3in;
C2.5) judge original CNF formula S 1all clauses whether be disposed, if be not yet disposed, redirect continue execution step C2.2), otherwise, obtain all clauses and added the CNF formula S after word 1with the clause's S set being formed by new clause nC 3, redirect execution step C2.6);
C2.6) obtain Husk formula S 2in clause's average length AL;
C2.7) added the CNF formula S word from described all clauses 1with the clause's S set being formed by new clause nC 3in the merging set forming, take out a untreated clause C as current clause;
Whether the length that C2.8) judges current clause C is less than described Husk formula S 2in clause's average length AL, if be less than described clause's average length AL, redirect continue execution step C2.9); Otherwise redirect execution step C2.7);
C2.9) from described Husk solution Hr, obtain at random one and instead do not belong to the word lit in current clause C, added the CNF formula S after word by adding respectively all clauses after described word lit negate to 1, clause's S set of being formed by new clause nC 3in corresponding current clause C;
C2.10) judge that described all clauses have added the CNF formula S after word 1with the clause's S set being formed by new clause nC 3whether all clauses in the merging set forming are disposed, if be not yet disposed, redirect continues execution step C2.7), otherwise the CNF formula S that obtains all clauses and again add word 1clause's S set of having added word with clause 3, redirect execution step C2.11);
C2.11) described all clauses are added again to the CNF formula S of word 1in variable var, Husk formula S 2in the variable var mixing of resequencing, recorded variable var and variable var affiliated original CNF formula S before rearrangement mixes for each variable var generates one 1or Husk formula S 2the list item of both mapping relations, finally obtains variable mapping table M;
C2.12) described all clauses are added again to the CNF formula S of word 1, Husk formula S 2, clause's clause's S set of having added word 3in clause's hybrid-sorting obtain having and original CNF formula S 1the new CNF formula S of different CNF structures;
C2.13) by variable mapping table M and new CNF formula S output.
CN201410292502.6A 2014-06-25 2014-06-25 CNF formula data protection method in SAT problem solving outsourcing process Active CN104123503B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201410292502.6A CN104123503B (en) 2014-06-25 2014-06-25 CNF formula data protection method in SAT problem solving outsourcing process

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201410292502.6A CN104123503B (en) 2014-06-25 2014-06-25 CNF formula data protection method in SAT problem solving outsourcing process

Publications (2)

Publication Number Publication Date
CN104123503A true CN104123503A (en) 2014-10-29
CN104123503B CN104123503B (en) 2017-02-15

Family

ID=51768911

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201410292502.6A Active CN104123503B (en) 2014-06-25 2014-06-25 CNF formula data protection method in SAT problem solving outsourcing process

Country Status (1)

Country Link
CN (1) CN104123503B (en)

Cited By (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106209774A (en) * 2016-06-24 2016-12-07 西安电子科技大学 The cloud service outsourcing access right control method obscured based on undistinguishable
CN107113160A (en) * 2014-12-22 2017-08-29 皇家飞利浦有限公司 What program was performed hides
CN107203707A (en) * 2016-03-16 2017-09-26 阿里巴巴集团控股有限公司 It is a kind of to realize the method and system that program code is obscured
CN108959959A (en) * 2018-06-15 2018-12-07 中国人民解放军国防科技大学 Data privacy protection method and system transparent to calculation
CN110826812A (en) * 2019-11-13 2020-02-21 南京航空航天大学 Target algorithm prediction method for Boolean satisfiability problem based on graph
CN111159628A (en) * 2019-12-31 2020-05-15 中国人民解放军国防科技大学 Hardware SAT solver for multi-thread parallel execution
CN112487740A (en) * 2020-12-23 2021-03-12 国微集团(深圳)有限公司 Boolean satisfiability problem solving method and system
CN114638162A (en) * 2022-03-18 2022-06-17 浙江大学 Method for solving SAT problem by combining CDCL solver and quantum annealer
CN117573556A (en) * 2023-12-05 2024-02-20 中国科学院软件研究所 Software assertion verification method, system and equipment based on incremental SMT problem solving
CN114638162B (en) * 2022-03-18 2024-08-27 浙江大学 Method for solving SAT problem by combining CDCL solver and quantum annealer

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1710567A (en) * 2005-07-07 2005-12-21 复旦大学 Sequential circuit equivalent testing and verifying
US7441216B1 (en) * 2008-03-31 2008-10-21 International Business Machines Corporation Applying CNF simplification techniques for SAT-based abstraction refinement

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1710567A (en) * 2005-07-07 2005-12-21 复旦大学 Sequential circuit equivalent testing and verifying
US7441216B1 (en) * 2008-03-31 2008-10-21 International Business Machines Corporation Applying CNF simplification techniques for SAT-based abstraction refinement

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
HIMANSHU JAIN等: "《Design Automation Conference,2009》", 31 July 2009 *
THOMAS RISTENPART等: "《CCS"09: Proceedings of the 16th ACM conference on Computer and communications security》", 30 November 2009 *

Cited By (16)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107113160A (en) * 2014-12-22 2017-08-29 皇家飞利浦有限公司 What program was performed hides
CN107113160B (en) * 2014-12-22 2020-05-15 皇家飞利浦有限公司 System, method and computer storage medium for hidden program execution
US10685096B2 (en) 2014-12-22 2020-06-16 Koninklijke Philips N.V. Hiding of a program execution
CN107203707A (en) * 2016-03-16 2017-09-26 阿里巴巴集团控股有限公司 It is a kind of to realize the method and system that program code is obscured
CN107203707B (en) * 2016-03-16 2020-05-12 阿里巴巴集团控股有限公司 Method and system for implementing program code confusion
CN106209774B (en) * 2016-06-24 2019-02-22 西安电子科技大学 The cloud service outsourcing access right control method obscured based on undistinguishable
CN106209774A (en) * 2016-06-24 2016-12-07 西安电子科技大学 The cloud service outsourcing access right control method obscured based on undistinguishable
CN108959959B (en) * 2018-06-15 2020-06-23 中国人民解放军国防科技大学 Data privacy protection method and system transparent to calculation
CN108959959A (en) * 2018-06-15 2018-12-07 中国人民解放军国防科技大学 Data privacy protection method and system transparent to calculation
CN110826812A (en) * 2019-11-13 2020-02-21 南京航空航天大学 Target algorithm prediction method for Boolean satisfiability problem based on graph
CN111159628A (en) * 2019-12-31 2020-05-15 中国人民解放军国防科技大学 Hardware SAT solver for multi-thread parallel execution
CN111159628B (en) * 2019-12-31 2022-09-13 中国人民解放军国防科技大学 Hardware SAT solver for multi-thread parallel execution
CN112487740A (en) * 2020-12-23 2021-03-12 国微集团(深圳)有限公司 Boolean satisfiability problem solving method and system
CN114638162A (en) * 2022-03-18 2022-06-17 浙江大学 Method for solving SAT problem by combining CDCL solver and quantum annealer
CN114638162B (en) * 2022-03-18 2024-08-27 浙江大学 Method for solving SAT problem by combining CDCL solver and quantum annealer
CN117573556A (en) * 2023-12-05 2024-02-20 中国科学院软件研究所 Software assertion verification method, system and equipment based on incremental SMT problem solving

Also Published As

Publication number Publication date
CN104123503B (en) 2017-02-15

Similar Documents

Publication Publication Date Title
CN104123503A (en) CNF formula data protection method in SAT problem solving outsourcing process
Pasquini et al. Eluding secure aggregation in federated learning via model inconsistency
Zhang et al. Identifying influential nodes in complex networks with community structure
CN102938767B (en) The fuzzy keyword search methodology that efficiently can verify that based on the outer packet system of cloud data
Gehrke et al. Crowd-blending privacy
Liu et al. Oracle-guided incremental SAT solving to reverse engineer camouflaged logic circuits
Hoffmann et al. Efficient zero-knowledge arguments in the discrete log setting, revisited
Seiller Interaction graphs: multiplicatives
Raikhlin et al. Reliable recognition of masked cartographic scenes during transmission over the network
Canetti et al. Obfuscating branching programs using black-box pseudo-free groups
Toda Hypergraph transversal computation with binary decision diagrams
Chakraborty et al. SAIL: Analyzing structural artifacts of logic locking using machine learning
Hu et al. Learning privacy-preserving graph convolutional network with partially observed sensitive attributes
Roux et al. Model-checking with edge-valued decision diagrams
Moreno et al. Tied Kronecker product graph models to capture variance in network populations
Bonnetain et al. Anomalies and vector space search: Tools for S-box analysis
Barrón-Romero Classical and quantum algorithms for the boolean satisfiability problem
Beullens et al. Obfuscating simple functionalities from knowledge assumptions
CN110162549A (en) A kind of fire data analysis method, device, readable storage medium storing program for executing and terminal device
Alanwar et al. Logical zonotopes: A set representation for the formal verification of boolean functions
Impagliazzo et al. An axiomatic approach to algebrization
Stibor et al. The link between r-contiguous detectors and k-CNF satisfiability
Anandan et al. Secure minimum weighted bipartite matching
Newman Property testing of massively parametrized problems–A survey
Drape Generalising the array split obfuscation

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant