JP2015108682A - Secrecy comparison method, program, and system - Google Patents

Secrecy comparison method, program, and system Download PDF

Info

Publication number
JP2015108682A
JP2015108682A JP2013250594A JP2013250594A JP2015108682A JP 2015108682 A JP2015108682 A JP 2015108682A JP 2013250594 A JP2013250594 A JP 2013250594A JP 2013250594 A JP2013250594 A JP 2013250594A JP 2015108682 A JP2015108682 A JP 2015108682A
Authority
JP
Japan
Prior art keywords
negative integer
elements
computer
common
secret
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.)
Pending
Application number
JP2013250594A
Other languages
Japanese (ja)
Inventor
裕司 山岡
Yuji Yamaoka
裕司 山岡
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.)
Fujitsu Ltd
Original Assignee
Fujitsu Ltd
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 Fujitsu Ltd filed Critical Fujitsu Ltd
Priority to JP2013250594A priority Critical patent/JP2015108682A/en
Publication of JP2015108682A publication Critical patent/JP2015108682A/en
Pending legal-status Critical Current

Links

Images

Abstract

PROBLEM TO BE SOLVED: To enable the comparison results of each other's to be known to each other without revealing the values of each other's in a secrecy comparison technique in order for two parties holding numeric data to know whether each other's values are close without revealing each other's values.SOLUTION: An element decomposition unit 102 (A, B) of a computer 100 (A, B) converts each of a first numeric value and a second numeric value which are the objects to be compared into a first set and a second set of elements each other's values of which can be compared for determination by the number of common elements. An encryption unit 103 (A, B) of the computer 100 (A, B) and a common element counting unit 109, etc., of a computer 100 (S) calculate, by secrecy calculation, the number of common elements in the first set and second set. A comparison result calculation unit 104 (A, B) of the computer 100 (A, B) converts the number of common elements into a comparison result and outputs the converted result.

Description

本発明は、秘匿比較方法、プログラム、およびシステムに関する。   The present invention relates to a secret comparison method, a program, and a system.

数値データ保持者2者が、互いの値を明かさず、互いの値が近いかどうか知りたい場合がある。   There are cases where two numerical data holders do not disclose their values and want to know whether their values are close.

たとえば、競合他社同士のA社とB社が、どちらもC社の製品やサービスを利用している場合、その利用価格が同程度か両者共に知りたい、ただし同程度でないときは互いの利用価格は教えたくない、という場合を考える。   For example, if Company A and Company B, both competitors, use the products and services of Company C, they would like to know whether the usage price is the same or both, but if they are not the same, the usage price of each other Suppose you don't want to teach.

以降ではそれぞれの数値を rA, rB とする。たとえば、A社の利用価格が50,000円なら、rA=50000 となる。 In the following, the numerical values are denoted as r A and r B , respectively. For example, if the usage price of Company A is 50,000 yen, r A = 50000.

両社は競合他社同士なので、自社が正しい答えが得られる限り、他社にはできるだけ自社情報を提供したくないとする。よって、たとえばA社がB社にrAを教え、B社がA社にrAとrBが同程度か教える、といった単純な方法は成り立たない。なぜなら、B社はA社に本当の情報を教える動機がなく、でたらめな情報を教える方がrBについての情報を漏らさずに済むからである。また、rAとrBが同程度でないとしても、rAの正確な値がB社に伝わってしまうのも問題である。 Since both companies are competitors, as long as they can get the right answer, they want to provide as little information as possible to other companies. Thus, for example, tell the r A A company to company B, company B teach r A and r B is whether the same degree in Company A, does not hold a simple methods such as. This is because, B company is because there is no incentive to teach the truth of the information in Company A, who teach the bogus information that it is not necessary to divulge information about the r B. Even if r A and r B are not comparable, it is also a problem that the correct value of r A is transmitted to B company.

従来から、クライアントは自身の入力を漏らさず、サーバは自身の関数を漏らさず、クライアントが入力に対する関数出力を取得できる、SFE(Secure Function Evaluation、秘匿関数評価)という方法がある(例えば非特許文献1)。   Conventionally, there is a method called SFE (Secure Function Evaluation) in which the client does not leak its own input, the server does not leak its own function, and the client can obtain the function output for the input (for example, non-patent literature) 1).

このSFEを使うと、B社が、入力がrBと同程度であるか判定する関数を用意することで、A社は自社の情報を知らせずにrAとrBが同程度か知ることができる、というシステムを構築することができる。たとえば、B社が関数 f(x) = (rB-d < x < rB+d) (d=10,000 など)を用意してサーバとなり、A社がクライアントとなれば、A社はrAをB社に知らせずに、B社は f(x) をA社に知らせずに、A社が f(rA) (つまり、rA が rB±d 以内か)を得られるようにすることができる。 With this SFE, B company, input is by preparing a determining function or about the same as the r B, A Company is r A and r B to know whether the same degree without informing the information of its own Can be built. For example, if company B prepares a function f (x) = (r B -d <x <r B + d) (d = 10,000, etc.) and becomes company A, then client A becomes r A Without letting B know, B wants to get f (r A ) (ie, r A is within r B ± d) without telling f (x) to A be able to.

しかし、この方法では、B社が何も情報を得られないという問題がある。A社は既に正しい答えを得ており、B社に正しい結果を教えてあげる動機がない。   However, this method has a problem that Company B cannot obtain any information. Company A has already obtained the correct answer and has no motivation to tell Company B the correct result.

他に、関数を限定することで準同型暗号を使い計算を高速化する技術などはあるが、この問題の解決はされていない(例えば特許文献1)。   In addition, there is a technique for speeding up the calculation using homomorphic encryption by limiting functions, but this problem has not been solved (for example, Patent Document 1).

また、他者と結託をしないことを前提とした第三者を介すことで、2者の値が同程度か判定する方法がある(例えば特許文献2)。   In addition, there is a method for determining whether or not the values of the two parties are approximately the same by using a third party on the premise that they do not collide with others (for example, Patent Document 2).

この方法では2者が乱数を共有し、それを使って暗号化することで、第三者には値がわからないようにする。この暗号化は準同型性を有するものを使い、第三者は暗号化されたまま元の値が一致しているか判定できるようにする。   In this method, the two parties share a random number and encrypt it using it, so that the value cannot be understood by a third party. This encryption uses homomorphism, and a third party can determine whether or not the original values match while being encrypted.

しかし、その第三者が一方と結託として乱数を知ることで、もう一方の値を(総当たりにより)知ることができてしまう。たとえば、A社が第三者と結託することでrBを知る事ができ正しい情報を得ることができるので、A社はB社のために正しいrAを使う動機がなくなり、B社だけが正しい情報を得られなくなる。 However, if the third party knows the random number as a collusion with one, the other value can be known (by brute force). For example, since Company A it is possible to obtain the correct information it is possible to know the r B by collusion with a third party, A company there is no incentive to use the correct r A for Company B, only Company B The correct information cannot be obtained.

これらのように、準同型暗号は暗号化されたまま計算ができるが、2者のうち秘密鍵(復号鍵)を(必要なら結託をして)入手できる者が一方的に有利になってしまうという問題がある。   As described above, homomorphic encryption can be calculated while encrypted, but one of the two who can obtain a private key (decryption key) (by collusion if necessary) is unilaterally advantageous. There is a problem.

一方、互いに自身の秘密鍵で暗号化する上、暗号化されたまま一致判定をできるようにする方法がある(例えば非特許文献2)。   On the other hand, there is a method of performing a match determination while encrypting each other with its own private key (for example, Non-Patent Document 2).

この方法は、互いの集合を明かさず、互いの集合の共通要素の数を互いに得るために有用である。まず、ステップ1として、互いに秘密鍵を用意し、自身の集合の各要素を暗号化して相手に送信する。ここで、暗号化は可換鍵付ハッシュ関数により行う。たとえば h(k, m) = mk mod p (k は鍵、m は要素の値、p は両者で予め共有した適当な自然数)という関数である。ステップ2として、受信した各要素を同様に暗号化し、(要素順序をランダムにして)送信する。ステップ3として、受信した集合と、ステップ2で暗号化した後の集合の、共通要素数を計算する。これにより、自身の秘密鍵を知らない任意の者から自身のデータを秘密にしつつ、相手の集合との共通要素数を計算できる。 This method is useful for obtaining each other the number of common elements of each other's set without revealing each other's set. First, as Step 1, secret keys are prepared for each other, and each element of its own set is encrypted and transmitted to the other party. Here, encryption is performed by a hash function with a commutative key. For example, h (k, m) = m k mod p (k is a key, m is an element value, and p is an appropriate natural number shared in advance by both). In step 2, each received element is similarly encrypted and transmitted (with the element order being random). In step 3, the number of common elements between the received set and the set encrypted in step 2 is calculated. This makes it possible to calculate the number of common elements with the other party set while keeping the own data secret from an arbitrary person who does not know his secret key.

しかし、この方法は互いの集合の共通要素の数を知ることしかできず、互いの数値が同程度かを知ることはできない。また、ステップ2で正しい値を送信する動機がない(でたらめな値を送っても、自分は正しい情報を得られる)という問題がある。   However, this method can only know the number of common elements in each other's set, and cannot know whether the numbers are similar. There is also a problem that there is no motivation to transmit a correct value in Step 2 (the user can obtain correct information even if a random value is transmitted).

以上のように、従来技術では、数値データ保持者2者が、結託されても自身の値が知られないようにしながら、互いの値が近いかどうか知ることはできなかった。   As described above, in the prior art, the two numerical data holders cannot know whether their values are close to each other while preventing their own values from being known even if they are collaborated.

特開2011−114392号公報JP 2011-114392 A 特開2010−237653号公報JP 2010-237653 A

Andrew C. Yao. Protocols for Secure Computations. Proceedings of 23rd Annual Symposium on Foundations of Computer Science (FOCS 1982), IEEE Computer Society, pp.160-164, 1982.Andrew C. Yao. Protocols for Secure Computations.Proceedings of 23rd Annual Symposium on Foundations of Computer Science (FOCS 1982), IEEE Computer Society, pp.160-164, 1982. Rakesh Agrawal, Alexandre Evfimievski, and Ramakrishnan Srikant. Information Sharing Across Private Databases. Proceedings of the 2003 ACM SIGMOD International Conference on Management of Data, pp.86-97, 2003.Rakesh Agrawal, Alexandre Evfimievski, and Ramakrishnan Srikant.Information Sharing Across Private Databases.Proceedings of the 2003 ACM SIGMOD International Conference on Management of Data, pp.86-97, 2003.

そこで、本発明の1つの側面では、互いの値を明かさず、互いの値の比較結果を、互いに取得することを可能にすることを目的とする。   Therefore, an object of one aspect of the present invention is to make it possible to obtain a comparison result of each other's values without revealing each other's values.

態様の一例では、比較対象の第1の数値および第2の数値をそれぞれ、互いの数値を共通要素数により比較判定可能な要素の第1の集合および第2の集合に変換し、第1の集合および第2の集合の共通要素数を秘匿計算で算出し、算出した第1の集合および第2の集合の共通要素数を比較し、比較結果を出力する、処理を含む。   In an example of the aspect, the first numerical value and the second numerical value to be compared are respectively converted into a first set and a second set of elements that can be compared and determined by the number of common elements. The processing includes calculating the number of common elements of the set and the second set by a secret calculation, comparing the calculated number of common elements of the first set and the second set, and outputting a comparison result.

互いの値を明かさず、互いの値の比較結果を取得することが可能となる。   It becomes possible to obtain a comparison result of each other's value without revealing each other's value.

本実施形態の構成例を示す図である。It is a figure which shows the structural example of this embodiment. 要素分解部が実行する非負整数の分解の処理例を示すフローチャートである。It is a flowchart which shows the process example of the decomposition | disassembly of the nonnegative integer which an element decomposition | disassembly part performs. 暗号化部が実行する暗号化およびシャッフルの処理例を示すフローチャートである。It is a flowchart which shows the example of a process of the encryption and shuffle which an encryption part performs. 比較結果算出部が実行する比較結果算出の処理例を示すフローチャートである。It is a flowchart which shows the process example of the comparison result calculation which a comparison result calculation part performs. 比較結果算出部が実行するリストMの変換の処理例を示すフローチャートである。It is a flowchart which shows the process example of conversion of the list | wrist M which a comparison result calculation part performs. 比較結果算出部が実行する大小判定の処理例を示すフローチャートである。It is a flowchart which shows the process example of the magnitude determination which a comparison result calculation part performs. 本実施形態における3つのコンピュータ間の処理関係の例を示すシーケンス図である。It is a sequence diagram which shows the example of the processing relationship between three computers in this embodiment. 本実施形態のシステムを実現可能なハードウェアシステムの構成図である。It is a block diagram of the hardware system which can implement | achieve the system of this embodiment.

以下、本発明を実施するための形態について図面を参照しながら詳細に説明する。
本発明の実施形態は、数値データ保持者2者が、それぞれ自身の数値を共通要素数により比較判定可能な集合に変換し、共通要素数を秘匿計算で算出し、それぞれがその結果を変換して比較結果を得る方式である。
Hereinafter, embodiments for carrying out the present invention will be described in detail with reference to the drawings.
In the embodiment of the present invention, two numerical data holders convert their numerical values into sets that can be compared and determined by the number of common elements, calculate the number of common elements by a secret calculation, and each converts the result. This is a method for obtaining a comparison result.

本発明の実施形態として、ソフトウェアで実現したものについて説明する。   An embodiment realized by software will be described as an embodiment of the present invention.

本実施形態への入力は、次の通りである。
・数値rx
・暗号鍵kx
・共有の変換方法 f(r)
・共有のビット長b
・共有の暗号化方法 h(k, m)
The input to this embodiment is as follows.
・ Numeric r x
・ Encryption key k x
-Share conversion method f (r)
-Shared bit length b
・ Shared encryption method h (k, m)

rxはA社およびB社が保持するそれぞれの秘密の数値である。xはAかBで、それぞれA社とB社のデータであることをあらわす。たとえば、rAはA社の保持する数値である。 r x is a secret numerical value held by each of A company and B company. x is A or B, which represents the data of Company A and Company B, respectively. For example, r A is a numerical value held by company A.

kxはそれぞれの秘密の暗号鍵である。たとえば、kAはA社のみが知る暗号鍵である。
f(r)はA社とB社で共有の、実数から非負整数への変換方法である。
k x is each secret encryption key. For example, k A is an encryption key that only company A knows.
f (r) is a conversion method from a real number to a non-negative integer shared by A company and B company.

b は共有のビット長である。
h(k, m) は共有の暗号化方法であり、可換鍵付ハッシュ関数である。
b is the shared bit length.
h (k, m) is a shared encryption method and a hash function with a commutative key.

本実施形態の出力は、次の通りである。
・相手の数値の範囲 Rx
The output of this embodiment is as follows.
• The opponent's numerical range R x .

A社は、B社の数値の範囲RBを知ることができる。同様に、B社はRAを知ることができる。また、お互いの数値が近いほどRの範囲が狭くなる。 Company A can know the value range RB of Company B. Similarly, Company B can know RA . Also, the closer the values are, the narrower the range of R.

図1は、本実施形態に係る秘匿比較システムの構成例を示す図である。
A社のデータを保持している計算機を100(A)とし、B社のデータを保持している計算機を100(B)とする。
FIG. 1 is a diagram illustrating a configuration example of a secret comparison system according to the present embodiment.
Assume that the computer holding the data of company A is 100 (A), and the computer holding the data of company B is 100 (B).

以降では、例として rA=50000, rB=30000 を用いて説明する。
まず、適当な時期に、変換方法f(r)とビット長 b そして暗号化方法 h(k, m) を、計算機100(A)と100(B)の間で何らかの手段で予め決め、共有しておく。たとえば、A社とB社の社員同士が話し合って決める。また、計算機100(S)が両社員にコミュニケーション支援サービスを提供しても良い。
In the following description, r A = 50000 and r B = 30000 will be described as an example.
First, at an appropriate time, the conversion method f (r), bit length b, and encryption method h (k, m) are determined in advance by some means between the computers 100 (A) and 100 (B) and shared. Keep it. For example, the employees of Company A and Company B will discuss and decide. Further, the computer 100 (S) may provide a communication support service to both employees.

変換方法f(r)には、たとえば次の式を使う。
nx=f(rx)=floor(srx+t)
ここで、floor(x) は床関数である。
例として、s=1/10000, t=0 とする。このとき、nA=5, nB=3 となる。
For example, the following equation is used for the conversion method f (r).
n x = f (r x ) = floor (sr x + t)
Where floor (x) is a floor function.
As an example, s = 1/10000 and t = 0. At this time, n A = 5 and n B = 3.

また、len(x) を非負整数の2進数表現の長さを返す関数とすると、b≧max(len(nA), len(nB)) が必要である。よって、本例では、b≧max(len(5), len(3))=max(len(1012), len(112))=max(3, 2)=3 である。 If len (x) is a function that returns the length of a non-negative integer binary number, b ≧ max (len (n A ), len (n B )) is required. Therefore, in this example, b ≧ max (len (5), len (3)) = max (len (101 2 ), len (11 2 )) = max (3, 2) = 3.

また、例として、b=4 、h(k, m)=mkmod p (p は非特許文献2に記載されているような適当な自然数)とする。 For example, b = 4 and h (k, m) = m k mod p (p is an appropriate natural number as described in Non-Patent Document 2).

計算機100(A)または計算機100(B)は、記憶部101(A)または101(B)、要素分解部102(A)または102(B)、暗号化部103(A)または103(B)、比較結果算出部104(A)または104(B)、および通信部105(A)または105(B)を備える。   The computer 100 (A) or the computer 100 (B) includes a storage unit 101 (A) or 101 (B), an element decomposition unit 102 (A) or 102 (B), an encryption unit 103 (A) or 103 (B) The comparison result calculation unit 104 (A) or 104 (B) and the communication unit 105 (A) or 105 (B) are provided.

計算機100(S)は、記憶部106、データ転送部107、集合受付部108、共通要素数計上部109、結果出力部110、および通信部105(S)を備える。   The computer 100 (S) includes a storage unit 106, a data transfer unit 107, a set reception unit 108, a common element number counting unit 109, a result output unit 110, and a communication unit 105 (S).

記憶部101(A)、102(B)、および106は、本実施形態で使用される入力値、途中経過値、出力値等を記憶する。また、図2〜図6のフローチャートで示される各処理の制御プログラムを記憶する。
その他の部分については、以下の説明で詳述する。
The storage units 101 (A), 102 (B), and 106 store input values, intermediate progress values, output values, and the like used in the present embodiment. Moreover, the control program of each process shown by the flowchart of FIGS. 2-6 is memorize | stored.
Other portions will be described in detail in the following description.

以上の構成を有する本実施形態の詳細な動作について、以下に説明する。   The detailed operation of the present embodiment having the above configuration will be described below.

本実施形態に係る図1の秘匿比較システムは、次のような処理を実施する。計算機100(A)、100(B)という別の場所の2つの整数値を、n次接頭辞配列(上位ビットから1ビットずつシフトして分解した配列)に分解してできる各列を、奇数か偶数かにより1を加算、また減算した配列を作成し、得られた2つの配列をそれぞれ暗号化する。そして、第三者である計算機100(S)が暗号化した配列同士を比較することにより整数の一致度である共通要素数を計算する。計算機100(A)、100(B)は、この共通要素数を受け取ることにより、比較結果に変換して出力する。   The secret comparison system of FIG. 1 according to the present embodiment performs the following processing. Computers 100 (A) and 100 (B) are separated from two integer values in different places into n-th order prefix arrays (arrays shifted by 1 bit at a time from the higher bits) Create an array with 1 added or subtracted depending on whether it is an even number or not, and encrypt the resulting two arrays. Then, the third party computer 100 (S) compares the encrypted sequences to calculate the number of common elements that is an integer matching degree. The computers 100 (A) and 100 (B) receive the number of common elements, convert it into a comparison result, and output it.

要素分解部102(A)および102(B)は、入力 rx を要素へ分解する。より詳細には、非負整数nxへの変換と、要素への分解をおこなう。 The element decomposition units 102 (A) and 102 (B) decompose the input r x into elements. More specifically, it performs a conversion to non-negative integer n x, the degradation of the element.

非負整数nxへの変換は上記の通り、rxにf(r)を適用することでおこなう。
続いて、計算機100(A)と計算機100(B)それぞれで、非負整数nxを、bを使って同じ方法により分解する。
Conversion to non-negative integer n x are as defined above, carried out by applying f (r) to the r x.
Then, they decomposed in the computer 100 (A) and each computer 100 (B), a non-negative integer n x, by the same method b. Use

図2は、図1の要素分解部102(102(A)または102(B))が実行する、分解の処理例を示すフローチャートである。各ステップについて計算機100(B)での処理例を説明する。   FIG. 2 is a flowchart showing an example of the disassembly process executed by the element disassembly unit 102 (102 (A) or 102 (B)) in FIG. An example of processing in the computer 100 (B) for each step will be described.

n=nB=3、b=4 を入力として受け入れる(図2のステップS1)。
nの、長さbの2進数表現の、接頭辞配列を格納したリストLを作成する(図2のステップS2)。接頭辞配列とは、文字列についての、先頭文字を含む全ての部分文字列であり、上位ビットから1ビットずつシフトして分解した配列をいう。n=3=00112 であるため、L=[0011, 001, 00, 0]となる。
n = n B = 3 and b = 4 are accepted as inputs (step S1 in FIG. 2).
A list L storing a prefix array of n in binary representation of length b is created (step S2 in FIG. 2). The prefix array is an all partial character string including the first character of the character string, and refers to an array that is decomposed by shifting bit by bit from the upper bits. Since n = 3 = 0011 2 , L = [0011, 001, 00, 0].

i=0 を用意する(図2のステップS3)。
i<b か否かを判定する(図2のステップS4)。
いま、b=4 であり i<b なので、図2のステップS4の判定がYESとなって、ステップS5に制御を移す。
i = 0 is prepared (step S3 in FIG. 2).
It is determined whether i <b (step S4 in FIG. 2).
Now, since b = 4 and i <b, the determination in step S4 in FIG. 2 is YES, and the control is transferred to step S5.

iを1増やし、i=1 となる(図2のステップS5)。
Lのi番目の要素をコピーし、e=0011 となる(図2のステップS6)。
i is incremented by 1 and i = 1 (step S5 in FIG. 2).
The i-th element of L is copied, and e = 0011 (step S6 in FIG. 2).

eの最下位ビットが0か否かを判定する(図2のステップS7)。
いま、eの最下位ビットは1でステップS7の判定はNOであるため、図2のステップS12に制御を移す。
It is determined whether or not the least significant bit of e is 0 (step S7 in FIG. 2).
Now, since the least significant bit of e is 1 and the determination in step S7 is NO, control is transferred to step S12 in FIG.

eを1増やし、e=0100 となる(図2のステップS12)。なお、このとき、文字列長を保持したまま計算する。   e is increased by 1, and e = 0100 is obtained (step S12 in FIG. 2). At this time, calculation is performed while maintaining the character string length.

eの全ビットが0か否かを判定する(図2のステップS13)。
いま、eには1のビットが含まれステップS13の判定はNOであるため、ステップS11に制御を移す。
It is determined whether or not all the bits of e are 0 (step S13 in FIG. 2).
Since e includes 1 bit and the determination in step S13 is NO, control is transferred to step S11.

eをLの末尾に追加する(図2のステップS11)。結果、L=[0011, 001, 00, 0, 0100]となる。その後、図2のステップS4に制御を移す。   e is added to the end of L (step S11 in FIG. 2). As a result, L = [0011, 001, 00, 0, 0100]. Thereafter, control is passed to step S4 in FIG.

i=1, b=4 であり i<b で図2のステップS4の判定はYESなので、ステップS5に制御を移す。同様にステップS14まで繰り返し、i=2の状態になる。このとき、L=[0011, 001, 00, 0, 0100, 010] である。本ステップに再度戻ったときには i=2, b=4 であり i<b でステップS4の判定はYESなので、ステップS5に制御を移す。   Since i = 1 and b = 4 and i <b and the determination in step S4 in FIG. 2 is YES, control is transferred to step S5. Similarly, the process is repeated until step S14, and i = 2 is obtained. At this time, L = [0011, 001, 00, 0, 0100, 010]. When returning to this step again, since i = 2 and b = 4 and i <b and the determination in step S4 is YES, control is transferred to step S5.

iを1増やし、i=3 となる(図2のステップS5)。
Lのi番目の要素をコピーし、e=00 となる(図2のステップS6)。
i is increased by 1, i = 3 (step S5 in FIG. 2).
The i-th element of L is copied and e = 00 (step S6 in FIG. 2).

eの最下位ビットは0なので図2のステップS7の判定はYESとなり、ステップS8に制御を移す。   Since the least significant bit of e is 0, the determination in step S7 in FIG. 2 is YES, and control is transferred to step S8.

eを1減らし、e=11 となる(図2のステップS8)。なお、このとき、文字列長を保持したまま計算する。これは、アンダーフローを起こした結果である。   e is decreased by 1 and e = 11 (step S8 in FIG. 2). At this time, calculation is performed while maintaining the character string length. This is a result of underflow.

Eの全ビットが1であるか否かを判定する(図2のステップS9)。
いま、eの全ビットが1なのでステップS9の判定はYESとなり、図2のステップS10に制御を移す。
It is determined whether or not all the bits of E are 1 (step S9 in FIG. 2).
Now, since all the bits of e are 1, the determination in step S9 is YES, and control is transferred to step S10 in FIG.

eにパディングをし、e=00111 となる(図2のステップS10)。パディングは、本実施形態では、まず先頭に1を追加し、さらに全体長がb+1になるまで0を追加する、という方式を使用する。一般的には、パディングされたか判別でき、単射な方式ならどのようなものでも良い。本実施形態の方式は、全体長がb+1の場合のみパディングされていることがわかり、その場合ははじめの1までがパディングなので単射である。   The padding is performed on e, so that e = 00111 (step S10 in FIG. 2). In the present embodiment, padding uses a method in which 1 is first added to the head and 0 is further added until the overall length becomes b + 1. In general, it can be discriminated whether it is padded, and any type of injection is acceptable. It can be seen that the method of this embodiment is padded only when the overall length is b + 1, and in this case, the first 1 is padded so that it is injection.

eをLの末尾に追加する(図2のステップS11)。その結果、L=[0011, 001, 00, 0, 0100, 010, 00111]となる。その後、図2のステップS4に制御を移す。   e is added to the end of L (step S11 in FIG. 2). As a result, L = [0011, 001, 00, 0, 0100, 010, 00111]. Thereafter, control is passed to step S4 in FIG.

i=3, b=4 であり i<b なのでステップS4の判定はYESとなり、ステップS5に制御を移す。同様にステップS14まで繰り返し、i=4の状態になる。このとき、L=[0011, 001, 00, 0, 0100, 010, 00111, 00011] である。本ステップに再度戻ったときには i=b=4 なのでステップS4の判定はNOとなり、図2のステップS14に制御を移す。   Since i = 3 and b = 4 and i <b, the determination in step S4 is YES, and the control is transferred to step S5. Similarly, the process is repeated until step S14, and i = 4. At this time, L = [0011, 001, 00, 0, 0100, 010, 00111, 00011]. When i = b = 4 again when returning to this step, the determination in step S4 is NO, and the control is transferred to step S14 in FIG.

Lを出力する(図2のステップS14)。つまり、LB=[0011, 001, 00, 0, 0100, 010, 00111, 00011] である。 L is output (step S14 in FIG. 2). That is, L B = [0011, 001, 00, 0, 0100, 010, 00111, 00011].

同様に、計算機100(A)において、nA=5 は、LA=[0101, 010, 01, 0, 0110, 001, 10, 00011] と分解される。 Similarly, in the computer 100 (A), n A = 5 is decomposed as L A = [0101, 010, 01, 0, 0110, 001, 10, 00011].

次に、互いの集合を明かさず、互いの集合の共通要素の数を互いに得る方法を使い、LAとLBの共通要素数を互いに得る。 Next, the number of common elements of L A and L B is obtained from each other by using the method of obtaining the number of common elements of each other's set without revealing each other's set.

本実施形態では、次のように行う。
まず、Lの各要素を非負整数に変換する。単射であることが必要であり、たとえば、各要素の先頭に"1"を追加して2進数とみなすことで実現できる。
In the present embodiment, this is performed as follows.
First, each element of L is converted to a non-negative integer. It is necessary to be injective. For example, it can be realized by adding "1" to the beginning of each element and considering it as a binary number.

たとえば、LAを変換すると、LA=[101012, 10102, 1012, 102, 101102, 10012, 1102, 1000112]=[21, 10, 5, 2, 22, 9, 6, 35] となる。同様に、LB=[100112, 10012, 1002, 102, 101002, 10102, 1001112, 1000112]=[19, 9, 4, 2, 20, 10, 39, 35] となる。 For example, when L A is converted, L A = [10101 2 , 1010 2 , 101 2 , 10 2 , 10110 2 , 1001 2 , 110 2 , 100011 2 ] = [21, 10, 5, 2, 22, 9, 6, 35]. Similarly, L B = [10011 2 , 1001 2 , 100 2 , 10 2 , 10100 2 , 1010 2 , 100111 2 , 100011 2 ] = [19, 9, 4, 2, 20, 10, 39, 35] Become.

次に、図1の暗号化部103(103(A)または103(B))で、リストLの各要素を暗号化し、シャッフルして送信する。   Next, the encryption unit 103 (103 (A) or 103 (B)) in FIG. 1 encrypts each element of the list L, shuffles it, and transmits it.

図3は、図1の暗号化部103(103(A)または103(B))が実行する、暗号化およびシャッフルの処理例を示すフローチャートである。各ステップについて計算機100(A)での処理を説明する。   FIG. 3 is a flowchart showing an example of encryption and shuffle processing executed by the encryption unit 103 (103 (A) or 103 (B)) of FIG. A process in the computer 100 (A) will be described for each step.

鍵k=kA、暗号化方法 h(k, m)、リストL=LAを入力として受け入れる(図3のステップS1)。 The key k = k A , the encryption method h (k, m), and the list L = L A are accepted as input (step S1 in FIG. 3).

Lの各要素を暗号化したリストL'を作成する(図3のステップS2)。よって、LA'=[h(kA, 21), h(kA, 10), h(kA, 5), h(kA, 2), h(kA, 22), h(kA, 9), h(kA, 6), h(kA, 35)] となる。 A list L ′ obtained by encrypting each element of L is created (step S2 in FIG. 3). Therefore, L A '= (h (k A , 21), h (k A , 10), h (k A , 5), h (k A , 2), h (k A , 22), h (k A , 9), h (k A , 6), h (k A , 35)].

0以上8(Lの要素数)未満の各整数値をランダムに並べたリストMを作成する(図3のステップS3)。これをM1とする。たとえば、MA1=[2, 6, 7, 0, 3, 1, 4, 5] を作る。 A list M in which integer values of 0 or more and less than 8 (the number of elements of L) are randomly arranged is created (step S3 in FIG. 3). This is referred to as M 1. For example, make M A1 = [2, 6, 7, 0, 3, 1, 4, 5].

L'[i] に、元の L'[M[i]] を再格納する(図3のステップS4)。ここで、L[i] はLのi+1番目の要素の意味である。つまり、たとえばLA' の最初(1番目)の要素には、LA'[MA1[0]]=LA'[2]=h(kA, 5) が再格納される。全ての要素についてこれが行われ、LA'=[h(kA, 5), h(kA, 6), h(kA, 35), h(kA, 21), h(kA, 2), h(kA, 10), h(kA, 22), h(kA, 9)] となる。 The original L ′ [M [i]] is re-stored in L ′ [i] (step S4 in FIG. 3). Here, L [i] means the i + 1-th element of L. That is, for example, 'The elements of the first (1st) of, L A' L A [M A1 [0]] = L A '[2] = h (k A, 5) is re-stored. This is done for all elements and L A '= [h (k A , 5), h (k A , 6), h (k A , 35), h (k A , 21), h (k A , 2), h (k A , 10), h (k A , 22), h (k A , 9)].

MA1, LA' を出力する(図3のステップS5)。
同様に、計算機100(B)では、たとえば MB1=[1, 6, 4, 2, 0, 3, 7, 5] が作成され、それと LB'=[h(kB, 9), h(kB, 39), h(kB, 20), h(kB, 4), h(kB, 19), h(kB, 2), h(kB, 35), h(kB, 10)] が出力される。
M A1 and L A ′ are output (step S5 in FIG. 3).
Similarly, in computer 100 (B), for example, M B1 = [1, 6, 4, 2, 0, 3, 7, 5] is created, and L B '= [h (k B , 9), h (k B , 39), h (k B , 20), h (k B , 4), h (k B , 19), h (k B , 2), h (k B , 35), h (k B , 10)] is output.

計算機100(A)はLA'を計算機100(B)に、計算機100(B)はLB'を計算機100(A)に、通信部105(A)および105(B)を介して送信する。このとき、直接送信せず、計算機100(S)に仲介してもらい受け渡しても良い。 The computer 100 (A) transmits L A ′ to the computer 100 (B), and the computer 100 (B) transmits L B ′ to the computer 100 (A) via the communication units 105 (A) and 105 (B). . At this time, the data may not be transmitted directly, but may be transferred by being mediated by the computer 100 (S).

計算機100(S)が仲介する場合、図1のデータ転送部107がその処理を実行する。データ転送部107は、計算機100(A)からLA'を受信して計算機100(B)に送信し、計算機100(B)からLB'を受信して計算機100(A)に送信する。仲介により、計算機100(A)と計算機100(B)が直接通信できなくても良いという効果がある。 When the computer 100 (S) mediates, the data transfer unit 107 in FIG. 1 executes the process. The data transfer unit 107 receives L A 'from the computer 100 (A) and transmits it to the computer 100 (B), and receives L B ' from the computer 100 (B) and transmits it to the computer 100 (A). Due to the mediation, there is an effect that the computer 100 (A) and the computer 100 (B) may not be able to communicate directly.

暗号化部103(A)または103(B)は、それぞれさらに、受信したリストLの各要素を暗号化し、シャッフルして計算機100(S)に送信する。処理は図3のフローチャートで示される処理例と同じであるが、計算機100(A)はLB'を入力としてMA2, LB'' を出力し、計算機100(B)はLA'を入力としてMB2, LA'' を出力する。 The encryption unit 103 (A) or 103 (B) further encrypts each element of the received list L, shuffles it, and transmits it to the computer 100 (S). The processing is the same as the processing example shown in the flowchart of FIG. 3, but the computer 100 (A) receives L B 'as an input and outputs M A2 , L B ″, and the computer 100 (B) outputs L A '. M B2 , L A ″ is output as input.

たとえば、計算機100(A)は MA2=[4, 3, 0, 6, 7, 2, 1, 5] を作成し、それと LB''=[h(kc, 19), h(kc, 4), h(kc, 9), h(kc, 35), h(kc, 10), h(kc, 20), h(kc, 39), h(kc, 2)] を出力する。ここで、h(kc, m)=h(kA, h(kB, m))=h(kB, h(kA, m)) である。また、計算機100(B)はMB2=[6, 2, 7, 1, 3, 4, 0, 5] を作成し、それとLA''=[h(kc, 22), h(kc, 35), h(kc, 9), h(kc, 6), h(kc, 21), h(kc, 2), h(kc, 5), h(kc, 10)] を出力する。 For example, computer 100 (A) creates M A2 = [4, 3, 0, 6, 7, 2, 1, 5] and L B '' = [h (k c , 19), h (k c , 4), h (k c , 9), h (k c , 35), h (k c , 10), h (k c , 20), h (k c , 39), h (k c , 2)] is output. Here, h (k c , m) = h (k A , h (k B , m)) = h (k B , h (k A , m)). Further, the computer 100 (B) creates M B2 = [6, 2, 7, 1, 3, 4, 0, 5], and L A '' = [h (k c , 22), h (k c , 35), h (k c , 9), h (k c , 6), h (k c , 21), h (k c , 2), h (k c , 5), h (k c , 10)] is output.

そして、計算機100(A)はLB''を、計算機100(B)はLA''を、それぞれ計算機100(S)へ送信する。 Then, the computer 100 (A) transmits L B ″ and the computer 100 (B) transmits L A ″ to the computer 100 (S).

計算機100(S)の集合受付部108は、LA''とLB''を受信する。
計算機100(S)の共通要素数計上部109は、LA''とLB''の共通要素数cを計算する。今回の場合、h(kc, 2), h(kc, 9), h(kc, 10), h(kc, 35) の4要素が共通であるので、c=4となる。
The set reception unit 108 of the computer 100 (S) receives L A ″ and L B ″.
The common element number counting unit 109 of the computer 100 (S) calculates the common element number c of L A ″ and L B ″. In this case, since four elements h (k c , 2), h (k c , 9), h (k c , 10), h (k c , 35) are common, c = 4.

計算機100(S)の結果出力部110は、cを、通信部106を介して、計算機100(A)と計算機100(B)へ送信する。   The result output unit 110 of the computer 100 (S) transmits c to the computer 100 (A) and the computer 100 (B) via the communication unit 106.

最終的に、計算機100(A)と計算機100(B)それぞれが、比較結果算出部104(A)および104(B)で、通信部105(A)および105(B)を介して受信したcから、相手の数値の範囲NあるいはRを求める。   Finally, the computer 100 (A) and the computer 100 (B) are respectively received by the comparison result calculation units 104 (A) and 104 (B) via the communication units 105 (A) and 105 (B). From this, the range N or R of the opponent's numerical value is obtained.

図4は、図1の比較結果算出部104(104(A)または104(B))が実行する比較結果算出の処理例を示すフローチャートである。各ステップについて計算機100(A)の視点で説明する。   FIG. 4 is a flowchart showing a comparison result calculation processing example executed by the comparison result calculation unit 104 (104 (A) or 104 (B)) of FIG. Each step will be described from the viewpoint of the computer 100 (A).

nA=5, b=4, c=4 を入力として受け入れる(図4のステップS1)。
c=2bか否かを判定する(図4のステップS2)。
n A = 5, b = 4, and c = 4 are accepted as inputs (step S1 in FIG. 4).
It is determined whether c = 2b (step S2 in FIG. 4).

いま、c<2b なのでステップS2の判定はNOとなり、図2のステップS4に制御を移す。なお、c=2b の場合、nA=nB であることが互いにわかり、その場合はステップS2の判定がYESとなって、N=[n] ([n, n] の意味)とされる(図2のステップS3)。 Since c <2b, the determination in step S2 is NO, and the control is transferred to step S4 in FIG. When c = 2b, it can be seen that n A = n B , in which case the determination in step S2 is YES and N = [n] (meaning [n, n]) (Step S3 in FIG. 2).

範囲[0, n], [n, 2b) それぞれで、2分探索により、共通要素数がcとなる値の範囲Nを計算する(図2のステップS4)。前述の分解方法により、相手の値が近いほど c は大きくなる。たとえば、範囲[0, nA]について説明すると、その範囲ではnB∈[0, nA] に対してcは狭義の単調増加となる。よって、2分探索により、共通要素数がcとなる値の範囲Nを効率的に計算することができる。たとえば、範囲[0, nA]でのnBの最大値xを求めることを考える。nA=5を分解して作った集合と、範囲[0, nA]の(ほぼ)中点2 を分解して作った集合の共通集合数を計算すると、4(=c) となるため、2≦x であることがわかる。同様に、範囲[2, nA]の(ほぼ)中点3との共通集合数は4(=c) となるため、3≦x であることがわかる。さらに、範囲[3, nA]の中点4との共通集合数は6(>c) となるため、3≦x<4 つまり x=3 であることがわかる。最小値も同様に計算することで、範囲[0, nA]でのnB の取り得る値の範囲は[2, 3]であることが計算できる。範囲[n, 2b)についても同様に計算することで、nA=5, b=4, c=4 の場合 nB の値の範囲NB=[2, 3]∪[7] であることを計算できる。ところで、相手の値が近いほど c は大きくなると説明した通り、実際、たとえばもし共通要素数がより少ない c=2 だった場合、NB=[0, 1]∪[8, 11] とより遠く広い範囲でしかnB を限定できない。 Range [0, n], [n, 2 b ) By each binary search, a range N of values in which the number of common elements is c is calculated (step S4 in FIG. 2). According to the above decomposition method, c gets larger as the opponent's value gets closer. For example, the range [0, n A ] will be described. In the range, c is a monotonically increasing in a narrow sense with respect to n B ∈ [0, n A ]. Therefore, the binary search can efficiently calculate the range N of values in which the number of common elements is c. For example, consider obtaining the maximum value x of n B in the range [0, n A ]. Since the number of common sets of a set created by decomposing n A = 5 and a set created by decomposing (almost) midpoint 2 in the range [0, n A ] is 4 (= c) , 2 ≦ x. Similarly, since the number of common sets with (almost) midpoint 3 in the range [2, n A ] is 4 (= c), it can be seen that 3 ≦ x. Furthermore, since the number of common sets with the midpoint 4 of the range [3, n A ] is 6 (> c), it can be seen that 3 ≦ x <4, that is, x = 3. By calculating the minimum value in the same way, it can be calculated that the range of possible values of n B in the range [0, n A ] is [2, 3]. Range [n, 2 b) by calculating similarly for, n A = 5, b = 4, the range of values of c = 4 when n B N B = [2, 3] is ∪ [7] Can be calculated. By the way, as explained that c gets larger as the opponent's value gets closer, in fact, if c = 2, which has fewer common elements, N B = [0, 1], [8, 11] N B can be limited only within a wide range.

Nを出力する(図2のステップS5)。NB=[2, 3]∪[7]である。
同様に、計算機100(B)の計算により NA=[0, 1]∪[5] となる。
N is output (step S5 in FIG. 2). N B = [2, 3] ∪ [7].
Similarly, N A = [0, 1] ∪ [5] is obtained by calculation of the computer 100 (B).

さらに、変換方法f(r)の逆変換を適用することで、rの範囲Rを計算しても良い。
たとえば、rBが整数の場合、NB=[2, 3]∪[7] ⇔ RB=[20000, 39999]∪[70000, 79999] となる。つまり、A社にとって、B社の利用価格はA社の利用価格である50,000円に比べ、20〜60%異なる値だと知ることができる。同様に、B社にとっては、A社の価格は33〜100%異なる値だと知ることができる。
Further, the range R of r may be calculated by applying the inverse transformation of the transformation method f (r).
For example, when r B is an integer, N B = [2, 3] ∪ [7] ⇔R B = [20000, 39999] ∪ [70000, 79999]. In other words, Company A can know that the usage price of Company B is 20 to 60% different from the usage price of Company A, which is 50,000 yen. Similarly, Company B can know that the price of Company A is 33-100% different.

以上の方法により、数値データ保持者2者が、互いの値を明かさず、互いの値が近いかどうか知ることができる。互いの値が近いほど相手の値の範囲が限定されるという性質がある。原則的には互いの値は範囲でしか明かさないが、互いの値がとても近い(nA=nBとなった)場合に限り、互いの値が一意にわかる可能性がある。 By the above method, two numerical data holders can know whether each value is close without revealing each other's value. The closer the values are, the more limited the value range of the opponent. In principle, the values of each other are disclosed only in the range, but each other's values may be uniquely known only when the values are very close (n A = n B ).

最後に、図1の比較結果算出部104(104(A)または104(B))で、大小比較結果を得る方法を説明する。   Finally, a method of obtaining a magnitude comparison result by the comparison result calculation unit 104 (104 (A) or 104 (B)) in FIG. 1 will be described.

大小比較は、前述の近さ判定の方法の一部を使って実現できる。最初から大小比較を目的として処理をしても良いが、本実施形態では近さ判定後の判断で続けて大小比較をする場合の方法について説明する。   The size comparison can be realized by using a part of the above-described proximity determination method. Although processing may be performed from the beginning for the purpose of size comparison, in the present embodiment, a method in which size comparison is continuously performed in the determination after the proximity determination will be described.

たとえば、数値データ保持者2者が、互いの値が近いと知った後、両者共が大小比較を行いたいと考えたとする。上記例では、両社ともに価格のおよその違いはわかったので、どちらが高いかを改めて知りたいような場合である。その実現方法を以下で説明する。   For example, after two numerical data holders know that their values are close to each other, they want to perform a size comparison. In the above example, we know the difference in price between the two companies, so we want to know again which is higher. The realization method will be described below.

まず、計算機100(S)は、LA''およびLB''を記憶しておく。
そして、計算機100(A)と計算機100(B)はそれぞれ、MA1とMB1を変換する。
First, the computer 100 (S) stores L A ″ and L B ″.
Then, the computer 100 (A) and the computer 100 (B) convert M A1 and M B1 , respectively.

図5は、図1の比較結果算出部104(104(A)または104(B))が実行する、Mを変換する処理例を示すフローチャートである。各ステップについて計算機100(A)の視点で説明する。   FIG. 5 is a flowchart illustrating an example of a process of converting M, which is executed by the comparison result calculation unit 104 (104 (A) or 104 (B)) of FIG. Each step will be described from the viewpoint of the computer 100 (A).

M=MA1=[2, 6, 7, 0, 3, 1, 4, 5] を入力として受け入れる(図5のステップS1)。
bにリストMの長さの半分の値を入れる(図5のステップS2)。いま、b=4 となる。
M = M A1 = [2, 6, 7, 0, 3, 1, 4, 5] is accepted as an input (step S1 in FIG. 5).
A value half the length of the list M is entered in b (step S2 in FIG. 5). Now b = 4.

Mの各要素につき、b未満なら1に、それ以外なら0を格納したリストM'を作成する(図5のステップS3)。よって、MA1'=[1, 0, 0, 1, 1, 1, 0, 0] となる。 For each element of M, a list M ′ is created in which 1 is stored if it is less than b, and 0 is stored otherwise (step S3 in FIG. 5). Therefore, M A1 '= [1, 0, 0, 1, 1, 1, 0, 0].

M'を出力する(図5のステップS4)。
同様に、計算機100(B)では、MB1=[1, 6, 4, 2, 0, 3, 7, 5] なので MB1'=[1, 0, 0, 1, 1, 1, 0, 0] となる。
M ′ is output (step S4 in FIG. 5).
Similarly, in the computer 100 (B), since M B1 = [1, 6, 4, 2, 0, 3, 7, 5], M B1 '= [1, 0, 0, 1, 1, 1, 0, 0].

次に、計算機100(A)は MA1', MA2 を、計算機100(B)はMB1', MB2 を、それぞれ計算機100(S)に送信する。 Next, the computer 100 (A) transmits M A1 ′ and M A2 , and the computer 100 (B) transmits M B1 ′ and M B2 to the computer 100 (S).

計算機100(S)は、リストMA' をMA'[i]=MA1'[MB2[i]] となるように作成する。MA1'=[1, 0, 0, 1, 1, 1, 0, 0], MB2=[6, 2, 7, 1, 3, 4, 0, 5] なので、MA'=[0, 0, 0, 0, 1, 1, 1, 1] となる。同様に、リストMB' をMB'[i]=MB1'[MA2[i]] となるように作成し、MB'=[1, 1, 1, 0, 0, 0, 0, 1] となる。 The computer 100 (S) creates the list M A 'so that M A ' [i] = M A1 '[M B2 [i]]. Since M A1 '= [1, 0, 0, 1, 1, 1, 0, 0], M B2 = [6, 2, 7, 1, 3, 4, 0, 5], M A ' = [0 , 0, 0, 0, 1, 1, 1, 1]. Similarly, the list M B 'is created so that M B ' [i] = M B1 '[M A2 [i]], and M B ' = [1, 1, 1, 0, 0, 0, 0 , 1].

続いて、図1の計算機100(S)の共通要素数計上部109は、LA''とLB''の各要素のうち、それぞれMA'とMB'の要素が1の位置の要素を抽出し、その要素のうち共通のものの数cを計上する。そして、結果出力部110が、cを計算機100(A)と計算機100(B)に送信する。これまでの例で説明すると、LA''=[h(kc, 22), h(kc, 35), h(kc, 9), h(kc, 6), h(kc, 21), h(kc, 2), h(kc, 5), h(kc, 10)] から MA'=[0, 0, 0, 0, 1, 1, 1, 1] の1の位置の要素を抽出すると [h(kc, 21), h(kc, 2), h(kc, 5), h(kc, 10)] である。また、LB''=[h(kc, 19), h(kc, 4), h(kc, 9), h(kc, 35), h(kc, 10), h(kc, 20), h(kc, 39), h(kc, 2)] から MB'=[1, 1, 1, 0, 0, 0, 0, 1] の1の位置の要素を抽出すると [h(kc, 19), h(kc, 4), h(kc, 9), h(kc, 2)] である。従って、これらの共通要素は h(kc, 2) のみなので、c=1を計算機100(A)と計算機100(B)に送信する。 Subsequently, the common element counting unit 109 of the computer 100 (S) in FIG. 1 has the elements of M A ′ and M B ′ at the position 1 among the elements of L A ″ and L B ″. Extract elements and count the number c of common elements. Then, the result output unit 110 transmits c to the computer 100 (A) and the computer 100 (B). In the above example, L A '' = [h (k c , 22), h (k c , 35), h (k c , 9), h (k c , 6), h (k c , 21), h (k c , 2), h (k c , 5), h (k c , 10)] to M A '= [0, 0, 0, 0, 1, 1, 1, 1] Extracting the element at position 1 of [h (k c , 21), h (k c , 2), h (k c , 5), h (k c , 10)] Also, L B '' = (h (k c , 19), h (k c , 4), h (k c , 9), h (k c , 35), h (k c , 10), h ( k c , 20), h (k c , 39), h (k c , 2)] to M B '= [1, 1, 1, 0, 0, 0, 0, 1] Is extracted as [h (k c , 19), h (k c , 4), h (k c , 9), h (k c , 2)]. Therefore, since these common elements are only h (k c, 2), c = 1 is transmitted to the computer 100 (A) and the computer 100 (B).

最後に、計算機100(A)および100(B)の比較結果算出部104(A)および104(B)は、それぞれcを使い大小判定をおこなう。   Finally, the comparison result calculation units 104 (A) and 104 (B) of the computers 100 (A) and 100 (B) perform size determination using c, respectively.

図6は、図1の比較結果算出部104(104(A)または104(B))が実行する、大小判定の処理例のフローチャートである。各ステップについて計算機100(A)の視点で説明する。   FIG. 6 is a flowchart of a size determination processing example executed by the comparison result calculation unit 104 (104 (A) or 104 (B)) of FIG. Each step will be described from the viewpoint of the computer 100 (A).

ビット数b=4、非負整数n=nA=5、共通要素数c=1 を、入力として受け入れる(図6のステップS1)。 The number of bits b = 4, the non-negative integer n = n A = 5, and the number of common elements c = 1 are accepted as inputs (step S1 in FIG. 6).

b=cか否かを判定する(図6のステップS2)。
いま、b>c なのでステップS2の判定はNOとなり、図6のステップS4に制御を移す。
It is determined whether or not b = c (step S2 in FIG. 6).
Now, since b> c, the determination in step S2 is NO, and the control is transferred to step S4 in FIG.

nを長さbの2進数表現zに変換する(図6のステップS4)。いま、z=0101 となる。
zのc+1番目のビットが1か否かを判定する(図6のステップS5)。
n is converted into a binary representation z of length b (step S4 in FIG. 6). Now, z = 0101.
It is determined whether or not the c + 1-th bit of z is 1 (step S5 in FIG. 6).

いま、zのc+1=2番目のビットは1なので、図6のステップS6に制御を移す。
「大」を出力する(図6のステップS6)。
Since the c + 1 = 2th bit of z is now 1, control is transferred to step S6 in FIG.
“Large” is output (step S6 in FIG. 6).

同様に、計算機100(B)の視点で説明する。
b=4、n=nB=3、c=1 を入力として受け入れる(図6のステップS1)。
Similarly, a description will be given from the viewpoint of the computer 100 (B).
b = 4, n = n B = 3, and c = 1 are accepted as inputs (step S1 in FIG. 6).

b>c なので図6のステップS2の判定がNOとなり、図6のステップS4に制御を移す。
z=0011 となる(図6のステップS4)。
Since b> c, the determination in step S2 in FIG. 6 is NO, and control is transferred to step S4 in FIG.
z = 0011 (step S4 in FIG. 6).

zのc+1=2番目のビットは0なので図6のステップS5の判定はNOとなり、図6のステップS7に制御を移す。
「小」を出力する(図6のステップS7)。
Since the c + 1 = 2th bit of z is 0, the determination in step S5 in FIG. 6 is NO, and the control is transferred to step S7 in FIG.
“Small” is output (step S7 in FIG. 6).

このように、出力の「大」「小」が、相手の数値と比較した自分の数値の大小に対応する。また、数値が同じ場合(図6のステップS2の判定がYES)は、「等」が出力される(図6のステップS3)。   In this way, “large” and “small” of the output correspond to the magnitude of one's own numerical value compared with the other's numerical value. If the numerical values are the same (YES in step S2 in FIG. 6), “etc.” is output (step S3 in FIG. 6).

つまり、計算機100(A)は、NB=[2, 3]∪[7, 7] を知った上、nB<nA=5 であることを知ったので、NB=[2, 3] まで限定できたことになる。同様に、計算機100(B)はnA=5 であることを特定できた。 That is, since the computer 100 (A) knew that N B = [2, 3] ∪ [7, 7] and knew that N B <n A = 5, N B = [2, 3 It was possible to limit to. Similarly, the computer 100 (B) was able to specify that n A = 5.

このように、近さ判定のときに使ったデータを再利用することで大小判定もできる。大小判定のために再び暗号化からやり直しても実現できるが、再利用により暗号化処理を省くことができるという効果がある。   In this way, it is possible to determine the size by reusing the data used for the proximity determination. This can be realized by re-encrypting for size determination, but there is an effect that the encryption process can be omitted by reuse.

共通要素数の計算は、図1の計算機100(S)の共通要素数計上部109が、LA''とLB''を入力としておこなうため、どちらかが偽のデータであると正しい計算結果とならない可能性が高い。そのため、計算機100(A)か計算機100(B)がこの方法に従わないことにより自分だけが正しい結果を得る、ということは困難にすることが可能となる。 The common element number calculation is performed when the common element number counting unit 109 of the computer 100 (S) in FIG. 1 uses L A ″ and L B ″ as input, so that either is false data. There is a high probability that it will not result. Therefore, it is possible that it is difficult for only the computer 100 (A) or the computer 100 (B) to obtain a correct result by not following this method.

また、計算機100(S)が一方と結託することにより、「計算機100(A)と計算機100(B)のどちらか片方だけが正しい結果を得る」ことが可能になるが、結託してももう一方のデータを知ることは難しくすることが可能となる。たとえば計算機100(A)と結託すると鍵kAを得ることができるが、それを使っても LB'=[h(kB, 9), ...] の各要素は鍵kBによる暗号文なので平文を知ることはできない。また、LB' や LB'' は計算機100(B)しか知らないMでシャッフルされているので、その要素順から平文を推測することもできない。計算機100(A)や計算機100(B)は計算機100(S)と結託しても知ることができるデータが増えるわけではないので、結託する動機が少なく、お互いに安心して本実施形態が実現するシステムを利用できると考えられる。 In addition, it is possible for computer 100 (S) to collaborate with one side, so that only one of computer 100 (A) or computer 100 (B) can obtain the correct result. Knowing one of the data can be difficult. For example, the key k A can be obtained by collaborating with the computer 100 (A), but even if it is used, each element of L B '= [h (k B , 9), ...] is encrypted with the key k B Since it is a sentence, plaintext cannot be known. Further, since L B ′ and L B ″ are shuffled by M which only the computer 100 (B) knows, it is impossible to infer plaintext from the element order. Since the computer 100 (A) and the computer 100 (B) do not increase the data that can be known even when collaborating with the computer 100 (S), there are few motives to collaborate and this embodiment can be realized with peace of mind. The system can be used.

本実施形態では図2で接頭辞配列を全て使っているが、その一部しか使わないようにしても良い。たとえば、一番長い接頭辞である元の文字列自身を使わないことで、N=[n]となることが起きないようにすることができる。   In the present embodiment, all the prefix arrays are used in FIG. 2, but only a part of them may be used. For example, you can prevent N = [n] from happening by not using the original string itself, which is the longest prefix.

図7は、上述の実施形態における図1の計算機100(A)、計算機100(B)、および計算機100(S)の3つのコンピュータ間の処理関係の例を示すシーケンス図である。   FIG. 7 is a sequence diagram illustrating an example of a processing relationship between the three computers of the computer 100 (A), the computer 100 (B), and the computer 100 (S) of FIG. 1 in the above-described embodiment.

まず、計算機100(A)および100(B)の要素分解部102(A)および102(B)が、図2に示したフローチャートの処理例に従って、非負整数の分解処理を実行する(図7のステップS1(A)およびS1(B))。   First, the element decomposing units 102 (A) and 102 (B) of the computers 100 (A) and 100 (B) execute non-negative integer decomposition processing according to the processing example of the flowchart shown in FIG. Steps S1 (A) and S1 (B)).

次に、計算機100(A)および100(B)の暗号化部103(A)および103(B)が、図3に示したフローチャートの処理例に従って、暗号化およびシャッフルの処理を実行する。そして、計算機100(A)はLA'を計算機100(B)に、計算機100(B)はLB'を計算機100(A)に送信する(以上、図7のステップS2(A)およびS2(B))。 Next, the encryption units 103 (A) and 103 (B) of the computers 100 (A) and 100 (B) execute encryption and shuffle processing according to the processing example of the flowchart shown in FIG. Then, the computer 100 (A) transmits L A ′ to the computer 100 (B), and the computer 100 (B) transmits L B ′ to the computer 100 (A) (the steps S2 (A) and S2 in FIG. (B)).

計算機100(A)および100(B)の暗号化部103(A)または103(B)は、それぞれさらに、図3に示したフローチャートの処理例に従って、受信したリストLの各要素を暗号化しシャッフルする。そして、計算機100(A)はLB''を、計算機100(B)はLA''を、それぞれ計算機100(S)へ送信する(以上、図7のステップS3(A)およびS3(B))。 The encryption units 103 (A) or 103 (B) of the computers 100 (A) and 100 (B) further encrypt and shuffle each element of the received list L in accordance with the processing example of the flowchart shown in FIG. To do. Then, the computer 100 (A) transmits L B ″ and the computer 100 (B) transmits L A ″ to the computer 100 (S), respectively (steps S3 (A) and S3 (B )).

計算機100(S)では、集合受付部108がLA''とLB''を受信し、共通要素数計上部109がLA''とLB''の共通要素数cを計算し、結果出力部110がcを計算機100(A)と計算機100(B)へ送信する(図7のステップS1(S))。 In the computer 100 (S), the set reception unit 108 receives L A '' and L B '', the common element number counting unit 109 calculates the common element number c of L A '' and L B '', The result output unit 110 transmits c to the computer 100 (A) and the computer 100 (B) (step S1 (S) in FIG. 7).

計算機100(A)および100(B)の比較結果算出部104(A)および104(B)は、図4に示したフローチャートの処理例に従って、比較結果算出の処理を実行する(図7のステップS4(A)およびS4(B))。   The comparison result calculation units 104 (A) and 104 (B) of the computers 100 (A) and 100 (B) execute the comparison result calculation process according to the processing example of the flowchart shown in FIG. 4 (step of FIG. 7). S4 (A) and S4 (B)).

計算機100(A)および100(B)の比較結果算出部104(A)および104(B)はさらに、図5に示したフローチャートの処理例に従って、リストMを変換する処理を実行する。その結果、計算機100(A)は MA1', MA2 を、BはMB1', MB2 を、それぞれ計算機100(S)に送信する(以上、図7のステップS5(A)およびS5(B))。 The comparison result calculation units 104 (A) and 104 (B) of the computers 100 (A) and 100 (B) further execute processing for converting the list M in accordance with the processing example of the flowchart shown in FIG. As a result, the computer 100 (A) transmits M A1 ′, M A2 and B transmits M B1 ′, M B2 to the computer 100 (S) (steps S5 (A) and S5 (in FIG. 7). B)).

計算機100(S)は、リストMA' およびMB' を作成する(図7のステップS2(S))。
その後、共通要素数計上部109が、LA''とLB''の各要素のうち、それぞれMA'とMB'の要素が1の位置の要素を抽出し、その要素のうち共通のものの数cを計上し、結果出力部110が、cを計算機100(A)と計算機100(B)に送信する(図7のステップS3(S))。
The computer 100 (S) creates lists M A ′ and M B ′ (step S2 (S) in FIG. 7).
After that, the common element counting unit 109 extracts the element at the position where the elements of M A ′ and M B ′ are 1 from the elements of L A ″ and L B ″, and common among the elements. The result output unit 110 transmits c to the computer 100 (A) and the computer 100 (B) (step S3 (S) in FIG. 7).

計算機100(A)および100(B)の比較結果算出部104(A)および104(B)は、図6に示したフローチャートの処理例に従って大小判定の処理を実行する(図7のステップS6(A)およびS6(B))。   The comparison result calculation units 104 (A) and 104 (B) of the computers 100 (A) and 100 (B) execute the size determination process according to the processing example of the flowchart shown in FIG. 6 (step S6 in FIG. A) and S6 (B)).

図8は、図1に示される各機能を、ソフトウェア処理として実現できる計算機100(A)、計算機100(B)、および計算機100(S)のハードウェア構成の一例を示す図である。   FIG. 8 is a diagram illustrating an example of a hardware configuration of the computer 100 (A), the computer 100 (B), and the computer 100 (S) that can implement the functions illustrated in FIG. 1 as software processing.

図8に示されるコンピュータは、CPU(中央演算処理装置)801、メモリ802、入力装置803、出力装置804、外部記憶装置805、可搬記録媒体809が挿入される可搬記録媒体駆動装置806、及び通信インタフェース807を有する。そして、これらがバス808によって相互に接続された構成を有する。同図に示される構成は上記システムを実現できる計算機100(A)、計算機100(B)、および計算機100(S)の一例であり、そのようなコンピュータはこの構成に限定されるものではない。   A computer shown in FIG. 8 includes a CPU (central processing unit) 801, a memory 802, an input device 803, an output device 804, an external storage device 805, a portable recording medium driving device 806 into which a portable recording medium 809 is inserted, And a communication interface 807. These components are connected to each other via a bus 808. The configuration shown in the figure is an example of a computer 100 (A), a computer 100 (B), and a computer 100 (S) that can realize the above system, and such a computer is not limited to this configuration.

CPU801は、当該コンピュータ全体の制御を行う。メモリ802は、プログラムの実行、データ更新等の際に、外部記憶装置805(或いは可搬記録媒体809)に記憶されているプログラム又はデータを一時的に格納するRAM(ランダムアクセスメモリ)等のメモリである。CUP801は、プログラムをメモリ802に読み出して実行することにより、全体の制御を行う。   The CPU 801 controls the entire computer. The memory 802 is a memory such as a RAM (Random Access Memory) that temporarily stores a program or data stored in the external storage device 805 (or portable recording medium 809) when executing a program, updating data, or the like. It is. The CUP 801 performs overall control by reading the program into the memory 802 and executing it.

入力装置803は、ユーザによるキーボードやマウス等による入力操作を検出し、その検出結果をCPU801に通知する。   The input device 803 detects an input operation by a user using a keyboard, a mouse, or the like, and notifies the CPU 801 of the detection result.

出力装置804は、CPU801の制御によって送られてくるデータを表示装置や印刷装置に出力する。   The output device 804 outputs data sent under the control of the CPU 801 to a display device or a printing device.

外部記憶装置805は、例えばハードディスク記憶装置である。主に各種データやプログラムの保存に用いられる。   The external storage device 805 is, for example, a hard disk storage device. Mainly used for storing various data and programs.

可搬記録媒体駆動装置806は、光ディスクやSDRAM、コンパクトフラッシュ(登録商標)等の可搬記録媒体809を収容するもので、外部記憶装置805の補助の役割を有する。   The portable recording medium driving device 806 accommodates a portable recording medium 809 such as an optical disc, SDRAM, and Compact Flash (registered trademark), and has an auxiliary role for the external storage device 805.

通信インタフェース807は、例えばLAN(ローカルエリアネットワーク)又はWAN(ワイドエリアネットワーク)の通信回線を接続するための装置である。   The communication interface 807 is a device for connecting, for example, a LAN (local area network) or WAN (wide area network) communication line.

本実施形態によるシステムは、計算機100(A)または計算機100(B)においては、図1の102、103、104の各機能に対応する図2から図6のフローチャート等で実現される機能を搭載したプログラムをCPU801が実行することで実現される。そのプログラムは、例えば外部記憶装置805や可搬記録媒体809に記録して配布してもよく、或いは通信インタフェース807によりネットワークから取得できるようにしてもよい。また、メモリ802は、図1の記憶部101の機能を実現し、通信インタフェース807は、図1の通信部105(A)または105(B)の機能を実現する。   The system according to this embodiment is equipped with functions realized by the flowcharts of FIGS. 2 to 6 corresponding to the functions 102, 103, and 104 of FIG. 1 in the computer 100 (A) or the computer 100 (B). This is realized by the CPU 801 executing the program. The program may be distributed by being recorded in, for example, the external storage device 805 or the portable recording medium 809, or may be acquired from the network by the communication interface 807. The memory 802 implements the function of the storage unit 101 in FIG. 1, and the communication interface 807 implements the function of the communication unit 105 (A) or 105 (B) in FIG.

計算機100(S)においては、図1の107から110の各機能を搭載したプログラムをCPU801が実行することで実現される。そのプログラムは、例えば外部記憶装置805や可搬記録媒体809に記録して配布してもよく、或いは通信インタフェース807によりネットワークから取得できるようにしてもよい。また、メモリ802は、図1の記憶部106の機能を実現し、通信インタフェース807は、図1の通信部105(S)の機能を実現する。   The computer 100 (S) is realized by the CPU 801 executing a program equipped with the functions 107 to 110 in FIG. The program may be distributed by being recorded in, for example, the external storage device 805 or the portable recording medium 809, or may be acquired from the network by the communication interface 807. The memory 802 implements the function of the storage unit 106 in FIG. 1, and the communication interface 807 implements the function of the communication unit 105 (S) in FIG.

上述した実施形態では、計算機100(A)および100(B)にて入力された第1の数値および第2の数値をそれぞれ非負整数に変換した後、さらに第1および第2の接頭辞配列に変換して第1および第2の集合として出力し、これらの共通要素数を算出している。このほか、「互いの数値を共通要素数により比較判定可能な要素の集合に変換」する手法であれば、どのような手法を用いてもよい。   In the above-described embodiment, the first numerical value and the second numerical value input by the computers 100 (A) and 100 (B) are converted into non-negative integers, respectively, and further converted into the first and second prefix arrays. The number of common elements is calculated by converting and outputting the first and second sets. In addition, any method may be used as long as it is a method of “converting each other's numerical values into a set of elements that can be compared and determined based on the number of common elements”.

以上説明した本実施形態により、互いの値を明かさず、互いの値の比較結果を、互いに知ることが可能となる。   According to the present embodiment described above, it is possible to know each other's value comparison results without revealing each other's values.

本実施形態の方式は公平である。つまり、片方だけが正しい結果を得ることは困難であるため、両者が協力して実施することが期待できる。   The method of this embodiment is fair. In other words, since it is difficult for only one of them to obtain the correct result, it can be expected that both parties will cooperate.

これにより、たとえば上記例、競合他社同士のA社とB社が、利用価格が同程度か両者共に知りたい、ただし同程度でないときは互いの利用価格は教えたくない、といった要望を実現することが可能となる。   By this, for example, in the above example, Company A and Company B of competitors want to know whether the usage price is the same or both, but if they are not the same, do not want to tell each other's usage price Is possible.

以上の実施形態に関して、更に以下の付記を開示する。
(付記1)
比較対象の第1の数値および第2の数値をそれぞれ、互いの数値を共通要素数により比較判定可能な要素の第1の集合および第2の集合に変換し、
前記第1の集合および前記第2の集合の共通要素数を秘匿計算で算出し、
算出した前記第1の集合および前記第2の集合の共通要素数を比較し、比較結果を出力する、
処理を含むことを特徴とする秘匿比較方法。
(付記2)
前記第1の数値は第1の利用者が操作するコンピュータから入力し、前記第2の数値は第2の利用者が操作するコンピュータから入力し、前記共通要素数の算出は前記第1の利用者および前記第2の利用者以外の第三者が管理するコンピュータで行う、
処理を含むことを特徴とする付記1に記載の秘匿比較方法。
(付記3)
前記第1の数値および前記第2の数値からそれぞれ前記第1の集合および前記第2の集合への変換は、
前記第1の数値および前記第2の数値をそれぞれ第1の非負整数および第2の非負整数へ変換し、
前記第1の非負整数および前記第2の非負整数のそれぞれの2進数表現の長さのうちの長いほうの値をbビットとしたときに、前記第1の非負整数および前記第2の非負整数をそれぞれ、b次の第1の接頭辞配列および第2の接頭辞配列に分解して前記第1の集合および第2の集合とする、
処理を含むことを特徴とする付記1または2のいずれかに記載の秘匿比較方法。
(付記4)
前記第1の接頭辞配列または前記第2の接頭辞配列が、奇数の場合には1を加算し、偶数の場合には1を減算し、前記加算または前記減算の結果を前記第1の接頭辞配列または前記第2の接頭辞配列として出力する、
処理を含むことを特徴とする付記3に記載の秘匿比較方法。
(付記5)
前記加算または前記減算の結果がアンダーフローあるいはオーバーフローを起こしたときに、前記加算または前記減算の結果に対して単射であるようにパディングを行い、該パディングの結果を前記第1の接頭辞配列または前記第2の接頭辞配列として出力する、
処理を含むことを特徴とする付記4に記載の秘匿比較方法。
(付記6)
前記共通要素数から前記比較結果への変換は、前記第1の非負整数または前記第2の非負整数について、前記bビットが前記共通要素数に等しくなければ、値0から前記第1の非負整数または前記第2の非負整数までの第1の範囲と、前記第1の非負整数または前記第2の非負整数から2のb乗までの第2の範囲のそれぞれで、2分検索により、共通要素数が前記共通要素数となる値の各範囲を計算し、当該各範囲を前記比較結果として出力し、前記bビットが前記共通要素数に等しければ前記第1の非負整数または前記第2の非負整数を前記比較結果として出力する近さ判定を行う、
処理を含むことを特徴とする付記3ないし6のいずれかに記載の秘匿比較方法。
(付記7)
前記共通要素数から前記比較結果への変換は、
値0以上前記第1の集合または前記第2の集合の要素数未満の各整数値をランダムに並べた第1のリストまたは第2のリストについて、当該第1のリストまたは第2のリストの各要素を、当該要素の値が当該リストの長さの半分の値未満なら値1で、そうでなければ値0で、それぞれ置き換えた第1の修正リストまたは第2の修正リストをそれぞれ作成し、
前記第1の集合および前記第2の集合の各要素のうち、それぞれ前記第1の修正リストおよび前記第2の修正リストの要素が値1である位置の要素を抽出し、当該抽出した要素のうち共通のものの数を第2の共通要素数として秘匿計算で算出し、
前記第1の非負整数または前記第2の非負整数について、前記bビットが前記第2の共通要素数に等しくなければ、前記第1の非負整数または前記第2の非負整数を2進数表現に変換し当該2進数表現の前記第2の共通要素数に値1をプラスした値に対応するビット位置の値が1であれば、前記第1の非負整数または前記第2の非負整数が前記第2の非負整数または前記第1の非負整数よりも大きいことを示す大小比較結果を出力し、そうでなければ前記第1の非負整数または前記第2の非負整数が前記第2の非負整数または前記第1の非負整数よりも小さいことを示す大小比較結果を出力し、前記bビットが前記第2の共通要素数に等しければ前記第1の非負整数と前記第2の非負整数が等しいことを示す大小比較結果を出力する大小判定を行う、
処理を含むことを特徴とする付記3ないし6のいずれかに記載の秘匿比較方法。
(付記8)
付記7に記載の近さ判定の処理と付記8に記載の大小判定の処理とから、前記比較結果を出力する、
処理を含むことを特徴とする付記6および7に記載の秘匿比較方法。
(付記9)
比較対象の第1の数値および第2の数値をそれぞれ、互いの数値を共通要素数により比較判定可能な要素の第1の集合および第2の集合に変換する手段と、
前記第1の集合および前記第2の集合の共通要素数を秘匿計算で算出する手段と、
算出した前記第1の集合および前記第2の集合の共通要素数を比較し、比較結果を出力する手段と、
を備えることを特徴とする秘匿比較システム。
(付記10)
比較対象の第1の数値および第2の数値をそれぞれ、互いの数値を共通要素数により比較判定可能な要素の第1の集合および第2の集合に変換し、
前記第1の集合および前記第2の集合の共通要素数を秘匿計算で算出し、
算出した前記第1の集合および前記第2の集合の共通要素数を比較し、比較結果を出力する、
ステップをコンピュータに実行させるための秘匿比較プログラム。
Regarding the above embodiment, the following additional notes are disclosed.
(Appendix 1)
The first numerical value and the second numerical value to be compared are respectively converted into a first set and a second set of elements that can be compared and determined by the number of common elements.
Calculating the number of common elements of the first set and the second set by a secret calculation;
Comparing the calculated number of common elements of the first set and the second set, and outputting a comparison result;
A secret comparison method comprising processing.
(Appendix 2)
The first numerical value is input from a computer operated by a first user, the second numerical value is input from a computer operated by a second user, and the calculation of the number of common elements is performed by the first usage. A computer managed by a third party other than the user and the second user,
The secret comparison method according to appendix 1, which includes a process.
(Appendix 3)
The conversion from the first numerical value and the second numerical value to the first set and the second set, respectively,
Converting the first numeric value and the second numeric value to a first non-negative integer and a second non-negative integer, respectively;
The first non-negative integer and the second non-negative integer when the longer value of the binary representation length of each of the first non-negative integer and the second non-negative integer is b bits Are decomposed into b-th order first prefix array and second prefix array, respectively, to obtain the first set and the second set,
The secret comparison method according to any one of Appendix 1 or 2, wherein the method includes a process.
(Appendix 4)
When the first prefix array or the second prefix array is an odd number, 1 is added, and when the first prefix array is an even number, 1 is subtracted, and the result of the addition or subtraction is set to the first prefix array. Output as a prefix array or the second prefix array,
The secret comparison method according to supplementary note 3, including a process.
(Appendix 5)
When the result of the addition or subtraction causes an underflow or overflow, padding is performed so that the result of the addition or subtraction is injective, and the result of the padding is added to the first prefix array. Or output as the second prefix array,
The secret comparison method according to supplementary note 4, including processing.
(Appendix 6)
The conversion from the number of common elements to the comparison result is as follows. For the first non-negative integer or the second non-negative integer, if the b bits are not equal to the number of common elements, the value 0 to the first non-negative integer Alternatively, a common element is obtained by performing a binary search in each of the first range up to the second non-negative integer and the second range from the first non-negative integer or the second non-negative integer to the power of 2b. Calculate each range of values whose number is the number of common elements, output each range as the comparison result, and if the b bit is equal to the number of common elements, the first non-negative integer or the second non-negative integer Perform proximity determination to output an integer as the comparison result.
The secret comparison method according to any one of appendices 3 to 6, further comprising a process.
(Appendix 7)
The conversion from the number of common elements to the comparison result is as follows:
For each of the first list and the second list, the first list or the second list in which integer values that are not less than 0 and less than the number of elements of the first set or the second set are randomly arranged Create a first modification list or a second modification list each replacing an element with a value of 1 if the value of the element is less than half the length of the list, and a value of 0 otherwise.
Among the elements of the first set and the second set, the elements at positions where the elements of the first correction list and the second correction list are 1 respectively are extracted, and the elements of the extracted elements The number of common ones is calculated by the secret calculation as the second common element number,
For the first non-negative integer or the second non-negative integer, if the b bits are not equal to the second common element number, the first non-negative integer or the second non-negative integer is converted into a binary representation. If the value of the bit position corresponding to the value obtained by adding the value 1 to the second common element number in the binary number representation is 1, the first non-negative integer or the second non-negative integer is the second Or a magnitude comparison result indicating greater than the first non-negative integer or greater than the first non-negative integer, otherwise the first non-negative integer or the second non-negative integer is the second non-negative integer or the first non-negative integer. A magnitude comparison result indicating that the first non-negative integer is smaller than 1, and if the b bit is equal to the second common element number, the first non-negative integer and the second non-negative integer are equal in magnitude. The size judgment that outputs the comparison result Cormorant,
The secret comparison method according to any one of appendices 3 to 6, further comprising a process.
(Appendix 8)
The comparison result is output from the proximity determination process described in appendix 7 and the size determination process described in appendix 8.
The secret comparison method according to appendix 6 and 7, characterized in that it includes a process.
(Appendix 9)
Means for converting the first numerical value and the second numerical value to be compared into a first set and a second set of elements that can be compared and determined by the number of common elements, respectively;
Means for calculating the number of common elements of the first set and the second set by a secret calculation;
Means for comparing the calculated number of common elements of the first set and the second set and outputting a comparison result;
A secret comparison system comprising:
(Appendix 10)
The first numerical value and the second numerical value to be compared are respectively converted into a first set and a second set of elements that can be compared and determined by the number of common elements.
Calculating the number of common elements of the first set and the second set by a secret calculation;
Comparing the calculated number of common elements of the first set and the second set, and outputting a comparison result;
A secret comparison program for causing a computer to execute steps.

100、100(A)、100(B)、100(S) 計算機
101、101(A)、101(B)、106 記憶部
102、102(A)、102(B) 要素分解部
103、103(A)、103(B) 暗号化部
104、104(A)、104(B) 比較結果算出部
105、105(A)、105(B) 通信部
107 データ転送部
108 集合受付部
109 共通要素数計上部
110 結果出力部
801 CPU(中央演算処理装置)
802 メモリ
803 入力装置
804 出力装置
805 外部記憶装置
806 可搬記録媒体駆動装置
807 通信インタフェース
808 バス
809 可搬記録媒体
100, 100 (A), 100 (B), 100 (S) Calculator
101, 101 (A), 101 (B), 106 Memory
102, 102 (A), 102 (B) Element decomposition part
103, 103 (A), 103 (B) Encryption section
104, 104 (A), 104 (B) Comparison result calculation unit
105, 105 (A), 105 (B) Communication unit
107 Data transfer section
108 Meeting reception
109 Number of common elements
110 Result output section
801 CPU (Central processing unit)
802 memory
803 input device
804 output device
805 External storage device
806 Portable recording medium drive
807 Communication interface
808 bus
809 Portable recording media

Claims (10)

比較対象の第1の数値および第2の数値をそれぞれ、互いの数値を共通要素数により比較判定可能な要素の第1の集合および第2の集合に変換し、
前記第1の集合および前記第2の集合の共通要素数を秘匿計算で算出し、
算出した前記第1の集合および前記第2の集合の共通要素数を比較し、比較結果を出力する、
処理を含むことを特徴とする秘匿比較方法。
The first numerical value and the second numerical value to be compared are respectively converted into a first set and a second set of elements that can be compared and determined by the number of common elements.
Calculating the number of common elements of the first set and the second set by a secret calculation;
Comparing the calculated number of common elements of the first set and the second set, and outputting a comparison result;
A secret comparison method comprising processing.
前記第1の数値は第1の利用者が操作するコンピュータから入力し、前記第2の数値は第2の利用者が操作するコンピュータから入力し、前記共通要素数の算出は前記第1の利用者および前記第2の利用者以外の第三者が管理するコンピュータで行う、
処理を含むことを特徴とする請求項1に記載の秘匿比較方法。
The first numerical value is input from a computer operated by a first user, the second numerical value is input from a computer operated by a second user, and the calculation of the number of common elements is performed by the first usage. A computer managed by a third party other than the user and the second user,
The secret comparison method according to claim 1, further comprising a process.
前記第1の数値および前記第2の数値からそれぞれ前記第1の集合および前記第2の集合への変換は、
前記第1の数値および前記第2の数値をそれぞれ第1の非負整数および第2の非負整数へ変換し、
前記第1の非負整数および前記第2の非負整数のそれぞれの2進数表現の長さのうちの長いほうの値をbビットとしたときに、前記第1の非負整数および前記第2の非負整数をそれぞれ、b次の第1の接頭辞配列および第2の接頭辞配列に分解して前記第1の集合および第2の集合とする、
処理を含むことを特徴とする請求項1または2のいずれかに記載の秘匿比較方法。
The conversion from the first numerical value and the second numerical value to the first set and the second set, respectively,
Converting the first numeric value and the second numeric value to a first non-negative integer and a second non-negative integer, respectively;
The first non-negative integer and the second non-negative integer when the longer value of the binary representation length of each of the first non-negative integer and the second non-negative integer is b bits Are decomposed into b-th order first prefix array and second prefix array, respectively, to obtain the first set and the second set,
The secret comparison method according to claim 1, further comprising a process.
前記第1の接頭辞配列または前記第2の接頭辞配列が、奇数の場合には1を加算し、偶数の場合には1を減算し、前記加算または前記減算の結果を前記第1の接頭辞配列または前記第2の接頭辞配列として出力する、
処理を含むことを特徴とする請求項3に記載の秘匿比較方法。
When the first prefix array or the second prefix array is an odd number, 1 is added, and when the first prefix array is an even number, 1 is subtracted, and the result of the addition or subtraction is set to the first prefix array. Output as a prefix array or the second prefix array,
The secret comparison method according to claim 3, further comprising a process.
前記加算または前記減算の結果がアンダーフローあるいはオーバーフローを起こしたときに、前記加算または前記減算の結果に対して単射であるようにパディングを行い、該パディングの結果を前記第1の接頭辞配列または前記第2の接頭辞配列として出力する、
処理を含むことを特徴とする請求項4に記載の秘匿比較方法。
When the result of the addition or subtraction causes an underflow or overflow, padding is performed so that the result of the addition or subtraction is injective, and the result of the padding is added to the first prefix array. Or output as the second prefix array,
The secret comparison method according to claim 4, further comprising a process.
前記共通要素数から前記比較結果への変換は、前記第1の非負整数または前記第2の非負整数について、前記bビットが前記共通要素数に等しくなければ、値0から前記第1の非負整数または前記第2の非負整数までの第1の範囲と、前記第1の非負整数または前記第2の非負整数から2のb乗までの第2の範囲のそれぞれで、2分検索により、共通要素数が前記共通要素数となる値の各範囲を計算し、当該各範囲を前記比較結果として出力し、前記bビットが前記共通要素数に等しければ前記第1の非負整数または前記第2の非負整数を前記比較結果として出力する近さ判定を行う、
処理を含むことを特徴とする請求項3ないし6のいずれかに記載の秘匿比較方法。
The conversion from the number of common elements to the comparison result is as follows. For the first non-negative integer or the second non-negative integer, if the b bits are not equal to the number of common elements, the value 0 to the first non-negative integer Alternatively, a common element is obtained by a binary search in each of the first range up to the second non-negative integer and the second range from the first non-negative integer or the second non-negative integer to the power of 2 b. Calculate each range of values whose number is the number of common elements, output each range as the comparison result, and if the b bit is equal to the number of common elements, the first non-negative integer or the second non-negative integer Perform proximity determination to output an integer as the comparison result.
The secret comparison method according to claim 3, further comprising a process.
前記共通要素数から前記比較結果への変換は、
値0以上前記第1の集合または前記第2の集合の要素数未満の各整数値をランダムに並べた第1のリストまたは第2のリストについて、当該第1のリストまたは第2のリストの各要素を、当該要素の値が当該リストの長さの半分の値未満なら値1で、そうでなければ値0で、それぞれ置き換えた第1の修正リストまたは第2の修正リストをそれぞれ作成し、
前記第1の集合および前記第2の集合の各要素のうち、それぞれ前記第1の修正リストおよび前記第2の修正リストの要素が値1である位置の要素を抽出し、当該抽出した要素のうち共通のものの数を第2の共通要素数として秘匿計算で算出し、
前記第1の非負整数または前記第2の非負整数について、前記bビットが前記第2の共通要素数に等しくなければ、前記第1の非負整数または前記第2の非負整数を2進数表現に変換し当該2進数表現の前記第2の共通要素数に値1をプラスした値に対応するビット位置の値が1であれば、前記第1の非負整数または前記第2の非負整数が前記第2の非負整数または前記第1の非負整数よりも大きいことを示す大小比較結果を出力し、そうでなければ前記第1の非負整数または前記第2の非負整数が前記第2の非負整数または前記第1の非負整数よりも小さいことを示す大小比較結果を出力し、前記bビットが前記第2の共通要素数に等しければ前記第1の非負整数と前記第2の非負整数が等しいことを示す大小比較結果を出力する大小判定を行う、
処理を含むことを特徴とする請求項3ないし6のいずれかに記載の秘匿比較方法。
The conversion from the number of common elements to the comparison result is as follows:
For each of the first list and the second list, the first list or the second list in which integer values that are not less than 0 and less than the number of elements of the first set or the second set are randomly arranged Create a first modification list or a second modification list each replacing an element with a value of 1 if the value of the element is less than half the length of the list, and a value of 0 otherwise.
Among the elements of the first set and the second set, the elements at positions where the elements of the first correction list and the second correction list are 1 respectively are extracted, and the elements of the extracted elements The number of common ones is calculated by the secret calculation as the second common element number,
For the first non-negative integer or the second non-negative integer, if the b bits are not equal to the second common element number, the first non-negative integer or the second non-negative integer is converted into a binary representation. If the value of the bit position corresponding to the value obtained by adding the value 1 to the second common element number in the binary number representation is 1, the first non-negative integer or the second non-negative integer is the second Or a magnitude comparison result indicating greater than the first non-negative integer or greater than the first non-negative integer, otherwise the first non-negative integer or the second non-negative integer is the second non-negative integer or the first non-negative integer. A magnitude comparison result indicating that the first non-negative integer is smaller than 1, and if the b bit is equal to the second common element number, the first non-negative integer is equal to the second non-negative integer. The size judgment that outputs the comparison result Cormorant,
The secret comparison method according to claim 3, further comprising a process.
請求項7に記載の近さ判定の処理と請求項8に記載の大小判定の処理とから、前記比較結果を出力する、
処理を含むことを特徴とする請求項6および7に記載の秘匿比較方法。
The comparison result is output from the proximity determination process according to claim 7 and the size determination process according to claim 8.
The secret comparison method according to claim 6, further comprising a process.
比較対象の第1の数値および第2の数値をそれぞれ、互いの数値を共通要素数により比較判定可能な要素の第1の集合および第2の集合に変換する手段と、
前記第1の集合および前記第2の集合の共通要素数を秘匿計算で算出する手段と、
前記共通要素数を比較結果に変換して出力する手段と、
を備えることを特徴とする秘匿比較システム。
Means for converting the first numerical value and the second numerical value to be compared into a first set and a second set of elements that can be compared and determined by the number of common elements, respectively;
Means for calculating the number of common elements of the first set and the second set by a secret calculation;
Means for converting and outputting the number of common elements into a comparison result;
A secret comparison system comprising:
比較対象の第1の数値および第2の数値をそれぞれ、互いの数値を共通要素数により比較判定可能な要素の第1の集合および第2の集合に変換し、
前記第1の集合および前記第2の集合の共通要素数を秘匿計算で算出し、
前記共通要素数を比較結果に変換して出力する、
ステップをコンピュータに実行させるための秘匿比較プログラム。
The first numerical value and the second numerical value to be compared are respectively converted into a first set and a second set of elements that can be compared and determined by the number of common elements.
Calculating the number of common elements of the first set and the second set by a secret calculation;
Converting the number of common elements into a comparison result and outputting it,
A secret comparison program for causing a computer to execute steps.
JP2013250594A 2013-12-03 2013-12-03 Secrecy comparison method, program, and system Pending JP2015108682A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2013250594A JP2015108682A (en) 2013-12-03 2013-12-03 Secrecy comparison method, program, and system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2013250594A JP2015108682A (en) 2013-12-03 2013-12-03 Secrecy comparison method, program, and system

Publications (1)

Publication Number Publication Date
JP2015108682A true JP2015108682A (en) 2015-06-11

Family

ID=53439088

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2013250594A Pending JP2015108682A (en) 2013-12-03 2013-12-03 Secrecy comparison method, program, and system

Country Status (1)

Country Link
JP (1) JP2015108682A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2022244227A1 (en) * 2021-05-21 2022-11-24 日本電信電話株式会社 Secure collation system, information processing device, secure collation method, and program
WO2022244226A1 (en) * 2021-05-21 2022-11-24 日本電信電話株式会社 Secure coupling system, information processing device, secure coupling method, and program

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2001265596A (en) * 2000-03-15 2001-09-28 Mitsubishi Electric Corp Device and method for mining data
JP2009523270A (en) * 2005-12-09 2009-06-18 フラウンホファー‐ゲゼルシャフト・ツア・フェルダルング ・デア・アンゲバンテン・フォルシュング・エー・ファウ. Method and apparatus used for automatic comparison of data strings
WO2013038698A1 (en) * 2011-09-14 2013-03-21 独立行政法人産業技術総合研究所 Search system, search method, and program

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2001265596A (en) * 2000-03-15 2001-09-28 Mitsubishi Electric Corp Device and method for mining data
JP2009523270A (en) * 2005-12-09 2009-06-18 フラウンホファー‐ゲゼルシャフト・ツア・フェルダルング ・デア・アンゲバンテン・フォルシュング・エー・ファウ. Method and apparatus used for automatic comparison of data strings
WO2013038698A1 (en) * 2011-09-14 2013-03-21 独立行政法人産業技術総合研究所 Search system, search method, and program

Non-Patent Citations (4)

* Cited by examiner, † Cited by third party
Title
千田 浩司 ほか: "匿名等結合プロトコルとその応用", 2011年 暗号と情報セキュリティシンポジウム SCIS2011 [CD−ROM], vol. 2C3−4, JPN6014044978, 25 January 2011 (2011-01-25), JP, pages 1 - 8, ISSN: 0003558872 *
宇都宮 秀利 ほか: "ペアリングを用いた大小比較の秘匿計算の一手法", 情報処理学会第73回(平成23年)全国大会講演論文集(3) ネットワーク セキュリティ, vol. 1Y−3, JPN6014012180, 2 March 2011 (2011-03-02), JP, pages 3 - 471, ISSN: 0003558873 *
濱田 浩気 ほか: "秘匿計算上の結合アルゴリズム", 2012年度人工知能学会全国大会(第26回)論文集 [CD−ROM], vol. 312−OS−20−4, JPN6014044981, 15 June 2012 (2012-06-15), JP, pages 1 - 2, ISSN: 0003558871 *
濱田 浩気 ほか: "秘匿計算上の集約関数中央値計算アルゴリズム", CSS2012コンピュータセキュリティシンポジウム2012論文集, vol. 2012, no. 3, JPN6017017225, 23 October 2012 (2012-10-23), JP, pages 509 - 516, ISSN: 0003558874 *

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2022244227A1 (en) * 2021-05-21 2022-11-24 日本電信電話株式会社 Secure collation system, information processing device, secure collation method, and program
WO2022244226A1 (en) * 2021-05-21 2022-11-24 日本電信電話株式会社 Secure coupling system, information processing device, secure coupling method, and program

Similar Documents

Publication Publication Date Title
Sun et al. An efficient non-interactive multi-client searchable encryption with support for boolean queries
WO2018205549A1 (en) Fully homomorphic encryption-based ciphertext query method and system
JP6934963B2 (en) Data encryption methods and systems
US10341086B2 (en) Method and system for providing encrypted data for searching of information therein and a method and system for searching of information on encrypted data
Kaosar et al. Fully homomorphic encryption based two-party association rule mining
Thangavel et al. Enhanced DNA and ElGamal cryptosystem for secure data storage and retrieval in cloud
EP2951945B1 (en) Method and system for providing encrypted data for searching of information therein and a method and system for searching of information on encrypted data
Ahmad et al. Hybrid cryptography algorithms in cloud computing: A review
JP6961324B2 (en) Searchable cryptographic processing system
Olumide et al. A hybrid encryption model for secure cloud computing
Wang et al. Toward forward secure SSE supporting conjunctive keyword search
JP2007114494A (en) Secrecy computing method and device
Xu et al. Applications of cryptography in database: a review
Awais et al. A novel searchable encryption scheme to reduce the access pattern leakage
JP2015108682A (en) Secrecy comparison method, program, and system
Tu et al. Protecting secret documents via a sharing and hiding scheme
Sanober et al. Crytographical primitive for blockchain: a secure random DNA encoded key generation technique
Al Etaiwi et al. Structured encryption algorithm for text cryptography
Taka Secure Communication by combined Diffe-Hellman key exchange Based AES Encryption and Arabic Text Steganography.
Faraoun A novel fast and provably secure (t, n)-threshold secret sharing construction for digital images
Phull et al. Symmetric cryptography using multiple access circular queues (MACQ)
Paragas An enhanced cryptographic algorithm in securing healthcare medical records
Mudegol Hybrid encryption using symmetric block and stream cipher
JP2010186075A (en) Integer encrypting and decoding method
KR100919824B1 (en) Data encryption apparatus and encryption method using by it

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20160804

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20170412

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20170523

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20170629

A02 Decision of refusal

Free format text: JAPANESE INTERMEDIATE CODE: A02

Effective date: 20171114