WO2016171271A1 - Encrypted database system and encrypted data management method - Google Patents

Encrypted database system and encrypted data management method Download PDF

Info

Publication number
WO2016171271A1
WO2016171271A1 PCT/JP2016/062826 JP2016062826W WO2016171271A1 WO 2016171271 A1 WO2016171271 A1 WO 2016171271A1 JP 2016062826 W JP2016062826 W JP 2016062826W WO 2016171271 A1 WO2016171271 A1 WO 2016171271A1
Authority
WO
WIPO (PCT)
Prior art keywords
encrypted
database
unit
data
sql
Prior art date
Application number
PCT/JP2016/062826
Other languages
French (fr)
Japanese (ja)
Inventor
啓成 藤原
小島 剛
雅之 吉野
佐藤 嘉則
鈴木 貴之
Original Assignee
株式会社日立製作所
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 株式会社日立製作所 filed Critical 株式会社日立製作所
Publication of WO2016171271A1 publication Critical patent/WO2016171271A1/en

Links

Images

Classifications

    • GPHYSICS
    • G09EDUCATION; CRYPTOGRAPHY; DISPLAY; ADVERTISING; SEALS
    • G09CCIPHERING OR DECIPHERING APPARATUS FOR CRYPTOGRAPHIC OR OTHER PURPOSES INVOLVING THE NEED FOR SECRECY
    • G09C1/00Apparatus or methods whereby a given sequence of signs, e.g. an intelligible text, is transformed into an unintelligible sequence of signs by transposing the signs or groups of signs or by replacing them by others according to a predetermined system
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/62Protecting access to data via a platform, e.g. using keys or access control rules

Definitions

  • the present invention relates to a concealment database system that encrypts data and deposits it with others.
  • a concealment database system that makes it impossible to restore data on the cloud by having only the hospital side have the data concealment key and reduces the risk of data export on the cloud side. Is effective. Furthermore, it is effective to enable search and analysis without decrypting the data at the data center by using a searchable encryption technique or the like that enables search of the data as encrypted.
  • Patent Document 1 is a user system connected to a database system via a network, and stores means for managing key information for encryption and decryption, and data and / or metadata safety setting information To determine whether or not encryption is required for the storage unit and the database operation instruction, and if encryption is necessary, the database is selected after encryption is selected according to the data and / or metadata. When the database operation is performed by transmitting to the control means, and encryption is not required, the database operation instruction is transmitted to the database control means to execute the database operation, and the processing result transmitted from the database control means is received.
  • an application response means returns the response of the database operation instruction, the system comprising a safety setting means for setting the security information of the data stored in the database is disclosed.
  • Patent Document 2 discloses a searchable cryptographic processing system in which a DB server that deposits data, a registration client that deposits data in the DB server, and a search client that causes the DB server to retrieve data are linked via a network,
  • the registration client deposits the encrypted data to the server using a probabilistic encryption method with a mask using a hash value and a homomorphic function, and the search client uses a homomorphic function to encrypt the search query.
  • a system that uses probabilistic encryption with a mask causes the DB server to release the mask, and causes the DB server to output search queries and non-corresponding data as search results so that the frequency of appearance of the data corresponding to the search does not leak Is disclosed.
  • a database index function as one of the means of high-speed search of large-capacity data in a normal database.
  • the index function has a data structure corresponding to an index for a specific column, thereby enabling a high-speed search by narrowing down the search target range.
  • an ordinary database index function may not be effective in retrieving encrypted data. In that case, a large amount of data cannot be searched at high speed.
  • the prior art does not disclose means for enabling high-speed retrieval of a large amount of data in an encrypted database in which the normal index function is not effective.
  • the normal database index function may or may not be effective depending on the appearance frequency of the attribute value to be searched. For example, a certain database product automatically determines whether or not to use an index depending on whether or not the frequency of attribute values to be searched exceeds a certain ratio with respect to the number of attribute values of the attribute. However, if the data is encrypted so that the frequency distribution is not known, the cloud side cannot determine whether or not to use the index based on the frequency distribution.
  • the present invention has been made in consideration of the above points, and proposes a concealment database system that enables high-speed retrieval of a large amount of encrypted data.
  • a typical example of the invention disclosed in the present application is as follows. That is, a concealment database system configured by a center system in which encrypted data obtained by encrypting original data owned by a user system with an encryption key managed by a data owner is deposited, and the center system includes the depository data A function of retrieving the encrypted data without decrypting the original data into the original data, wherein the user system uses a plain SQL sentence for processing the encrypted data, and the encrypted data as the encrypted data.
  • a database wrapper unit that converts the encrypted SQL text received from the center system into a encrypted SQL sentence to be processed on the center system, and the center system stores the encrypted data
  • the encrypted deposit data table and the encrypted hash value obtained by encrypting the hash value of the original data are stored.
  • a ciphertext match comparison unit that determines a match with a query, and the database wrapper unit processes a plaintext SQL sentence for searching the encrypted data, and processes the encrypted data on the center system.
  • the encrypted data is converted to an encrypted SQL sentence and the encrypted SQL sentence received by the center system is executed, whereby the database control unit searches the hash table to limit the range of the encrypted data, and A sentence match comparison unit performs a match comparison indicated by the encrypted SQL sentence for the limited range of encrypted data, and The database control unit transmits the execution result of the encrypted SQL statement to the user system, and the database wrapper unit decrypts the execution result of the SQL statement received from the database control unit, and displays the search result of the encrypted data. Output.
  • FIG. 1 shows a hardware and software configuration of a concealment database system 1 according to the first embodiment of the present invention. It is a block diagram.
  • the concealment database system 1 encrypts the original data possessed by the user system side server 3 and deposits it in the cloud system side server 4. Further, the cloud system side server 4 has a search function and an analysis function for the deposited data. This is a system provided to the system-side server 3.
  • the concealment database system 1 includes a user terminal 2, a user system side server 3, and a cloud system side server 4, as shown in FIG.
  • the user terminal 2 and the user system side server 3 are connected via a user internal network 5 including a local area network in the user's office.
  • the user system side server 3 and the cloud system side server 4 include a user internal network 5, an external network 6 including a wide area network provided by the Internet or a carrier, and a local area network in a data center of a cloud provider. Connected via the internal network 7.
  • the user terminal 2 is a device such as a personal computer, a tablet terminal, or a smartphone used by an end user, and includes a display device, an input device, a nonvolatile storage device (magnetic disk drive, SSD), a memory, a CPU, a network interface, and the like. .
  • the user terminal 2 transmits the request input from the input device by the end user to the application unit 211 of the user system side server 3 in plain text, receives the result for the request, displays the result on the display device, Memorize the results in the fusogenic memory.
  • the user system side server 3 is a computer having a memory 210, a display device 220, an input device 230, a CPU 240, a network interface device (NIC) 250, a disk device 260, and the like.
  • the server 3 on the user system side generates a ciphertext SQL from the request for plaintext received from the user terminal 2, sends it to the cloud system side server 4, receives the result of the ciphertext for the SQL text, Decrypt and send the plaintext result to the user terminal 2.
  • the application unit 211 is configured by the CPU 240 reading an application program to the memory 210 via the disk device 260, the external storage medium, or the user internal network 5, and executing the application program read by the CPU 240.
  • the application unit 211 processes the plaintext request received from the user terminal 2, transmits a plaintext SQL sentence necessary in the course of processing to the database wrapper unit 212, and receives a plaintext result for the SQL sentence.
  • the database wrapper unit 212 is configured by the CPU 240 reading a program to the memory 210 via the disk device 260, an external medium, or the user internal network 5, and executing the program read by the CPU 240.
  • the database wrapper unit 212 converts the plain text SQL received from the application unit 211 into cipher text SQL using information in the secret index map table 262 of the disk device 260, and transmits the cipher text SQL to the database interface unit 213. Further, the result of the ciphertext for the SQL text is received from the database interface unit 213, decrypted into plaintext, and the plaintext result is transmitted to the application unit 211.
  • the database interface unit 213 is configured by the CPU 240 reading a program to the memory 210 via the disk device 260, an external medium, or the user internal network 5, and executing the program read by the CPU 240.
  • the database interface unit 213 transmits the SQL of the ciphertext received from the database wrapper unit 212 to the cloud system side server 4, receives the result of the ciphertext from the cloud system side server 4, and transmits it to the database wrapper unit 212.
  • the disk device 260 is composed of a nonvolatile storage device such as a hard disk drive or a solid state drive, and stores a main table 261 and a secret index map table 262.
  • the main table 261 stores plaintext information before depositing to the cloud system side server 4.
  • the secret index map table 262 stores related information for accessing the information in the encryption main table 361 on the cloud system server 4 at high speed.
  • the cloud system side server 4 includes a computer including a memory 310, a display device 320, an input device 330, a CPU 340, a network interface device (NIC) 350, a disk device 360, and the like. .
  • the cloud system side server 4 executes SQL of the ciphertext received from the user system side server 3 and transmits the obtained ciphertext execution result to the user system side server 3.
  • the database control unit 311 is configured by the CPU 340 reading the program to the memory 310 via the disk device 360, the external medium or the cloud internal network 7, and the CPU 340 executing the read program.
  • the database control unit 311 receives the ciphertext SQL from the user system side server 3, and uses the information in the hash table 362 and the function of the user definition function unit 312 to send the ciphertext SQL to the encryption main table 361. Then, the result of the obtained ciphertext is transmitted to the server 3 on the user system side.
  • the user-defined function unit 312 is configured by the CPU 340 reading the program to the memory 310 via the disk device 360, the external medium, or the cloud internal network 7, and the CPU 340 executing the read program.
  • the user-defined function unit 312 receives input information to the user-defined function from the database control unit 311, executes processing by the user-defined function that determines whether the original plaintexts of different ciphertexts match, and the processing result Is output to the database control unit 311.
  • the disk device 360 includes a nonvolatile storage device such as a hard disk drive or a solid state drive, and stores an encrypted main table 361 and a hash table 362.
  • the encrypted main table 361 encrypts and stores the main table 261.
  • the hash table 362 stores information for speeding up access to the encrypted main table 361.
  • FIG. 2 shows a logical configuration of the database wrapper unit 212.
  • the database wrapper unit 212 includes an encryption unit 2121, a search query generation unit 2122, a decryption unit 2124, a key management unit 2125, an SQL conversion unit 2126, and a secret index SQL conversion unit 2127.
  • the encryption unit 2121 receives the encryption key acquired from the plaintext and key management unit 2125, converts the input plaintext into ciphertext, and outputs the ciphertext.
  • the search query generation unit 2122 generates a search query necessary for a match search between the encrypted data stored in the encryption main table 361 and the search data. That is, the search query generation unit 2122 receives the plaintext search data and the encryption key and search key acquired from the key management unit 2125 as input, and identifies the encrypted data in the encryption main table 361 that matches the search data. An encrypted search query serving as input information is generated and an encrypted search query is output.
  • the hash value generation unit 2123 receives the hash length specifying the plaintext data and the number of types of hash values to be generated, acquires the plaintext hash value obtained by processing the plaintext data with the hash function, and outputs the plaintext hash value.
  • the decryption unit 2124 receives the encryption key acquired from the ciphertext and key management unit 2125, converts the input ciphertext into plaintext, and outputs the plaintext.
  • the key management unit 2125 manages key information used for encryption, decryption, and search query generation. That is, the key management unit 2125 stores the encryption key data and the search key data in the memory 210 and / or the disk device 260, and requests the key from the encryption unit 2121, the search query generation unit 2122, or the decryption unit 2124. In contrast, encryption key data or search key data is provided. Note that both encryption key data and search key data may be provided.
  • the SQL conversion unit 2126 creates SQL that performs processing only on the encrypted main table 361. That is, the SQL conversion unit 2126 receives the plain text SQL, replaces the search data with the encrypted search query, replaces the plain text data to be inserted or updated with the cipher text data, and replaces the match comparison text with the cipher text of the user definition function unit 312. An encrypted SQL statement replaced with a user-defined function call statement that calls the match comparison unit 3121 is generated. Then, the encrypted SQL sentence is transmitted to the database interface unit 213.
  • the secret index SQL conversion unit 2127 performs processing on the encryption main table 361 and the hash table 362. That is, the secret index SQL conversion unit 2127 receives plain text SQL, replaces the search data with an encrypted search query, and generates a hash value from the search data. Then, the generated hash value is replaced with an encrypted search query, the plaintext data to be inserted or updated is replaced with ciphertext data, and a plaintext hash value is generated from the plaintext data to be inserted or updated. Then, the generated plaintext hash value is replaced with a ciphertext hash value, and an encrypted SQL sentence that performs at least one of reference, insertion, update, and deletion on the hash table 362 and the encryption main table 361 is generated. Then, the encrypted SQL sentence is transmitted to the database interface unit 213.
  • FIG. 3 shows a logical configuration of the user-defined function unit 312.
  • the user definition function unit 312 includes a ciphertext match comparison unit 3121.
  • the ciphertext match comparison unit 3121 stores the search key data in the memory 310 and / or the disk device 360, receives the input of the encrypted search query and the ciphertext data from the database control unit 311, and encrypts using the search key
  • the encrypted search query is decrypted into a match search query that can be compared with the ciphertext data, and the match search query is compared with the encrypted data.
  • a value indicating the match for example, “1”
  • the value indicating the mismatch for example, "0" is output.
  • FIG. 4 shows a data structure of the main table 261 indicating plain text data before being encrypted and deposited.
  • the main table 261 is stored in the disk device 260 or the memory 210 of the user system side server 3.
  • the main table 261 may be stored in both the disk device 260 and the memory 210.
  • the table is hospital data
  • the schema name is “medical information”
  • the table name is “patient information”.
  • the main table 261 includes a “patient number” column that is a number that uniquely identifies a patient, a “name” column that is the name of the patient, and a “disease name” column that indicates the type of disease of the patient.
  • the record 2611 indicates that the name of the patient whose patient number is “0000001” is “Suzuki” and the disease name is “hypertension”.
  • the main table 261 stores 1 million records from patient numbers “0000001” to “1000000”.
  • FIG. 5 shows the data structure of the secret index map table 262 that stores information that associates the hash table 362 that speeds up the search with the map ID column of the encrypted main table 361.
  • the secret index map table 262 is stored in the disk device 260 or the memory 210 of the user system side server 3.
  • the secret index map table 262 may be stored in both the disk device 260 and the memory 210.
  • hospital data is assumed, and the secret index map table 262 indicates that the “schema name” column for classifying hospital table types includes “medical information” or “management information”. Show.
  • the “encrypted main table name” column indicating the name of each table indicates that a “patient information” table, a “drug information” table, a “medicine information” table, a “medical accounting” table, and the like exist.
  • the column “column name” indicates that the hash table 362 corresponding to the column exists, and that the encryption main table 361 includes a “map ID name” column indicating the relationship with the hash table 362.
  • the “map ID column name” column and the “hash table name” relate to the map ID column name such as the “MapID-1” column included in the encryption main table 361 and the hash table 362 such as the hash table 362 (HT1). Indicates.
  • the hash table 362 is not generated for a column whose search is not accelerated even if it is indexed. Specifically, it is not necessary to generate a column having a distribution of column attribute values in which the same attribute value occupies most.
  • the “column name” having the related map ID column and the hash table is “disease name”, and the related “map ID column name” is “ MapID-1 ”, indicating that the associated“ hash table name ”is“ HT1 ”.
  • FIG. 6 shows the data structure of the encrypted main table 361 for storing the ciphertext data of the main table 261 deposited by the cloud system side server 4.
  • the encryption main table 361 is stored in the disk device 360 or the memory 310 of the cloud system side server 4. Note that the encryption main table 361 may be stored in both the disk device 360 and the memory 310.
  • the encrypted main table 361 includes a “patient number” column, a “name” column, and a “disease name” column included in the main table 261. Furthermore, a record is configured by an “ID” column that is an identifier for uniquely specifying each record in the encryption main table 361 and a “MapID-1” column that is information related to the hash table (HT1) 362.
  • the encrypted patient number is “Enc (0000001)”
  • the encrypted name is “Enc (Kojima)”
  • the encrypted disease name is “Enc (hypertension)”
  • the identifier of the record Is “1” and the value of MapID-1 indicating the association with the hash table 362 is “1”.
  • “Enc ()” indicates that the plaintext data in “()” is a ciphertext encrypted by the encryption unit 2121.
  • the normal index function of the database control unit 311 is applied to the “ID” column and the “MapID-1” column.
  • FIG. 7 shows the data structure of the hash table 362 used for speeding up the search.
  • the hash table 362 is stored in the disk device 360 or the memory 310 of the cloud system side server 4.
  • the hash table 362 may be stored in the disk device 360 and the memory 310 of the cloud system side server 4.
  • the record of the hash table 362 includes the “MapID” column indicating the correspondence information with the “MapID-1” column of the encryption main table 361, and the plaintext hash value obtained by converting the plaintext data by the hash value generation unit 2123 into the encryption unit 2121. Is composed of an “encrypted hash value” column indicating an encrypted value.
  • the value of the “MapID” column is equal to the value of “MapID-1” of one or more records in the main table 261. Therefore, by designating “MapID”, the search range can be limited without searching all records in the encrypted main table 361.
  • FIG. 8 Flow of processing related to search of concealment database Using FIG. 8, FIG. 9 and FIG. 10, in the concealment database system 1, a concealment index search that is a search using the hash table 362 is performed. Details of a series of processing performed by the database wrapper unit 212 and the database control unit 311 will be described.
  • FIG. 8 is a flowchart showing a secret index search query generation process executed by the database wrapper unit 212 in the user system side server 3.
  • the secret index search query generation process starts when the database wrapper unit 212 receives a plain text search SQL from the application unit 211.
  • the SQL received by the database wrapper unit 212 at the start of the secret index search query generation process is the following plaintext search SQL (1).
  • Patient Information WHERE Disease Name Diabetes (1)
  • This search SQL searches a record whose schema name is “medical information” and whose table name is “patient information” and whose value of the “disease name” column is “diabetes”, and sets all the column values. It means that it is obtained as a search result (step 810).
  • the database wrapper unit 212 acquires “map ID column name” and “hash table name” of the search target column from the secret index map table 262. Specifically, the database wrapper unit 212 searches the secret index map table 262 using the combination of the schema name, the encryption main table name, and the column name that are to be searched by the plaintext search SQL as a key. The “map ID column name” and “hash table name” of the record having the same main table name and column name are acquired. For example, when the plain text search SQL is (1), from the record 2621 where the schema name is “medical information”, the encrypted main table name is “patient information”, and the column name is “disease name”. The map ID column name “MapID-1” and the hash table name “HT1” are acquired (step 830).
  • step 840 the database wrapper unit 212 determines whether or not the result of step 830 exists (step 840).
  • step 840 the database wrapper unit 212 performs a search SQL conversion process that does not use the hash table 362. Specifically, the database wrapper unit 212 replaces the plaintext SQL search target value with the encrypted search query generated in step 820, and further matches the WHERE clause match comparison statement with the ciphertext of the user definition function unit 312.
  • the ciphertext search SQL replaced with the format for calling the match comparison unit 3121 is output. For example, when the plaintext SQL is (1) and the encrypted search query is (2), the following ciphertext search SQL (3) is output (step 850).
  • Patient information WHERE Ciphertext match comparison unit (disease name, encrypted search query (diabetes)) (3)
  • step 840 the database wrapper unit 212 performs the secret index search SQL conversion (step 860-) from the hash value generation in order to perform a high-speed search using the hash table 362.
  • the ciphertext search SQL for which the processing of 880) is performed is output.
  • the database wrapper unit 212 inputs the hash value acquired in step 860 to the search query generation unit 2122, and uses the output as a hash table search query.
  • the database wrapper unit 212 first searches the hash table 362 to limit the search range, and then performs a secret index search SQL conversion that generates an SQL for searching the encrypted main table 361. Specifically, the encrypted search query obtained in step 820, the map ID column name and hash table name obtained in step 830, and the hash table search query obtained in step 870 are input, and the hash table 362 is hashed. The value of the “MapID” column of the corresponding record is acquired by searching with a table search query. Then, a record having a value that matches the encrypted search query from the record of the encrypted main table 361 having the value of the “MapID-1” column equal to the acquired value is converted into a ciphertext match comparison unit of the user definition function unit 312.
  • ciphertext search SQL is output (step 880).
  • the database wrapper unit 212 transmits the ciphertext search SQL output in step 850 or step 880 to the database interface unit 213. If the plaintext search SQL is (1), the result of step 840 exists, so the database wrapper unit 212 transmits the ciphertext search SQL (6) output in step 880 to the database interface unit 213 (step 890). ). As described above, the database wrapper unit 212 ends the secret index search query generation process (FIG. 8).
  • FIG. 9 is a flowchart showing a secret index search process executed by the database control unit 311 in the cloud system side server 4.
  • the secret index search process starts when the database control unit 311 receives the ciphertext search SQL from the database interface unit 213.
  • the SQL received by the database control unit 311 at the start of the secret index search process is the ciphertext search SQL (6).
  • the database control unit 311 identifies a hash table 362 and a hash table search query to be searched from the ciphertext search SQL, and the ciphertext match comparison unit 3121 of the user definition function unit 312 performs the hash table 362.
  • the record in which the “encrypted hash value” column value matches the hash table search query is specified, and the “MapID” column value of the specified record is acquired as MapID_hit.
  • the hash table 362 is the hash table 362 (HT1)
  • the hash table search query is “hash table search query (1012)” in (5).
  • the search query matches the encrypted hash value “Enc (1012)” of the record 3622 of the hash table 362 (HT 1), and MapID “2” of the record Is acquired as MapID_hit (step 910).
  • the database control unit 311 determines from the encryption main table 361 that the value of the map ID column corresponding to the hash table 362 has a value that matches MapID_hit and a value that matches the encryption search query.
  • the record group MapResult confirmed by the ciphertext match comparison unit 3121 of 312 is acquired. For example, when the ciphertext search SQL is (6), for example, the database control unit 311 determines that the value of the map ID column “MapID-1” from the encryption main table 361 is “2” acquired in step 910.
  • a record group having Enc (diabetes) that is a value of the “disease name” column that matches and the value of the encrypted search query (diabetes) is confirmed by the ciphertext match comparison unit 3121, and as a result, records 3613 and 3615 are recorded. Is acquired as MapResult (step 920).
  • the database control unit 311 transmits a record group obtained by removing the ID column and the map ID column from the Map Result to the database interface unit 213 of the user system side server 3 as a search result.
  • a record group excluding the “ID” column and the “MapID-1” column from the records 3613 and 3615 of the encryption main table 361 is used as the ciphertext search result. Transmit (step 930).
  • the secret index search process (FIG. 9) is completed.
  • FIG. 10 is a flowchart showing a search result decoding process executed by the database wrapper unit 212 in the user system side server 3.
  • the search result decryption process starts when the database wrapper unit 212 receives the ciphertext search result from the database interface unit 213.
  • the database wrapper unit 212 inputs the ciphertext search result to the decryption unit 2124, and obtains the plaintext search result as an output (step 1010). Finally, the database wrapper unit 212 transmits a plain text search result to the application unit 211 (step 1020). Thus, the search result decoding process (FIG. 10) is completed.
  • FIG. 11 is a flowchart showing a secret index insertion query generation process executed by the database wrapper unit 212 in the user system side server 3.
  • the secret index insertion query generation process starts when the database wrapper unit 212 receives the plain text insertion SQL from the application unit 211.
  • the SQL received by the database wrapper unit 212 at the start of the secret index insertion query generation process is the following plaintext insertion SQL (7).
  • INSERT INTO Medical information.Patient information patient number, name, disease name
  • VALUES 1000001, Kinoshita, gastroenteritis
  • the value of the “patient number” column is “1000001” and the value of the “name” column is “1000001” for the table whose schema name is “medical information” and whose table name is “patient information”.
  • the database wrapper unit 212 extracts the value to be inserted from the plain text insertion SQL, and encrypts it by the encryption unit 2121.
  • the plaintext insertion SQL is (7)
  • the values to be inserted are “1000001”, “Kinoshita”, and “Gastroenteritis”
  • the output ciphertexts obtained as a result of encryption by the encryption unit 2121 are respectively “Enc (1000001)”, “Enc (Kinoshita)”, and “Enc (gastroenteritis)” are obtained (step 1120).
  • the database wrapper unit 212 acquires “map ID column name” and “hash table name” related to the record to be inserted from the secret index map table 262. Specifically, the database wrapper unit 212 searches the secret index map table 262 using the combination of the schema name and encryption main table name to be inserted by the plaintext insertion SQL as a key, and the schema and encryption main table name. “Column name”, “map ID column name”, and “hash table name” are acquired from all records that match.
  • the column name “disease name”, map ID column name from the record 2621 whose schema name is “medical information” and whose encrypted main table name is “patient information” “MapID-1” and hash table name “HT1” are acquired (step 1130).
  • step 1140 the database wrapper unit 212 determines whether or not the result of step 1130 exists (step 1140).
  • the database wrapper unit 212 When the result of step 1140 does not exist (NO), the database wrapper unit 212 performs an insertion SQL conversion process that does not use the hash table 362. Specifically, the database wrapper unit 212 outputs the ciphertext insertion SQL in which the value to be inserted in the plaintext insertion SQL is replaced with the ciphertext value generated in step 1120. For example, when the plaintext SQL is (7), the ciphertext insertion SQL outputs the following ciphertext insertion SQL (8) (step 1150).
  • step 1140 the database wrapper unit 212 performs hash index generation to secret index insertion SQL conversion (steps 1160 to 1190) in order to perform insertion that is consistent with the hash table 362. ) To output ciphertext insertion SQL.
  • the database wrapper unit 212 inputs the value of the column related to the hash table 362 among the insertion target values to the hash value generation unit 2123, and acquires the output hash value. For example, when the plaintext insertion SQL is (7), the following hash value (9) is acquired (step 1160).
  • the database wrapper unit 212 inputs the hash value acquired in step 1160 to the search query generation unit 2122, and uses the output as a hash table search query.
  • hash table search query (0035) search query generation unit (encryption key, search key, “0035”) (10)
  • the database wrapper unit 212 inputs the hash value to the encryption unit 2121 and acquires the output encrypted hash value. For example, when the plaintext hash value is (8), the encrypted hash value is “Enc (0035)” (step 1180).
  • the database wrapper unit 212 searches the hash table 362 with a hash table search query. If the search does not match, after inserting a record that includes a new MapID and an encrypted hash value, the MapID of the record that matches the hash table search query is acquired, and the MapID and the value of the record of the ciphertext acquired in Step 1120
  • a secret index insertion SQL conversion is performed for inserting a record composed of an ID which is an identifier of a new record into the encryption main table 361. For example, when the plaintext SQL is (7), the following ciphertext insertion SQLs (11) and (12) are output (step 1190).
  • INSERT INTO hash table 362 MapID, encrypted hash value
  • INSERT INTO encryption main table 361 Principal number, name, disease name, ID, MapID-1) VALUES (Enc (1000001), Enc (Kinoshita), Enc (Gastroenteritis), New ID, (SELECT MapID FROM hash table 362 WHERE Encrypted match comparison unit (encrypted hash value, hash table search query (0035)) ); (12)
  • the database wrapper unit 212 transmits the ciphertext insertion SQL output in step 1150 or step 1190 to the database interface unit 213.
  • the database wrapper unit 212 converts the ciphertext insertion SQL (11) and (12) output in step 1190 to the database interface unit 213. (Step 1195).
  • the secret index insertion query generation process in FIG. 11 is completed.
  • FIG. 12 is a flowchart showing a secret index insertion process executed by the database control unit 311 in the cloud system side server 4.
  • the secret index insertion process starts when the database control unit 311 receives the ciphertext insertion SQL from the database interface unit 213.
  • the SQL received by the database control unit 311 at the start of the secret index insertion process is the ciphertext insertion SQL (11) and (12).
  • the database control unit 311 specifies a hash table, a hash table search query, and an encrypted hash value to be searched from the ciphertext search SQL. Then, the ciphertext match comparison unit 3121 of the user definition function unit 312 determines whether or not there is a record in which the value of the “encrypted hash value” column of the hash table 362 matches the hash table search query. (Step 1210).
  • step 1210 If it is determined in step 1210 that there is a record that matches the search query (YES), the database control unit 311 acquires the value of the MapID column of the record as MapID_hit (step 1220).
  • step 1210 determines whether there is no record that matches the search query. If it is determined in step 1210 that there is no record that matches the search query, the database control unit 311 generates a new MapID to MapID_hit, along with the encrypted hash value acquired from the search SQL, and the hash table 362. As a record (step 1230).
  • the database control unit 311 executes ciphertext insertion SQL, and inserts a record composed of the encrypted value, ID, and MapID_hit into the encrypted main table 361.
  • the database control unit 311 determines that the patient number is “Enc (1000001)”, the name is “Enc (Kinoshita)”, the disease name is “Enc (gastroenteritis)”, and the ID is “ A record having “1000001” and MapID-1 “10” is inserted into the encryption main table 361 (step 1240).
  • the database control unit 311 transmits the execution result of the insertion SQL to the database interface unit 213 of the user system side server 3 (step 1250).
  • the secret index insertion process (FIG. 12) is completed.
  • FIG. 13 is a flowchart showing a secret index update query generation process executed by the database wrapper unit 212 in the user system side server 3.
  • the secret index update query generation process starts when the database wrapper unit 212 receives a plaintext update SQL from the application unit 211.
  • the SQL received by the database wrapper unit 212 at the start of the secret index update query generation process is the following plaintext update SQL (13).
  • the database wrapper unit 212 extracts the value of the update source column from the plaintext update SQL (13), and acquires an encrypted search query used for matching search in the encrypted main table 361 using the search query generation unit 2122. To do. Specifically, the database wrapper unit 212 acquires an encryption key and a search key from the key management unit 2125, inputs the acquired key to the search query generation unit 2122, and obtains an encrypted search query as its output. For example, when the plaintext update SQL is (13), “encrypted search query (diabetes)” is obtained in the same manner as the encrypted search query (2) (step 1315).
  • the database wrapper unit 212 acquires “map ID column name” and “hash table name” of the update source column from the secret index map table 262. Specifically, the database wrapper unit 212 searches the secret index map table 262 using the combination of the schema name, the encrypted main table name, and the update source column name that are to be searched by the plaintext search SQL as a key. The “map ID column name” and “hash table name” of the record having the same name, encrypted main table name, and column name are acquired.
  • the schema name is “medical information”
  • the encrypted main table name is “patient information”
  • the record includes the update source column name “disease name”
  • the map ID column name “MapID-1” and the hash table name “HT1” are obtained from the information 2621 (step 1320).
  • step 1325 the database wrapper unit 212 determines whether or not the result of step 1320 exists (step 1325).
  • the database wrapper unit 212 performs a process of converting the update SQL without using the hash table 362. Specifically, the database wrapper unit 212 first transmits an SQL for obtaining an update target ID list, which is a list of IDs of records to be updated, from the encryption main table 361 to the database interface unit 213, and as a result An update target ID list is received. For example, when the plaintext update SQL is (13), the update target ID list is acquired by the following SQL (14) (step 1330). SELECT ID FROM medical information.patient information WHERE ciphertext match comparison part (disease name, encrypted search query (diabetes)) (14)
  • the database wrapper unit 212 acquires the number of update target IDs from the update ID list obtained in step 1330, and generates ciphertexts with updated values for the number of acquired update target IDs. For example, when the update SQL of the plaintext is (13), the number of update target IDs is “3” and “1000000”, so the ciphertext of the updated value is Enc (Angina) and Enc When using probabilistic encryption, these are different ciphertexts (step 1335).
  • the database wrapper unit 212 generates a ciphertext update SQL for updating the ciphertext of the two updated values obtained in step 1335 as the record values indicated by the respective update target IDs.
  • This update SQL is preferably described in one sentence SQL, but if the maximum length of the SQL sentence of the database control unit 311 is exceeded, a plurality of divided update SQLs may be generated.
  • the plaintext update SQL is (13)
  • the following update SQL (15) is output (step 1340).
  • UPDATE Medical information.Patient information SET "Disease name” CASE ID WHEN 3 THEN Enc WHEN 1000000 THEN Enc (angina) END WHERE Ciphertext match comparison unit (disease name, encrypted search query (diabetes)) (15)
  • step 1320 when the result of step 1320 exists (YES), the database wrapper unit 212 updates the encryption main table 361 and the hash table 362 to update the secret index update SQL conversion (steps 1345 to 1370).
  • the update SQL of the ciphertext that has been performed) is output.
  • the database wrapper unit 212 inputs the updated value to the hash value generation unit 2123 and acquires the output hash value. For example, when the plaintext update SQL is (13), the hash value (16) is acquired (step 1345).
  • the database wrapper unit 212 inputs the hash value acquired in step 1345 to the search query generation unit 2122, and uses the output as a hash table search query.
  • the database wrapper unit 212 inputs the hash value acquired in step 1345 to the encryption unit 2121 and acquires an encrypted hash value to be inserted into the hash table 362 as an output. For example, when the plaintext hash value (16) is “0500”, the encrypted hash value is “Enc (0500)” (step 1360).
  • the database wrapper unit 212 uses the hash table 362 to execute the secret index update target ID table acquisition SQL for acquiring the table of the ID column values of the record group to be updated, and to update the update target ID table. obtain. Specifically, the database wrapper unit 212 uses the encrypted search query for the update source value acquired in step 1315, the map ID column name and hash table name related to the update source column acquired in step 1320, and the update source. The hash table search query of the value of the value is input, the hash table 362 is searched, the search range of the encryption main table 361 is limited, the SQL for acquiring the update target ID table is executed, and the result is used as the update target ID table Output as.
  • the secret index update target ID table acquisition SQL generates the following ciphertext search SQL (18) and sends it to the database control unit 311 via the database interface unit 213.
  • the execution result is acquired as an update target ID table (step 1360).
  • the database wrapper unit 212 acquires the number of update target IDs from the update ID list obtained in step 1360, and generates a ciphertext list with updated values for the number of acquired update target IDs. For example, when the plaintext update SQL is (13), the number of update target IDs is two, “3” and “1000000”, as in step 1335. Therefore, the ciphertext list of updated values is Enc. (Angina pectoris) and Enc (angina pectoris). If probabilistic encryption is used, these are different ciphertexts (step 1365).
  • the database wrapper unit 212 receives plaintext update SQL, various information acquired in steps 1315, 1320, 1350, 1355, 1360, and 1365 as input, and updates ciphertext update SQL for the secret index. Output. Specifically, first, an encrypted match search is performed using the hash table search query of the updated value of the hash table 362. If there is no match, a record consisting of the encrypted hash value of the updated value and the new MapID value Is inserted into the hash table 362. Second, an SQL for acquiring the MapID of the updated value from the hash table 362 is generated. Third, in the encryption main table 361, for each record having the update target ID, an update SQL for replacing the ciphertext of the updated value is generated.
  • the plaintext update SQL is (13)
  • the first SQL is the following update SQL (19)
  • the second SQL is the following update SQL (20)
  • the third SQL is the following update SQL (21).
  • the ciphertext update SQL including these three SQL texts is output (step 1370).
  • INSERT INTO hash table 362 MapID, encrypted hash value
  • SELECT New MapID, encrypted hash value "Enc (0500)" FROM hash table 362 WHERE NOT EXIST SELECT * FROM hash table 362 WHERE Encryption match comparison part (encrypted hash value, hash table search query (0500) ) ) LIMIT 1; (19) SELECT MapID FROM hash table 362 WHERE Encryption match comparison unit (encrypted hash value, hash table search query (0500)) (20)
  • the database wrapper unit 212 transmits the ciphertext update SQL output in step 1340 or step 1370 to the database interface unit 213.
  • the database wrapper unit 212 converts the SQL (19), (20), and (21) of the ciphertext output from step 1370 to the database interface unit. It transmits to 213 (step 1375).
  • the database wrapper unit 212 ends the secret index update query generation process (FIG. 13).
  • FIG. 14 is a flowchart showing an update target ID list acquisition process executed by the database control unit 311 in the cloud system side server 4.
  • the update target ID list acquisition process starts when the database control unit 311 receives the ciphertext search SQL from the database interface unit 213.
  • step 1410 all the IDs of the records whose update target column values match the encrypted search query are acquired from the encrypted main table 361 (step 1410). Finally, the acquisition result is transmitted to the database interface unit 213 (step 1420), and the update target ID list acquisition process (FIG. 14) is terminated. For example, when the ciphertext search SQL is (14), the elements of the update target ID list are “3” and “1000000”.
  • FIG. 15 is a flowchart showing a secret index update target ID table acquisition process executed by the database control unit 311 in the cloud system side server 4.
  • the secret index update target ID table acquisition process starts when the database control unit 311 receives the ciphertext search SQL from the database interface unit 213.
  • the MapID of the record that matches the hash table search query is acquired from the hash table 362 (step 1510).
  • the ID of the record having the value of MapID-1 that matches the MapID acquired in step 1510 and the value of the “disease name” column that is the update source column matches the encrypted search query is stored in the encrypted main table 361.
  • the acquisition result is transmitted to the database interface unit 213 (1530), and the confidential index update target ID table acquisition process (FIG. 15) is terminated.
  • the update target ID table is a table storing “3” and “1000000” as values of the ID column.
  • FIG. 16 is a flowchart showing a secret index update process executed by the database control unit 311 in the cloud system side server 4.
  • the secret index update process starts when the database control unit 311 receives the ciphertext update SQL from the database interface unit 213.
  • the SQL received by the database control unit 311 at the start of the secret index update process is the ciphertext update SQL (19), (20), and (21).
  • the database control unit 311 acquires the hash table 362 and the hash table search query (0500) to be updated from the first SQL of the ciphertext update SQL (19).
  • the ciphertext match comparison unit 3121 of the user definition function unit 312 searches for a record in which the value of the “encrypted hash value” column of the hash table matches the hash table search query (0500) (step 1610). .
  • step 1610 the database control unit 311 acquires MapID from the matched record (step 1620).
  • step 1610 if the result of step 1610 does not exist, the database control unit 311 generates a new MapID, inserts it into the hash table 362 together with the encrypted hash value “Enc (0500)”, and acquires a new MapID (step 1630). .
  • the database control unit 311 replaces the updated ciphertext with the value of the update target column of the record having the update target ID of the encryption main table 361, and sets the value of the map ID column “MapID-1” to step 1620 or The value is replaced with the value of MapID acquired in step 1630 (step 1640).
  • the database control unit 311 deletes the record having the MapID that does not exist in the map ID column “MapID-1” of the encrypted main table 361 from the hash table 362 (Step 1650).
  • the database control unit 311 transmits the update result to the database interface unit 213 (1660).
  • the secret index update process (FIG. 16) is completed.
  • FIG. 17 is a flowchart showing a secret index deletion query generation process executed by the database wrapper unit 212 in the user system side server 3.
  • the secret index deletion query generation process starts when the database wrapper unit 212 receives a plaintext deletion SQL from the application unit 211.
  • the SQL received by the database wrapper unit 212 at the start of the secret index deletion query generation process is the plaintext deletion SQL (22) shown below.
  • Patient Information WHERE Disease Name Diabetes (22)
  • This deletion SQL means that all records whose “Disease Name” column value is “Diabetes” are deleted from the table whose schema name is “Medical Information” and whose table name is “Patient Information” (Steps). 1710).
  • the database wrapper unit 212 acquires “map ID column name” and “hash table name” of the search target column from the secret index map table 262. Specifically, the database wrapper unit 212 searches the secret index map table 262 using the combination of the schema name, the encryption main table name, and the column name that the plaintext deletion SQL is the target of the deletion condition, as a schema name. Then, the “map ID column name” and “hash table name” of the record whose encrypted main table name and column name match are acquired. For example, when the plain text search SQL is (22), from the record 2621 where the schema name is “medical information”, the encrypted main table name is “patient information”, and the column name is “disease name”. The map ID column name “MapID-1” and the hash table name “HT1” are acquired (step 1730).
  • step 1740 the database wrapper unit 212 determines whether or not the result of step 1730 exists (step 1740).
  • step 1740 the database wrapper unit 212 performs processing for converting the deletion SQL without using the hash table 362. Specifically, the database wrapper unit 212 replaces the value of the target column of the plaintext SQL deletion condition with the encrypted search query generated in step 1720, and further converts the match comparison sentence of the WHERE clause to the user-defined function unit.
  • the ciphertext deletion SQL replaced with the format for calling the ciphertext match comparison unit 3121 of 312 is output. For example, when the plaintext SQL is (22) and the encrypted search query is (2), the ciphertext deletion SQL is the following ciphertext SQL (23) (step 1750). DELETE FROM Medical information.Patient information WHERE Ciphertext match comparison unit (disease name, encrypted search query (diabetes)) (23)
  • step 1730 if the result of step 1730 exists (YES), the database wrapper unit 212 performs processing from hash value generation to secret index deletion SQL conversion (steps 1760 to 1780) in order to perform deletion using the hash table 362.
  • the deletion SQL of the ciphertext that has been performed is output.
  • the database wrapper unit 212 inputs the value of the target column of the deletion condition to the hash value generation unit 2123, and acquires the output hash value. For example, when the plaintext deletion SQL is (22), the hash value (4) is acquired (step 1760).
  • the database wrapper unit 212 inputs the hash value acquired in step 1760 to the search query generation unit 2122, and uses the output as a hash table search query. For example, if the hash value of the plaintext is (4), a hash table search query (5) is acquired (step 1770).
  • Hash table search query (1012) search query generator (encryption key, search key, "1012") (5)
  • the database wrapper unit 212 searches the hash table 362 by using the secret index SQL conversion unit 2127 to limit the search range, and then generates SQL for executing deletion from the encrypted main table 361.
  • Search SQL conversion for the secret index is performed.
  • the encrypted search query obtained in step 1720, the map ID column name and hash table name obtained in step 1730, and the hash table search query obtained in step 1770 are input, and the hash table 362 is used as the hash table.
  • the value of the “MapID” column of the corresponding record is obtained by searching with the search query, and matches the encrypted search query from the record of the encrypted main table 361 having the value of the “MapID-1” column equal to the value.
  • a record having a value is determined using the ciphertext match comparison unit 3121 of the user definition function unit 312. Then, an SQL for deleting the matched record from the encrypted main table 361 is generated. Further, an SQL for deleting a record including a MapID that does not exist in the map ID column “MapID-1” of the encrypted main table 361 is generated from the hash table 362. For example, if the plaintext deletion SQL is (22), the ciphertext deletion SQL including the two SQL texts (23) and (24) is output (step 1780). DELETE Medical information. Patient information FROM Medical information.
  • the database wrapper unit 212 transmits the ciphertext deletion SQL output in step 1750 or step 1780 to the database interface unit 213.
  • the database wrapper unit 212 transmits the ciphertext search SQL (24) and (25) output in step 1780 to the database interface unit 213. (Step 1790).
  • the database wrapper unit 212 ends the secret index deletion query generation process (FIG. 17).
  • FIG. 18 is a flowchart showing a secret index deletion process executed by the database control unit 311 in the cloud system side server 4.
  • the secret index deletion process starts when the database control unit 311 receives the ciphertext deletion SQL from the database interface unit 213.
  • the SQL received by the database control unit 311 at the start of the secret index deletion process is the ciphertext deletion SQL (24) and (25).
  • the database control unit 311 identifies the hash table 362 and the hash table search query that are subject to the deletion condition from the ciphertext deletion SQL, and the ciphertext match comparison unit 3121 of the user definition function unit 312 performs the hash table 362.
  • the record in which the “encrypted hash value” column value matches the hash table search query is identified, and the “MapID” column value of the record is acquired as MapID_hit.
  • the hash table 362 is the hash table 362 (HT1)
  • the hash table search query is “hash table search query (1012)”.
  • the encrypted hash value “Enc (1012)” of the record 3622 of the hash table 362 (HT 1) is matched, and MapID “2” of the record is acquired as MapID_hit. (Step 1810).
  • the database control unit 311 confirms that the value of the map ID column corresponding to the hash table 362 has a value that matches MapID_hit and a value that matches the encrypted search query, and the ciphertext match comparison unit of the user definition function unit 312.
  • the record group MapResult confirmed by 3121 is acquired from the encryption main table 361.
  • the database control unit 311 matches the value of the map ID column “MapID-1” with “2” acquired in step 910 and A group of records having Enc (diabetes) that is the value of the “disease name” column that matches the value of the generalized search query (diabetes) is confirmed by the ciphertext match comparison unit 3121, and as a result, the record 3613 and the record 3615 are set as MapResult. (Steps 1820 and 1830).
  • the database control unit 311 deletes the record included in MapResult from the encryption main table 361 (step 1840).
  • the database control unit 311 deletes a record including a MapID that does not exist in the map ID column “MapID-1” of the encrypted main table 361 from the hash table 362 (Step 1850).
  • the database control unit 311 transmits the result of the ciphertext deletion SQL to the database interface unit 213 (step 1860).
  • the secret index deletion process (FIG. 18) is completed.
  • FIG. 19 shows a hardware and software configuration of the concealment database system 1 according to the second embodiment of the present invention. It is a block diagram.
  • the concealment database system 1 encrypts the original data held by the user system side server 3 and deposits it in the cloud system side server 4.
  • the concealment database system 1 of the second embodiment is different from the first embodiment in that the MapID-1 column indicating the correspondence with the hash table 362B is removed instead of the encryption main table 361.
  • a mapping table 363 that has a main table 361B and that is encrypted and stored in order to conceal the correspondence between the encrypted main table 361B and the hash table 362B having different encrypted hash values.
  • the user terminal 2 of the second embodiment is the same as the user terminal 2 of the first embodiment.
  • the user system side server 3 of the second embodiment is the same as the user system side server 3 of the first embodiment.
  • the application unit 211 of the second embodiment is the same as the application unit 211 of the first embodiment.
  • the database wrapper unit 212 of the second embodiment is different from the first embodiment in that an index search query generation unit 2128, an ID encryption unit 2129, an index encryption unit 2120, and a mapping table rearrangement query generation unit 21200. It is to have. Each unit of the database wrapper unit 212 will be described later with reference to FIG. The rest is the same as the first embodiment.
  • the database interface unit 213 of the second embodiment is the same as the database interface unit 213 of the first embodiment.
  • the disk device 260 of the second embodiment is different from the first embodiment in that the secret index map table 262B having a “mapping table name” column instead of the “map ID column name” column of the secret index map table 262. It is to have. The rest is the same as the first embodiment.
  • the cloud system side server 4 of the second embodiment is the same as the cloud system side server 4 of the first embodiment.
  • the database control unit 311 of the second embodiment is different from the first embodiment in that the information of the mapping table 363 is added and used.
  • the rest is the same as the user-defined function unit 312 of the first embodiment.
  • the user-defined function unit 312 of the second embodiment is different from the first embodiment in that it includes an index match comparison unit 3122, an ID key acquisition unit 3123, an ID decryption unit 3124, and an ID encryption unit 3125. It is. Each unit of the user-defined function unit 312 will be described later with reference to FIG. The rest is the same as the user-defined function unit 312 of the first embodiment.
  • the disk device 360 of the second embodiment is different from the first embodiment in that it has an encrypted main table 361B instead of the encrypted main table 361, and has a hash table 362B instead of the hash table 362, Furthermore, the mapping table 363 is additionally provided. The rest is the same as the disk device 360 of the first embodiment.
  • FIG. 20 shows a logical configuration of the database wrapper unit 212 of the second embodiment.
  • the database wrapper unit 212 of the second embodiment is different from the first embodiment in that, in addition to the components shown in FIG. 2, an index search query generation unit 2128, an ID encryption unit 2129, an index encryption unit 2120 and a mapping table rearrangement query generation unit 21200. The rest is the same as the database wrapper unit 212 (FIG. 2) of the first embodiment.
  • the encryption unit 2121 of the second embodiment is the same as the encryption unit 2121 of the first embodiment.
  • the search query generation unit 2122 of the second embodiment is the same as the search query generation unit 2122 of the first embodiment.
  • the hash value generation unit 2123 of the second embodiment is the same as the hash value generation unit 2123 of the first embodiment.
  • the decoding unit 2124 of the second embodiment is the same as the decoding unit 2124 of the first embodiment.
  • the key management unit 2125 of the second embodiment differs from the first embodiment in that the key search unit 2128, the ID encryption unit 2129, and the index encryption unit 2120 request a key. Is to provide encryption key data or search key data. Note that encryption key data and search key data may be provided. The rest is the same as the key management unit 2125 of the first embodiment.
  • the SQL converter 2126 of the second embodiment is the same as the SQL converter 2126 of the first embodiment.
  • the difference between the secret index SQL conversion unit 2127 of the second embodiment and the secret index SQL conversion unit 2127 of the first embodiment is that the hash table 362B, the mapping table 363, and the encryption main table 361B are referred to.
  • An encrypted SQL sentence that performs at least one of insertion, update, and deletion is generated, and the encrypted SQL sentence is transmitted to the database interface unit 213.
  • the rest is the same as the secret index SQL conversion unit 2127 of the first embodiment.
  • the index search query generation unit 2128 of the second embodiment receives the index byte string output by the hash value generation unit 2123 and outputs an index hash table search query for searching the hash table 362B.
  • the ID encryption unit 2129 of the second embodiment encrypts the value of the ID column of the main table 261 stored in the mapping table 363. Specifically, the ID encryption unit 2129 acquires an ID key for encrypting the ID from the key management unit 2125, encrypts the plaintext ID using the acquired key, and outputs the result as the encryption ID. To do.
  • the index encryption unit 2120 of the second embodiment encrypts the identifier of the index. Specifically, the index encryption unit 2120 receives the ID key acquired from the key management unit 2125 and the plaintext hash value output from the hash value generation unit 2123 as input, and the encryption key acquired from the key management unit 2125. The hash value input by is encrypted, and the result is output as an encrypted hash value.
  • the mapping table rearrangement query generation unit 21200 of the second embodiment rearranges the order of each record in the mapping table 363 at random.
  • FIG. 21 shows a logical configuration of the user-defined function unit 312 of the second embodiment.
  • the user-defined function unit 312 of the second example differs from the user-defined function unit 312 (FIG. 3) of the first example in addition to the configuration of the first example, the index match comparison unit 3122, An ID key acquisition unit 3123, an ID decryption unit 3124, and an ID encryption unit 3125 are provided. The rest is the same as the user-defined function unit 312 of the first embodiment.
  • the ciphertext match comparison unit 3121 of the second embodiment is the same as the ciphertext match comparison unit 3121 of the first embodiment.
  • the index match comparison unit 3122 of the second embodiment stores the search key data in the memory 310 and / or the disk device 360. Also, an index match that allows an index hash table search query and an encrypted hash value to be input from the database control unit 311 and can be compared with the encrypted hash value using the search key. Convert to search query. Then, a match comparison between the index match search query and the encrypted hash value is performed. If they match, a value indicating a match (for example, “1”) is output, and if they do not match, a value indicating a mismatch (for example, “0”) is output. Is output.
  • the ID key acquisition unit 3123 of the second embodiment receives an index hash table search query and an encrypted hash value, converts a part of the encrypted hash value, and outputs an ID key.
  • the ID decryption unit 3124 of the second embodiment receives the encryption ID and the ID key, decrypts the encryption ID with the ID key, and outputs a plaintext ID.
  • the ID encryption unit 3125 of the second embodiment receives the plaintext ID and the ID key, encrypts the plaintext ID with the ID key, and outputs the encrypted ID.
  • FIG. 22 shows the data structure of the secret index map table 262B of the second embodiment.
  • the secret index map table 262B of the second embodiment is different from the secret index map table 262 (FIG. 5) of the first embodiment in that there is no “map ID column name” column and the mapping table 363 It has a “mapping table name” column indicating the relationship. The rest is the same as the secret index map table 262 (FIG. 5) of the first embodiment.
  • “column name” having a related mapping table and hash table is “disease name”, and related “mapping table name” is “MT1”.
  • the related “hash table name” is “HT1”.
  • FIG. 23 shows the data structure of the encryption main table 361B of the second embodiment.
  • the difference between the encryption main table 361B of the second embodiment and the encryption main table 361 (FIG. 6) of the first embodiment is that there is no “map ID column”. Due to this difference, the MapID corresponding to each record cannot be specified on the encryption main table 361B. The rest is the same as the encryption main table 361 (FIG. 6) of the first embodiment.
  • FIG. 24 shows the data structure of the mapping table 363 (MT1) of the second embodiment.
  • the mapping table 363 is stored in the disk device 360 or (and) the memory 310 of the cloud system side server 4, and conceals the correspondence between each record on the encryption main table 361B and “MapID” on the hash table 362B (HT1). And hold.
  • the mapping table 363 may be stored in both the disk device 360 and the memory 310.
  • the mapping table 363 forms a record by a “MID” column, an “encryption ID” column, and a “MapID” column indicating a value of “MapID”.
  • the “MID” column is an identifier that uniquely identifies a record on the mapping table.
  • the “encryption ID” column indicates an encryption ID obtained by encrypting the value of the “ID” column of the encryption main table 361B by the ID encryption unit 2129 or the ID encryption unit 3125.
  • the “MapID” column indicates the value of “MapID” in the hash table 362 corresponding to each record in the mapping table 363.
  • the record 3631 has an identifier “MID” column value that uniquely identifies the record as “101”, and is an encrypted value of the “ID” column value of the record in the corresponding encrypted main table 361B.
  • the value of the “encryption ID” column is “IEnc (1)”, and the value of the “MapID” column corresponding to the hash table 362 is “1”.
  • mapping table 363 conceals and holds the “MapID” value of the hash table 362 to which each record on the encrypted main table 361B corresponds.
  • “IEnc ()” indicates that the plaintext ID in “()” is an encryption ID encrypted by the ID encryption unit 2129 or the ID encryption unit 3125. Further, the normal index function of the database control unit 311 is applied to the “MID” column and the “MapID” column.
  • FIG. 25 shows the data structure of the hash table 362B used for speeding up the search.
  • the hash table 362B of the second embodiment is different from the hash table 362 (FIG. 7) of the first embodiment in that a record is constituted by a “MapID” column and an “encrypted hash value” column.
  • the “MapID” column indicates correspondence information with the mapping table 363.
  • the “encrypted hash value” indicates a value obtained by encrypting the hash value generated by the hash value generation unit 2123 and the bit string of the ID key pair by the secret index SQL conversion unit 2127.
  • the value of “MapID” corresponding to the value of the “MapID” column of the mapping table 363 is “1”, and the value of the corresponding “encrypted hash value” is “INEnc (ID_key — 1,0765)”. ".
  • the value of the “MapID” column is equal to the value of “MapID” of one or more records in the mapping table 363.
  • FIG. 26 is a flowchart showing a secret index search query generation process of the second embodiment.
  • the secret index search query generation process of the second embodiment is different from the secret index search query generation process of the first embodiment in that the “ID” column and the hash table of the encryption main table 361B using the mapping table 363 are used. This is to associate the “MapID” column of 362B.
  • This process starts when the database wrapper unit 212 receives a plain text search SQL from the application unit 211.
  • the SQL received by the database wrapper unit 212 is SQL (1) for plain text search. SELECT * FROM Medical information.
  • Patient information WHERE Disease name Diabetes (1)
  • This search SQL searches a record whose schema name is “medical information” and whose table name is “patient information” and whose value in the “disease name” column is “diabetes”, and finds all the records that match the conditions. This means that the column value is obtained as a search result (step 2510).
  • the database wrapper unit 212 first acquires the encryption key and the search key from the key management unit 2125, and inputs the acquired key to the search query generation unit 2122, as in step 820 of the first embodiment. , Get an encrypted search query as its output.
  • the plaintext SQL is (1)
  • the following execution formula (2) is obtained (step 2520).
  • Encrypted search query (diabetes) Search query generator (encryption key, search key, “diabetes”) (2)
  • the database wrapper unit 212 acquires “mapping table name” and “hash table name” of the search target column from the secret index map table 262, which is partially different from step 830 of the first embodiment. Specifically, the database wrapper unit 212 searches the secret index map table 262B using the combination of the schema name, the encryption main table name, and the column name to be searched by the plaintext search SQL as a key, and the schema name, encryption The “mapping table name” and “hash table name” of the record having the same main table name and column name are acquired. For example, when the plain text search SQL is (1), from the record 2621B in which the schema name is “medical information”, the encrypted main table name is “patient information”, and the column name is “disease name”. The mapping table name “MT1” and the hash table name “HT1” are acquired (step 2530).
  • the database wrapper unit 212 determines whether or not the result of step 2530 exists as in step 830 of FIG. 8 in the first embodiment (step 2540).
  • step 2540 When the result of step 2540 is “does not exist” (NO), the database wrapper unit 212 sets the search target value of the plaintext SQL in step 2520 as in step 850 of FIG. 8 in the first embodiment.
  • a ciphertext search SQL is output by replacing the generated ciphertext search query with the generated ciphertext match comparison unit 3121 of the user definition function unit 312.
  • the plaintext SQL is (1) and the encrypted search query is (2)
  • the ciphertext search SQL is the following ciphertext search SQL (3) (step 2550).
  • Patient information WHERE Ciphertext match comparison unit (disease name, encrypted search query (diabetes)) (3)
  • step 2540 if the result of step 2540 is “exists” (YES), the database wrapper unit 212 performs the search from the hash value to the secret index search SQL in order to perform a high-speed search using the hash table 362 and the mapping table 363.
  • a ciphertext search SQL subjected to the conversion (steps 2560 to 2580) processing is output.
  • the database wrapper unit 212 inputs the search target value to the hash value generation unit 2123 and acquires the output hash value, as in step 860 of FIG. 8 in the first embodiment.
  • the plaintext search SQL is (1)
  • the following hash value (4) is acquired (step 2560).
  • the database wrapper unit 212 is partly different from the step 870 of FIG. 8 in the first embodiment, and the hash value acquired in the step 2560 is used as the index search query generation unit 2128 in order to search the hash table 362B.
  • the output is used as an index hash table search query.
  • index (1012) Index search query generator (encryption key, search key, "1012") (5-2)
  • the database wrapper unit 212 is partially different from step 880 of FIG. 8 in the first embodiment, and after searching the hash table 362B to limit the search range, the encryption ID corresponding to the search range is set.
  • the encryption ID is identified from the mapping table 363, and the encrypted ID is decrypted to obtain the ID, and the secret index search SQL conversion is performed to generate the SQL for searching the record of the encrypted main table 361B corresponding to the ID.
  • the encrypted search query obtained in step 2520, the mapping table name and hash table name obtained in step 2530, and the index hash table search query obtained in step 2570 are input, and hash table 362B is indexed.
  • the value in the “MapID” column and the ID key of the corresponding record are acquired by searching with the hash table search query. Then, the encryption ID to be searched is specified from the record of the mapping table 363 having the value of the “MapID” column equal to the value, and the ID to be searched is acquired by decrypting the encryption ID with the ID key. Further, using the ciphertext match comparison unit 3121 of the user-defined function unit 312, a record having a value that matches the encrypted search query is determined from the records of the encryption main table 361B having the ID to be searched, and matches. Only a column existing in the main table 261 (other than the “ID” column) is selected from the record, and a ciphertext search SQL as a search result is generated and output.
  • the plaintext search SQL is (1)
  • the following ciphertext search SQL (6-2) is output (step 2580).
  • the database wrapper unit 212 transmits the ciphertext search SQL output in step 2550 or step 2880 to the database interface unit 213.
  • the database wrapper unit 212 transmits the ciphertext search SQL (6-2) output in step 2580 to the database interface unit 213 ( Step 2590).
  • the database wrapper unit 212 ends the secret index search query generation process (FIG. 26).
  • FIG. 27 is a flowchart showing the secret index search process of the second embodiment.
  • the secret index search process of the second embodiment is different from the secret index search process (FIG. 9) of the first embodiment in that the “ID” column and the hash table of the encryption main table 361B using the mapping table 363 are used. This is to associate the “MapID” column of 362B.
  • the secret index search process starts when the database control unit 311 receives the ciphertext search SQL from the database interface unit 213.
  • the ciphertext search SQL received by the database control unit 311 at the start of the secret index search process is SQL (6-2).
  • the database control unit 311 identifies a hash table 362B and an index hash table search query to be searched from the ciphertext search SQL, and the hash table 362B is searched by the index match comparison unit 3122 of the user definition function unit 312.
  • the record in which the value of the “encrypted hash value” column matches the hash table search query for the index is specified, and the value of the “MapID” column of the record is acquired as MapID_hit.
  • the ciphertext search SQL is (6-2)
  • the hash table is the hash table 362B (HT1)
  • the index hash table search query is “index hash table search query (5-2) ( 1012) ".
  • the index match comparison unit 3122 matches the encrypted hash value “INEc (ID_key_2, 1012)” of the record 3622B of the hash table 362B (HT1), and MapID “2” of the record is set as MapID_hit. Obtain (step 2610).
  • the database control unit 311 acquires, from the mapping table 363, a record group in which the value of the “MapID” column matches MapID_hit as HashResult. For example, when the ciphertext search SQL is (6-2), since MapID_hit is “2”, records 3632 and 3633 having a “MapID” value of 2 in the mapping table 363 are acquired as HashResult (step). 2620).
  • the database control unit 311 inputs the index hash table search query and the encrypted hash value hit in step 2610 to the ID key acquisition unit 3123 to acquire the ID key. Further, the ID key and the value of the “Encryption ID” column of the HashResult are input to the ID decryption unit 3124 to acquire an IDResult that is an ID group to be searched. For example, when the ciphertext search SQL is (6-2), the encrypted hash value “INEnc (ID_key_2, 0120)” hit in step 2610 is obtained, and the ID key “ID_key_2” is obtained from the ID key acquisition unit 3123. Get.
  • the ID ID “3, 4” is acquired by decrypting the encrypted ID “IEnc (3), IEnc (1000000)” of the HashResult (records 3632 and 3633 of the mapping table 363) acquired in step 3620 with the acquired ID key. (Step 2630).
  • the database control unit 311 indicates from the encryption main table 361B that the encrypted text of the user definition function unit 312 has a value in the “ID” column corresponding to IDResult and a value that matches the encrypted search query.
  • the record group MapResult confirmed by the match comparison unit 3121 is acquired. For example, when the ciphertext search SQL is (6-2), the database control unit 311 uses the ciphertext match comparison unit 3121 to set the value of the “ID” column to “3, 4” acquired in step 2630.
  • the database control unit 311 transmits a record group obtained by removing the “ID” column from the Map Result to the database interface unit 213 of the user system side server 3 as a search result.
  • a record group excluding the “ID” column is transmitted as a ciphertext search result from the records 3613B and 3615B of the encryption main table 361B (step 2650).
  • the secret index search process (FIG. 27) is completed.
  • the search result decoding process is the same as the search result decoding process (FIG. 10) of the first embodiment.
  • FIG. 28 is a flowchart illustrating a secret index insertion query generation process according to the second embodiment.
  • the secret index insertion query generation process of the second embodiment is different from the secret index insertion query generation process (FIG. 11) of the first embodiment in that an insertion process for the mapping table 363 is added.
  • the secret index insertion query generation process starts when the database wrapper unit 212 receives the plain text insertion SQL from the application unit 211.
  • the plaintext insertion SQL received by the database wrapper unit 212 at the start of the secret index insertion query generation process is the following plaintext insertion SQL (7), as in the first embodiment.
  • INSERT INTO Medical information.Patient information patient number, name, disease name
  • VALUES 1000001, Kinoshita, gastroenteritis
  • the value of the “patient number” column is “1000001” and the value of the “name” column is “1000001” for the table whose schema name is “medical information” and whose table name is “patient information”. This means that a record that is “Kinoshita” and the value of the “disease name” column is “gastroenteritis” is inserted (step 2710).
  • the database wrapper unit 212 takes out the value to be inserted from the plain text insertion SQL and encrypts it by the encryption unit 2121 as in step 1120 of FIG. 11 in the first embodiment.
  • the plaintext insertion SQL is (7)
  • the values to be inserted are “1000001”, “Kinoshita”, and “Gastroenteritis”
  • the encrypted text output as a result of encryption by the encryption unit 2121 is: “Enc (1000001)”, “Enc (Kinoshita)”, and “Enc (gastroenteritis)” are obtained (step 2720).
  • the database wrapper unit 212 acquires “mapping table name” and “hash table name” related to the record to be inserted from the secret index map table 262B as in step 1130 of FIG. Specifically, the database wrapper unit 212 searches the secret index map table 262B using the combination of the schema name and encryption main table name to be inserted by the plaintext insertion SQL as a key, and the schema and encryption main table name. “Column name”, “mapping table name”, and “hash table name” are acquired from all records that match. For example, when the plain text insertion SQL is (7), the column name “disease name”, mapping table name ”from the record 2621B in which the schema name is“ medical information ”and the encrypted main table name is“ patient information ”. MT1 "and hash table name” HT1 "are acquired (step 2730).
  • the database wrapper unit 212 determines whether or not the result of step 2730 exists as in step 1140 of FIG. 11 in the first embodiment (step 2740).
  • step 2740 If the result of step 2740 does not exist (NO), the database wrapper unit 212 generates the value to be inserted in the plaintext insertion SQL in step 2720 as in step 1150 of FIG. 11 in the first embodiment.
  • the ciphertext insertion SQL replaced with the text value is output.
  • the plaintext SQL is (7)
  • the following ciphertext insertion SQL (8) is output (step 2750).
  • step 2740 when the result of step 2740 exists (YES), the database wrapper unit 212 performs the insertion of the hash value from the hash value generation to the secret index insertion SQL conversion (steps 2760 to 2790) in order to perform the insertion that is consistent with the hash table 362B. ) To output ciphertext insertion SQL.
  • the database wrapper unit 212 inputs the column value related to the hash table 362B among the insertion target values to the hash value generation unit 2123 and outputs the same as in step 1160 of FIG. 11 in the first embodiment.
  • the database wrapper unit 212 inputs the hash value acquired in step 2760 to the index search query generation unit 2128 in order to search the hash table 362B.
  • the output is an index hash table search query.
  • Hash table search query for index (0035) Index search query generator (encryption key, search key, “0035”) (9-2)
  • the database wrapper unit 212 inputs the hash value (8) and the ID key acquired from the key management unit 2125 to the index encryption unit 2120, Get the output cryptographic hash value. For example, when the plaintext hash value is (8) and the ID key is “ID_key — 3”, the encrypted hash value is “INEc (ID_key — 3,0035)” (step 2780).
  • the database wrapper unit 212 searches the hash table 362B with an index hash table search query in the same manner as in step 1190 of FIG. 11 in the first embodiment, and if the search does not match, a new MapID and encrypted hash A record consisting of the value is inserted into the hash table 362B, and the MapID of the record that matches the hash table search query is acquired. From the MapID, the value of the ciphertext record acquired in step 2720 and the ID that is the identifier of the new record Insert the record to be configured into the encryption main table 361B, and finally insert the record composed of the encryption ID obtained by encrypting the ID of the new record by the ID encryption unit 3125 and the new Map ID into the mapping table 363. SQL Perform the conversion.
  • INSERT INTO hash table HT1 MapID, encrypted hash value
  • INSERT INTO encryption main table patient number, name, disease name, ID
  • VALUES Enc (1000001), Enc (Kinoshita), Enc (Gastroenteritis), New ID,
  • SELECT MapID FROM hash table HT1 WHERE encryption match comparison unit encrypted hash value, Hash table search query for index (0035)
  • (12-2) INSERT INTO mapping table MT1 (MapID, encrypted hash value) SELECT New MapID, encrypted hash value "INEnc (ID_key_3, 0035)" FROM hash table
  • the database wrapper unit 212 transmits the ciphertext insertion SQL output in step 2750 or step 2790 to the database interface unit 213 as in step 2795 of FIG. 11 in the first embodiment.
  • the database wrapper unit 212 causes the ciphertext insertion SQL (11-2), (12-2) and (13-2) is transmitted to the database interface unit 213 (step 2795).
  • the secret index insertion query generation process (FIG. 28) is thus completed.
  • FIG. 29 is a flowchart showing the secret index insertion process of the second embodiment.
  • the secret index insertion process of the second embodiment is different from the secret index insertion process (FIG. 12) of the first embodiment in that an insertion process for the mapping table 363 is added.
  • the secret index insertion process starts when the database control unit 311 receives the ciphertext insertion SQL from the database interface unit 213.
  • the ciphertext insertion SQL received by the database control unit 311 at the start of the secret index insertion processing is SQL (11-2), (12-2), and (13-2).
  • the database control unit 311 specifies the hash table 362B, index hash table search query, and encrypted hash value to be searched from the ciphertext search SQL, and the index matching comparison unit of the user-defined function unit 312.
  • step 2810 If there is a matching record in step 2810 (YES), the database control unit 311 acquires the value of the MapID column of the record as MapID_hit (step 2820). For example, when the insertion SQL is (11-2), MapID_hit is “10”.
  • the database control unit 311 determines whether there is no matching record in step 2810. If there is no matching record in step 2810, the database control unit 311 generates a new MapID to make MapID_hit, and inserts it into the hash table 362B as a record together with the encrypted hash value acquired from the search SQL (step 2830). ).
  • the database control unit 311 executes the ciphertext insertion SQL, and inserts a record composed of the encrypted value and ID into the encrypted main table 361B.
  • the database control unit 311 determines that the patient number is “Enc (1000001)”, the name is “Enc (Kinoshita)”, and the disease name is “Enc (gastroenteritis)”. "And a record with ID" 1000001 "are inserted into the encrypted main table 361B (step 2840).
  • the database control unit 311 inputs the index hash table search query and the encrypted hash value to the ID key acquisition unit 3123, and acquires the ID key as an output. For example, if the encrypted hash value is “INEnc (ID_key — 3,0035)” of (11-2), ID_key — 3 is acquired as an ID key (step 2850).
  • the database control unit 311 inputs the new ID and the ID key acquired in step 2850 to the ID encryption unit 3125, and acquires the encryption ID as an output. For example, when the new ID is “1000001”, the encryption ID is “IEnc (1000001)” (step 2860).
  • the database control unit 311 inserts a record consisting of the encryption ID acquired in step 2860 and the MapID_hit acquired in step 2820 or step 2830 into the mapping table 363.
  • a record including the encryption ID “IEnc (1000001)” and MapID_hit “10” is inserted into the mapping table 363.
  • the value of the “MID” column is assigned by the database control unit 311 using a normal automatic numbering function (step 2870).
  • the database control unit 311 transmits the execution result of the insertion SQL to the database interface unit 213 of the user system side server 3 (step 2880).
  • the secret index insertion process (FIG. 28) is completed.
  • FIG. 30 is a flowchart illustrating a secret index update query generation process executed by the database wrapper unit 212 of the user system side server 3 according to the second embodiment.
  • the secret index update query generation process starts when the database wrapper unit 212 receives a plaintext update SQL from the application unit 211.
  • the plaintext update SQL received by the database wrapper unit 212 at the start of the secret index update query generation process is the plaintext update SQL (13), as in the first embodiment.
  • the database wrapper unit 212 extracts the value of the update source column from the plaintext update SQL, and uses the search query generation unit 2122 to acquire the encrypted search query used for matching search in the encrypted main table 361B. Specifically, the database wrapper unit 212 acquires an encryption key and a search key from the key management unit 2125, inputs them to the search query generation unit 2122, and obtains an encrypted search query as its output. For example, as an example when the update SQL of the plaintext is (13), “encrypted search query (diabetes)” is obtained as in (2) (step 2910).
  • the database wrapper unit 212 acquires “mapping table name” and “hash table name” of the update source column from the secret index map table 262. Specifically, the database wrapper unit 212 searches the secret index map table 262B using the combination of the schema name, the encrypted main table name, and the update source column name that are to be searched by the plaintext search SQL as a key. The “mapping table name” and “hash table name” of the record having the same name, encrypted main table name, and column name are acquired.
  • the schema name is “medical information”
  • the encrypted main table name is “patient information”
  • the record includes the update source column name “disease name”
  • the mapping table name “MT1” and the hash table name “HT1” are acquired from 2621B (step 2915).
  • step 2920 the database wrapper unit 212 determines whether or not the result of step 2915 exists (step 2920).
  • step 2915 the database wrapper unit 212 is a list of IDs of records to be updated from the encryption main table 361B, as in step 1330 of FIG. 13 in the first embodiment.
  • SQL for obtaining the update target ID list is transmitted to the database interface unit 213, and as a result, the update target ID list is received.
  • the update target ID list is acquired by the following SQL (14) (step 2925). SELECT ID FROM Medical Information.
  • Patient Information WHERE Ciphertext Match Comparison Unit (Disease Name, Encrypted Search Query (Diabetes)) (14)
  • the database wrapper unit 212 acquires the number of update target IDs from the update ID list obtained in step 2925, and updates the number of update target IDs. Generate ciphertext with the value of. For example, when the update SQL of the plaintext is (13), the number of update target IDs is “3” and “1000000”, so the ciphertext of the updated value is Enc (Angina) and Enc (Angina pectoris). If probabilistic encryption is used, these are different ciphertexts (step 2930).
  • the database wrapper unit 212 updates the ciphertext of the two updated values obtained in step 1335 of FIG. 13 in the first embodiment as the values of the records indicated by the respective update target IDs.
  • the update SQL is generated.
  • the plaintext update SQL is (13)
  • the following ciphertext update SQL (15) is output (step 2935).
  • UPDATE Medical information.Patient information SET "Disease name” CASE ID WHEN 3 THEN Enc WHEN 1000000 THEN Enc (angina) END WHERE Ciphertext match comparison part (disease name, encrypted search query (diabetes)) (15)
  • step 2915 when the result of step 2915 exists (YES), the database wrapper unit 212 updates the encryption main table 361B, the hash table 362B, and the mapping table 363 from the hash value generation to the secret index update SQL conversion (The ciphertext update SQL for which steps 2940 to 2970) have been performed is output.
  • the database wrapper unit 212 inputs the updated value to the hash value generation unit 2123 and acquires the output hash value, similarly to step 1345 of FIG. 13 in the first embodiment.
  • the hash value (16) is acquired (step 2940).
  • the database wrapper unit 212 inputs the hash value acquired in step 2945 to the index search query generation unit 2128, and uses the output as the index hash table search query. For example, if the hash value of the plaintext is (16), the following hash table search query (17-2) is acquired (step 2945).
  • Hash table search query for index (0500) Index search query generator (encryption key, search key, “0500”) (17-2)
  • the database wrapper unit 212 inputs the hash value acquired in step 2940 and the ID key acquired from the key management unit 2125 to the index encryption unit 2120 and performs encryption for insertion into the hash table 362B as output.
  • Get hash value For example, when the plaintext hash value (16) is “0500” and the ID key is “ID_key — 4”, the encrypted hash value is “INEc (ID_key — 4,0500)” (step 2950).
  • the database wrapper unit 212 executes a secret index update target ID table acquisition SQL for acquiring a table of ID column values of the record group to be updated using the hash table 362B and the mapping table 363, and performs update target Get the ID table.
  • the database wrapper unit 212 uses the encrypted search query for the update source value acquired in step 2910, the mapping table name and hash table name related to the update source column acquired in step 2915, and the update source value.
  • the index hash table search query is input, the hash table 362B and the mapping table 363 are searched, the search range of the encryption main table 361B is limited, and the SQL for obtaining the update target ID table is executed. Output as update target ID table.
  • the ciphertext secret index update target ID table acquisition SQL (18-2) is generated and transmitted to the database control unit 311 via the database interface unit 213.
  • the execution result is acquired as an update target ID table (step 2955).
  • SELECT ID FROM encryption main table 361BX JOIN SELECT ID decryption part (@ID key, encryption ID) AS TempID FROM mapping table MT1 JOIN
  • the database wrapper unit 212 acquires the number of update target IDs from the update target ID table obtained in step 2955, and generates an updated value ciphertext list for that number.
  • the plaintext update SQL is (13)
  • the number of update target IDs is two, “3” and “1000000”, as in step 1335 of FIG. 13 in the first embodiment.
  • the ciphertext lists of the latter values are Enc (angina) and Enc (angina). If probabilistic encryption is used, these are different ciphertexts (step 2960).
  • the database wrapper unit 212 receives plaintext update SQL, various information acquired in Step 2910, Step 2915, Step 2945, Step 2950, Step 2955, and Step 2960 as input, and updates the ciphertext update SQL for the secret index. Output. Specifically, first, an index match search is performed on the hash table 362B with an index hash table search query of the updated value, and if the hash table 362B does not match, the encrypted hash value of the updated value and the new MapID value The SQL for inserting the record consisting of the above into the hash table 362B is generated. Second, SQL for acquiring the MapID of the updated value is generated from the hash table 362B.
  • an update SQL for replacing the ciphertext of the updated value is generated.
  • an SQL is generated that replaces the value of the “MapID” column of the record having the update target ID with the MapID obtained in the second SQL.
  • the plaintext update SQL is (13)
  • the first SQL is the following update SQL (19-2)
  • the second SQL is the following update SQL (20-2)
  • the third SQL is Is the update SQL (21-2)
  • the fourth SQL is the following update SQL (22-2) and (23-2).
  • a ciphertext update SQL composed of these four SQL texts is output (step 2965).
  • INSERT INTO hash table HT1 MapID, encrypted hash value
  • SELECT * FROM hash table HT1 WHERE index match comparison part Index hash table search query, encrypted hash value)
  • LIMIT 1 SELECT * FROM hash table HT1 WHERE index match comparison part ( Index hash table search query, encrypted hash value) ) LIMIT 1; (19-2) SELECT MapID FROM hash table HT1 WHERE index match comparison part ( Index hash table search query, encrypted hash value)) (20-2)
  • UPDATE Encryption main table X JOIN Update target ID table Y ON X.ID Y.ID SET X.
  • the database wrapper unit 212 transmits the ciphertext update SQL output in step 2935 or step 2965 to the database interface unit 213.
  • the database wrapper unit 212 outputs the encrypted SQL statements (19-2), (20-2), (21) output by the step. -2), (22-2) and (23-2) are transmitted to the database interface unit 213 (step 2970).
  • the database wrapper unit 212 ends the secret index update query generation process (FIG. 30).
  • FIG. 14 shows the flow of the update target ID list acquisition process executed by the database control unit 311 in the cloud system side server 4.
  • the database control unit 311 performs the same process as in FIG. Do.
  • the update target ID list acquisition process starts when the database control unit 311 receives the ciphertext search SQL from the database interface unit 213.
  • all IDs of records whose update target column values match the encrypted search query are acquired from the encrypted main table 361B (step 1410).
  • the acquisition result is transmitted to the database interface unit 213 (step 1420), and the process of FIG.
  • the ciphertext search SQL is (18-2)
  • the elements of the update target ID list are “3” and “1000000”.
  • FIG. 31 is a flowchart showing a secret index update target ID table acquisition process executed by the database control unit 311 in the cloud system side server 4 of the second embodiment.
  • the secret index update target ID table acquisition process starts when the database control unit 311 receives the ciphertext search SQL from the database interface unit 213.
  • the database control unit 311 acquires the MapID of a record that matches the index hash table search query from the hash table 362B (step 3010).
  • the database control unit 311 acquires a record group HashResult having a MapID that matches the MapID acquired in Step 3010 from the mapping table 363 (Step 3020).
  • the database control unit 311 inputs the encrypted hash value of the record of the hash table 362B matched in step 3010 and the index ash table search query to the ID key acquisition unit 3123, and acquires the ID key as an output.
  • the acquired ID key and HashResult encryption ID are input to the ID decryption unit 3124, and the ID group obtained as an output is defined as IDResult (3030).
  • the database control unit 311 has the ID included in the ID group included in the ID Result acquired in Step 3030 from the encryption main table 361B, and the value of the “disease name” column that is the update source column is the encrypted search query. Are acquired and stored as an update target ID table (step 3040). Finally, the database control unit 311 transmits the acquisition result to the database interface unit 213 (3050), and ends the confidential index update target ID table acquisition process (FIG. 31). For example, when the ciphertext search SQL is (18-2), the update target ID table is a table storing “3” and “1000000” as ID column values.
  • FIG. 32 is a flowchart showing a secret index update process executed by the database control unit 311 in the cloud system side server 4 of the second embodiment.
  • the secret index update process starts when the database control unit 311 receives the ciphertext update SQL from the database interface unit 213.
  • the update SQL of the ciphertext received by the database control unit 311 at the start of the secret index update process is SQL (19-2), (20-2), (21-2), (22-2), and (23 -2).
  • the database control unit 311 acquires the hash table 362B and index hash table search query to be updated from the first SQL of the ciphertext update SQL (19-2), and the user definition function unit 312
  • the index match comparison unit 3122 searches for a record in which the value of the “encrypted hash value” column of the hash table matches the index hash table search query (step 3110).
  • step 3110 If the result of step 3110 exists (YES), the database control unit 311 acquires MapID from the matched record, and sets the acquired MapID as MapID_New (step 3120).
  • step 3110 if the result of step 3110 does not exist, the database control unit 311 generates a new MapID, sets the generated MapID to MapID_new, and inserts it into the hash table 362B together with the encrypted hash value “INEnc (ID_key — 4,0500)”. (Step 3130).
  • the database control unit 311 updates the value of the update target column of the record for the record having the update target ID in the encryption main table 361B, and further selects an encryption ID that matches the ID of the record.
  • the value in the “MapID” column of the record of the mapping table 363 is MapID_New (step 3140).
  • the database control unit 311 deletes the record having the MapID that does not exist in the “MapID” column of the mapping table 363 from the hash table 362B (Step 3150).
  • the database control unit 311 transmits the update result to the database interface unit 213 (3160).
  • the secret index update process (FIG. 32) is completed.
  • FIG. 33 is a flowchart showing a secret index deletion query generation process executed by the database wrapper unit 212 in the user system side server 3 of the second embodiment.
  • the secret index deletion query generation process starts when the database wrapper unit 212 receives a plaintext deletion SQL from the application unit 211.
  • the plaintext deletion SQL received by the database wrapper unit 212 at the start of the secret index deletion query generation process is the following SQL (22).
  • the database wrapper unit 212 extracts the value of the target column of the deletion condition from the plaintext deletion SQL, acquires the encryption key and the search key from the key management unit 2125, and inputs them to the search query generation unit 2122. And an encrypted search query is obtained as its output.
  • the plaintext SQL is (21)
  • the encrypted search query is the following execution expression (2) (step 3220).
  • Encrypted search query (diabetes) search query generator (encryption key, search key, "diabetes") (2)
  • the database wrapper unit 212 acquires “mapping table name” and “hash table name” of the search target column from the secret index map table 262B. Specifically, the database wrapper unit 212 searches the secret index map table 262B using the combination of the schema name, encryption main table name, and column name that is the object of the deletion condition in the plaintext deletion SQL as a schema name. Then, the “mapping table name” and “hash table name” of the record whose encrypted main table name and column name match are acquired. For example, when the plain text search SQL is (22), from the record 2621 where the schema name is “medical information”, the encrypted main table name is “patient information”, and the column name is “disease name”. The mapping table name “MT1” and the hash table name “HT1” are acquired (step 3230).
  • step 3240 the database wrapper unit 212 determines whether or not the result of step 3230 exists (step 3240).
  • the database wrapper unit 212 performs a deletion SQL conversion process that does not use the hash table 362B. Specifically, the database wrapper unit 212 replaces the value of the target column of the plaintext SQL deletion condition with the encrypted search query generated in step 3220, and further converts the match comparison sentence of the WHERE clause to the user-defined function unit.
  • the ciphertext deletion SQL replaced with the format for calling the ciphertext match comparison unit 3121 of 312 is output. For example, when the plaintext SQL is (22) and the encrypted search query is (2), the ciphertext deletion SQL is the following ciphertext SQL (23) (step 3250). DELETE FROM Medical information.Patient information WHERE Ciphertext match comparison unit (disease name, encrypted search query (diabetes)) (23)
  • step 3230 if the result of step 3230 exists (YES), the database wrapper unit 212 performs processing from hash value generation to secret index deletion SQL conversion (steps 3260 to 3280) in order to perform deletion using the hash table 362B.
  • the deletion SQL of the ciphertext that has been performed is output.
  • the database wrapper unit 212 inputs the value of the target column of the deletion condition to the hash value generation unit 2123 and acquires the output hash value. For example, when the plaintext deletion SQL is (22), the hash value (4) is acquired (step 3260).
  • the database wrapper unit 212 inputs the hash value acquired in step 3260 to the index search query generation unit 2128, and uses the output as an index hash table search query. For example, if the hash value of the plaintext is (4), the following index hash table search query (5-2) is acquired (step 3770).
  • Index hash table search query (1012) index search query generation unit (encryption key, search key, “1012”) (5-2)
  • the database wrapper unit 212 uses the secret index SQL conversion unit 2127 to search the hash table 362B to limit the search range, and then generate an SQL for executing deletion from the encrypted main table 361B.
  • the search SQL conversion for the secret index is performed. Specifically, the encrypted search query obtained in step 3220, the mapping table name and hash table name obtained in step 3230, and the index hash table search query obtained in step 3770 are input, and hash table 362B is indexed.
  • the value of the “MapID” column of the corresponding record is obtained by searching with the hash table search query for the mapping, and the ID of the mapping table 363 having the value of the “MapID” column equal to that value is decrypted to obtain the ID , And a record having a value that matches the encrypted search query is determined from the records of the encrypted main table 361B having the ID by using the ciphertext match comparison unit 3121 of the user definition function unit 312. Is deleted from the encryption main table 361B. To generate the SQL that. Furthermore, an SQL for deleting a record including a MapID that does not exist in the map ID column “MapID” of the mapping table 363 is generated from the hash table 362B.
  • the database wrapper unit 212 transmits the ciphertext deletion SQL output in step 3250 or step 3280 to the database interface unit 213. If the plaintext deletion SQL is (22), the result of step 3240 exists, so the database wrapper unit 212 causes the ciphertext search SQL (24-2), (25-2), and (26) output by step 3280 to exist. -2) is transmitted to the database interface unit 213 (step 3290). As described above, the database wrapper unit 212 ends the secret index deletion query generation process (FIG. 32).
  • FIG. 34 is a flowchart showing a secret index deletion process executed by the database control unit 311 in the cloud system side server 4 of the second embodiment.
  • the secret index deletion process starts when the database control unit 311 receives the ciphertext deletion SQL from the database interface unit 213.
  • the ciphertext deletion SQL received by the database control unit 311 at the start of the secret index deletion processing is SQL (24-2) (25-2) and (26-2).
  • the database control unit 311 identifies the hash table 362B and the index hash table search query that are subject to the deletion condition from the ciphertext deletion SQL, and the hash match search unit 3122 of the user definition function unit 312 performs the hash search.
  • the record in which the value of the “encrypted hash value” column of the table 362B matches the hash table search query for the index is specified, and the value of the “MapID” column of the record is acquired as MapID_hit.
  • the hash table 362B is the hash table 362B, and as a result of the match comparison by the index match comparison unit 3122, Matches the encrypted hash value “INEnc (ID_key — 2, 1012)” of the record 3622B of the hash table 362B, and acquires MapID “2” of the record as MapID_hit (step 3310).
  • the database control unit 311 specifies a record group HashResult whose value in the “MapID” column matches MapID_hit from the mapping table 363. For example, when the ciphertext deletion SQL is (24-2) (25-2) and (26-2), the records 3632 and 3633 whose MapID_hit is “2” are HashResult (step 3320).
  • the database control unit 311 inputs the index hash table search query and the encrypted hash value of the record hit in step 3310 to the ID key acquisition unit 3123, acquires the ID key as an output, and acquires the ID key.
  • the key and the encryption ID of HashResult are input to the ID decryption unit 3124, and the ID group acquired as an output is defined as IDResult.
  • the IDResult is “3, 1000000” (step 3330).
  • the database control unit 311 deletes the record having the ID included in the IDResult and the value matching the encrypted search query from the encryption main table 361B, and further mapping with the encryption ID matching the record The record in the table 363 is deleted (step 3340).
  • the database control unit 311 deletes the record including the MapID that does not exist in the mapping table 363 from the hash table 362B (Step 3350).
  • the database control unit 311 transmits the ciphertext deletion SQL result to the database interface unit 213 (step 3360).
  • the secret index deletion process (FIG. 34) is completed.
  • FIG. 35 is a flowchart showing the mapping table rearrangement query generation process of the second embodiment.
  • the database wrapper unit 212 sets the mapping table 363 at the time of generating the mapping table 363 or at an arbitrary timing so that the order of the records in the mapping table 363 does not match the order of the IDs of the corresponding records in the encrypted main table 361B.
  • a rearrangement SQL for rearranging the records in a random order is generated (step 3410) and transmitted to the database control unit 311 (step 3420).
  • FIG. 36 is a flowchart showing the mapping table rearrangement process of the second embodiment.
  • the database control unit 311 Upon receiving the rearrangement SQL from the database wrapper unit 212, the database control unit 311 rearranges the records in the mapping table 363 at random (step 3510), and transmits the result to the database wrapper unit 212 (step 3520).
  • the hardware and software configuration of the concealment database system 1 according to the third embodiment of the present invention is the second embodiment.
  • the configuration is the same as that described in the example (FIG. 19).
  • the third embodiment differs from the second embodiment in that the frequency deviation of map IDs in the mapping table 363B is leveled and the appearance frequency is concealed.
  • FIG. 37 shows a logical configuration of the database wrapper unit 212 of the third embodiment.
  • the database wrapper unit 212 of the third embodiment is different from the second embodiment (FIG. 20) in that it has a map ID frequency distribution leveling query generation unit 21201 for leveling the appearance frequency of map IDs in the mapping table 363B. That is.
  • FIG. 38 shows the data structure of the mapping table 363B before the frequency distribution leveling of the third embodiment.
  • the difference between the mapping table 363B of the third embodiment and the mapping table 363 of the second embodiment (FIG. 24) is that a sample record is added to indicate the deviation in the frequency of MapID.
  • the frequency of MapID “1” is 2
  • the frequency of MapID “2” is 3
  • the frequencies of MapID “3” and “10” are 1.
  • the rest is the same as the second embodiment.
  • FIG. 39 shows the data structure of the mapping table 363C after frequency distribution leveling in the third embodiment.
  • the mapping table 363C after leveling differs from the mapping table 363B before leveling in that it includes a simulated record for leveling the frequency of MapID.
  • the simulated record has a value generated by a random number of bit strings of the same type as the encryption ID instead of the encryption ID. For example, in FIG. 39, as a result of adding simulated records 3631C to 3635C, the frequency of all MapIDs is 3.
  • the configuration of the information processing system according to the third embodiment other than FIGS. 37, 38 and 39 is the same as that of the second embodiment described in the section 2-1.
  • FIG. 40 is a flowchart showing map ID frequency distribution leveling query generation processing executed by the database wrapper unit 212 in the user system side server 3 of the third embodiment.
  • the map ID frequency distribution leveling query generation process starts when the database wrapper unit 212 receives a leveling request from the application unit 211 or the like.
  • the database wrapper unit 212 acquires the frequency for each value of the “MapID” column from the mapping table 363B before leveling. For example, in the mapping table 363B before leveling shown in FIG. 38, the frequency of MapID “1” is 2, the frequency of MapID “2” is 3, and the frequencies of MapID “3” and “10” are 1. is there.
  • the database wrapper unit 212 determines whether the frequency of each value of MapID is the same, and if it is the same (YES), ends the process.
  • the database wrapper unit 212 sets the maximum frequency among the frequencies acquired in step 3910 as Nmax.
  • Nmax is 3 which is the frequency of MapID “2” (step 3930).
  • the database wrapper unit 212 generates random numbers for each value of MapID other than the maximum frequency by the number of differences between Nmax and the frequency of each value, and maps a record composed of a pair of each value of the random number
  • a frequency distribution leveling SQL to be inserted into the table 363B is generated. For example, in the case of the mapping table 363B before leveling, SQL for inserting the simulation records 3631C to 3635C shown in FIG. 39 is generated (step 3940).
  • the database wrapper unit 212 transmits the frequency distribution leveling SQL generated in step 3940 to the database interface unit 213, and ends the map ID frequency distribution leveling query generation process (FIG. 40).
  • FIG. 41 is a flowchart showing map ID frequency distribution leveling processing executed by the database control unit 311 in the cloud system side server 4 of the third embodiment.
  • the database control unit 311 receives the frequency distribution leveling SQL from the database wrapper unit 212
  • the record specified in the SQL is inserted into the mapping table 363B (step 4010).
  • the insertion result is transmitted to the database wrapper (step 4020).
  • the appearance of MapID is obtained by leveling the distribution of the appearance frequency of MapID in the mapping table 363. Since the frequency is concealed, a safer search can be performed than in the second embodiment.
  • the database wrapper unit 212 processes the encrypted data on the cloud system side server 4 when receiving the plain text SQL text for searching the encrypted data.
  • the database control unit 311 searches the hash table by executing the received encrypted SQL sentence, and the encryption The range of the encrypted data is limited, the user-defined function unit 312 (ciphertext match comparison unit 3121) performs a match comparison indicated by the encrypted SQL statement on the limited range of encrypted data, and the database control unit 311 Since the execution result of the encrypted SQL statement is transmitted to the server 3 on the user system side, the encrypted large-capacity encryption In search of the main table 361, by reducing the record to be retrieved by searching the hash table 362 in advance, it can be retrieved at a high speed.
  • the user system side server 3 sends the SQL statement for processing the encrypted data from the user terminal 2 used by the data owner via the user internal network 5 of the equipment provided with the user system side server 3.
  • the user system side server 3 receives the SQL statement for processing the encrypted data and sends it to the cloud system side server 4 via the external network 6. Data can be retrieved at high speed.
  • the hash table 362 includes a map ID that is an identifier of each record of the encrypted main table 361 and the hash value, and the encrypted main table 361 is an identifier corresponding to the hash value stored in the hash table 362.
  • the database control unit 311 includes the map ID, the database control unit 311 searches the hash table 362 using the hash value as a keyword, acquires the map ID of the record having the matched hash value, and the encrypted main table 361 having the acquired map ID. Therefore, the search target can be narrowed down using the map ID recorded in the hash table 362.
  • the database control unit 311 associates the map ID of the encrypted main table 361 with the map ID of the hash table, and hashes the record including the map ID that does not exist in the encrypted main table 361 but exists in the hash table 362. Since the data is deleted from the table 362, unnecessary data can be deleted to speed up the search and reduce the resources used.
  • the database wrapper unit 212 generates a hash table search query for performing a match search between the hash value of the data to be searched and the encrypted hash value stored in the hash table 362, and the database control unit 311 Since the ciphertext match comparison unit 3121 makes a match determination between the hash table search query and the encrypted hash value, enlargement of the hash table 362 can be prevented.
  • the user system side server 3 has a secret index map table 262 that stores information indicating a relationship with a hash table that stores an encrypted hash value corresponding to the original data, and the database wrapper unit 212 includes a secret index map.
  • the SQL main statement 361 is searched without generating the SQL statement for searching the hash table 362. Since an SQL sentence is generated, even when an index based on a hash value cannot be used, a high-speed search can be performed.
  • the database wrapper unit 212 updates the encryption main table 361 with the encrypted data subjected to the stochastic encryption
  • the database wrapper unit 212 acquires all the identifiers of the update target records in the encryption main table 361, and acquires the identifier of the acquired identifier. Since the ciphertext of the updated data corresponding to the number is generated and the SQL text for updating the plurality of records corresponding to the number of the identifiers is generated, the search can be performed at high speed without reducing the strength of the cipher.
  • the database wrapper unit 212 has a plurality of SQLs having a length that does not exceed the restriction on the maximum length of the SQL sentence. Since a sentence is generated, a plurality of writing processes can be executed in parallel to speed up the process.
  • the encryption main table 361B does not include an identifier map ID corresponding to the encryption hash value stored in the hash table 362B, and the cloud system side server 4 stores an identifier corresponding to each record of the encryption main table 361B.
  • the database wrapper unit 212 includes a mapping table 363 including an encrypted encryption ID and a map ID that is an identifier corresponding to a hash value stored in the hash table 362 corresponding to the encryption ID.
  • the encryption ID of the mapping table corresponding to the map ID acquired from 362B is acquired, the acquired encryption ID is temporarily decrypted, and the search range of the encrypted data is determined by the identifier obtained by decrypting the encryption ID.
  • the encryption main table 361B To hide the correspondence between the over soil and map ID, it is possible to perform a more secure search.
  • the database wrapper unit 212 includes a mapping table rearrangement query generation unit that generates a query for rearranging the mapping table records
  • the database control unit 311 includes an SQL generated by the mapping table rearrangement query generation unit. Since the mapping table records are rearranged according to the sentence, the correspondence between the records in the encrypted main table 361B and the mapping table 363 is concealed so that the record order of the encrypted main table 361B and the mapping table 363 is not the same. And you can search more safely.
  • the database wrapper unit 212 acquires the map ID frequency of the mapping table, and generates a query for inserting a pseudo record for equalizing the acquired frequency into the mapping table.
  • the database control unit 311 has a query generation unit, and inserts the pseudo record into the mapping table in accordance with the SQL statement generated by the map ID frequency distribution leveling query generation unit, so the appearance frequency of the map ID in the mapping table 363 Can be leveled and the appearance frequency of map IDs can be concealed for safer search.
  • the present invention is not limited to the above-described embodiments, and includes various modifications and equivalent configurations within the scope of the appended claims.
  • the above-described embodiments have been described in detail for easy understanding of the present invention, and the present invention is not necessarily limited to those having all the configurations described.
  • a part of the configuration of one embodiment may be replaced with the configuration of another embodiment.
  • another configuration may be added, deleted, or replaced.
  • each of the above-described configurations, functions, processing units, processing means, etc. may be realized in hardware by designing a part or all of them, for example, with an integrated circuit, and the processor realizes each function. It may be realized by software by interpreting and executing the program to be executed.
  • Information such as programs, tables, and files that realize each function can be stored in a storage device such as a memory, a hard disk, and an SSD (Solid State Drive), or a recording medium such as an IC card, an SD card, and a DVD.
  • a storage device such as a memory, a hard disk, and an SSD (Solid State Drive), or a recording medium such as an IC card, an SD card, and a DVD.
  • control lines and information lines indicate what is considered necessary for the explanation, and do not necessarily indicate all control lines and information lines necessary for mounting. In practice, it can be considered that almost all the components are connected to each other.
  • the present invention provides a customer with a function of depositing encrypted data with a key on the user system side to a cloud operator, and searching and analyzing a large amount of encrypted data deposited by the cloud operator while encrypting the data. It can be widely applied to information processing systems.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • Health & Medical Sciences (AREA)
  • Bioethics (AREA)
  • General Health & Medical Sciences (AREA)
  • Computer Hardware Design (AREA)
  • Computer Security & Cryptography (AREA)
  • Software Systems (AREA)
  • Databases & Information Systems (AREA)
  • Data Mining & Analysis (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

Provided is an encrypted database system wherein: a database wrapper unit converts a plain text SQL statement for searching encoded data to an encoded SQL statement for processing the encoded data on the center system; in the center system, a database controller searches a hash table and limits the scope of the encoded data by executing the received encoded SQL statement; an encoded text match comparison unit performs a match comparison, specified by the encoded SQL statement, on the encoded data the scope of which was limited; the database control unit transmits the encoded SQL statement execution results to a user system; and the database wrapper unit decodes the received SQL statement execution results and outputs the encoded data search results.

Description

秘匿化データベースシステム及び秘匿化データ管理方法Concealed database system and concealed data management method 参照による取り込みImport by reference
 本出願は、平成27年(2015年)4月22日に出願された日本出願である特願2015-87303の優先権を主張し、その内容を参照することにより、本出願に取り込む。 This application claims the priority of Japanese Patent Application No. 2015-87303, which was filed on April 22, 2015, and is incorporated herein by reference.
 本発明は、データを暗号化して他者に預託する秘匿化データベースシステムに関する。 The present invention relates to a concealment database system that encrypts data and deposits it with others.
 近年、ストレージの低価格化及び大規模化、及びネットワークの整備などの様々な情報技術の発展に伴い、蓄積される情報量が増大している。このような状況の下、いわゆるビックデータを利活用しようという動きが活発化している。 In recent years, the amount of information stored has increased with the development of various information technologies such as lower storage costs, larger scale, and network development. Under such circumstances, a movement to utilize so-called big data is activated.
 ところで、多種多様な医療情報、経営情報、個人情報が取り扱われる医療機関においては、機関全体のビックデータの利活用によるグループ全体のリソース及び業務の最適化が有効である。医療機関にとって、高度なビッグデータ分析基盤は本来業務とは異なり過大な投資は難しいため、効果に応じた投資が可能なクラウド上のビッグデータ分析基盤の利用が適する。 By the way, in medical institutions that handle a wide variety of medical information, management information, and personal information, it is effective to optimize the resources and operations of the entire group by utilizing the big data of the entire institution. For medical institutions, an advanced big data analysis platform is difficult to invest excessively unlike the original business, so it is appropriate to use a big data analysis platform on the cloud that can be invested according to the effect.
 ただし、医療情報、個人情報は極めて機微性が高く、クラウド側でのデータの復元やデータ持ち出し等の情報漏えいリスクに対処する必要がある。その対処法の一つとして、病院側のみがデータの秘匿化の鍵を持つことにより、クラウド上でのデータの復元が不可能とし、クラウド側でのデータの持ち出しリスクを低減する秘匿化データベースシステムが有効である。さらに、暗号化したままでのデータの検索を可能とする検索可能暗号技術などを用いることにより、データセンタでデータを復号化することなく、検索及び分析を可能とすることが有効である。 However, medical information and personal information are extremely sensitive, and it is necessary to deal with information leakage risks such as data restoration and data export on the cloud side. As one of the countermeasures, a concealment database system that makes it impossible to restore data on the cloud by having only the hospital side have the data concealment key and reduces the risk of data export on the cloud side. Is effective. Furthermore, it is effective to enable search and analysis without decrypting the data at the data center by using a searchable encryption technique or the like that enables search of the data as encrypted.
 本技術の背景技術として、国際公開2013/069776号公報(特許文献1)、国際公開2012/077541号公報(特許文献2)がある。特許文献1には、データベースシステムにネットワークを介して接続するユーザシステムであって、暗号化と復号化のための鍵情報を管理する手段と、データ及び/又はメタデータの安全性設定情報を記憶する記憶部と、データベース操作命令に対して暗号化の必要の有無を判別し、暗号化が必要な場合、データ及び/又はメタデータに応じた暗号化アルゴリズムを選択して暗号化した上でデータベース制御手段に送信してデータベースの操作を実行し、暗号化が不要な場合、前記データベース操作命令をデータベース制御手段に送信してデータベース操作を実行し、前記データベース制御手段から送信された処理結果を受け取り、前記処理結果のデータ及び/又はメタデータの復号化あるいは変換が必要な場合、必要な復号化あるいは変換を行い、前記データベース操作命令の応答として返すアプリケーション応答手段と、データベースに格納するデータの安全性情報を設定する安全性設定手段を備えるシステムが開示されている。 As background art of this technology, there are International Publication 2013/069776 (Patent Document 1) and International Publication 2012/077751 (Patent Document 2). Patent Document 1 is a user system connected to a database system via a network, and stores means for managing key information for encryption and decryption, and data and / or metadata safety setting information To determine whether or not encryption is required for the storage unit and the database operation instruction, and if encryption is necessary, the database is selected after encryption is selected according to the data and / or metadata. When the database operation is performed by transmitting to the control means, and encryption is not required, the database operation instruction is transmitted to the database control means to execute the database operation, and the processing result transmitted from the database control means is received. If the data and / or metadata of the processing result needs to be decoded or converted, the necessary decoding or conversion is required. Performed, an application response means returns the response of the database operation instruction, the system comprising a safety setting means for setting the security information of the data stored in the database is disclosed.
 また、特許文献2には、データを預かるDBサーバと、DBサーバにデータを預託する登録クライアントと、DBサーバにデータを検索させる検索クライアントがネットワーク経由で連携する検索可能暗号処理ステムであって、登録クライアントは、ハッシュ値と準同型関数を用いたマスクによる確率的暗号化方式を用いて、暗号化したデータをサーバに預託し、検索クライアントは、検索クエリの暗号化に準同型関数を用いたマスクによる確率的暗号化を用い、DBサーバにマスクを解除させずに、かつ、DBサーバに検索に該当するデータの出現頻度が漏洩しないよう、検索クエリと該当しないデータを検索結果として出力させるシステムが開示されている。 Patent Document 2 discloses a searchable cryptographic processing system in which a DB server that deposits data, a registration client that deposits data in the DB server, and a search client that causes the DB server to retrieve data are linked via a network, The registration client deposits the encrypted data to the server using a probabilistic encryption method with a mask using a hash value and a homomorphic function, and the search client uses a homomorphic function to encrypt the search query. A system that uses probabilistic encryption with a mask, causes the DB server to release the mask, and causes the DB server to output search queries and non-corresponding data as search results so that the frequency of appearance of the data corresponding to the search does not leak Is disclosed.
 ところで、通常のデータベースにおける大容量データの高速検索の手段の一つとして、データベースのインデックス機能がある。インデックス機能は、特定のカラムに対して索引に相当するデータ構造を持つことで、検索対象範囲を絞り込むことにより、高速な検索を可能とする。しかし、ユーザ側のみが鍵を持つシステムの場合、暗号化されているデータの検索においては、通常のデータベースのインデックス機能が有効でない場合がある。その場合、多量のデータの高速検索ができない。従来技術では、通常のインデックス機能が有効でない暗号化状態のデータベースにおいて、多量のデータの高速検索を可能とする手段は開示されていない。 By the way, there is a database index function as one of the means of high-speed search of large-capacity data in a normal database. The index function has a data structure corresponding to an index for a specific column, thereby enabling a high-speed search by narrowing down the search target range. However, in the case of a system in which only the user side has a key, an ordinary database index function may not be effective in retrieving encrypted data. In that case, a large amount of data cannot be searched at high speed. The prior art does not disclose means for enabling high-speed retrieval of a large amount of data in an encrypted database in which the normal index function is not effective.
 また、通常のデータベースのインデックス機能は、検索対象となる属性値の出現頻度によって有効な場合と有効ではない場合がある。例えば、あるデータベース製品は、検索対象の属性値の頻度が、その属性の属性値数に対して一定の割合を超えているか否かによって、インデックスの使用要否を自動的に判断する。しかし、頻度分布が分からないようにデータが暗号化されている場合、クラウド側では頻度分布によるインデックスの使用要否を判断できない。 Also, the normal database index function may or may not be effective depending on the appearance frequency of the attribute value to be searched. For example, a certain database product automatically determines whether or not to use an index depending on whether or not the frequency of attribute values to be searched exceeds a certain ratio with respect to the number of attribute values of the attribute. However, if the data is encrypted so that the frequency distribution is not known, the cloud side cannot determine whether or not to use the index based on the frequency distribution.
 本発明は、以上の点を考慮してなされたもので、暗号化された多量のデータの高速検索を可能とする秘匿化データベースシステムを提案するものである。 The present invention has been made in consideration of the above points, and proposes a concealment database system that enables high-speed retrieval of a large amount of encrypted data.
 本願において開示される発明の代表的な一例を示せば以下の通りである。すなわち、ユーザシステムが所有する元データをデータ所有者が管理する暗号鍵によって暗号化した暗号化データが預託されるセンタシステムによって構成される秘匿化データベースシステムであって、前記センタシステムは、前記預託された暗号化データを元データに復号化することなく検索する機能を提供するものであって、前記ユーザシステムは、前記暗号化データを処理するための平文のSQL文を、前記暗号化データを前記センタシステム上で処理する暗号化SQL文に変換し、前記センタシステムから受信した暗号化データの処理結果を復号化するデータベースラッパー部を有し、前記センタシステムは、前記暗号化データを格納する暗号化預託データテーブルと、前記元データのハッシュ値を暗号化した暗号化ハッシュ値を格納し、前記暗号化預託データテーブルの検索範囲を限定するために参照されるハッシュテーブルと、前記暗号化預託データテーブルに格納された暗号化データを検索するデータベース制御部と、前記暗号化データと検索クエリとの一致を判定する暗号文一致比較部と、を有し、前記データベースラッパー部は、前記暗号化データを検索するための平文のSQL文を、前記暗号化データを前記センタシステム上で処理する暗号化SQL文に変換し、前記センタシステムが受信した前記暗号化SQL文を実行することによって、前記データベース制御部が前記ハッシュテーブルを検索して前記暗号化データの範囲を限定し、前記暗号文一致比較部が前記限定された範囲の暗号化データについて前記暗号化SQL文が指示する一致比較を行い、前記データベース制御部が前記暗号化SQL文の実行結果を前記ユーザシステムへ送信し、前記データベースラッパー部は、前記データベース制御部から受信したSQL文の実行結果を復号化し、前記暗号化データの検索結果を出力する。 A typical example of the invention disclosed in the present application is as follows. That is, a concealment database system configured by a center system in which encrypted data obtained by encrypting original data owned by a user system with an encryption key managed by a data owner is deposited, and the center system includes the depository data A function of retrieving the encrypted data without decrypting the original data into the original data, wherein the user system uses a plain SQL sentence for processing the encrypted data, and the encrypted data as the encrypted data. A database wrapper unit that converts the encrypted SQL text received from the center system into a encrypted SQL sentence to be processed on the center system, and the center system stores the encrypted data The encrypted deposit data table and the encrypted hash value obtained by encrypting the hash value of the original data are stored. A hash table referred to in order to limit a search range of the encrypted deposit data table, a database control unit for searching for encrypted data stored in the encrypted deposit data table, and the encrypted data and search A ciphertext match comparison unit that determines a match with a query, and the database wrapper unit processes a plaintext SQL sentence for searching the encrypted data, and processes the encrypted data on the center system. The encrypted data is converted to an encrypted SQL sentence and the encrypted SQL sentence received by the center system is executed, whereby the database control unit searches the hash table to limit the range of the encrypted data, and A sentence match comparison unit performs a match comparison indicated by the encrypted SQL sentence for the limited range of encrypted data, and The database control unit transmits the execution result of the encrypted SQL statement to the user system, and the database wrapper unit decrypts the execution result of the SQL statement received from the database control unit, and displays the search result of the encrypted data. Output.
 本発明の代表的な形態によれば、暗号化した多量のデータを高速で検索することができる。前述した以外の課題、構成及び効果は、以下の実施例の説明により明らかにされる。 According to the representative embodiment of the present invention, a large amount of encrypted data can be searched at high speed. Problems, configurations, and effects other than those described above will become apparent from the description of the following embodiments.
本発明の第一の実施例の秘匿化データベースシステムのハードウェア及びソフトウェア構成を示すブロック図である。It is a block diagram which shows the hardware and software structure of the concealment database system of the 1st Example of this invention. 第一の実施例のデータベースラッパー部の論理構成を示すブロック図である。It is a block diagram which shows the logic structure of the database wrapper part of a 1st Example. 第一の実施例のユーザ定義機能部の論理構成を示すブロック図である。It is a block diagram which shows the logic structure of the user definition function part of a 1st Example. 第一の実施例のメインテーブルのデータ構造を示す図である。It is a figure which shows the data structure of the main table of a 1st Example. 第一の実施例の秘匿インデックスマップテーブルのデータ構造を示す図である。It is a figure which shows the data structure of the confidential index map table of a 1st Example. 第一の実施例の暗号化メインテーブルのデータ構造を示す図である。It is a figure which shows the data structure of the encryption main table of a 1st Example. 第一の実施例のハッシュテーブルのデータ構造を示す図である。It is a figure which shows the data structure of the hash table of a 1st Example. 第一の実施例の秘匿インデックス検索クエリ生成処理を示すフローチャートである。It is a flowchart which shows the secret index search query production | generation process of a 1st Example. 第一の実施例の秘匿インデックス検索処理を示すフローチャートである。It is a flowchart which shows the secret index search process of a 1st Example. 第一の実施例の検索結果復号処理を示すフローチャートである。It is a flowchart which shows the search result decoding process of a 1st Example. 第一の実施例の秘匿インデックス挿入クエリ生成処理を示すフローチャートである。It is a flowchart which shows the secret index insertion query production | generation process of a 1st Example. 第一の実施例の秘匿インデックス挿入処理を示すフローチャートである。It is a flowchart which shows the secret index insertion process of a 1st Example. 第一の実施例の秘匿インデックス更新クエリ生成処理を示すフローチャートである。It is a flowchart which shows the secret index update query production | generation process of a 1st Example. 第一の実施例の更新対象IDリスト取得処理を示すフローチャートである。It is a flowchart which shows the update object ID list acquisition process of a 1st Example. 第一の実施例の秘匿インデックス用更新対象IDテーブル取得処理を示すフローチャートである。It is a flowchart which shows the update target ID table acquisition process for secret indexes of a 1st Example. 第一の実施例の秘匿インデックス更新処理を示すフローチャートである。It is a flowchart which shows the secret index update process of a 1st Example. 第一の実施例の秘匿インデックス削除クエリ生成処理を示すフローチャートである。It is a flowchart which shows the confidential index deletion query production | generation process of a 1st Example. 第一の実施例の秘匿インデックス削除処理を示すフローチャートである。It is a flowchart which shows the secret index deletion process of a 1st Example. 第二の実施例の秘匿化データベースシステムのハードウェア及びソフトウェアの構成を示すブロック図である。It is a block diagram which shows the structure of the hardware and software of the concealment database system of a 2nd Example. 第二の実施例のデータベースラッパー部の論理構成を示すブロック図である。It is a block diagram which shows the logic structure of the database wrapper part of a 2nd Example. 第二の実施例のユーザ定義機能部の論理構成を示すブロック図である。It is a block diagram which shows the logic structure of the user definition function part of a 2nd Example. 第二の実施例の秘匿インデックスマップテーブルのデータ構造を示す図である。It is a figure which shows the data structure of the confidential index map table of a 2nd Example. 第二の実施例の暗号化メインテーブルのデータ構造を示す図である。It is a figure which shows the data structure of the encryption main table of a 2nd Example. 第二の実施例のマッピングテーブルのデータ構造を示す概念図である。It is a conceptual diagram which shows the data structure of the mapping table of a 2nd Example. 第二の実施例のハッシュテーブルのデータ構造を示す図である。It is a figure which shows the data structure of the hash table of a 2nd Example. 第二の実施例の秘匿インデックス検索クエリ生成処理を示すフローチャートである。It is a flowchart which shows the secret index search query production | generation process of a 2nd Example. 第二の実施例の秘匿インデックス検索処理を示すフローチャートである。It is a flowchart which shows the secret index search process of a 2nd Example. 第二の実施例の秘匿インデックス挿入クエリ生成処理を示すフローチャートである。It is a flowchart which shows the secret index insertion query production | generation process of a 2nd Example. 第二の実施例の秘匿インデックス挿入処理を示すフローチャートである。It is a flowchart which shows the secret index insertion process of a 2nd Example. 第二の実施例の秘匿インデックス更新クエリ生成処理を示すフローチャートである。It is a flowchart which shows the secret index update query production | generation process of a 2nd Example. 第二の実施例の秘匿インデックス用更新対象IDテーブル取得処理を示すフローチャートである。It is a flowchart which shows the update target ID table acquisition process for confidential indexes of a 2nd Example. 第二の実施例の秘匿インデックス更新処理を示すフローチャートである。It is a flowchart which shows the secret index update process of a 2nd Example. 第二の実施例の秘匿インデックス削除クエリ生成処理を示すフローチャートである。It is a flowchart which shows the secret index deletion query production | generation process of a 2nd Example. 第二の実施例の秘匿インデックス削除処理を示すフローチャートである。It is a flowchart which shows the secret index deletion process of a 2nd Example. 第二の実施例のマッピングテーブルの並べ替えクエリ生成処理を示すフローチャートである。It is a flowchart which shows the rearrangement query production | generation process of the mapping table of a 2nd Example. 第二の実施例のマッピングテーブルの並べ替え処理を示すフローチャートである。It is a flowchart which shows the rearrangement process of the mapping table of a 2nd Example. 第三の実施例のデータベースラッパー部の論理構成を示すブロック図である。It is a block diagram which shows the logic structure of the database wrapper part of a 3rd Example. 第三の実施例の頻度分布平準化前のマッピングテーブルのデータ構造を示す図である。It is a figure which shows the data structure of the mapping table before the frequency distribution leveling of a 3rd Example. 第三の実施例の頻度分布平準化後のマッピングテーブルのデータ構造を示す図である。It is a figure which shows the data structure of the mapping table after frequency distribution leveling of the 3rd Example. 第三の実施例のマップID頻度分布平準化クエリ生成処理を示すフローチャートである。It is a flowchart which shows the map ID frequency distribution equalization query production | generation process of a 3rd Example. 第三の実施例のマップID頻度分布平準化処理を示すフローチャートである。It is a flowchart which shows the map ID frequency distribution leveling process of a 3rd Example.
 以下、図面を参照して本発明の実施の形態を詳述する。 Hereinafter, embodiments of the present invention will be described in detail with reference to the drawings.
 (1)第一の実施例
 (1-1)第一の実施例による情報処理システムの構成
 図1は、本発明の第一の実施例の秘匿化データベースシステム1のハードウェア及びソフトウェア構成を示すブロック図である。秘匿化データベースシステム1は、ユーザシステム側サーバ3が持つ元データを暗号化して、クラウドシステム側サーバ4に預託し、さらに、クラウドシステム側サーバ4が預託されたデータに対する検索機能及び分析機能をユーザシステム側サーバ3に提供するシステムである。
(1) First Embodiment (1-1) Configuration of Information Processing System According to First Embodiment FIG. 1 shows a hardware and software configuration of a concealment database system 1 according to the first embodiment of the present invention. It is a block diagram. The concealment database system 1 encrypts the original data possessed by the user system side server 3 and deposits it in the cloud system side server 4. Further, the cloud system side server 4 has a search function and an analysis function for the deposited data. This is a system provided to the system-side server 3.
 秘匿化データベースシステム1は、図1に示すように、ユーザ端末2、ユーザシステム側サーバ3、及びクラウドシステム側サーバ4によって構成される。ユーザ端末2とユーザシステム側サーバ3とは、ユーザの事業所内のローカルエリアネットワーク等からなるユーザ内部ネットワーク5を介して接続されている。ユーザシステム側サーバ3とクラウドシステム側サーバ4とは、ユーザ内部ネットワーク5、インターネットやキャリアが提供するワイドエリアネットワーク等からなる外部ネットワーク6及びクラウド事業者のデータセンタ内のローカルエリアネットワーク等からなるクラウド内部ネットワーク7を介して接続される。 The concealment database system 1 includes a user terminal 2, a user system side server 3, and a cloud system side server 4, as shown in FIG. The user terminal 2 and the user system side server 3 are connected via a user internal network 5 including a local area network in the user's office. The user system side server 3 and the cloud system side server 4 include a user internal network 5, an external network 6 including a wide area network provided by the Internet or a carrier, and a local area network in a data center of a cloud provider. Connected via the internal network 7.
 ユーザ端末2は、エンドユーザが使用するパーソナルコンピュータ、タブレット端末、スマートフォン等の装置であり、表示装置、入力装置、不揮発性記憶装置(磁気ディスクドライブ、SSD)、メモリ、CPU及びネットワークインタフェース等を有する。ユーザ端末2は、エンドユーザが入力装置から入力した要求を暗号化していない平文でユーザシステム側サーバ3のアプリケーション部211に送信し、当該要求に対する結果を受信し、表示装置に結果を表示し、福発性記憶装置に結果を記憶する。 The user terminal 2 is a device such as a personal computer, a tablet terminal, or a smartphone used by an end user, and includes a display device, an input device, a nonvolatile storage device (magnetic disk drive, SSD), a memory, a CPU, a network interface, and the like. . The user terminal 2 transmits the request input from the input device by the end user to the application unit 211 of the user system side server 3 in plain text, receives the result for the request, displays the result on the display device, Memorize the results in the fusogenic memory.
 ユーザシステム側サーバ3は、メモリ210、表示装置220、入力装置230、CPU240、ネットワークインタフェース装置(NIC)250及びディスク装置260などを有する計算機である。ユーザシステム側サーバ3は、ユーザ端末2から受信した平文の要求から暗号文のSQLを生成し、クラウドシステム側サーバ4へ送信し、SQL文に対する暗号文による結果を受信し、受信した暗号文を復号化し、平文の結果をユーザ端末2へ送信する。 The user system side server 3 is a computer having a memory 210, a display device 220, an input device 230, a CPU 240, a network interface device (NIC) 250, a disk device 260, and the like. The server 3 on the user system side generates a ciphertext SQL from the request for plaintext received from the user terminal 2, sends it to the cloud system side server 4, receives the result of the ciphertext for the SQL text, Decrypt and send the plaintext result to the user terminal 2.
 アプリケーション部211は、CPU240が、ディスク装置260、外部記憶媒体又はユーザ内部ネットワーク5経由でアプリケーションプログラムをメモリ210に読み出し、CPU240が読み出したアプリケーションプログラムを実行することによって構成される。アプリケーション部211は、ユーザ端末2から受信した平文の要求を処理し、処理の過程で必要な平文のSQL文をデータベースラッパー部212へ送信し、SQL文に対する平文の結果を受信する。 The application unit 211 is configured by the CPU 240 reading an application program to the memory 210 via the disk device 260, the external storage medium, or the user internal network 5, and executing the application program read by the CPU 240. The application unit 211 processes the plaintext request received from the user terminal 2, transmits a plaintext SQL sentence necessary in the course of processing to the database wrapper unit 212, and receives a plaintext result for the SQL sentence.
 データベースラッパー部212は、CPU240が、ディスク装置260、外部媒体又はユーザ内部ネットワーク5経由でプログラムをメモリ210に読み出し、CPU240が読み出したプログラムを実行することによって構成される。データベースラッパー部212は、アプリケーション部211から受信した平文のSQLを、ディスク装置260の秘匿インデックスマップテーブル262の情報を利用して暗号文のSQLに変換し、データベースインタフェース部213へ送信する。さらに、SQL文に対する暗号文による結果をデータベースインタフェース部213から受信し、平文に復号化して、平文の結果をアプリケーション部211へ送信する。 The database wrapper unit 212 is configured by the CPU 240 reading a program to the memory 210 via the disk device 260, an external medium, or the user internal network 5, and executing the program read by the CPU 240. The database wrapper unit 212 converts the plain text SQL received from the application unit 211 into cipher text SQL using information in the secret index map table 262 of the disk device 260, and transmits the cipher text SQL to the database interface unit 213. Further, the result of the ciphertext for the SQL text is received from the database interface unit 213, decrypted into plaintext, and the plaintext result is transmitted to the application unit 211.
 データベースインタフェース部213は、CPU240が、ディスク装置260、外部媒体又はユーザ内部ネットワーク5経由でプログラムをメモリ210に読み出し、CPU240が読み出したプログラムを実行することによって構成される。データベースインタフェース部213は、データベースラッパー部212から受信した暗号文のSQLをクラウドシステム側サーバ4へ送信し、クラウドシステム側サーバ4から暗号文による結果を受信して、データベースラッパー部212へ送信する。 The database interface unit 213 is configured by the CPU 240 reading a program to the memory 210 via the disk device 260, an external medium, or the user internal network 5, and executing the program read by the CPU 240. The database interface unit 213 transmits the SQL of the ciphertext received from the database wrapper unit 212 to the cloud system side server 4, receives the result of the ciphertext from the cloud system side server 4, and transmits it to the database wrapper unit 212.
 ディスク装置260は、ハードディスクドライブ又はソリッドステートドライブなどの不揮発性記憶装置から構成され、メインテーブル261及び秘匿インデックスマップテーブル262を記憶する。メインテーブル261は、クラウドシステム側サーバ4へ預託する前の平文の情報を格納する。秘匿インデックスマップテーブル262は、クラウドシステム側サーバ4上の暗号化メインテーブル361の情報へ高速にアクセスするための関連情報を格納する。 The disk device 260 is composed of a nonvolatile storage device such as a hard disk drive or a solid state drive, and stores a main table 261 and a secret index map table 262. The main table 261 stores plaintext information before depositing to the cloud system side server 4. The secret index map table 262 stores related information for accessing the information in the encryption main table 361 on the cloud system server 4 at high speed.
 クラウドシステム側サーバ4は、ユーザシステム側サーバ3と同様に、メモリ310、表示装置320、入力装置330、CPU340、ネットワークインタフェース装置(NIC)350及びディスク装置360などを備えた計算機等から構成される。クラウドシステム側サーバ4は、ユーザシステム側サーバ3から受信した暗号文のSQLを実行し、得られた暗号文の実行結果をユーザシステム側サーバ3へ送信する。 Similarly to the user system side server 3, the cloud system side server 4 includes a computer including a memory 310, a display device 320, an input device 330, a CPU 340, a network interface device (NIC) 350, a disk device 360, and the like. . The cloud system side server 4 executes SQL of the ciphertext received from the user system side server 3 and transmits the obtained ciphertext execution result to the user system side server 3.
 データベース制御部311は、CPU340が、ディスク装置360、外部媒体あるいはクラウド内部ネットワーク7経由でプログラムをメモリ310に読み出し、読み出したプログラムをCPU340が実行することによって構成される。データベース制御部311は、ユーザシステム側サーバ3から暗号文のSQLを受信し、ハッシュテーブル362の情報とユーザ定義機能部312の機能を利用して暗号化メインテーブル361に対して暗号文のSQLを実行し、得られた暗号文による結果をユーザシステム側サーバ3へ送信する。 The database control unit 311 is configured by the CPU 340 reading the program to the memory 310 via the disk device 360, the external medium or the cloud internal network 7, and the CPU 340 executing the read program. The database control unit 311 receives the ciphertext SQL from the user system side server 3, and uses the information in the hash table 362 and the function of the user definition function unit 312 to send the ciphertext SQL to the encryption main table 361. Then, the result of the obtained ciphertext is transmitted to the server 3 on the user system side.
 ユーザ定義機能部312は、CPU340が、ディスク装置360、外部媒体あるいはクラウド内部ネットワーク7経由でプログラムをメモリ310に読み出し、読み出したプログラムをCPU340が実行することによって構成される。ユーザ定義機能部312は、データベース制御部311からユーザ定義機能への入力情報を受け、異なる暗号文の元の平文が一致しているか否かを判定するユーザ定義機能による処理を実行し、処理結果をデータベース制御部311へ出力する。 The user-defined function unit 312 is configured by the CPU 340 reading the program to the memory 310 via the disk device 360, the external medium, or the cloud internal network 7, and the CPU 340 executing the read program. The user-defined function unit 312 receives input information to the user-defined function from the database control unit 311, executes processing by the user-defined function that determines whether the original plaintexts of different ciphertexts match, and the processing result Is output to the database control unit 311.
 ディスク装置360は、ハードディスクドライブ又はソリッドステートドライブなどの不揮発性記憶装置から構成され、暗号化メインテーブル361及びハッシュテーブル362を記憶する。暗号化メインテーブル361は、メインテーブル261を暗号化して格納する。ハッシュテーブル362は、暗号化メインテーブル361に対するアクセスを高速化するための情報を格納する。 The disk device 360 includes a nonvolatile storage device such as a hard disk drive or a solid state drive, and stores an encrypted main table 361 and a hash table 362. The encrypted main table 361 encrypts and stores the main table 261. The hash table 362 stores information for speeding up access to the encrypted main table 361.
 図2は、データベースラッパー部212の論理構成を示す。データベースラッパー部212は、暗号化部2121、検索クエリ生成部2122、復号化部2124、鍵管理部2125、SQL変換部2126、及び秘匿インデックス用SQL変換部2127で構成される。 FIG. 2 shows a logical configuration of the database wrapper unit 212. The database wrapper unit 212 includes an encryption unit 2121, a search query generation unit 2122, a decryption unit 2124, a key management unit 2125, an SQL conversion unit 2126, and a secret index SQL conversion unit 2127.
 暗号化部2121は、平文及び鍵管理部2125から取得した暗号化鍵を入力とし、入力された平文を暗号文に変換して、暗号文を出力する。 The encryption unit 2121 receives the encryption key acquired from the plaintext and key management unit 2125, converts the input plaintext into ciphertext, and outputs the ciphertext.
 検索クエリ生成部2122は、暗号化メインテーブル361に格納された暗号化データと検索データとの一致検索に必要な検索クエリを生成する。すなわち、検索クエリ生成部2122は、平文の検索データ及び鍵管理部2125から取得した暗号化鍵及び検索用鍵を入力とし、検索データと一致する暗号化メインテーブル361の暗号化データを識別するための入力情報となる暗号化検索クエリを生成し、暗号化検索クエリを出力する。 The search query generation unit 2122 generates a search query necessary for a match search between the encrypted data stored in the encryption main table 361 and the search data. That is, the search query generation unit 2122 receives the plaintext search data and the encryption key and search key acquired from the key management unit 2125 as input, and identifies the encrypted data in the encryption main table 361 that matches the search data. An encrypted search query serving as input information is generated and an encrypted search query is output.
 ハッシュ値生成部2123は、平文データと生成するハッシュ値の種類数を指定するハッシュ長を入力とし、平文データをハッシュ関数で処理した平文のハッシュ値を取得し、平文のハッシュ値を出力する。 The hash value generation unit 2123 receives the hash length specifying the plaintext data and the number of types of hash values to be generated, acquires the plaintext hash value obtained by processing the plaintext data with the hash function, and outputs the plaintext hash value.
 復号化部2124は、暗号文及び鍵管理部2125から取得した暗号化鍵を入力とし、入力された暗号文を平文に変換して、平文を出力する。 The decryption unit 2124 receives the encryption key acquired from the ciphertext and key management unit 2125, converts the input ciphertext into plaintext, and outputs the plaintext.
 鍵管理部2125は、暗号化、復号化及び検索クエリ生成に用いられる鍵情報を管理する。すなわち、鍵管理部2125は、暗号化鍵データ及び検索用鍵データをメモリ210及び/又はディスク装置260に格納し、暗号化部2121、検索クエリ生成部2122又は復号化部2124からの鍵の要求に対して、暗号化鍵データ又は検索用鍵データを提供する。なお、暗号化鍵データ及び検索用鍵データの両方を提供してもよい。 The key management unit 2125 manages key information used for encryption, decryption, and search query generation. That is, the key management unit 2125 stores the encryption key data and the search key data in the memory 210 and / or the disk device 260, and requests the key from the encryption unit 2121, the search query generation unit 2122, or the decryption unit 2124. In contrast, encryption key data or search key data is provided. Note that both encryption key data and search key data may be provided.
 SQL変換部2126は、暗号化メインテーブル361のみに対し処理を行うSQLを作成する。すなわち、SQL変換部2126は、平文のSQLを入力とし、検索データを暗号化検索クエリに置き換え、挿入又は更新する平文データを暗号文データに置き換え、一致比較文をユーザ定義機能部312の暗号文一致比較部3121を呼び出すユーザ定義関数呼出文に置き換えた暗号化SQL文を生成する。そして、暗号化SQL文をデータベースインタフェース部213へ送信する。 The SQL conversion unit 2126 creates SQL that performs processing only on the encrypted main table 361. That is, the SQL conversion unit 2126 receives the plain text SQL, replaces the search data with the encrypted search query, replaces the plain text data to be inserted or updated with the cipher text data, and replaces the match comparison text with the cipher text of the user definition function unit 312. An encrypted SQL statement replaced with a user-defined function call statement that calls the match comparison unit 3121 is generated. Then, the encrypted SQL sentence is transmitted to the database interface unit 213.
 秘匿インデックス用SQL変換部2127は、暗号化メインテーブル361とハッシュテーブル362に対する処理を行う。すなわち、秘匿インデックス用SQL変換部2127は、平文のSQLを入力とし、検索データを暗号化検索クエリに置き換え、検索データからハッシュ値を生成する。そして、生成されたハッシュ値を暗号化検索クエリに置き換え、挿入又は更新する平文データを暗号文データに置き換え、挿入又は更新する平文データから平文ハッシュ値を生成する。そして、生成された平文ハッシュ値を暗号文ハッシュ値に置き換え、ハッシュテーブル362及び暗号化メインテーブル361に対して参照、挿入、更新及び削除の少なくとも一つの処理を行う暗号化SQL文を生成する。そして、暗号化SQL文をデータベースインタフェース部213へ送信する。 The secret index SQL conversion unit 2127 performs processing on the encryption main table 361 and the hash table 362. That is, the secret index SQL conversion unit 2127 receives plain text SQL, replaces the search data with an encrypted search query, and generates a hash value from the search data. Then, the generated hash value is replaced with an encrypted search query, the plaintext data to be inserted or updated is replaced with ciphertext data, and a plaintext hash value is generated from the plaintext data to be inserted or updated. Then, the generated plaintext hash value is replaced with a ciphertext hash value, and an encrypted SQL sentence that performs at least one of reference, insertion, update, and deletion on the hash table 362 and the encryption main table 361 is generated. Then, the encrypted SQL sentence is transmitted to the database interface unit 213.
 図3は、ユーザ定義機能部312の論理構成を示す。ユーザ定義機能部312は、暗号文一致比較部3121で構成される。暗号文一致比較部3121は、検索用鍵データをメモリ310及び/又はディスク装置360に格納し、データベース制御部311から暗号化検索クエリ及び暗号文データの入力を受け、検索用鍵を用いて暗号化検索クエリを暗号文データとの一致比較が可能な一致検索クエリに復号し、一致検索クエリと暗号化データとを一致比較する。そして、一致検索クエリと暗号化データとが一致する場合、一致を示す値(例えば、”1”)を出力し、一致検索クエリと暗号化データとが一致しない場合、不一致を示す値(例えば、”0”)を出力する。 FIG. 3 shows a logical configuration of the user-defined function unit 312. The user definition function unit 312 includes a ciphertext match comparison unit 3121. The ciphertext match comparison unit 3121 stores the search key data in the memory 310 and / or the disk device 360, receives the input of the encrypted search query and the ciphertext data from the database control unit 311, and encrypts using the search key The encrypted search query is decrypted into a match search query that can be compared with the ciphertext data, and the match search query is compared with the encrypted data. When the matched search query and the encrypted data match, a value indicating the match (for example, “1”) is output. When the matched search query and the encrypted data do not match, the value indicating the mismatch (for example, "0") is output.
 図4は、暗号化して預託される前の平文データを示すメインテーブル261のデータ構造を示す。メインテーブル261は、ユーザシステム側サーバ3のディスク装置260又はメモリ210に格納される。メインテーブル261は、ディスク装置260及びメモリ210の両方に格納されてもよい。本実施例では病院のデータであり、スキーマ名が”医療情報”であり、テーブル名が”患者情報”であるテーブルを想定している。メインテーブル261は、患者を一意に特定する番号である”患者番号”カラム、患者の名前である”名前”カラム、及び患者の疾病の種類を示す”病名”カラムを含む。例えば、レコード2611は、患者番号が”0000001”の患者の名前は”鈴木”であり、病名は”高血圧症”であることを示す。メインテーブル261は患者番号が”0000001”から”1000000”まで、100万件のレコードを格納している。 FIG. 4 shows a data structure of the main table 261 indicating plain text data before being encrypted and deposited. The main table 261 is stored in the disk device 260 or the memory 210 of the user system side server 3. The main table 261 may be stored in both the disk device 260 and the memory 210. In the present embodiment, it is assumed that the table is hospital data, the schema name is “medical information”, and the table name is “patient information”. The main table 261 includes a “patient number” column that is a number that uniquely identifies a patient, a “name” column that is the name of the patient, and a “disease name” column that indicates the type of disease of the patient. For example, the record 2611 indicates that the name of the patient whose patient number is “0000001” is “Suzuki” and the disease name is “hypertension”. The main table 261 stores 1 million records from patient numbers “0000001” to “1000000”.
 図5は、検索を高速化するハッシュテーブル362と暗号化メインテーブル361のマップIDカラムとを関連付ける情報を格納する秘匿インデックスマップテーブル262のデータ構造を示す。秘匿インデックスマップテーブル262は、ユーザシステム側サーバ3のディスク装置260又はメモリ210に格納される。秘匿インデックスマップテーブル262は、ディスク装置260及びメモリ210の両方に格納されてもよい。本実施例では病院のデータを想定しており、秘匿インデックスマップテーブル262は、病院のテーブルの種類を分類する”スキーマ名”カラムは、”医療情報”あるいは”経営情報”などが存在することを示す。個々のテーブルの名前を示す”暗号化メインテーブル名”カラムは”患者情報”テーブル、”薬剤情報”テーブル、”投薬情報”テーブル、”医事会計”テーブルなどが存在することを示す。”カラム名”のカラムは、そのカラムに対応するハッシュテーブル362が存在すること、及び暗号化メインテーブル361がハッシュテーブル362との関連を示す”マップID名”カラムを含むことを示す。”マップIDカラム名”カラム及び”ハッシュテーブル名”は、暗号化メインテーブル361が備える”MapID-1”カラムなどのマップIDカラム名と、ハッシュテーブル362(HT1)などのハッシュテーブル362との関連を示す。なお、ハッシュテーブル362は、インデックス化しても検索が高速化されないカラムに対しては生成しない。具体的には、同一の属性値が大部分を占めるようなカラムの属性値の分布を持つカラムに対しては生成しなくてよい。例えば、レコード2621は、”医療情報”スキーマの”患者情報”テーブルにおいて、関連するマップIDカラムとハッシュテーブルを持つ”カラム名”が”病名”であり、関連する”マップIDカラム名”が”MapID-1”であり、関連する”ハッシュテーブル名”が”HT1”であることを示す。 FIG. 5 shows the data structure of the secret index map table 262 that stores information that associates the hash table 362 that speeds up the search with the map ID column of the encrypted main table 361. The secret index map table 262 is stored in the disk device 260 or the memory 210 of the user system side server 3. The secret index map table 262 may be stored in both the disk device 260 and the memory 210. In this embodiment, hospital data is assumed, and the secret index map table 262 indicates that the “schema name” column for classifying hospital table types includes “medical information” or “management information”. Show. The “encrypted main table name” column indicating the name of each table indicates that a “patient information” table, a “drug information” table, a “medicine information” table, a “medical accounting” table, and the like exist. The column “column name” indicates that the hash table 362 corresponding to the column exists, and that the encryption main table 361 includes a “map ID name” column indicating the relationship with the hash table 362. The “map ID column name” column and the “hash table name” relate to the map ID column name such as the “MapID-1” column included in the encryption main table 361 and the hash table 362 such as the hash table 362 (HT1). Indicates. It should be noted that the hash table 362 is not generated for a column whose search is not accelerated even if it is indexed. Specifically, it is not necessary to generate a column having a distribution of column attribute values in which the same attribute value occupies most. For example, in the record 2621, in the “patient information” table of the “medical information” schema, the “column name” having the related map ID column and the hash table is “disease name”, and the related “map ID column name” is “ MapID-1 ”, indicating that the associated“ hash table name ”is“ HT1 ”.
 図6は、クラウドシステム側サーバ4が預託されたメインテーブル261の暗号文データを格納する暗号化メインテーブル361のデータ構造を示す。暗号化メインテーブル361は、クラウドシステム側サーバ4のディスク装置360又はメモリ310に格納される。なお、暗号化メインテーブル361は、ディスク装置360及びメモリ310の両方に格納されてもよい。暗号化メインテーブル361は、メインテーブル261に含まれる”患者番号”カラム、”名前”カラム及び”病名”カラムを含む。更に、暗号化メインテーブル361の各レコードを一意に特定する識別子である”ID”カラム及びハッシュテーブル(HT1)362との関連情報である”MapID-1”カラムによって、レコードを構成する。例えば、レコード3611は、暗号化された患者番号が”Enc(0000001)”、暗号化された名前が”Enc(小島)”、暗号化された病名が”Enc(高血圧症)”、レコードの識別子が”1”、及びハッシュテーブル362との関連を示すMapID-1の値が”1”であることを示す。なお、本実施例の説明で、”Enc( )”は、”( )”内の平文データが、暗号化部2121によって暗号化された暗号文であることを示す。また、”ID”カラム及び”MapID-1”カラムには、データベース制御部311の通常のインデックス機能を適用する。 FIG. 6 shows the data structure of the encrypted main table 361 for storing the ciphertext data of the main table 261 deposited by the cloud system side server 4. The encryption main table 361 is stored in the disk device 360 or the memory 310 of the cloud system side server 4. Note that the encryption main table 361 may be stored in both the disk device 360 and the memory 310. The encrypted main table 361 includes a “patient number” column, a “name” column, and a “disease name” column included in the main table 261. Furthermore, a record is configured by an “ID” column that is an identifier for uniquely specifying each record in the encryption main table 361 and a “MapID-1” column that is information related to the hash table (HT1) 362. For example, in the record 3611, the encrypted patient number is “Enc (0000001)”, the encrypted name is “Enc (Kojima)”, the encrypted disease name is “Enc (hypertension)”, and the identifier of the record Is “1” and the value of MapID-1 indicating the association with the hash table 362 is “1”. In the description of this embodiment, “Enc ()” indicates that the plaintext data in “()” is a ciphertext encrypted by the encryption unit 2121. Further, the normal index function of the database control unit 311 is applied to the “ID” column and the “MapID-1” column.
 図7は、検索を高速化するために用いるハッシュテーブル362のデータ構造を示す。ハッシュテーブル362は、クラウドシステム側サーバ4のディスク装置360又はメモリ310に格納される。なお、ハッシュテーブル362は、クラウドシステム側サーバ4のディスク装置360及びメモリ310に格納されてもよい。ハッシュテーブル362のレコードは、暗号化メインテーブル361の”MapID-1”カラムとの対応情報を示す”MapID”カラム、及びハッシュ値生成部2123が平文データを変換した平文ハッシュ値を暗号化部2121が暗号化した値を示す”暗号化ハッシュ値”カラムにより構成される。例えば、レコード3621は、暗号化メインテーブル361の”MapID-1”カラムの値と対応する”MapID”の値が”1”であり、MapID=1に対応する”暗号化ハッシュ値”の値が”Enc(0765)”であることを示す。”MapID”カラムの値は、メインテーブル261の一つ以上のレコードの”MapID-1”の値と等しい。このため、”MapID”を指定することによって、暗号化メインテーブル361の全レコードを全件検索することなく、検索範囲を限定することができる。 FIG. 7 shows the data structure of the hash table 362 used for speeding up the search. The hash table 362 is stored in the disk device 360 or the memory 310 of the cloud system side server 4. The hash table 362 may be stored in the disk device 360 and the memory 310 of the cloud system side server 4. The record of the hash table 362 includes the “MapID” column indicating the correspondence information with the “MapID-1” column of the encryption main table 361, and the plaintext hash value obtained by converting the plaintext data by the hash value generation unit 2123 into the encryption unit 2121. Is composed of an “encrypted hash value” column indicating an encrypted value. For example, in the record 3621, the value of “MapID” corresponding to the value of the “MapID-1” column of the encryption main table 361 is “1”, and the value of “encryption hash value” corresponding to MapID = 1 is set. “Enc (0765)”. The value of the “MapID” column is equal to the value of “MapID-1” of one or more records in the main table 261. Therefore, by designating “MapID”, the search range can be limited without searching all records in the encrypted main table 361.
 (1-2)秘匿化データベースの検索に関する処理の流れ
 図8、図9及び図10を用いて、秘匿化データベースシステム1において、ハッシュテーブル362を用いた検索である秘匿インデックス検索を行う際の、データベースラッパー部212及びデータベース制御部311が行う一連の処理の詳細を説明する。
(1-2) Flow of processing related to search of concealment database Using FIG. 8, FIG. 9 and FIG. 10, in the concealment database system 1, a concealment index search that is a search using the hash table 362 is performed. Details of a series of processing performed by the database wrapper unit 212 and the database control unit 311 will be described.
 図8は、ユーザシステム側サーバ3において、データベースラッパー部212が実行する秘匿インデックス検索クエリ生成処理を示すフローチャートである。秘匿インデックス検索クエリ生成処理は、データベースラッパー部212がアプリケーション部211から平文の検索のSQLを受信すると、開始する。例えば、秘匿インデックス検索クエリ生成処理の開始時にデータベースラッパー部212が受信するSQLは、以下の平文の検索SQL(1)である。
 
SELECT * FROM 医療情報.患者情報 WHERE 病名=糖尿病 (1)
 
 この検索SQLは、スキーマ名が”医療情報”であり、テーブル名が”患者情報”であるテーブルから、”病名”カラムの値が”糖尿病”であるレコードを検索し、全てのカラムの値を検索結果として得ることを意味する(ステップ810)。
FIG. 8 is a flowchart showing a secret index search query generation process executed by the database wrapper unit 212 in the user system side server 3. The secret index search query generation process starts when the database wrapper unit 212 receives a plain text search SQL from the application unit 211. For example, the SQL received by the database wrapper unit 212 at the start of the secret index search query generation process is the following plaintext search SQL (1).

SELECT * FROM Medical Information. Patient Information WHERE Disease Name = Diabetes (1)

This search SQL searches a record whose schema name is “medical information” and whose table name is “patient information” and whose value of the “disease name” column is “diabetes”, and sets all the column values. It means that it is obtained as a search result (step 810).
 次に、データベースラッパー部212は、平文の検索SQLから、検索対象のカラムの値を取り出し、検索クエリ生成部2122を用いて暗号化メインテーブル361における一致検索に用いる暗号化検索クエリを取得する。具体的には、データベースラッパー部212は、まず、鍵管理部2125から暗号化鍵及び検索用鍵を取得し、それらを検索クエリ生成部2122に入力し、その出力として暗号化検索クエリを得る。例えば、平文のSQLが(1)である場合、以下の実行文(2)となる(ステップ820)。
 
暗号化検索クエリ(糖尿病)=検索クエリ生成部(暗号化鍵、検索用鍵、"糖尿病") (2)
 
Next, the database wrapper unit 212 extracts the value of the search target column from the plain text search SQL, and acquires an encrypted search query used for matching search in the encrypted main table 361 using the search query generation unit 2122. Specifically, the database wrapper unit 212 first obtains an encryption key and a search key from the key management unit 2125, inputs them to the search query generation unit 2122, and obtains an encrypted search query as its output. For example, when the plain text SQL is (1), the following executable sentence (2) is obtained (step 820).

Encrypted search query (diabetes) = search query generator (encryption key, search key, "diabetes") (2)
 次に、データベースラッパー部212は、秘匿インデックスマップテーブル262から、検索対象カラムの”マップIDカラム名”及び”ハッシュテーブル名”を取得する。具体的には、データベースラッパー部212は、平文の検索SQLが検索対象とするスキーマ名、暗号化メインテーブル名及びカラム名の組をキーとして、秘匿インデックスマップテーブル262を検索し、スキーマ名、暗号化メインテーブル名及びカラム名が一致するレコードの”マップIDカラム名”及び”ハッシュテーブル名”を取得する。例えば、平文の検索SQLが(1)である場合、スキーマ名が”医療情報”であり、かつ暗号化メインテーブル名が”患者情報”であり、かつカラム名が”病名”であるレコード2621から、マップIDカラム名”MapID-1”及びハッシュテーブル名”HT1”を取得する(ステップ830)。 Next, the database wrapper unit 212 acquires “map ID column name” and “hash table name” of the search target column from the secret index map table 262. Specifically, the database wrapper unit 212 searches the secret index map table 262 using the combination of the schema name, the encryption main table name, and the column name that are to be searched by the plaintext search SQL as a key. The “map ID column name” and “hash table name” of the record having the same main table name and column name are acquired. For example, when the plain text search SQL is (1), from the record 2621 where the schema name is “medical information”, the encrypted main table name is “patient information”, and the column name is “disease name”. The map ID column name “MapID-1” and the hash table name “HT1” are acquired (step 830).
 次に、データベースラッパー部212は、ステップ830の結果が存在するか否かを判定する(ステップ840)。 Next, the database wrapper unit 212 determines whether or not the result of step 830 exists (step 840).
 ステップ840の結果が存在しない場合(ステップ840でNO)、データベースラッパー部212は、ハッシュテーブル362を用いない検索SQL変換の処理を行う。具体的には、データベースラッパー部212は、平文のSQLの検索対象の値を、ステップ820で生成した暗号化検索クエリに置き換え、さらに、WHERE句の一致比較文をユーザ定義機能部312の暗号文一致比較部3121を呼び出す形式に置き換えた暗号文の検索SQLを出力する。例えば、平文のSQLが(1)、暗号化検索クエリが(2)である場合、以下の暗号文の検索SQL(3)が出力される(ステップ850)。
 
SELECT * FROM 医療情報.患者情報 
WHERE 暗号文一致比較部(病名、暗号化検索クエリ(糖尿病)) (3)
 
When the result of step 840 does not exist (NO in step 840), the database wrapper unit 212 performs a search SQL conversion process that does not use the hash table 362. Specifically, the database wrapper unit 212 replaces the plaintext SQL search target value with the encrypted search query generated in step 820, and further matches the WHERE clause match comparison statement with the ciphertext of the user definition function unit 312. The ciphertext search SQL replaced with the format for calling the match comparison unit 3121 is output. For example, when the plaintext SQL is (1) and the encrypted search query is (2), the following ciphertext search SQL (3) is output (step 850).

SELECT * FROM Medical information. Patient information
WHERE Ciphertext match comparison unit (disease name, encrypted search query (diabetes)) (3)
 一方、ステップ840の結果が存在する場合(ステップ840でYES)、データベースラッパー部212は、ハッシュテーブル362を用いた高速検索を行うために、ハッシュ値生成から秘匿インデックス用検索SQL変換(ステップ860~880)の処理を行った暗号文の検索SQLを出力する。 On the other hand, if the result of step 840 exists (YES in step 840), the database wrapper unit 212 performs the secret index search SQL conversion (step 860-) from the hash value generation in order to perform a high-speed search using the hash table 362. The ciphertext search SQL for which the processing of 880) is performed is output.
 まず、データベースラッパー部212は、検索対象の値をハッシュ値生成部2123に入力し、出力されるハッシュ値を取得する。例えば、平文の検索SQLが(1)である場合、以下のハッシュ値(4)を取得する(ステップ860)。
 
ハッシュ値 = ハッシュ値生成部(糖尿病)="1012" (4)
 
First, the database wrapper unit 212 inputs a search target value to the hash value generation unit 2123 and obtains an output hash value. For example, when the plaintext search SQL is (1), the following hash value (4) is acquired (step 860).

Hash value = Hash value generator (diabetes) = "1012" (4)
 次に、データベースラッパー部212は、ハッシュテーブル362を検索するために、ステップ860で取得したハッシュ値を検索クエリ生成部2122に入力し、出力をハッシュテーブル検索クエリとする。例えば、平文のハッシュ値が(4)である場合、以下のハッシュテーブル検索クエリ(5)を取得する(ステップ870)。
 
ハッシュテーブル検索クエリ(1012)=検索クエリ生成部(暗号鍵、検索用鍵、"1012") (5)
 
Next, in order to search the hash table 362, the database wrapper unit 212 inputs the hash value acquired in step 860 to the search query generation unit 2122, and uses the output as a hash table search query. For example, when the hash value of the plaintext is (4), the following hash table search query (5) is acquired (step 870).

Hash table search query (1012) = search query generator (encryption key, search key, "1012") (5)
 次に、データベースラッパー部212は、まずハッシュテーブル362を検索して検索範囲を限定した上で、暗号化メインテーブル361を検索するためのSQLを生成する秘匿インデックス用検索SQL変換を行う。具体的には、ステップ820で得た暗号化検索クエリと、ステップ830で得たマップIDカラム名及びハッシュテーブル名と、ステップ870で得たハッシュテーブル検索クエリとを入力とし、ハッシュテーブル362をハッシュテーブル検索クエリで検索して該当したレコードの”MapID”カラムの値を取得する。そして、取得した値と等しい”MapID-1”カラムの値を持つ暗号化メインテーブル361のレコードから、暗号化検索クエリと一致する値を持つレコードを、ユーザ定義機能部312の暗号文一致比較部3121を用いて判定し、一致するレコードからメインテーブル261に存在するカラムのみ(”ID”カラム及び”MapID-1”カラム以外)を選択し、検索結果とする暗号文の検索SQLを生成し、出力する。例えば、平文の検索SQLが(1)である場合、以下の暗号文の検索SQL(6)を出力する(ステップ880)。
 
  SELECT 患者番号, 名前, 病名 FROM 医療情報.患者情報
  JOIN
  (SELECT MapID FROM ハッシュテーブル(HT1)
        WHERE
暗号文一致比較部(暗号化ハッシュ値、ハッシュテーブル検索クエリ(1012))
  ) MapResult
  ON  医療情報.患者情報.MapID-1 = MapResult.MapID
  WHERE 暗号化一致比較部(病名、暗号化検索クエリ(糖尿病))  (6)
 
Next, the database wrapper unit 212 first searches the hash table 362 to limit the search range, and then performs a secret index search SQL conversion that generates an SQL for searching the encrypted main table 361. Specifically, the encrypted search query obtained in step 820, the map ID column name and hash table name obtained in step 830, and the hash table search query obtained in step 870 are input, and the hash table 362 is hashed. The value of the “MapID” column of the corresponding record is acquired by searching with a table search query. Then, a record having a value that matches the encrypted search query from the record of the encrypted main table 361 having the value of the “MapID-1” column equal to the acquired value is converted into a ciphertext match comparison unit of the user definition function unit 312. 312 is used to select only the columns existing in the main table 261 (other than the “ID” column and the “MapID-1” column) from the matching records, and to generate a ciphertext search SQL as a search result, Output. For example, when the plaintext search SQL is (1), the following ciphertext search SQL (6) is output (step 880).

SELECT patient number, name, disease name FROM medical information.patient information JOIN
(SELECT MapID FROM Hash Table (HT1)
WHERE
Ciphertext match comparison unit (encrypted hash value, hash table search query (1012))
) MapResult
ON Medical information.Patient information.MapID-1 = MapResult.MapID
WHERE Encryption match comparison part (disease name, encrypted search query (diabetes)) (6)
 最後に、データベースラッパー部212は、ステップ850又はステップ880で出力された暗号文の検索SQLを、データベースインタフェース部213へ送信する。平文の検索SQLが(1)である場合、ステップ840の結果が存在するため、データベースラッパー部212はステップ880が出力した暗号文の検索SQL(6)をデータベースインタフェース部213へ送信する(ステップ890)。以上によって、データベースラッパー部212は、秘匿インデックス検索クエリ生成処理(図8)を終了する。 Finally, the database wrapper unit 212 transmits the ciphertext search SQL output in step 850 or step 880 to the database interface unit 213. If the plaintext search SQL is (1), the result of step 840 exists, so the database wrapper unit 212 transmits the ciphertext search SQL (6) output in step 880 to the database interface unit 213 (step 890). ). As described above, the database wrapper unit 212 ends the secret index search query generation process (FIG. 8).
 図9は、クラウドシステム側サーバ4において、データベース制御部311が実行する秘匿インデックス検索処理を示すフローチャートである。秘匿インデックス検索処理は、データベース制御部311がデータベースインタフェース部213から暗号文の検索SQLを受信すると、開始する。例えば、秘匿インデックス検索処理の開始時にデータベース制御部311が受信するSQLは、暗号文の検索SQL(6)である。 FIG. 9 is a flowchart showing a secret index search process executed by the database control unit 311 in the cloud system side server 4. The secret index search process starts when the database control unit 311 receives the ciphertext search SQL from the database interface unit 213. For example, the SQL received by the database control unit 311 at the start of the secret index search process is the ciphertext search SQL (6).
 まず、データベース制御部311は、暗号文の検索SQLから、検索対象となるハッシュテーブル362とハッシュテーブル検索クエリとを特定し、ユーザ定義機能部312の暗号文一致比較部3121によって、当該ハッシュテーブル362の”暗号化ハッシュ値”カラムの値と当該ハッシュテーブル検索クエリとが一致するレコードを特定し、特定されたレコードの”MapID”カラムの値をMapID_hitとして取得する。例えば、暗号文の検索SQLが(6)である場合、ハッシュテーブル362はハッシュテーブル362(HT1)であり、ハッシュテーブル検索クエリは(5)の”ハッシュテーブル検索クエリ(1012)”である。そして、暗号文一致比較部3121による一致比較の結果、検索クエリがハッシュテーブル362(HT1)のレコード3622の暗号化ハッシュ値”Enc(1012)”と一致すると判定し、当該レコードのMapID”2”をMapID_hitとして取得する(ステップ910)。 First, the database control unit 311 identifies a hash table 362 and a hash table search query to be searched from the ciphertext search SQL, and the ciphertext match comparison unit 3121 of the user definition function unit 312 performs the hash table 362. The record in which the “encrypted hash value” column value matches the hash table search query is specified, and the “MapID” column value of the specified record is acquired as MapID_hit. For example, when the ciphertext search SQL is (6), the hash table 362 is the hash table 362 (HT1), and the hash table search query is “hash table search query (1012)” in (5). As a result of the match comparison by the ciphertext match comparison unit 3121, it is determined that the search query matches the encrypted hash value “Enc (1012)” of the record 3622 of the hash table 362 (HT 1), and MapID “2” of the record Is acquired as MapID_hit (step 910).
 次に、データベース制御部311は、暗号化メインテーブル361から、ハッシュテーブル362と対応するマップIDカラムの値がMapID_hitと一致し、かつ暗号化検索クエリと一致する値を持つことをユーザ定義機能部312の暗号文一致比較部3121により確認したレコード群MapResultを取得する。例えば、暗号文の検索SQLが(6)である場合、例えば、データベース制御部311は、暗号化メインテーブル361から、マップIDカラム”MapID-1”の値がステップ910で取得した”2”と一致し、かつ暗号化検索クエリ(糖尿病)の値と一致する”病名”カラムの値であるEnc(糖尿病)を持つレコード群を暗号文一致比較部3121により確認し、その結果レコード3613及びレコード3615をMapResultとして取得する(ステップ920)。 Next, the database control unit 311 determines from the encryption main table 361 that the value of the map ID column corresponding to the hash table 362 has a value that matches MapID_hit and a value that matches the encryption search query. The record group MapResult confirmed by the ciphertext match comparison unit 3121 of 312 is acquired. For example, when the ciphertext search SQL is (6), for example, the database control unit 311 determines that the value of the map ID column “MapID-1” from the encryption main table 361 is “2” acquired in step 910. A record group having Enc (diabetes) that is a value of the “disease name” column that matches and the value of the encrypted search query (diabetes) is confirmed by the ciphertext match comparison unit 3121, and as a result, records 3613 and 3615 are recorded. Is acquired as MapResult (step 920).
 最後に、データベース制御部311は、MapResultからIDカラム及びマップIDカラムを除いたレコード群を検索結果としてユーザシステム側サーバ3のデータベースインタフェース部213へ送信する。例えば、暗号文の検索SQLが(6)である場合、暗号化メインテーブル361のレコード3613及び3615から、”ID”カラム及び”MapID-1”カラムを除いたレコード群を暗号文の検索結果として送信する(ステップ930)。以上で、秘匿インデックス検索処理(図9)を終了する。 Finally, the database control unit 311 transmits a record group obtained by removing the ID column and the map ID column from the Map Result to the database interface unit 213 of the user system side server 3 as a search result. For example, when the ciphertext search SQL is (6), a record group excluding the “ID” column and the “MapID-1” column from the records 3613 and 3615 of the encryption main table 361 is used as the ciphertext search result. Transmit (step 930). Thus, the secret index search process (FIG. 9) is completed.
 図10は、ユーザシステム側サーバ3において、データベースラッパー部212が実行する検索結果復号処理を示すフローチャートである。検索結果復号処理は、データベースラッパー部212がデータベースインタフェース部213から暗号文の検索結果を受信すると、開始する。 FIG. 10 is a flowchart showing a search result decoding process executed by the database wrapper unit 212 in the user system side server 3. The search result decryption process starts when the database wrapper unit 212 receives the ciphertext search result from the database interface unit 213.
 まず、データベースラッパー部212は、暗号文の検索結果を復号化部2124に入力し、平文の検索結果を出力として得る(ステップ1010)。最後に、データベースラッパー部212は、アプリケーション部211へ平文の検索結果を送信する(ステップ1020)。以上で、検索結果復号処理(図10)を終了する。 First, the database wrapper unit 212 inputs the ciphertext search result to the decryption unit 2124, and obtains the plaintext search result as an output (step 1010). Finally, the database wrapper unit 212 transmits a plain text search result to the application unit 211 (step 1020). Thus, the search result decoding process (FIG. 10) is completed.
 (1-3)秘匿化データベースへの挿入に関する処理の流れ
 図11及び図12を用いて、秘匿化データベースシステム1において、ハッシュテーブル362を用いた挿入である秘匿インデックス挿入を行う際の、データベースラッパー部212及びデータベース制御部311が行う一連の処理の詳細を説明する。
(1-3) Process Flow for Insertion into Concealed Database A database wrapper used for concealment index insertion, which is insertion using the hash table 362, in the concealment database system 1 with reference to FIGS. Details of a series of processing performed by the unit 212 and the database control unit 311 will be described.
 図11は、ユーザシステム側サーバ3において、データベースラッパー部212が実行する秘匿インデックス挿入クエリ生成処理を示すフローチャートである。秘匿インデックス挿入クエリ生成処理は、データベースラッパー部212がアプリケーション部211から平文の挿入のSQLを受信すると、開始する。例えば、秘匿インデックス挿入クエリ生成処理の開始時にデータベースラッパー部212が受信するSQLは、以下の平文の挿入SQL(7)である。
 
  INSERT INTO 医療情報.患者情報 ( 患者番号, 名前, 病名 )
                                VALUES ( 1000001, 木下, 胃腸炎 ) (7)
 
 この挿入SQLは、スキーマ名が”医療情報”であり、テーブル名が”患者情報”であるテーブルに対し、”患者番号”カラムの値が”1000001”であり、”名前”カラムの値が”木下”であり、”病名”カラムの値が”胃腸炎”であるレコードを挿入することを意味する(ステップ1110)。
FIG. 11 is a flowchart showing a secret index insertion query generation process executed by the database wrapper unit 212 in the user system side server 3. The secret index insertion query generation process starts when the database wrapper unit 212 receives the plain text insertion SQL from the application unit 211. For example, the SQL received by the database wrapper unit 212 at the start of the secret index insertion query generation process is the following plaintext insertion SQL (7).

INSERT INTO Medical information.Patient information (patient number, name, disease name)
VALUES (1000001, Kinoshita, gastroenteritis) (7)

In this insertion SQL, the value of the “patient number” column is “1000001” and the value of the “name” column is “1000001” for the table whose schema name is “medical information” and whose table name is “patient information”. This means that a record that is “Kinoshita” and the value of the “disease name” column is “gastroenteritis” is inserted (step 1110).
 次に、データベースラッパー部212は、平文の挿入SQLから、挿入対象の値を取り出し、暗号化部2121により暗号化する。例えば、平文の挿入SQLが(7)である場合、挿入対象の値は”1000001”、”木下”及び”胃腸炎”であり、暗号化部2121により暗号化した結果の出力の暗号文はそれぞれ”Enc(1000001)”、”Enc(木下)”及び”Enc(胃腸炎)”となる(ステップ1120)。 Next, the database wrapper unit 212 extracts the value to be inserted from the plain text insertion SQL, and encrypts it by the encryption unit 2121. For example, when the plaintext insertion SQL is (7), the values to be inserted are “1000001”, “Kinoshita”, and “Gastroenteritis”, and the output ciphertexts obtained as a result of encryption by the encryption unit 2121 are respectively “Enc (1000001)”, “Enc (Kinoshita)”, and “Enc (gastroenteritis)” are obtained (step 1120).
 次に、データベースラッパー部212は、秘匿インデックスマップテーブル262から、挿入対象レコードに関連する”マップIDカラム名”及び”ハッシュテーブル名”を取得する。具体的には、データベースラッパー部212は、平文の挿入SQLが挿入対象とするスキーマ名及び暗号化メインテーブル名の組をキーとして、秘匿インデックスマップテーブル262を検索し、スキーマ及び暗号化メインテーブル名が一致するすべてのレコードから、”カラム名”、”マップIDカラム名”及び”ハッシュテーブル名”を取得する。例えば、平文の挿入SQLが(7)である場合、スキーマ名が”医療情報”でありかつ暗号化メインテーブル名が”患者情報”であるレコード2621から、カラム名”病名”、マップIDカラム名”MapID-1”及びハッシュテーブル名”HT1”を取得する(ステップ1130)。 Next, the database wrapper unit 212 acquires “map ID column name” and “hash table name” related to the record to be inserted from the secret index map table 262. Specifically, the database wrapper unit 212 searches the secret index map table 262 using the combination of the schema name and encryption main table name to be inserted by the plaintext insertion SQL as a key, and the schema and encryption main table name. “Column name”, “map ID column name”, and “hash table name” are acquired from all records that match. For example, when the plain text insertion SQL is (7), the column name “disease name”, map ID column name from the record 2621 whose schema name is “medical information” and whose encrypted main table name is “patient information” “MapID-1” and hash table name “HT1” are acquired (step 1130).
 次に、データベースラッパー部212は、ステップ1130の結果が存在するか否かを判定する(ステップ1140)。 Next, the database wrapper unit 212 determines whether or not the result of step 1130 exists (step 1140).
 ステップ1140の結果が存在しない場合(NO)、データベースラッパー部212は、ハッシュテーブル362を用いない挿入SQL変換の処理を行う。具体的には、データベースラッパー部212は、平文の挿入SQLの挿入対象の値を、ステップ1120で生成した暗号文の値に置き換えた暗号文の挿入SQLを出力する。例えば、平文のSQLが(7)である場合、暗号文の挿入SQLは、以下の暗号文の挿入SQL(8)を出力する(ステップ1150)。
 
  INSERT INTO 医療情報.患者情報 ( 患者番号, 名前, 病名 )
VALUES ( Enc(1000001), Enc(木下), Enc(胃腸炎) ) (8)
 
When the result of step 1140 does not exist (NO), the database wrapper unit 212 performs an insertion SQL conversion process that does not use the hash table 362. Specifically, the database wrapper unit 212 outputs the ciphertext insertion SQL in which the value to be inserted in the plaintext insertion SQL is replaced with the ciphertext value generated in step 1120. For example, when the plaintext SQL is (7), the ciphertext insertion SQL outputs the following ciphertext insertion SQL (8) (step 1150).

INSERT INTO Medical information.Patient information (patient number, name, disease name)
VALUES (Enc (1000001), Enc (Kinoshita), Enc (Gastroenteritis)) (8)
 一方、ステップ1140の結果が存在する場合(YES)、データベースラッパー部212は、ハッシュテーブル362と一貫性を保持した挿入を行うために、ハッシュ値生成から秘匿インデックス用挿入SQL変換(ステップ1160~1190)の処理を行い暗号文の挿入SQLを出力する。 On the other hand, if the result of step 1140 exists (YES), the database wrapper unit 212 performs hash index generation to secret index insertion SQL conversion (steps 1160 to 1190) in order to perform insertion that is consistent with the hash table 362. ) To output ciphertext insertion SQL.
 まず、データベースラッパー部212は、挿入対象の値のうち、ハッシュテーブル362に関連するカラムの値をハッシュ値生成部2123に入力し、出力されるハッシュ値を取得する。例えば、平文の挿入SQLが(7)である場合、以下のハッシュ値(9)を取得する(ステップ1160)。
 
ハッシュ値 = ハッシュ値生成部(胃腸炎) = "0035" (9)
 
First, the database wrapper unit 212 inputs the value of the column related to the hash table 362 among the insertion target values to the hash value generation unit 2123, and acquires the output hash value. For example, when the plaintext insertion SQL is (7), the following hash value (9) is acquired (step 1160).

Hash value = Hash value generator (gastroenteritis) = “0035” (9)
 次に、データベースラッパー部212は、ハッシュテーブル362を検索するために、ステップ1160で取得したハッシュ値を検索クエリ生成部2122に入力し、出力をハッシュテーブル検索クエリとする。例えば、平文のハッシュ値が(8)である場合、以下のハッシュテーブル検索クエリ(10)を取得する(ステップ1170)。
 
ハッシュテーブル検索クエリ(0035)=検索クエリ生成部(暗号鍵、検索用鍵、"0035") (10)
 
Next, in order to search the hash table 362, the database wrapper unit 212 inputs the hash value acquired in step 1160 to the search query generation unit 2122, and uses the output as a hash table search query. For example, when the hash value of plaintext is (8), the following hash table search query (10) is acquired (step 1170).

Hash table search query (0035) = search query generation unit (encryption key, search key, “0035”) (10)
 次に、データベースラッパー部212は、ハッシュ値を暗号化部2121に入力し、出力される暗号化ハッシュ値を取得する。例えば、平文のハッシュ値が(8)である場合、暗号化ハッシュ値は”Enc(0035)”となる(ステップ1180)。 Next, the database wrapper unit 212 inputs the hash value to the encryption unit 2121 and acquires the output encrypted hash value. For example, when the plaintext hash value is (8), the encrypted hash value is “Enc (0035)” (step 1180).
 次に、データベースラッパー部212は、ハッシュテーブル362をハッシュテーブル検索クエリで検索する。検索が一致しない場合、新しいMapIDと暗号化ハッシュ値からなるレコードを挿入した後、ハッシュテーブル検索クエリに一致するレコードのMapIDを取得し、そのMapIDとステップ1120で取得した暗号文のレコードの値と新しいレコードの識別子であるIDとから構成されるレコードを暗号化メインテーブル361へ挿入する秘匿インデックス用挿入SQL変換を行う。例えば、平文のSQLが(7)である場合、以下の暗号文の挿入SQL(11)及び(12)を出力する(ステップ1190)。
 
  INSERT INTO ハッシュテーブル362( MapID, 暗号化ハッシュ値 )
    SELECT 新MapID,暗号化ハッシュ値"Enc(0035)"
    FROM ハッシュテーブル362 WHERE NOT EXIST
    (
SELECT * FROM ハッシュテーブル362
     WHERE 暗号化一致比較部(暗号化ハッシュ値、ハッシュテーブル検索クエリ(0035)
    ) LIMIT 1; (11)
 
  INSERT INTO 暗号化メインテーブル361
  ( 患者番号,名前,病名,ID,MapID-1 )
  VALUES
( Enc(1000001),Enc(木下), Enc(胃腸炎), 新ID,
   ( SELECT MapID FROM ハッシュテーブル362 WHERE
暗号化一致比較部(暗号化ハッシュ値,ハッシュテーブル検索クエリ(0035) )
); (12)
 
Next, the database wrapper unit 212 searches the hash table 362 with a hash table search query. If the search does not match, after inserting a record that includes a new MapID and an encrypted hash value, the MapID of the record that matches the hash table search query is acquired, and the MapID and the value of the record of the ciphertext acquired in Step 1120 A secret index insertion SQL conversion is performed for inserting a record composed of an ID which is an identifier of a new record into the encryption main table 361. For example, when the plaintext SQL is (7), the following ciphertext insertion SQLs (11) and (12) are output (step 1190).

INSERT INTO hash table 362 (MapID, encrypted hash value)
SELECT New MapID, encrypted hash value "Enc (0035)"
FROM hash table 362 WHERE NOT EXIST
(
SELECT * FROM hash table 362
WHERE Encryption match comparison unit (encrypted hash value, hash table search query (0035)
) LIMIT 1; (11)

INSERT INTO encryption main table 361
(Patient number, name, disease name, ID, MapID-1)
VALUES
(Enc (1000001), Enc (Kinoshita), Enc (Gastroenteritis), New ID,
(SELECT MapID FROM hash table 362 WHERE
Encrypted match comparison unit (encrypted hash value, hash table search query (0035))
); (12)
 最後に、データベースラッパー部212は、ステップ1150又はステップ1190で出力された暗号文の挿入SQLを、データベースインタフェース部213へ送信する。例えば、平文の挿入SQLが(7)である場合、ステップ1140の結果が存在するため、データベースラッパー部212はステップ1190が出力した暗号文の挿入SQL(11)及び(12)をデータベースインタフェース部213へ送信する(ステップ1195)。以上で、図11の秘匿インデックス挿入クエリ生成処理を終了する。 Finally, the database wrapper unit 212 transmits the ciphertext insertion SQL output in step 1150 or step 1190 to the database interface unit 213. For example, if the plaintext insertion SQL is (7), the result of step 1140 is present, so the database wrapper unit 212 converts the ciphertext insertion SQL (11) and (12) output in step 1190 to the database interface unit 213. (Step 1195). Thus, the secret index insertion query generation process in FIG. 11 is completed.
 図12は、クラウドシステム側サーバ4において、データベース制御部311が実行する秘匿インデックス挿入処理を示すフローチャートである。秘匿インデックス挿入処理は、データベース制御部311がデータベースインタフェース部213から暗号文の挿入SQLを受信すると、開始する。例えば、秘匿インデックス挿入処理の開始時にデータベース制御部311が受信するSQLは、暗号文の挿入SQL(11)及び(12)である。 FIG. 12 is a flowchart showing a secret index insertion process executed by the database control unit 311 in the cloud system side server 4. The secret index insertion process starts when the database control unit 311 receives the ciphertext insertion SQL from the database interface unit 213. For example, the SQL received by the database control unit 311 at the start of the secret index insertion process is the ciphertext insertion SQL (11) and (12).
 まず、データベース制御部311は、暗号文の検索SQLから、検索対象となるハッシュテーブルとハッシュテーブル検索クエリと暗号化ハッシュ値とを特定する。そして、ユーザ定義機能部312の暗号文一致比較部3121が、当該ハッシュテーブル362の”暗号化ハッシュ値”のカラムの値と当該ハッシュテーブル検索クエリとが一致するレコードが存在するか否かを判定する(ステップ1210)。 First, the database control unit 311 specifies a hash table, a hash table search query, and an encrypted hash value to be searched from the ciphertext search SQL. Then, the ciphertext match comparison unit 3121 of the user definition function unit 312 determines whether or not there is a record in which the value of the “encrypted hash value” column of the hash table 362 matches the hash table search query. (Step 1210).
 ステップ1210にて、検索クエリと一致するレコードがあると判定された場合(YES)、データベース制御部311は、当該レコードのMapIDカラムの値をMapID_hitとして取得する(ステップ1220)。 If it is determined in step 1210 that there is a record that matches the search query (YES), the database control unit 311 acquires the value of the MapID column of the record as MapID_hit (step 1220).
 一方、ステップ1210にて、検索クエリと一致するレコードがないと判定された場合、データベース制御部311は、新しいMapIDを生成してMapID_hitとし、検索SQLから取得した暗号化ハッシュ値と共に、ハッシュテーブル362へレコードとして挿入する(ステップ1230)。 On the other hand, if it is determined in step 1210 that there is no record that matches the search query, the database control unit 311 generates a new MapID to MapID_hit, along with the encrypted hash value acquired from the search SQL, and the hash table 362. As a record (step 1230).
 次に、データベース制御部311は、暗号文の挿入SQLを実行し、暗号化された値、ID及びMapID_hitから構成されるレコードを暗号化メインテーブル361へ挿入する。例えば、暗号文の挿入SQL(12)では、データベース制御部311は、患者番号が”Enc(1000001)”、名前が”Enc(木下)”、病名が”Enc(胃腸炎)”、IDが”1000001”及びMapID-1が”10”であるレコードを暗号化メインテーブル361へ挿入する(ステップ1240)。 Next, the database control unit 311 executes ciphertext insertion SQL, and inserts a record composed of the encrypted value, ID, and MapID_hit into the encrypted main table 361. For example, in the ciphertext insertion SQL (12), the database control unit 311 determines that the patient number is “Enc (1000001)”, the name is “Enc (Kinoshita)”, the disease name is “Enc (gastroenteritis)”, and the ID is “ A record having “1000001” and MapID-1 “10” is inserted into the encryption main table 361 (step 1240).
 最後に、データベース制御部311は、挿入SQLの実行結果をユーザシステム側サーバ3のデータベースインタフェース部213へ送信する(ステップ1250)。以上で、秘匿インデックス挿入処理(図12)を終了する。 Finally, the database control unit 311 transmits the execution result of the insertion SQL to the database interface unit 213 of the user system side server 3 (step 1250). Thus, the secret index insertion process (FIG. 12) is completed.
 (1-4)秘匿化データベースの更新に関する処理の流れ
 図13、図14、図15及び図16を用いて、秘匿化データベースシステム1において、ハッシュテーブル362を用いて秘匿インデックスを更新する際の、データベースラッパー部212及びデータベース制御部311が行う一連の処理の詳細を説明する。
(1-4) Flow of processing related to update of concealment database In FIG. 13, FIG. 14, FIG. 15 and FIG. 16, in the concealment database system 1, when the concealment index is updated using the hash table 362, Details of a series of processing performed by the database wrapper unit 212 and the database control unit 311 will be described.
 図13は、ユーザシステム側サーバ3において、データベースラッパー部212が実行する秘匿インデックス更新クエリ生成処理を示すフローチャートである。秘匿インデックス更新クエリ生成処理は、データベースラッパー部212がアプリケーション部211から平文の更新のSQLを受信すると、開始する。例えば、秘匿インデックス更新クエリ生成処理の開始時にデータベースラッパー部212が受信するSQLは、以下の平文の更新SQL(13)である。
 
 UPDATE 医療情報.患者情報 SET "病名"="狭心症"
WHERE "病名"="糖尿病" (13)
 
 この更新SQL(13)は、スキーマ名が”医療情報”であり、テーブル名が”患者情報”であるテーブルの”病名”カラムの値が”糖尿病”であるレコードにおいて、”病名”カラムの値を”狭心症”へ更新することを意味する(ステップ1310)。
FIG. 13 is a flowchart showing a secret index update query generation process executed by the database wrapper unit 212 in the user system side server 3. The secret index update query generation process starts when the database wrapper unit 212 receives a plaintext update SQL from the application unit 211. For example, the SQL received by the database wrapper unit 212 at the start of the secret index update query generation process is the following plaintext update SQL (13).

UPDATE Medical Information.Patient Information SET "Disease name" = "Angina"
WHERE "Disease name" = "Diabetes" (13)

This update SQL (13) is the value of the “disease name” column in the record whose schema name is “medical information” and whose table name is “patient information” and whose “disease name” column value is “diabetes”. Is updated to “angina” (step 1310).
 次に、データベースラッパー部212は、平文の更新SQL(13)から、更新元カラムの値を取り出し、検索クエリ生成部2122を用いて暗号化メインテーブル361における一致検索に用いる暗号化検索クエリを取得する。具体的には、データベースラッパー部212は、鍵管理部2125から暗号化鍵及び検索用鍵を取得し、取得した鍵を検索クエリ生成部2122に入力し、その出力として暗号化検索クエリを得る。例えば、平文の更新SQLが(13)である場合、暗号化検索クエリ(2)と同様に”暗号化検索クエリ(糖尿病)”を得る(ステップ1315)。 Next, the database wrapper unit 212 extracts the value of the update source column from the plaintext update SQL (13), and acquires an encrypted search query used for matching search in the encrypted main table 361 using the search query generation unit 2122. To do. Specifically, the database wrapper unit 212 acquires an encryption key and a search key from the key management unit 2125, inputs the acquired key to the search query generation unit 2122, and obtains an encrypted search query as its output. For example, when the plaintext update SQL is (13), “encrypted search query (diabetes)” is obtained in the same manner as the encrypted search query (2) (step 1315).
 次に、データベースラッパー部212は、秘匿インデックスマップテーブル262から、更新元のカラムの”マップIDカラム名”及び”ハッシュテーブル名”を取得する。具体的には、データベースラッパー部212は、平文の検索SQLが検索対象とするスキーマ名、暗号化メインテーブル名及び更新元のカラム名の組をキーとして、秘匿インデックスマップテーブル262を検索し、スキーマ名、暗号化メインテーブル名及びカラム名が一致するレコードの”マップIDカラム名”及び”ハッシュテーブル名”を取得する。例えば、平文の検索SQLが(13)である場合、スキーマ名が”医療情報”であり、かつ暗号化メインテーブル名が”患者情報”であり、かつ更新元のカラム名”病名”を含むレコード2621から、マップIDカラム名”MapID-1”及びハッシュテーブル名”HT1”を取得する(ステップ1320)。 Next, the database wrapper unit 212 acquires “map ID column name” and “hash table name” of the update source column from the secret index map table 262. Specifically, the database wrapper unit 212 searches the secret index map table 262 using the combination of the schema name, the encrypted main table name, and the update source column name that are to be searched by the plaintext search SQL as a key. The “map ID column name” and “hash table name” of the record having the same name, encrypted main table name, and column name are acquired. For example, when the plain text search SQL is (13), the schema name is “medical information”, the encrypted main table name is “patient information”, and the record includes the update source column name “disease name” The map ID column name “MapID-1” and the hash table name “HT1” are obtained from the information 2621 (step 1320).
 次に、データベースラッパー部212は、ステップ1320の結果が存在するか否かを判定する(ステップ1325)。 Next, the database wrapper unit 212 determines whether or not the result of step 1320 exists (step 1325).
 ステップ1320の結果が存在しない場合(NO)、データベースラッパー部212は、ハッシュテーブル362を用いないで更新SQLを変換する処理を行う。具体的には、データベースラッパー部212は、まず、暗号化メインテーブル361から更新対象となるレコードのIDのリストである更新対象IDリストを取得するSQLを、データベースインタフェース部213へ送信し、結果として更新対象IDリストを受信する。例えば、平文の更新SQLが(13)である場合、以下のSQL(14)で更新対象IDリストを取得する(ステップ1330)。
 
  SELECT ID FROM 医療情報.患者情報
      WHERE 暗号文一致比較部(病名、暗号化検索クエリ(糖尿病)) (14)
 
When the result of step 1320 does not exist (NO), the database wrapper unit 212 performs a process of converting the update SQL without using the hash table 362. Specifically, the database wrapper unit 212 first transmits an SQL for obtaining an update target ID list, which is a list of IDs of records to be updated, from the encryption main table 361 to the database interface unit 213, and as a result An update target ID list is received. For example, when the plaintext update SQL is (13), the update target ID list is acquired by the following SQL (14) (step 1330).

SELECT ID FROM medical information.patient information WHERE ciphertext match comparison part (disease name, encrypted search query (diabetes)) (14)
 データベースラッパー部212は、ステップ1330で得られた更新IDリストから更新対象IDの個数を取得し、取得した更新対象IDの個数分の、更新後の値の暗号文を生成する。例えば、平文の更新SQLが(13)である場合、更新対象IDの数は”3”及び”1000000”の二つであるため、更新後の値の暗号文はEnc(狭心症)及びEnc(狭心症)の二つとなり、確率的暗号化を用いる場合、これらは異なる暗号文となる(ステップ1335)。 The database wrapper unit 212 acquires the number of update target IDs from the update ID list obtained in step 1330, and generates ciphertexts with updated values for the number of acquired update target IDs. For example, when the update SQL of the plaintext is (13), the number of update target IDs is “3” and “1000000”, so the ciphertext of the updated value is Enc (Angina) and Enc When using probabilistic encryption, these are different ciphertexts (step 1335).
 次に、データベースラッパー部212は、ステップ1335で得られた二つの更新後の値の暗号文を、それぞれの更新対象IDが示すレコードの値として更新する暗号文の更新SQLを生成する。この更新SQLは、望ましくは一文のSQLで記述されるが、データベース制御部311のSQL文の最大長を超える場合、分割された複数の更新SQLを生成するとよい。例えば、平文の更新SQLが(13)である場合、以下の更新SQL(15)が出力される(ステップ1340)。
 
UPDATE 医療情報.患者情報
SET "病名"=
        CASE ID
              WHEN 3 THEN Enc(狭心症)
       WHEN 1000000 THEN Enc(狭心症)
    END
  WHERE 暗号文一致比較部(病名、暗号化検索クエリ(糖尿病)) (15)
 
Next, the database wrapper unit 212 generates a ciphertext update SQL for updating the ciphertext of the two updated values obtained in step 1335 as the record values indicated by the respective update target IDs. This update SQL is preferably described in one sentence SQL, but if the maximum length of the SQL sentence of the database control unit 311 is exceeded, a plurality of divided update SQLs may be generated. For example, when the plaintext update SQL is (13), the following update SQL (15) is output (step 1340).

UPDATE Medical information.Patient information
SET "Disease name" =
CASE ID
WHEN 3 THEN Enc
WHEN 1000000 THEN Enc (angina)
END
WHERE Ciphertext match comparison unit (disease name, encrypted search query (diabetes)) (15)
 一方、ステップ1320の結果が存在する場合(YES)、データベースラッパー部212は、暗号化メインテーブル361及びハッシュテーブル362を更新するために、ハッシュ値生成から秘匿インデックス用更新SQL変換(ステップ1345~1370)を行った暗号文の更新SQLを出力する。 On the other hand, when the result of step 1320 exists (YES), the database wrapper unit 212 updates the encryption main table 361 and the hash table 362 to update the secret index update SQL conversion (steps 1345 to 1370). The update SQL of the ciphertext that has been performed) is output.
 まず、データベースラッパー部212は、更新後の値をハッシュ値生成部2123に入力し、出力されるハッシュ値を取得する。例えば、平文の更新SQLが(13)である場合、ハッシュ値(16)を取得する(ステップ1345)。
 
  ハッシュ値 = ハッシュ値生成部(狭心症)="0500" (16)
 
First, the database wrapper unit 212 inputs the updated value to the hash value generation unit 2123 and acquires the output hash value. For example, when the plaintext update SQL is (13), the hash value (16) is acquired (step 1345).

Hash value = Hash value generator (angina) = "0500" (16)
 次に、データベースラッパー部212は、ハッシュテーブル362を検索するために、ステップ1345で取得したハッシュ値を検索クエリ生成部2122に入力し、出力をハッシュテーブル検索クエリとする。例えば、平文のハッシュ値が(16)である場合、以下のハッシュテーブル検索クエリ(17)を取得する(ステップ1350)。
 
  ハッシュテーブル検索クエリ(0500)
    =検索クエリ生成部(暗号鍵、検索用鍵、"0500") (17)
 
Next, in order to search the hash table 362, the database wrapper unit 212 inputs the hash value acquired in step 1345 to the search query generation unit 2122, and uses the output as a hash table search query. For example, when the hash value of plaintext is (16), the following hash table search query (17) is acquired (step 1350).

Hash table search query (0500)
= Search query generator (encryption key, search key, "0500") (17)
 次に、データベースラッパー部212は、暗号化部2121へステップ1345で取得したハッシュ値を入力し、出力としてハッシュテーブル362に挿入するための暗号化ハッシュ値を取得する。例えば、平文のハッシュ値(16)が”0500”である場合、暗号化ハッシュ値は”Enc(0500)”となる(ステップ1360)。 Next, the database wrapper unit 212 inputs the hash value acquired in step 1345 to the encryption unit 2121 and acquires an encrypted hash value to be inserted into the hash table 362 as an output. For example, when the plaintext hash value (16) is “0500”, the encrypted hash value is “Enc (0500)” (step 1360).
 次に、データベースラッパー部212は、ハッシュテーブル362を用いて、更新対象となるレコード群のIDカラムの値のテーブルを取得する秘匿インデックス用更新対象IDテーブル取得SQLを実行し、更新対象IDテーブルを得る。具体的には、データベースラッパー部212は、ステップ1315で取得した更新元の値の暗号化検索クエリ、ステップ1320で取得した更新元のカラムに関連するマップIDカラム名とハッシュテーブル名、及び更新元の値のハッシュテーブル検索クエリを入力とし、ハッシュテーブル362を検索した上で暗号化メインテーブル361の検索範囲を限定し、更新対象IDテーブルを取得するSQLを実行し、その結果を更新対象IDテーブルとして出力する。例えば、平文の更新SQLが(13)である場合、秘匿インデックス用更新対象IDテーブル取得SQLは、以下の暗号文の検索SQL(18)を生成し、データベースインタフェース部213経由でデータベース制御部311へ送信し、その実行結果を更新対象IDテーブルとして取得する(ステップ1360)。
 
 SELECT ID FROM 暗号化メインテーブル361 X
 JOIN
  (  SELECT MapID FROM ハッシュテーブル362
     WHERE 暗号化一致比較部(暗号化ハッシュ値,ハッシュテーブル検索クエリ(1012)
  ) Y
  ON X.MapID= Y.MapID
  WHERE 暗号化一致比較部(病名,暗号化検索クエリ(糖尿病)) (18)
 
Next, the database wrapper unit 212 uses the hash table 362 to execute the secret index update target ID table acquisition SQL for acquiring the table of the ID column values of the record group to be updated, and to update the update target ID table. obtain. Specifically, the database wrapper unit 212 uses the encrypted search query for the update source value acquired in step 1315, the map ID column name and hash table name related to the update source column acquired in step 1320, and the update source. The hash table search query of the value of the value is input, the hash table 362 is searched, the search range of the encryption main table 361 is limited, the SQL for acquiring the update target ID table is executed, and the result is used as the update target ID table Output as. For example, when the update SQL of the plaintext is (13), the secret index update target ID table acquisition SQL generates the following ciphertext search SQL (18) and sends it to the database control unit 311 via the database interface unit 213. The execution result is acquired as an update target ID table (step 1360).

SELECT ID FROM Encryption main table 361 X
JOIN
(SELECT MapID FROM hash table 362
WHERE Encryption match comparison part (encrypted hash value, hash table search query (1012)
) Y
ON X.MapID = Y.MapID
WHERE Encryption match comparison part (disease name, encrypted search query (diabetes)) (18)
 次に、データベースラッパー部212は、ステップ1360で得られた更新IDリストから更新対象IDの個数を取得し、取得した更新対象IDの個数分の、更新後の値の暗号文リストを生成する。例えば、平文の更新SQLが(13)である場合、ステップ1335と同様に、更新対象IDの数は”3”及び”1000000”の二つであるため、更新後の値の暗号文リストはEnc(狭心症)及びEnc(狭心症)の二つとなる。確率的暗号化を用いる場合、これらは異なる暗号文となる(ステップ1365)。 Next, the database wrapper unit 212 acquires the number of update target IDs from the update ID list obtained in step 1360, and generates a ciphertext list with updated values for the number of acquired update target IDs. For example, when the plaintext update SQL is (13), the number of update target IDs is two, “3” and “1000000”, as in step 1335. Therefore, the ciphertext list of updated values is Enc. (Angina pectoris) and Enc (angina pectoris). If probabilistic encryption is used, these are different ciphertexts (step 1365).
 次に、データベースラッパー部212は、平文の更新SQL、ステップ1315、ステップ1320、ステップ1350、ステップ1355、ステップ1360及びステップ1365で取得した各種情報を入力とし、秘匿インデックス用の暗号文の更新SQLを出力する。具体的には、第一に、ハッシュテーブル362の更新後の値のハッシュテーブル検索クエリで暗号化一致検索し、一致しない場合、更新後の値の暗号化ハッシュ値と新しいMapIDの値から成るレコードをハッシュテーブル362へ挿入するSQLを生成する。第二に、ハッシュテーブル362から更新後の値のMapIDを取得するSQLを生成する。第三に、暗号化メインテーブル361において、更新対象IDをもつレコードごとに、更新後の値の暗号文を置き換える更新SQLを生成する。例えば、平文の更新SQLが(13)である場合、第一のSQLは以下の更新SQL(19)となり、第二のSQLは以下の更新SQL(20)となり、第三のSQLは以下の更新SQL(21)となる。これら三つのSQL文を含む暗号文の更新SQLを出力する(ステップ1370)。
 
  INSERT INTO ハッシュテーブル362( MapID, 暗号化ハッシュ値 )
    SELECT 新MapID,暗号化ハッシュ値"Enc(0500)"
    FROM ハッシュテーブル362 WHERE NOT EXIST
    (
SELECT * FROM ハッシュテーブル362
     WHERE 暗号化一致比較部(暗号化ハッシュ値、ハッシュテーブル検索クエリ(0500)

    ) LIMIT 1; (19)
 
  SELECT MapID FROM ハッシュテーブル362 WHERE
暗号化一致比較部(暗号化ハッシュ値、ハッシュテーブル検索クエリ(0500)) (20)
 
  UPDATE 暗号化メインテーブル361 X  JOIN 更新対象IDテーブルY
ON  X.ID = Y.ID
SET  X.病名 =
    CASE ID
      WHEN  3  THEN  Enc(狭心症)
      WHEN 1000000 THEN  Enc(狭心症)
    END
  ,X.MapID =(20)で取得したMapID    (21)
 
Next, the database wrapper unit 212 receives plaintext update SQL, various information acquired in steps 1315, 1320, 1350, 1355, 1360, and 1365 as input, and updates ciphertext update SQL for the secret index. Output. Specifically, first, an encrypted match search is performed using the hash table search query of the updated value of the hash table 362. If there is no match, a record consisting of the encrypted hash value of the updated value and the new MapID value Is inserted into the hash table 362. Second, an SQL for acquiring the MapID of the updated value from the hash table 362 is generated. Third, in the encryption main table 361, for each record having the update target ID, an update SQL for replacing the ciphertext of the updated value is generated. For example, when the plaintext update SQL is (13), the first SQL is the following update SQL (19), the second SQL is the following update SQL (20), and the third SQL is the following update SQL (21). The ciphertext update SQL including these three SQL texts is output (step 1370).

INSERT INTO hash table 362 (MapID, encrypted hash value)
SELECT New MapID, encrypted hash value "Enc (0500)"
FROM hash table 362 WHERE NOT EXIST
(
SELECT * FROM hash table 362
WHERE Encryption match comparison part (encrypted hash value, hash table search query (0500)
)
) LIMIT 1; (19)

SELECT MapID FROM hash table 362 WHERE
Encryption match comparison unit (encrypted hash value, hash table search query (0500)) (20)

UPDATE Encryption main table 361 X JOIN Update target ID table Y
ON X.ID = Y.ID
SET X. Disease name =
CASE ID
WHEN 3 THEN Enc
WHEN 1000000 THEN Enc (angina)
END
, X.MapID = MapID acquired by (20) (21)
 最後に、データベースラッパー部212は、ステップ1340又はステップ1370で出力された暗号文の更新SQLを、データベースインタフェース部213へ送信する。平文の更新SQLが(13)である場合、ステップ1320の結果が存在するため、データベースラッパー部212はステップ1370が出力した暗号文のSQL(19)、(20)及び(21)をデータベースインタフェース部213へ送信する(ステップ1375)。以上で、データベースラッパー部212は、秘匿インデックス更新クエリ生成処理(図13)を終了する。 Finally, the database wrapper unit 212 transmits the ciphertext update SQL output in step 1340 or step 1370 to the database interface unit 213. When the plaintext update SQL is (13), since the result of step 1320 exists, the database wrapper unit 212 converts the SQL (19), (20), and (21) of the ciphertext output from step 1370 to the database interface unit. It transmits to 213 (step 1375). As described above, the database wrapper unit 212 ends the secret index update query generation process (FIG. 13).
 図14は、クラウドシステム側サーバ4において、データベース制御部311が実行する更新対象IDリスト取得処理を示すフローチャートである。更新対象IDリスト取得処理は、データベース制御部311がデータベースインタフェース部213から暗号文の検索SQLを受信すると、開始する。 FIG. 14 is a flowchart showing an update target ID list acquisition process executed by the database control unit 311 in the cloud system side server 4. The update target ID list acquisition process starts when the database control unit 311 receives the ciphertext search SQL from the database interface unit 213.
 まず、更新対象カラムの値が暗号化検索クエリと一致するレコードのIDを、暗号化メインテーブル361からすべて取得する(ステップ1410)。最後に、取得結果をデータベースインタフェース部213へ送信し(ステップ1420)、更新対象IDリスト取得処理(図14)を終了する。例えば、暗号文の検索SQLが(14)である場合、更新対象IDリストの要素は”3”及び”1000000”となる。 First, all the IDs of the records whose update target column values match the encrypted search query are acquired from the encrypted main table 361 (step 1410). Finally, the acquisition result is transmitted to the database interface unit 213 (step 1420), and the update target ID list acquisition process (FIG. 14) is terminated. For example, when the ciphertext search SQL is (14), the elements of the update target ID list are “3” and “1000000”.
 図15は、クラウドシステム側サーバ4において、データベース制御部311が実行する秘匿インデックス用更新対象IDテーブル取得処理を示すフローチャートである。秘匿インデックス用更新対象IDテーブル取得処理は、データベース制御部311がデータベースインタフェース部213から暗号文の検索SQLを受信すると、開始する。 FIG. 15 is a flowchart showing a secret index update target ID table acquisition process executed by the database control unit 311 in the cloud system side server 4. The secret index update target ID table acquisition process starts when the database control unit 311 receives the ciphertext search SQL from the database interface unit 213.
 まず、ハッシュテーブル362から、ハッシュテーブル検索クエリに一致するレコードのMapIDを取得する(ステップ1510)。次に、ステップ1510で取得したMapIDと一致するMapID-1の値を持ち、かつ更新元カラムである”病名”カラムの値が暗号化検索クエリと一致するレコードのIDを、暗号化メインテーブル361から全て取得し、更新対象IDテーブルとして格納する(ステップ1520)。最後に、取得結果をデータベースインタフェース部213へ送信し(1530)、秘匿インデックス用更新対象IDテーブル取得処理(図15)を終了する。例えば、暗号文の検索SQLが(18)である場合、更新対象IDテーブルはIDカラムの値として”3”及び”1000000”を格納したテーブルとなる。 First, the MapID of the record that matches the hash table search query is acquired from the hash table 362 (step 1510). Next, the ID of the record having the value of MapID-1 that matches the MapID acquired in step 1510 and the value of the “disease name” column that is the update source column matches the encrypted search query, is stored in the encrypted main table 361. Are acquired and stored as an update target ID table (step 1520). Finally, the acquisition result is transmitted to the database interface unit 213 (1530), and the confidential index update target ID table acquisition process (FIG. 15) is terminated. For example, if the ciphertext search SQL is (18), the update target ID table is a table storing “3” and “1000000” as values of the ID column.
 図16は、クラウドシステム側サーバ4において、データベース制御部311が実行する秘匿インデックス更新処理を示すフローチャートである。秘匿インデックス更新処理は、データベース制御部311がデータベースインタフェース部213から暗号文の更新SQLを受信すると、開始する。例えば、秘匿インデックス更新処理の開始時にデータベース制御部311が受信するSQLは、暗号文の更新SQL(19)、(20)及び(21)である。 FIG. 16 is a flowchart showing a secret index update process executed by the database control unit 311 in the cloud system side server 4. The secret index update process starts when the database control unit 311 receives the ciphertext update SQL from the database interface unit 213. For example, the SQL received by the database control unit 311 at the start of the secret index update process is the ciphertext update SQL (19), (20), and (21).
 まず、データベース制御部311は、暗号文の更新SQLの第一のSQLである(19)から、更新対象となるハッシュテーブル362とハッシュテーブル検索クエリ(0500)を取得する。そして、ユーザ定義機能部312の暗号文一致比較部3121は、当該ハッシュテーブルの"暗号化ハッシュ値"カラムの値と当該ハッシュテーブル検索クエリ(0500)とが一致するレコードを検索する(ステップ1610)。 First, the database control unit 311 acquires the hash table 362 and the hash table search query (0500) to be updated from the first SQL of the ciphertext update SQL (19). The ciphertext match comparison unit 3121 of the user definition function unit 312 searches for a record in which the value of the “encrypted hash value” column of the hash table matches the hash table search query (0500) (step 1610). .
 ステップ1610の結果が存在する場合、データベース制御部311は、一致したレコードからMapIDを取得する(ステップ1620)。 If the result of step 1610 exists, the database control unit 311 acquires MapID from the matched record (step 1620).
 一方、ステップ1610の結果が存在しない場合、データベース制御部311は、新しいMapIDを生成し、暗号化ハッシュ値”Enc(0500)”と共にハッシュテーブル362へ挿入し、新しいMapIDを取得する(ステップ1630)。 On the other hand, if the result of step 1610 does not exist, the database control unit 311 generates a new MapID, inserts it into the hash table 362 together with the encrypted hash value “Enc (0500)”, and acquires a new MapID (step 1630). .
 次に、データベース制御部311は、暗号化メインテーブル361の更新対象IDを持つレコードの更新対象カラムの値に更新後の暗号文を置き換え、マップIDカラム”MapID-1”の値をステップ1620又はステップ1630で取得したMapIDの値に置き換える(ステップ1640)。 Next, the database control unit 311 replaces the updated ciphertext with the value of the update target column of the record having the update target ID of the encryption main table 361, and sets the value of the map ID column “MapID-1” to step 1620 or The value is replaced with the value of MapID acquired in step 1630 (step 1640).
 次に、データベース制御部311は、ハッシュテーブル362から、暗号化メインテーブル361のマップIDカラム”MapID-1”に存在しないMapIDを持つレコードを削除する(ステップ1650)。 Next, the database control unit 311 deletes the record having the MapID that does not exist in the map ID column “MapID-1” of the encrypted main table 361 from the hash table 362 (Step 1650).
 最後に、データベース制御部311は、データベースインタフェース部213へ、更新結果を送信する(1660)。以上で、秘匿インデックス更新処理(図16)を終了する。 Finally, the database control unit 311 transmits the update result to the database interface unit 213 (1660). Thus, the secret index update process (FIG. 16) is completed.
 (1-5)秘匿化データベースの削除に関する処理の流れ
 図17及び図18を用いて、秘匿化データベースシステム1において、ハッシュテーブル362を用いた削除である秘匿インデックスを削除する際の、データベースラッパー部212及びデータベース制御部311が行う一連の処理の詳細を説明する。
(1-5) Process Flow Regarding Deletion of Concealed Database A database wrapper unit for deleting a concealment index that is a deletion using the hash table 362 in the concealment database system 1 with reference to FIGS. 17 and 18 Details of a series of processes performed by 212 and the database control unit 311 will be described.
 図17は、ユーザシステム側サーバ3において、データベースラッパー部212が実行する秘匿インデックス削除クエリ生成処理を示すフローチャートである。秘匿インデックス削除クエリ生成処理は、データベースラッパー部212がアプリケーション部211から平文の削除のSQLを受信すると、開始する。例えば、秘匿インデックス削除クエリ生成処理の開始時にデータベースラッパー部212が受信するSQLは、以下に示す平文の削除SQL(22)である。
 
  DELETE FROM 医療情報.患者情報 WHERE 病名=糖尿病 (22)
 
 この削除SQLは、スキーマ名が”医療情報”であり、テーブル名が”患者情報”であるテーブルから、”病名”カラムの値が”糖尿病”であるレコードを全て削除することを意味する(ステップ1710)。
FIG. 17 is a flowchart showing a secret index deletion query generation process executed by the database wrapper unit 212 in the user system side server 3. The secret index deletion query generation process starts when the database wrapper unit 212 receives a plaintext deletion SQL from the application unit 211. For example, the SQL received by the database wrapper unit 212 at the start of the secret index deletion query generation process is the plaintext deletion SQL (22) shown below.

DELETE FROM Medical Information. Patient Information WHERE Disease Name = Diabetes (22)

This deletion SQL means that all records whose “Disease Name” column value is “Diabetes” are deleted from the table whose schema name is “Medical Information” and whose table name is “Patient Information” (Steps). 1710).
 次に、データベースラッパー部212は、平文の削除SQLから、削除条件の対象カラムの値を取り出し、検索クエリ生成部2122を用いて暗号化メインテーブル361における削除条件の一致検索に用いる暗号化検索クエリを取得する。具体的には、データベースラッパー部212は、鍵管理部2125から暗号化鍵及び検索用鍵を取得し、取得した鍵を検索クエリ生成部2122に入力し、その出力として暗号化検索クエリを得る。例えば、平文のSQLが(22)である場合、以下の実行文(2)となる(ステップ1720)。
 
暗号化検索クエリ(糖尿病)=検索クエリ生成部(暗号化鍵、検索用鍵、"糖尿病") (2)
 
Next, the database wrapper unit 212 extracts the value of the target column of the deletion condition from the plaintext deletion SQL, and uses the search query generation unit 2122 to use the encrypted search query used for the deletion condition matching search in the encrypted main table 361. To get. Specifically, the database wrapper unit 212 acquires an encryption key and a search key from the key management unit 2125, inputs the acquired key to the search query generation unit 2122, and obtains an encrypted search query as its output. For example, when the plain text SQL is (22), the following executable sentence (2) is obtained (step 1720).

Encrypted search query (diabetes) = search query generator (encryption key, search key, "diabetes") (2)
 次に、データベースラッパー部212は、秘匿インデックスマップテーブル262から、検索対象カラムの”マップIDカラム名”及び”ハッシュテーブル名”を取得する。具体的には、データベースラッパー部212は、平文の削除SQLが削除条件の対象とするスキーマ名、暗号化メインテーブル名及びカラム名の組をキーとして、秘匿インデックスマップテーブル262を検索し、スキーマ名、暗号化メインテーブル名及びカラム名が一致するレコードの”マップIDカラム名”及び”ハッシュテーブル名”を取得する。例えば、平文の検索SQLが(22)である場合、スキーマ名が”医療情報”であり、かつ暗号化メインテーブル名が”患者情報”であり、かつカラム名が”病名”であるレコード2621から、マップIDカラム名”MapID-1”及びハッシュテーブル名”HT1”を取得する(ステップ1730)。 Next, the database wrapper unit 212 acquires “map ID column name” and “hash table name” of the search target column from the secret index map table 262. Specifically, the database wrapper unit 212 searches the secret index map table 262 using the combination of the schema name, the encryption main table name, and the column name that the plaintext deletion SQL is the target of the deletion condition, as a schema name. Then, the “map ID column name” and “hash table name” of the record whose encrypted main table name and column name match are acquired. For example, when the plain text search SQL is (22), from the record 2621 where the schema name is “medical information”, the encrypted main table name is “patient information”, and the column name is “disease name”. The map ID column name “MapID-1” and the hash table name “HT1” are acquired (step 1730).
 次に、データベースラッパー部212は、ステップ1730の結果が存在するか否かを判定する(ステップ1740)。 Next, the database wrapper unit 212 determines whether or not the result of step 1730 exists (step 1740).
 ステップ1740の結果が存在しない場合(NO)、データベースラッパー部212は、ハッシュテーブル362を用いないで削除SQLを変換する処理を行う。具体的には、データベースラッパー部212は、平文のSQLの削除条件の対象カラムの値を、ステップ1720で生成した暗号化検索クエリに置き換え、さらに、WHERE句の一致比較文を、ユーザ定義機能部312の暗号文一致比較部3121を呼び出す形式に置き換えた、暗号文の削除SQLを出力する。例えば、平文のSQLが(22)であり、暗号化検索クエリが(2)である場合、暗号文の削除SQLは以下の暗号文のSQL(23)である(ステップ1750)。
 
DELETE  FROM 医療情報.患者情報 
WHERE 暗号文一致比較部(病名、暗号化検索クエリ(糖尿病)) (23)
 
If the result of step 1740 does not exist (NO), the database wrapper unit 212 performs processing for converting the deletion SQL without using the hash table 362. Specifically, the database wrapper unit 212 replaces the value of the target column of the plaintext SQL deletion condition with the encrypted search query generated in step 1720, and further converts the match comparison sentence of the WHERE clause to the user-defined function unit. The ciphertext deletion SQL replaced with the format for calling the ciphertext match comparison unit 3121 of 312 is output. For example, when the plaintext SQL is (22) and the encrypted search query is (2), the ciphertext deletion SQL is the following ciphertext SQL (23) (step 1750).

DELETE FROM Medical information.Patient information
WHERE Ciphertext match comparison unit (disease name, encrypted search query (diabetes)) (23)
 一方、ステップ1730の結果が存在する場合(YES)、データベースラッパー部212は、ハッシュテーブル362を用いた削除を行うために、ハッシュ値生成から秘匿インデックス用削除SQL変換(ステップ1760~1780)の処理を行った暗号文の削除SQLを出力する。 On the other hand, if the result of step 1730 exists (YES), the database wrapper unit 212 performs processing from hash value generation to secret index deletion SQL conversion (steps 1760 to 1780) in order to perform deletion using the hash table 362. The deletion SQL of the ciphertext that has been performed is output.
 具体的には、まず、データベースラッパー部212は、削除条件の対象カラムの値をハッシュ値生成部2123に入力し、出力されるハッシュ値を取得する。例えば、平文の削除SQLが(22)である場合、ハッシュ値(4)を取得する(ステップ1760)。
 
ハッシュ値 = ハッシュ値生成部(糖尿病)="1012"   (4)
 
Specifically, first, the database wrapper unit 212 inputs the value of the target column of the deletion condition to the hash value generation unit 2123, and acquires the output hash value. For example, when the plaintext deletion SQL is (22), the hash value (4) is acquired (step 1760).

Hash value = Hash value generator (diabetes) = "1012" (4)
 次に、データベースラッパー部212は、ハッシュテーブル362を検索するために、ステップ1760で取得したハッシュ値を検索クエリ生成部2122に入力し、出力をハッシュテーブル検索クエリとする。例えば、平文のハッシュ値が(4)である場合、ハッシュテーブル検索クエリ(5)を取得する(ステップ1770)。
 
ハッシュテーブル検索クエリ(1012)=検索クエリ生成部(暗号鍵、検索用鍵、"1012") (5)
 
Next, in order to search the hash table 362, the database wrapper unit 212 inputs the hash value acquired in step 1760 to the search query generation unit 2122, and uses the output as a hash table search query. For example, if the hash value of the plaintext is (4), a hash table search query (5) is acquired (step 1770).

Hash table search query (1012) = search query generator (encryption key, search key, "1012") (5)
 次に、データベースラッパー部212は、秘匿インデックス用SQL変換部2127により、ハッシュテーブル362を検索して検索範囲を限定した上で、暗号化メインテーブル361からの削除を実行するためのSQLを生成する秘匿インデックス用検索SQL変換を行う。具体的には、ステップ1720で得た暗号化検索クエリと、ステップ1730で得たマップIDカラム名及びハッシュテーブル名と、ステップ1770で得たハッシュテーブル検索クエリを入力とし、ハッシュテーブル362をハッシュテーブル検索クエリで検索して該当したレコードの”MapID”カラムの値を取得し、その値と等しい”MapID-1”カラムの値を持つ暗号化メインテーブル361のレコードから、暗号化検索クエリと一致する値を持つレコードを、ユーザ定義機能部312の暗号文一致比較部3121を用いて判定する。そして、一致したレコードを暗号化メインテーブル361から削除するSQLを生成する。さらに、ハッシュテーブル362から、暗号化メインテーブル361のマップIDカラム”MapID-1”に存在しないMapIDを含むレコードを削除するSQLを生成する。例えば、平文の削除SQLが(22)である場合、二つのSQL文(23)、(24)を含む暗号文の削除SQLを出力する(ステップ1780)。
 
 DELETE 医療情報.患者情報FROM 医療情報.患者情報
 JOIN
  (  SELECT MapID FROM ハッシュテーブル(HT1)
        WHERE
暗号文一致比較部(暗号化ハッシュ値、ハッシュテーブル検索クエリ(1012))
  ) MapResult
  ON  医療情報.患者情報.MapID-1 = MapResult.MapID
  WHERE 暗号化一致比較部(病名、暗号化検索クエリ(糖尿病))  (24)
 
  DELETE ハッシュテーブル(HT1) FROM ハッシュテーブル(HT1)
  WHERE NOT EXIST
  ( SELECT MapID FROM 医療情報.患者情報
    WHERE ハッシュテーブル(HT1).MapID = 医療情報.患者情報.MapID
  )      (25)
 
Next, the database wrapper unit 212 searches the hash table 362 by using the secret index SQL conversion unit 2127 to limit the search range, and then generates SQL for executing deletion from the encrypted main table 361. Search SQL conversion for the secret index is performed. Specifically, the encrypted search query obtained in step 1720, the map ID column name and hash table name obtained in step 1730, and the hash table search query obtained in step 1770 are input, and the hash table 362 is used as the hash table. The value of the “MapID” column of the corresponding record is obtained by searching with the search query, and matches the encrypted search query from the record of the encrypted main table 361 having the value of the “MapID-1” column equal to the value. A record having a value is determined using the ciphertext match comparison unit 3121 of the user definition function unit 312. Then, an SQL for deleting the matched record from the encrypted main table 361 is generated. Further, an SQL for deleting a record including a MapID that does not exist in the map ID column “MapID-1” of the encrypted main table 361 is generated from the hash table 362. For example, if the plaintext deletion SQL is (22), the ciphertext deletion SQL including the two SQL texts (23) and (24) is output (step 1780).

DELETE Medical information. Patient information FROM Medical information. Patient information JOIN
(SELECT MapID FROM Hashtable (HT1)
WHERE
Ciphertext match comparison unit (encrypted hash value, hash table search query (1012))
) MapResult
ON Medical information.Patient information.MapID-1 = MapResult.MapID
WHERE Encryption match comparison part (disease name, encrypted search query (diabetes)) (24)

DELETE Hash table (HT1) FROM Hash table (HT1)
WHERE NOT EXIST
(SELECT MapID FROM Medical Information. Patient Information WHERE Hash Table (HT1). MapID = Medical Information. Patient Information. MapID
(25)
 最後に、データベースラッパー部212は、ステップ1750又はステップ1780で出力された暗号文の削除SQLを、データベースインタフェース部213へ送信する。平文の削除SQLが(22)である場合、ステップ1740の結果が存在するため、データベースラッパー部212はステップ1780が出力した暗号文の検索SQL(24)及び(25)をデータベースインタフェース部213へ送信する(ステップ1790)。以上で、データベースラッパー部212は、秘匿インデックス削除クエリ生成処理(図17)を終了する。 Finally, the database wrapper unit 212 transmits the ciphertext deletion SQL output in step 1750 or step 1780 to the database interface unit 213. When the plaintext deletion SQL is (22), the result of step 1740 is present, so the database wrapper unit 212 transmits the ciphertext search SQL (24) and (25) output in step 1780 to the database interface unit 213. (Step 1790). As described above, the database wrapper unit 212 ends the secret index deletion query generation process (FIG. 17).
 図18は、クラウドシステム側サーバ4において、データベース制御部311が実行する秘匿インデックス削除処理を示すフローチャートである。秘匿インデックス削除処理は、データベース制御部311がデータベースインタフェース部213から暗号文の削除SQLを受信すると、開始する。例えば、秘匿インデックス削除処理の開始時にデータベース制御部311が受信するSQLは、暗号文の削除SQL(24)及び(25)である。 FIG. 18 is a flowchart showing a secret index deletion process executed by the database control unit 311 in the cloud system side server 4. The secret index deletion process starts when the database control unit 311 receives the ciphertext deletion SQL from the database interface unit 213. For example, the SQL received by the database control unit 311 at the start of the secret index deletion process is the ciphertext deletion SQL (24) and (25).
 まず、データベース制御部311は、暗号文の削除SQLから、削除条件の対象となるハッシュテーブル362及びハッシュテーブル検索クエリを特定し、ユーザ定義機能部312の暗号文一致比較部3121により当該ハッシュテーブル362の”暗号化ハッシュ値”カラムの値と当該ハッシュテーブル検索クエリとが一致するレコードを特定し、そのレコードの”MapID”カラムの値をMapID_hitとして取得する。例えば、暗号文の削除SQLが(24)及び(25)である場合、ハッシュテーブル362はハッシュテーブル362(HT1)であり、ハッシュテーブル検索クエリは”ハッシュテーブル検索クエリ(1012)”である。そして、暗号文一致比較部3121による一致比較の結果、ハッシュテーブル362(HT1)のレコード3622の暗号化ハッシュ値”Enc(1012)”と一致し、当該レコードのMapID”2”をMapID_hitとして取得する(ステップ1810)。 First, the database control unit 311 identifies the hash table 362 and the hash table search query that are subject to the deletion condition from the ciphertext deletion SQL, and the ciphertext match comparison unit 3121 of the user definition function unit 312 performs the hash table 362. The record in which the “encrypted hash value” column value matches the hash table search query is identified, and the “MapID” column value of the record is acquired as MapID_hit. For example, when the ciphertext deletion SQL is (24) and (25), the hash table 362 is the hash table 362 (HT1), and the hash table search query is “hash table search query (1012)”. As a result of the match comparison by the ciphertext match comparison unit 3121, the encrypted hash value “Enc (1012)” of the record 3622 of the hash table 362 (HT 1) is matched, and MapID “2” of the record is acquired as MapID_hit. (Step 1810).
 次に、データベース制御部311は、ハッシュテーブル362と対応するマップIDカラムの値がMapID_hitと一致し、かつ暗号化検索クエリと一致する値を持つことをユーザ定義機能部312の暗号文一致比較部3121により確認したレコード群MapResultを、暗号化メインテーブル361から取得する。例えば、暗号文の削除SQLが(24)及び(25)である場合、データベース制御部311は、マップIDカラム”MapID-1”の値がステップ910で取得した”2”と一致し、かつ暗号化検索クエリ(糖尿病)の値と一致する”病名”カラムの値であるEnc(糖尿病)を持つレコード群を暗号文一致比較部3121により確認し、その結果レコード3613及びレコード3615をMapResultとして、暗号化メインテーブル361から取得する(ステップ1820及び1830)。 Next, the database control unit 311 confirms that the value of the map ID column corresponding to the hash table 362 has a value that matches MapID_hit and a value that matches the encrypted search query, and the ciphertext match comparison unit of the user definition function unit 312. The record group MapResult confirmed by 3121 is acquired from the encryption main table 361. For example, when the ciphertext deletion SQL is (24) and (25), the database control unit 311 matches the value of the map ID column “MapID-1” with “2” acquired in step 910 and A group of records having Enc (diabetes) that is the value of the “disease name” column that matches the value of the generalized search query (diabetes) is confirmed by the ciphertext match comparison unit 3121, and as a result, the record 3613 and the record 3615 are set as MapResult. (Steps 1820 and 1830).
 次に、データベース制御部311は、暗号化メインテーブル361から、MapResultに含まれるレコードを削除する(ステップ1840)。 Next, the database control unit 311 deletes the record included in MapResult from the encryption main table 361 (step 1840).
 次に、データベース制御部311は、ハッシュテーブル362から、暗号化メインテーブル361のマップIDカラム”MapID-1”に存在しないMapIDを含むレコードを削除する(ステップ1850)。 Next, the database control unit 311 deletes a record including a MapID that does not exist in the map ID column “MapID-1” of the encrypted main table 361 from the hash table 362 (Step 1850).
 最後に、データベース制御部311は、暗号文の削除SQLの結果をデータベースインタフェース部213へ送信する(ステップ1860)。以上で、秘匿インデックス削除処理(図18)を終了する。 Finally, the database control unit 311 transmits the result of the ciphertext deletion SQL to the database interface unit 213 (step 1860). Thus, the secret index deletion process (FIG. 18) is completed.
 (1-6)第一の実施例の効果
 以上に説明したように、第一の実施例の秘匿化データベースシステム1では、暗号化された大容量の暗号化メインテーブル361への検索に際して、ハッシュテーブル362を事前に検索することで検索対象とするレコードを少なくするため、高速に検索することができる。
(1-6) Effect of First Embodiment As described above, in the concealed database system 1 of the first embodiment, when searching for the encrypted large-capacity encrypted main table 361, the hash Since the number of records to be searched is reduced by searching the table 362 in advance, it is possible to search at high speed.
 (2)第二の実施例
 (2-1)第二の実施例による情報処理システムの構成
 図19は、本発明の第二の実施例の秘匿化データベースシステム1のハードウェア及びソフトウェア構成を示すブロック図である。
(2) Second Embodiment (2-1) Configuration of Information Processing System According to Second Embodiment FIG. 19 shows a hardware and software configuration of the concealment database system 1 according to the second embodiment of the present invention. It is a block diagram.
 秘匿化データベースシステム1は、第一の実施例(図1)と同様に、ユーザシステム側サーバ3が持つ元データを暗号化して、クラウドシステム側サーバ4に預託し、さらに、クラウドシステム側サーバ4が預託されたデータに対する検索機能及び分析機能をユーザシステム側サーバ3に対して提供するシステムである。 As in the first embodiment (FIG. 1), the concealment database system 1 encrypts the original data held by the user system side server 3 and deposits it in the cloud system side server 4. Is a system that provides the user system side server 3 with a search function and an analysis function for data deposited.
 第二の実施例の秘匿化データベースシステム1が、第一の実施例と異なる点は、暗号化メインテーブル361の代わりに、ハッシュテーブル362Bとの対応関係を示すMapID-1カラムを取り除いた暗号化メインテーブル361Bを有し、さらに、暗号化ハッシュ値の内容が異なる暗号化メインテーブル361Bとハッシュテーブル362Bとの対応関係を隠蔽するために暗号化して格納するマッピングテーブル363を有することである。 The concealment database system 1 of the second embodiment is different from the first embodiment in that the MapID-1 column indicating the correspondence with the hash table 362B is removed instead of the encryption main table 361. A mapping table 363 that has a main table 361B and that is encrypted and stored in order to conceal the correspondence between the encrypted main table 361B and the hash table 362B having different encrypted hash values.
 第二の実施例のユーザ端末2は、第一の実施例のユーザ端末2と同じである。 The user terminal 2 of the second embodiment is the same as the user terminal 2 of the first embodiment.
 第二の実施例のユーザシステム側サーバ3は、第一の実施例のユーザシステム側サーバ3と同じである。 The user system side server 3 of the second embodiment is the same as the user system side server 3 of the first embodiment.
 第二の実施例のアプリケーション部211は、第一の実施例のアプリケーション部211と同じである。 The application unit 211 of the second embodiment is the same as the application unit 211 of the first embodiment.
 第二の実施例のデータベースラッパー部212が第一の実施例と異なる点は、インデックス用検索クエリ生成部2128、ID暗号化部2129、インデックス用暗号化部2120及びマッピングテーブル並べ替えクエリ生成部21200を有することである。データベースラッパー部212の各部については、図20を参照して後述する。それ以外は、第一の実施例と同じである。 The database wrapper unit 212 of the second embodiment is different from the first embodiment in that an index search query generation unit 2128, an ID encryption unit 2129, an index encryption unit 2120, and a mapping table rearrangement query generation unit 21200. It is to have. Each unit of the database wrapper unit 212 will be described later with reference to FIG. The rest is the same as the first embodiment.
 第二の実施例のデータベースインタフェース部213は、第一の実施例のデータベースインタフェース部213と同じである。 The database interface unit 213 of the second embodiment is the same as the database interface unit 213 of the first embodiment.
 第二の実施例のディスク装置260が第一の実施例と異なる点は、秘匿インデックスマップテーブル262の”マップIDカラム名”カラムの代わりに、”マッピングテーブル名”カラムを備える秘匿インデックスマップテーブル262Bを有することである。それ以外は、第一の実施例と同じである。 The disk device 260 of the second embodiment is different from the first embodiment in that the secret index map table 262B having a “mapping table name” column instead of the “map ID column name” column of the secret index map table 262. It is to have. The rest is the same as the first embodiment.
 第二の実施例のクラウドシステム側サーバ4は、第一の実施例のクラウドシステム側サーバ4と同様である。 The cloud system side server 4 of the second embodiment is the same as the cloud system side server 4 of the first embodiment.
 第二の実施例のデータベース制御部311が第一の実施例と異なる点は、マッピングテーブル363の情報を加えて利用することである。それ以外は、第一の実施例のユーザ定義機能部312と同じである。 The database control unit 311 of the second embodiment is different from the first embodiment in that the information of the mapping table 363 is added and used. The rest is the same as the user-defined function unit 312 of the first embodiment.
 第二の実施例のユーザ定義機能部312が第一の実施例と異なる点は、インデックス用一致比較部3122、ID用鍵取得部3123、ID復号化部3124及びID暗号化部3125を有することである。ユーザ定義機能部312の各部については、図21を参照して後述する。それ以外は第一の実施例のユーザ定義機能部312と同じである。 The user-defined function unit 312 of the second embodiment is different from the first embodiment in that it includes an index match comparison unit 3122, an ID key acquisition unit 3123, an ID decryption unit 3124, and an ID encryption unit 3125. It is. Each unit of the user-defined function unit 312 will be described later with reference to FIG. The rest is the same as the user-defined function unit 312 of the first embodiment.
 第二の実施例のディスク装置360が第一の実施例と異なる点は、暗号化メインテーブル361に代えて暗号化メインテーブル361Bを有し、ハッシュテーブル362に代えてハッシュテーブル362Bを有し、さらに、マッピングテーブル363を追加で有することである。それ以外は、第一の実施例のディスク装置360と同じである。 The disk device 360 of the second embodiment is different from the first embodiment in that it has an encrypted main table 361B instead of the encrypted main table 361, and has a hash table 362B instead of the hash table 362, Furthermore, the mapping table 363 is additionally provided. The rest is the same as the disk device 360 of the first embodiment.
 図20は、第二の実施例のデータベースラッパー部212の論理構成を示す。第二の実施例のデータベースラッパー部212が、第一の実施例と異なる点は、図2に示す各部に加えて、インデックス用検索クエリ生成部2128、ID暗号化部2129、インデックス用暗号化部2120及びマッピングテーブル並べ替えクエリ生成部21200を有することである。それ以外は、第一の実施例のデータベースラッパー部212(図2)と同じである。 FIG. 20 shows a logical configuration of the database wrapper unit 212 of the second embodiment. The database wrapper unit 212 of the second embodiment is different from the first embodiment in that, in addition to the components shown in FIG. 2, an index search query generation unit 2128, an ID encryption unit 2129, an index encryption unit 2120 and a mapping table rearrangement query generation unit 21200. The rest is the same as the database wrapper unit 212 (FIG. 2) of the first embodiment.
 第二の実施例の暗号化部2121は、第一の実施例の暗号化部2121と同じである。 The encryption unit 2121 of the second embodiment is the same as the encryption unit 2121 of the first embodiment.
 第二の実施例の検索クエリ生成部2122は、第一の実施例の検索クエリ生成部2122と同じである。 The search query generation unit 2122 of the second embodiment is the same as the search query generation unit 2122 of the first embodiment.
 第二の実施例のハッシュ値生成部2123は、第一の実施例のハッシュ値生成部2123と同じである。 The hash value generation unit 2123 of the second embodiment is the same as the hash value generation unit 2123 of the first embodiment.
 第二の実施例の復号化部2124は、第一の実施例の復号化部2124と同じである。 The decoding unit 2124 of the second embodiment is the same as the decoding unit 2124 of the first embodiment.
 第二の実施例の鍵管理部2125が、第一の実施例と異なる点は、インデックス用検索クエリ生成部2128、ID暗号化部2129及びインデックス用暗号化部2120からの鍵の要求に対しても、暗号化鍵データ又は検索用鍵データを提供することである。なお、暗号化鍵データ及び検索用鍵データを提供してもよい。それ以外は、第一の実施例の鍵管理部2125と同じである。 The key management unit 2125 of the second embodiment differs from the first embodiment in that the key search unit 2128, the ID encryption unit 2129, and the index encryption unit 2120 request a key. Is to provide encryption key data or search key data. Note that encryption key data and search key data may be provided. The rest is the same as the key management unit 2125 of the first embodiment.
 第二の実施例のSQL変換部2126は、第一の実施例のSQL変換部2126と同じである。 The SQL converter 2126 of the second embodiment is the same as the SQL converter 2126 of the first embodiment.
 第二の実施例の秘匿インデックス用SQL変換部2127が第一の実施例の秘匿インデックス用SQL変換部2127と異なる点は、ハッシュテーブル362B、マッピングテーブル363及び暗号化メインテーブル361Bに対して参照、挿入、更新及び削除の少なくとも一つの処理を行う暗号化SQL文を生成し、暗号化SQL文をデータベースインタフェース部213へ送信することである。それ以外は、第一の実施例の秘匿インデックス用SQL変換部2127と同じである。 The difference between the secret index SQL conversion unit 2127 of the second embodiment and the secret index SQL conversion unit 2127 of the first embodiment is that the hash table 362B, the mapping table 363, and the encryption main table 361B are referred to. An encrypted SQL sentence that performs at least one of insertion, update, and deletion is generated, and the encrypted SQL sentence is transmitted to the database interface unit 213. The rest is the same as the secret index SQL conversion unit 2127 of the first embodiment.
 第二の実施例のインデックス用検索クエリ生成部2128は、ハッシュ値生成部2123が出力したインデックスのバイト列を入力とし、ハッシュテーブル362Bを検索するためのインデックス用ハッシュテーブル検索クエリを出力する。 The index search query generation unit 2128 of the second embodiment receives the index byte string output by the hash value generation unit 2123 and outputs an index hash table search query for searching the hash table 362B.
 第二の実施例のID暗号化部2129は、マッピングテーブル363に格納するメインテーブル261のIDカラムの値を暗号化する。具体的には、ID暗号化部2129は、IDを暗号化するID用鍵を鍵管理部2125から取得し、取得した鍵を用いて平文のIDを暗号化し、その結果を暗号化IDとして出力する。 The ID encryption unit 2129 of the second embodiment encrypts the value of the ID column of the main table 261 stored in the mapping table 363. Specifically, the ID encryption unit 2129 acquires an ID key for encrypting the ID from the key management unit 2125, encrypts the plaintext ID using the acquired key, and outputs the result as the encryption ID. To do.
 第二の実施例のインデックス用暗号化部2120は、インデックスの識別子を暗号化する。具体的には、インデックス用暗号化部2120は、鍵管理部2125から取得するID用鍵とハッシュ値生成部2123が出力する平文のハッシュ値を入力とし、鍵管理部2125から取得する暗号化鍵により入力されたハッシュ値を暗号化し、その結果を暗号化ハッシュ値として出力する。 The index encryption unit 2120 of the second embodiment encrypts the identifier of the index. Specifically, the index encryption unit 2120 receives the ID key acquired from the key management unit 2125 and the plaintext hash value output from the hash value generation unit 2123 as input, and the encryption key acquired from the key management unit 2125. The hash value input by is encrypted, and the result is output as an encrypted hash value.
 第二の実施例のマッピングテーブル並べ替えクエリ生成部21200は、マッピングテーブル363の各レコードの順序をランダムに並べ替える。 The mapping table rearrangement query generation unit 21200 of the second embodiment rearranges the order of each record in the mapping table 363 at random.
 図21は、第二の実施例のユーザ定義機能部312の論理構成を示す。第二の実施例のユーザ定義機能部312が、第一の実施例のユーザ定義機能部312(図3)と異なる点は、第一の実施例の構成に加えてインデックス用一致比較部3122、ID用鍵取得部3123、ID復号化部3124及びID暗号化部3125を有する点である。それ以外は、第一の実施例のユーザ定義機能部312と同じである。 FIG. 21 shows a logical configuration of the user-defined function unit 312 of the second embodiment. The user-defined function unit 312 of the second example differs from the user-defined function unit 312 (FIG. 3) of the first example in addition to the configuration of the first example, the index match comparison unit 3122, An ID key acquisition unit 3123, an ID decryption unit 3124, and an ID encryption unit 3125 are provided. The rest is the same as the user-defined function unit 312 of the first embodiment.
 第二の実施例の暗号文一致比較部3121は、第一の実施例の暗号文一致比較部3121と同じである。 The ciphertext match comparison unit 3121 of the second embodiment is the same as the ciphertext match comparison unit 3121 of the first embodiment.
 第二の実施例のインデックス用一致比較部3122は、検索用鍵データをメモリ310及び/又はディスク装置360に格納する。また、データベース制御部311からインデックス用ハッシュテーブル検索クエリ及び暗号化ハッシュ値の入力を受け、検索用鍵を用いてインデックス用ハッシュテーブル検索クエリを暗号化ハッシュ値との一致比較が可能なインデックス用一致検索クエリに変換する。そして、インデックス用一致検索クエリと暗号化ハッシュ値の一致比較を行い、一致する場合は一致を示す値(例えば”1”)を出力し、一致しない場合は不一致を示す値(例えば”0”)を出力する。 The index match comparison unit 3122 of the second embodiment stores the search key data in the memory 310 and / or the disk device 360. Also, an index match that allows an index hash table search query and an encrypted hash value to be input from the database control unit 311 and can be compared with the encrypted hash value using the search key. Convert to search query. Then, a match comparison between the index match search query and the encrypted hash value is performed. If they match, a value indicating a match (for example, “1”) is output, and if they do not match, a value indicating a mismatch (for example, “0”) is output. Is output.
 第二の実施例のID用鍵取得部3123は、インデックス用ハッシュテーブル検索クエリ及び暗号化ハッシュ値を入力とし、暗号化ハッシュ値の一部を変換しID用鍵を出力する。 The ID key acquisition unit 3123 of the second embodiment receives an index hash table search query and an encrypted hash value, converts a part of the encrypted hash value, and outputs an ID key.
 第二の実施例のID復号化部3124は、暗号化IDとID用鍵を入力とし、暗号化IDをID用鍵で復号化し、平文IDを出力する。 The ID decryption unit 3124 of the second embodiment receives the encryption ID and the ID key, decrypts the encryption ID with the ID key, and outputs a plaintext ID.
 第二の実施例のID暗号化部3125は、平文IDとID用鍵を入力とし、平文IDをID用鍵で暗号化し、暗号化IDを出力する。 The ID encryption unit 3125 of the second embodiment receives the plaintext ID and the ID key, encrypts the plaintext ID with the ID key, and outputs the encrypted ID.
 図22は、第二の実施例の秘匿インデックスマップテーブル262Bのデータ構造を示す。第二の実施例の秘匿インデックスマップテーブル262Bが第一の実施例の秘匿インデックスマップテーブル262(図5)と異なる点は、”マップIDカラム名”カラムがないこと、また、マッピングテーブル363との関連を示す”マッピングテーブル名”カラムを有することである。それ以外は第一の実施例の秘匿インデックスマップテーブル262(図5)と同じである。例えば、レコード2621Bは、”医療情報”スキーマの”患者情報”テーブルにおいて、関連するマッピングテーブルとハッシュテーブルを持つ”カラム名”が”病名”であり、関連する”マッピングテーブル名”が”MT1”であり、関連する”ハッシュテーブル名”が”HT1”であることを示す。 FIG. 22 shows the data structure of the secret index map table 262B of the second embodiment. The secret index map table 262B of the second embodiment is different from the secret index map table 262 (FIG. 5) of the first embodiment in that there is no “map ID column name” column and the mapping table 363 It has a “mapping table name” column indicating the relationship. The rest is the same as the secret index map table 262 (FIG. 5) of the first embodiment. For example, in the record 2621B, in the “patient information” table of the “medical information” schema, “column name” having a related mapping table and hash table is “disease name”, and related “mapping table name” is “MT1”. And the related “hash table name” is “HT1”.
 図23は、第二の実施例の暗号化メインテーブル361Bのデータ構造を示す。第二の実施例の暗号化メインテーブル361Bが第一の実施例の暗号化メインテーブル361(図6)と異なる点は、”マップIDカラム”がないことである。この違いにより、暗号化メインテーブル361B上で、各レコードが対応するMapIDを特定することができない。それ以外は第一の実施例の暗号化メインテーブル361(図6)と同じである。 FIG. 23 shows the data structure of the encryption main table 361B of the second embodiment. The difference between the encryption main table 361B of the second embodiment and the encryption main table 361 (FIG. 6) of the first embodiment is that there is no “map ID column”. Due to this difference, the MapID corresponding to each record cannot be specified on the encryption main table 361B. The rest is the same as the encryption main table 361 (FIG. 6) of the first embodiment.
 図24は、第二の実施例のマッピングテーブル363(MT1)のデータ構造を示す。マッピングテーブル363は、クラウドシステム側サーバ4のディスク装置360又は(及び)メモリ310に格納され、暗号化メインテーブル361B上の各レコードとハッシュテーブル362B(HT1)上の”MapID”の対応関係を隠蔽して保持する。なお、マッピングテーブル363は、ディスク装置360及びメモリ310の両方に格納されてもよい。マッピングテーブル363は、”MID”カラム、”暗号化ID”カラム及び”MapID”の値を示す”MapID”カラムによりレコードを構成する。”MID”カラムは、マッピングテーブル上のレコードを一意に特定する識別子である。”暗号化ID”カラムは、暗号化メインテーブル361Bの”ID”カラムの値をID暗号化部2129又はID暗号化部3125が暗号化した暗号化IDを示す。”MapID”カラムは、マッピングテーブル363の各レコードと対応するハッシュテーブル362の”MapID”の値を示す。 FIG. 24 shows the data structure of the mapping table 363 (MT1) of the second embodiment. The mapping table 363 is stored in the disk device 360 or (and) the memory 310 of the cloud system side server 4, and conceals the correspondence between each record on the encryption main table 361B and “MapID” on the hash table 362B (HT1). And hold. The mapping table 363 may be stored in both the disk device 360 and the memory 310. The mapping table 363 forms a record by a “MID” column, an “encryption ID” column, and a “MapID” column indicating a value of “MapID”. The “MID” column is an identifier that uniquely identifies a record on the mapping table. The “encryption ID” column indicates an encryption ID obtained by encrypting the value of the “ID” column of the encryption main table 361B by the ID encryption unit 2129 or the ID encryption unit 3125. The “MapID” column indicates the value of “MapID” in the hash table 362 corresponding to each record in the mapping table 363.
 例えば、レコード3631は、当該レコードを一意に特定する識別子”MID”カラムの値が”101”であり、対応する暗号化メインテーブル361Bのレコードの”ID”カラムの値を暗号化した値である”暗号化ID”カラムの値が”IEnc(1)”であり、ハッシュテーブル362と対応する”MapID”カラムの値が”1”であることを示す。 For example, the record 3631 has an identifier “MID” column value that uniquely identifies the record as “101”, and is an encrypted value of the “ID” column value of the record in the corresponding encrypted main table 361B. The value of the “encryption ID” column is “IEnc (1)”, and the value of the “MapID” column corresponding to the hash table 362 is “1”.
 このマッピングテーブル363のデータ構造により、暗号化メインテーブル361B上の各レコードが対応するハッシュテーブル362の”MapID”の値を隠蔽して保持する。なお、”IEnc( )”は、”( )”内の平文IDが、ID暗号化部2129あるいはID暗号化部3125により暗号化された暗号化IDであることを示す。また、”MID”カラム及び”MapID”カラムには、データベース制御部311の通常のインデックス機能を適用する。 The data structure of the mapping table 363 conceals and holds the “MapID” value of the hash table 362 to which each record on the encrypted main table 361B corresponds. “IEnc ()” indicates that the plaintext ID in “()” is an encryption ID encrypted by the ID encryption unit 2129 or the ID encryption unit 3125. Further, the normal index function of the database control unit 311 is applied to the “MID” column and the “MapID” column.
 図25は、検索を高速化するために用いるハッシュテーブル362Bのデータ構造を示す。第二の実施例のハッシュテーブル362Bが、第一の実施例のハッシュテーブル362(図7)と異なる点は、”MapID”カラム及び”暗号化ハッシュ値”カラムによりレコードを構成することである。”MapID”カラムは、マッピングテーブル363との対応情報を示す。”暗号化ハッシュ値”は、ハッシュ値生成部2123が生成したハッシュ値とID用鍵のペアのビット列とを秘匿インデックス用SQL変換部2127が暗号化した値を示す。 FIG. 25 shows the data structure of the hash table 362B used for speeding up the search. The hash table 362B of the second embodiment is different from the hash table 362 (FIG. 7) of the first embodiment in that a record is constituted by a “MapID” column and an “encrypted hash value” column. The “MapID” column indicates correspondence information with the mapping table 363. The “encrypted hash value” indicates a value obtained by encrypting the hash value generated by the hash value generation unit 2123 and the bit string of the ID key pair by the secret index SQL conversion unit 2127.
 例えば、レコード3621Bは、マッピングテーブル363の”MapID”カラムの値と対応する”MapID”の値が”1”であり、それに対応する”暗号化ハッシュ値”の値が”INEnc(ID_key_1,0765)”であることを示す。”MapID”カラムの値は、マッピングテーブル363の一つ以上のレコードの”MapID”の値と等しく、”MapID”を指定することによりマッピングテーブル363及び暗号化メインテーブル361Bの全レコードを全件検索することなく、検索範囲を限定する。 For example, in the record 3621B, the value of “MapID” corresponding to the value of the “MapID” column of the mapping table 363 is “1”, and the value of the corresponding “encrypted hash value” is “INEnc (ID_key — 1,0765)”. ". The value of the “MapID” column is equal to the value of “MapID” of one or more records in the mapping table 363. By specifying “MapID”, all records in the mapping table 363 and the encrypted main table 361B are searched. Without limiting the search range.
 なお、”INEnc(x,y)”は、”( )”内のID用鍵x及びハッシュ値yが、インデックス用暗号化部2120により暗号化された暗号化ハッシュ値であることを示す。また、”MapID”カラムには、データベース制御部311の通常のインデックス機能を適用する。 Note that “INEnc (x, y)” indicates that the ID key x and the hash value y in “()” are the encrypted hash values encrypted by the index encryption unit 2120. Further, the normal index function of the database control unit 311 is applied to the “MapID” column.
(2-2)秘匿化データベースの検索に関する処理の流れ
 図26、図27及び図10を用いて、第二の実施例の秘匿化データベースシステム1において、ハッシュテーブル362B及びマッピングテーブル363を用いた検索である秘匿インデックス検索を行う際の、データベースラッパー部212及びデータベース制御部311が行う一連の処理について、主に第一の実施例との違いを説明する。
(2-2) Flow of processing related to search of concealment database Search using hash table 362B and mapping table 363 in concealment database system 1 of the second embodiment using FIG. 26, FIG. 27 and FIG. A series of processing performed by the database wrapper unit 212 and the database control unit 311 when performing a secret index search is mainly described for differences from the first embodiment.
 図26は、第二の実施例の秘匿インデックス検索クエリ生成処理を示すフローチャートである。第二の実施例の秘匿インデックス検索クエリ生成処理が、第一の実施例の秘匿インデックス検索クエリ生成処理と異なる点は、マッピングテーブル363を用いて暗号化メインテーブル361Bの”ID”カラムとハッシュテーブル362Bの”MapID”カラムを対応付けることである。この処理は、データベースラッパー部212がアプリケーション部211から平文の検索のSQLを受信すると、開始する。例えば、第一の実施例と同様に、データベースラッパー部212が受信するSQLは、平文の検索のSQL(1)である。
 
SELECT * FROM 医療情報.患者情報 WHERE 病名=糖尿病  (1)再掲
 
 この検索SQLは、スキーマ名が”医療情報”であり、テーブル名が”患者情報”であるテーブルから、”病名”カラムの値が”糖尿病”であるレコードを検索し、条件に一致する全てのカラムの値を検索結果として得ることを意味する(ステップ2510)。
FIG. 26 is a flowchart showing a secret index search query generation process of the second embodiment. The secret index search query generation process of the second embodiment is different from the secret index search query generation process of the first embodiment in that the “ID” column and the hash table of the encryption main table 361B using the mapping table 363 are used. This is to associate the “MapID” column of 362B. This process starts when the database wrapper unit 212 receives a plain text search SQL from the application unit 211. For example, as in the first embodiment, the SQL received by the database wrapper unit 212 is SQL (1) for plain text search.

SELECT * FROM Medical information. Patient information WHERE Disease name = Diabetes (1)
This search SQL searches a record whose schema name is “medical information” and whose table name is “patient information” and whose value in the “disease name” column is “diabetes”, and finds all the records that match the conditions. This means that the column value is obtained as a search result (step 2510).
 次に、データベースラッパー部212は、第一の実施例のステップ820と同様に、まず鍵管理部2125から暗号化鍵及び検索用鍵を取得し、取得した鍵を検索クエリ生成部2122に入力し、その出力として暗号化検索クエリを得る。例えば、平文のSQLが(1)である場合、以下の実行式(2)である(ステップ2520)。
 
 暗号化検索クエリ(糖尿病)
 = 検索クエリ生成部(暗号化鍵、検索用鍵、"糖尿病") (2)再掲
 
Next, the database wrapper unit 212 first acquires the encryption key and the search key from the key management unit 2125, and inputs the acquired key to the search query generation unit 2122, as in step 820 of the first embodiment. , Get an encrypted search query as its output. For example, when the plaintext SQL is (1), the following execution formula (2) is obtained (step 2520).

Encrypted search query (diabetes)
= Search query generator (encryption key, search key, “diabetes”) (2)
 次に、データベースラッパー部212は、第一の実施例のステップ830と一部異なり、秘匿インデックスマップテーブル262から、検索対象カラムの”マッピングテーブル名”及び”ハッシュテーブル名”を取得する。具体的には、データベースラッパー部212は、平文の検索SQLが検索対象とするスキーマ名、暗号化メインテーブル名及びカラム名の組をキーとして、秘匿インデックスマップテーブル262Bを検索し、スキーマ名、暗号化メインテーブル名及びカラム名が一致するレコードの”マッピングテーブル名”及び”ハッシュテーブル名”を取得する。例えば、平文の検索SQLが(1)である場合、スキーマ名が”医療情報”であり、かつ暗号化メインテーブル名が”患者情報”であり、かつカラム名が”病名”であるレコード2621Bから、マッピングテーブル名”MT1”及びハッシュテーブル名”HT1”を取得する(ステップ2530)。 Next, the database wrapper unit 212 acquires “mapping table name” and “hash table name” of the search target column from the secret index map table 262, which is partially different from step 830 of the first embodiment. Specifically, the database wrapper unit 212 searches the secret index map table 262B using the combination of the schema name, the encryption main table name, and the column name to be searched by the plaintext search SQL as a key, and the schema name, encryption The “mapping table name” and “hash table name” of the record having the same main table name and column name are acquired. For example, when the plain text search SQL is (1), from the record 2621B in which the schema name is “medical information”, the encrypted main table name is “patient information”, and the column name is “disease name”. The mapping table name “MT1” and the hash table name “HT1” are acquired (step 2530).
 次に、データベースラッパー部212は、第一の実施例における図8のステップ830と同様に、ステップ2530の結果が存在するか否かを判定する(ステップ2540)。 Next, the database wrapper unit 212 determines whether or not the result of step 2530 exists as in step 830 of FIG. 8 in the first embodiment (step 2540).
 ステップ2540の結果が”存在しない”である場合(NO)、第一の実施例における図8のステップ850と同様に、データベースラッパー部212は、平文のSQLの検索対象の値を、ステップ2520で生成した暗号化検索クエリに置き換え、さらに、WHERE句の一致比較文を、ユーザ定義機能部312の暗号文一致比較部3121を呼び出す形式に置き換えた、暗号文の検索SQLを出力する。例えば、平文のSQLが(1)であり、暗号化検索クエリが(2)である場合、暗号文の検索SQLは、以下の暗号文の検索SQL(3)となる(ステップ2550)。
 
SELECT * FROM 医療情報.患者情報 
WHERE 暗号文一致比較部(病名、暗号化検索クエリ(糖尿病))(3)再掲
 
When the result of step 2540 is “does not exist” (NO), the database wrapper unit 212 sets the search target value of the plaintext SQL in step 2520 as in step 850 of FIG. 8 in the first embodiment. A ciphertext search SQL is output by replacing the generated ciphertext search query with the generated ciphertext match comparison unit 3121 of the user definition function unit 312. For example, when the plaintext SQL is (1) and the encrypted search query is (2), the ciphertext search SQL is the following ciphertext search SQL (3) (step 2550).

SELECT * FROM Medical information. Patient information
WHERE Ciphertext match comparison unit (disease name, encrypted search query (diabetes)) (3)
 一方、ステップ2540の結果が”存在する”である場合(YES)、データベースラッパー部212は、ハッシュテーブル362及びマッピングテーブル363を用いた高速検索を行うために、ハッシュ値生成から秘匿インデックス用検索SQL変換(ステップ2560~2580)の処理を行った暗号文の検索SQLを出力する。 On the other hand, if the result of step 2540 is “exists” (YES), the database wrapper unit 212 performs the search from the hash value to the secret index search SQL in order to perform a high-speed search using the hash table 362 and the mapping table 363. A ciphertext search SQL subjected to the conversion (steps 2560 to 2580) processing is output.
 まず、データベースラッパー部212は、第一の実施例における図8のステップ860と同様に、検索対象の値をハッシュ値生成部2123に入力し、出力されるハッシュ値を取得する。例えば、平文の検索SQLが(1)である場合、以下のハッシュ値(4)を取得する(ステップ2560)。
 
ハッシュ値 = ハッシュ値生成部(糖尿病)="1012" (4) 再掲
 
First, the database wrapper unit 212 inputs the search target value to the hash value generation unit 2123 and acquires the output hash value, as in step 860 of FIG. 8 in the first embodiment. For example, when the plaintext search SQL is (1), the following hash value (4) is acquired (step 2560).

Hash value = Hash value generator (diabetes) = "1012" (4)
 次に、データベースラッパー部212は、第一の実施例における図8のステップ870とは一部異なり、ハッシュテーブル362Bを検索するために、ステップ2560で取得したハッシュ値をインデックス用検索クエリ生成部2128に入力し、出力をインデックス用ハッシュテーブル検索クエリとする。例えば、平文のハッシュ値が(4)である場合、以下のインデックス用ハッシュテーブル検索クエリ(5-2)を取得する(ステップ2570)。
 
 インデックス用ハッシュテーブル検索クエリ(1012)
=インデックス用検索クエリ生成部(暗号鍵、検索用鍵、"1012") (5-2)
 
Next, the database wrapper unit 212 is partly different from the step 870 of FIG. 8 in the first embodiment, and the hash value acquired in the step 2560 is used as the index search query generation unit 2128 in order to search the hash table 362B. The output is used as an index hash table search query. For example, when the hash value of the plaintext is (4), the following index hash table search query (5-2) is acquired (step 2570).

Hash table search query for index (1012)
= Index search query generator (encryption key, search key, "1012") (5-2)
 次に、データベースラッパー部212は、第一の実施例における図8のステップ880とは一部異なり、ハッシュテーブル362Bを検索して検索範囲を限定した上で、検索範囲に相当する暗号化IDをマッピングテーブル363から特定して、暗号化IDを復号してIDとし、そのIDに対応する暗号化メインテーブル361Bのレコードを検索するためのSQLを生成する秘匿インデックス用検索SQL変換を行う。具体的には、ステップ2520で得た暗号化検索クエリと、ステップ2530で得たマッピングテーブル名及びハッシュテーブル名と、ステップ2570で得たインデックス用ハッシュテーブル検索クエリを入力とし、ハッシュテーブル362Bをインデックス用ハッシュテーブル検索クエリで検索して該当したレコードの”MapID”カラムの値及びID用鍵を取得する。そして、その値と等しい”MapID”カラムの値を持つマッピングテーブル363のレコードから検索対象の暗号化IDを特定し、暗号化IDをID用鍵で復号して検索対象のIDを取得する。さらに、ユーザ定義機能部312の暗号文一致比較部3121を用いて、検索対象のIDをもつ暗号化メインテーブル361Bのレコードから、暗号化検索クエリと一致する値を持つレコードを判定し、一致するレコードからメインテーブル261に存在するカラムのみ(”ID”カラム以外)を選択し、検索結果とする暗号文の検索SQLを生成し、出力する。例えば、平文の検索SQLが(1)である場合、以下の暗号文の検索SQL(6-2)を出力する(ステップ2580)。
 
SELECT 患者番号, 名前, 病名 FROM 医療情報.患者情報
JOIN (
SELECT ( ID復号部( @ID用鍵, 暗号化ID) ) AS ID
FROM マッピングテーブル MT1
JOIN (
  SELECT MapID, 
@ID鍵:=ID用鍵取得部(インデックス用ハッシュテーブル検索クエリ、
暗号化ハッシュ値)
      FROM ハッシュテーブル HT1 
      WHERE インデックス用一致比較部(インデックス用ハッシュテーブル検索クエリ、
                暗号化ハッシュ値)
    ) IDResult
    ON ( MT1.MapID = IDResult.MapID )
  ) MapResult
  ON  医療情報.患者情報.ID = MapResult.ID
  WHERE 暗号化一致比較部(病名、暗号化検索クエリ(糖尿病)) (6-2)
 
Next, the database wrapper unit 212 is partially different from step 880 of FIG. 8 in the first embodiment, and after searching the hash table 362B to limit the search range, the encryption ID corresponding to the search range is set. The encryption ID is identified from the mapping table 363, and the encrypted ID is decrypted to obtain the ID, and the secret index search SQL conversion is performed to generate the SQL for searching the record of the encrypted main table 361B corresponding to the ID. Specifically, the encrypted search query obtained in step 2520, the mapping table name and hash table name obtained in step 2530, and the index hash table search query obtained in step 2570 are input, and hash table 362B is indexed. The value in the “MapID” column and the ID key of the corresponding record are acquired by searching with the hash table search query. Then, the encryption ID to be searched is specified from the record of the mapping table 363 having the value of the “MapID” column equal to the value, and the ID to be searched is acquired by decrypting the encryption ID with the ID key. Further, using the ciphertext match comparison unit 3121 of the user-defined function unit 312, a record having a value that matches the encrypted search query is determined from the records of the encryption main table 361B having the ID to be searched, and matches. Only a column existing in the main table 261 (other than the “ID” column) is selected from the record, and a ciphertext search SQL as a search result is generated and output. For example, when the plaintext search SQL is (1), the following ciphertext search SQL (6-2) is output (step 2580).

SELECT patient number, name, disease name FROM medical information.patient information
JOIN (
SELECT (ID decryption part (@ID key, encryption ID)) AS ID
FROM mapping table MT1
JOIN (
SELECT MapID,
@ID key: = ID key acquisition part (index hash table search query,
(Encrypted hash value)
FROM hash table HT1
WHERE Index match comparison section (index hash table search query,
Cryptographic hash value)
) IDResult
ON (MT1.MapID = IDResult.MapID)
) MapResult
ON Medical information.Patient information.ID = MapResult.ID
WHERE Encrypted match comparison unit (disease name, encrypted search query (diabetes)) (6-2)
 最後に、データベースラッパー部212は、ステップ2550又はステップ2880で出力された暗号文の検索SQLを、データベースインタフェース部213へ送信する。平文の検索SQLが(1)である場合、ステップ2540の結果が存在するため、データベースラッパー部212はステップ2580が出力した暗号文の検索SQL(6-2)をデータベースインタフェース部213へ送信する(ステップ2590)。以上で、データベースラッパー部212は、秘匿インデックス検索クエリ生成処理(図26)を終了する。 Finally, the database wrapper unit 212 transmits the ciphertext search SQL output in step 2550 or step 2880 to the database interface unit 213. When the plaintext search SQL is (1), the result of step 2540 is present, so the database wrapper unit 212 transmits the ciphertext search SQL (6-2) output in step 2580 to the database interface unit 213 ( Step 2590). As described above, the database wrapper unit 212 ends the secret index search query generation process (FIG. 26).
 図27は、第二の実施例の秘匿インデックス検索処理を示すフローチャートである。第二の実施例の秘匿インデックス検索処理が、第一の実施例の秘匿インデックス検索処理(図9)と異なる点は、マッピングテーブル363を用いて暗号化メインテーブル361Bの”ID”カラムとハッシュテーブル362Bの”MapID”カラムを対応付けることである。秘匿インデックス検索処理は、データベース制御部311がデータベースインタフェース部213から暗号文の検索SQLを受信すると、開始する。例えば、秘匿インデックス検索処理の開始時にデータベース制御部311が受信する暗号文の検索SQLは、SQL(6-2)である。 FIG. 27 is a flowchart showing the secret index search process of the second embodiment. The secret index search process of the second embodiment is different from the secret index search process (FIG. 9) of the first embodiment in that the “ID” column and the hash table of the encryption main table 361B using the mapping table 363 are used. This is to associate the “MapID” column of 362B. The secret index search process starts when the database control unit 311 receives the ciphertext search SQL from the database interface unit 213. For example, the ciphertext search SQL received by the database control unit 311 at the start of the secret index search process is SQL (6-2).
 まず、データベース制御部311は、暗号文の検索SQLから、検索対象となるハッシュテーブル362Bとインデックス用ハッシュテーブル検索クエリを特定し、ユーザ定義機能部312のインデックス用一致比較部3122により当該ハッシュテーブル362Bの”暗号化ハッシュ値”カラムの値と当該インデックス用ハッシュテーブル検索クエリが一致するレコードを特定し、そのレコードの”MapID”カラムの値をMapID_hitとして取得する。例えば、暗号文の検索SQLが(6-2)である場合、ハッシュテーブルはハッシュテーブル362B(HT1)であり、インデックス用ハッシュテーブル検索クエリは(5-2)の”インデックス用ハッシュテーブル検索クエリ(1012)”である。さらに、インデックス用一致比較部3122による一致比較の結果、ハッシュテーブル362B(HT1)のレコード3622Bの暗号化ハッシュ値”INEnc(ID_key_2, 1012)”と一致し、当該レコードのMapID”2”をMapID_hitとして取得する(ステップ2610)。 First, the database control unit 311 identifies a hash table 362B and an index hash table search query to be searched from the ciphertext search SQL, and the hash table 362B is searched by the index match comparison unit 3122 of the user definition function unit 312. The record in which the value of the “encrypted hash value” column matches the hash table search query for the index is specified, and the value of the “MapID” column of the record is acquired as MapID_hit. For example, when the ciphertext search SQL is (6-2), the hash table is the hash table 362B (HT1), and the index hash table search query is “index hash table search query (5-2) ( 1012) ". Further, as a result of the match comparison by the index match comparison unit 3122, it matches the encrypted hash value “INEc (ID_key_2, 1012)” of the record 3622B of the hash table 362B (HT1), and MapID “2” of the record is set as MapID_hit. Obtain (step 2610).
 次に、データベース制御部311は、マッピングテーブル363から、”MapID”カラムの値がMapID_hitと一致するレコード群をHashResultとして取得する。例えば、暗号文の検索SQLが(6-2)である場合、MapID_hitが”2”であるため、マッピングテーブル363の”MapID”の値が2であるレコード3632及び3633をHashResultとして取得する(ステップ2620)。 Next, the database control unit 311 acquires, from the mapping table 363, a record group in which the value of the “MapID” column matches MapID_hit as HashResult. For example, when the ciphertext search SQL is (6-2), since MapID_hit is “2”, records 3632 and 3633 having a “MapID” value of 2 in the mapping table 363 are acquired as HashResult (step). 2620).
 次に、データベース制御部311は、インデックス用ハッシュテーブル検索クエリ及びステップ2610でヒットした暗号化ハッシュ値をID用鍵取得部3123に入力してID用鍵を取得する。さらに、そのID用鍵とHashResultの”暗号化ID”カラムの値をID復号化部3124に入力して、検索対象のID群であるIDResultを取得する。例えば、暗号文の検索SQLが(6-2)である場合、ステップ2610でヒットした暗号化ハッシュ値”INEnc(ID_key_2,0120)”であり、ID用鍵取得部3123からID用鍵”ID_key_2”を得る。取得したID用鍵で、ステップ3620で取得したHashResult(マッピングテーブル363のレコード3632及び3633)の暗号化ID”IEnc(3)、IEnc(1000000)”を復号化し、IDResult”3、4”を取得する(ステップ2630)。 Next, the database control unit 311 inputs the index hash table search query and the encrypted hash value hit in step 2610 to the ID key acquisition unit 3123 to acquire the ID key. Further, the ID key and the value of the “Encryption ID” column of the HashResult are input to the ID decryption unit 3124 to acquire an IDResult that is an ID group to be searched. For example, when the ciphertext search SQL is (6-2), the encrypted hash value “INEnc (ID_key_2, 0120)” hit in step 2610 is obtained, and the ID key “ID_key_2” is obtained from the ID key acquisition unit 3123. Get. The ID ID “3, 4” is acquired by decrypting the encrypted ID “IEnc (3), IEnc (1000000)” of the HashResult ( records 3632 and 3633 of the mapping table 363) acquired in step 3620 with the acquired ID key. (Step 2630).
 次に、データベース制御部311は、暗号化メインテーブル361Bから、IDResultに対応する”ID”カラムの値を持ち、かつ暗号化検索クエリと一致する値を持つことをユーザ定義機能部312の暗号文一致比較部3121により確認したレコード群MapResultを取得する。例えば、暗号文の検索SQLが(6-2)である場合、データベース制御部311は、暗号文一致比較部3121により、”ID”カラムの値がステップ2630で取得した”3、4”と一致し、かつ暗号化検索クエリ(糖尿病)の値と一致する”病名”カラムの値であるEnc(糖尿病)を持つレコード群を暗号化メインテーブル361Bで確認し、その結果レコード3613B及びレコード3615BをMapResultとして取得する(ステップ2640)。 Next, the database control unit 311 indicates from the encryption main table 361B that the encrypted text of the user definition function unit 312 has a value in the “ID” column corresponding to IDResult and a value that matches the encrypted search query. The record group MapResult confirmed by the match comparison unit 3121 is acquired. For example, when the ciphertext search SQL is (6-2), the database control unit 311 uses the ciphertext match comparison unit 3121 to set the value of the “ID” column to “3, 4” acquired in step 2630. In addition, a record group having Enc (diabetes) which is the value of the “disease name” column that matches the value of the encrypted search query (diabetes) is confirmed in the encryption main table 361B, and as a result, the record 3613B and the record 3615B are mapped to MapResult (Step 2640).
 最後に、データベース制御部311は、MapResultから”ID”カラムを除いたレコード群を検索結果としてユーザシステム側サーバ3のデータベースインタフェース部213へ送信する。例えば、暗号文の検索SQLが(6-2)である場合、暗号化メインテーブル361Bのレコード3613B及び3615Bから、”ID”カラムを除いたレコード群を暗号文の検索結果として送信する(ステップ2650)。以上で、秘匿インデックス検索処理(図27)を終了する。 Finally, the database control unit 311 transmits a record group obtained by removing the “ID” column from the Map Result to the database interface unit 213 of the user system side server 3 as a search result. For example, when the ciphertext search SQL is (6-2), a record group excluding the “ID” column is transmitted as a ciphertext search result from the records 3613B and 3615B of the encryption main table 361B (step 2650). ). Thus, the secret index search process (FIG. 27) is completed.
 第二の実施例において、検索結果復号処理は、第一の実施例の検索結果復号処理(図10)と同じである。 In the second embodiment, the search result decoding process is the same as the search result decoding process (FIG. 10) of the first embodiment.
(2-3)秘匿化データベースへの挿入に関する処理の流れ
 図28及び図29を用いて、第二の実施例の秘匿化データベースシステム1において、ハッシュテーブル362B及びマッピングテーブル363を用いた挿入である秘匿インデックス挿入を行う際の、データベースラッパー部212及びデータベース制御部311が行う一連の処理について、主に第一の実施例との違いを説明する。
(2-3) Process Flow for Insertion into Concealed Database Insertion using hash table 362B and mapping table 363 in concealed database system 1 of the second embodiment using FIG. 28 and FIG. A series of processing performed by the database wrapper unit 212 and the database control unit 311 when inserting a secret index will be described mainly with respect to differences from the first embodiment.
 図28は、第二の実施例の秘匿インデックス挿入クエリ生成処理を示すフローチャートである。第二の実施例の秘匿インデックス挿入クエリ生成処理が、第一の実施例の秘匿インデックス挿入クエリ生成処理(図11)と異なる点は、マッピングテーブル363に対する挿入処理が加わることである。秘匿インデックス挿入クエリ生成処理は、データベースラッパー部212がアプリケーション部211から平文の挿入のSQLを受信すると、開始する。秘匿インデックス挿入クエリ生成処理の開始時にデータベースラッパー部212が受信する平文の挿入SQLは、第一の実施例と同様に、以下の平文の挿入SQL(7)である。
 
  INSERT INTO 医療情報.患者情報 ( 患者番号, 名前, 病名 )
                                VALUES ( 1000001, 木下, 胃腸炎) (7)再掲
 
 この挿入SQLは、スキーマ名が”医療情報”であり、テーブル名が”患者情報”であるテーブルに対し、”患者番号”カラムの値が”1000001”であり、”名前”カラムの値が”木下”であり、”病名”カラムの値が”胃腸炎”であるレコードを挿入することを意味する(ステップ2710)。
FIG. 28 is a flowchart illustrating a secret index insertion query generation process according to the second embodiment. The secret index insertion query generation process of the second embodiment is different from the secret index insertion query generation process (FIG. 11) of the first embodiment in that an insertion process for the mapping table 363 is added. The secret index insertion query generation process starts when the database wrapper unit 212 receives the plain text insertion SQL from the application unit 211. The plaintext insertion SQL received by the database wrapper unit 212 at the start of the secret index insertion query generation process is the following plaintext insertion SQL (7), as in the first embodiment.

INSERT INTO Medical information.Patient information (patient number, name, disease name)
VALUES (1000001, Kinoshita, gastroenteritis) (7) Repost
In this insertion SQL, the value of the “patient number” column is “1000001” and the value of the “name” column is “1000001” for the table whose schema name is “medical information” and whose table name is “patient information”. This means that a record that is “Kinoshita” and the value of the “disease name” column is “gastroenteritis” is inserted (step 2710).
 次に、データベースラッパー部212は、第一の実施例における図11のステップ1120と同様に、平文の挿入SQLから挿入対象の値を取り出し、暗号化部2121により暗号化する。例えば、平文の挿入SQLが(7)である場合、挿入対象の値は”1000001”、”木下”及び”胃腸炎”であり、暗号化部2121により暗号化した結果の出力の暗号文は、それぞれ”Enc(1000001)”、”Enc(木下)”及び”Enc(胃腸炎)”となる(ステップ2720)。 Next, the database wrapper unit 212 takes out the value to be inserted from the plain text insertion SQL and encrypts it by the encryption unit 2121 as in step 1120 of FIG. 11 in the first embodiment. For example, when the plaintext insertion SQL is (7), the values to be inserted are “1000001”, “Kinoshita”, and “Gastroenteritis”, and the encrypted text output as a result of encryption by the encryption unit 2121 is: “Enc (1000001)”, “Enc (Kinoshita)”, and “Enc (gastroenteritis)” are obtained (step 2720).
 次に、データベースラッパー部212は、図11のステップ1130と同様に、秘匿インデックスマップテーブル262Bから、挿入対象レコードに関連する”マッピングテーブル名”及び”ハッシュテーブル名”を取得する。具体的には、データベースラッパー部212は、平文の挿入SQLが挿入対象とするスキーマ名及び暗号化メインテーブル名の組をキーとして、秘匿インデックスマップテーブル262Bを検索し、スキーマ及び暗号化メインテーブル名が一致するすべてのレコードから、”カラム名”、”マッピングテーブル名”及び”ハッシュテーブル名”を取得する。例えば、平文の挿入SQLが(7)である場合、スキーマ名が”医療情報”でありかつ暗号化メインテーブル名が”患者情報”であるレコード2621Bから、カラム名”病名”、マッピングテーブル名”MT1”及びハッシュテーブル名”HT1”を取得する(ステップ2730)。 Next, the database wrapper unit 212 acquires “mapping table name” and “hash table name” related to the record to be inserted from the secret index map table 262B as in step 1130 of FIG. Specifically, the database wrapper unit 212 searches the secret index map table 262B using the combination of the schema name and encryption main table name to be inserted by the plaintext insertion SQL as a key, and the schema and encryption main table name. “Column name”, “mapping table name”, and “hash table name” are acquired from all records that match. For example, when the plain text insertion SQL is (7), the column name “disease name”, mapping table name ”from the record 2621B in which the schema name is“ medical information ”and the encrypted main table name is“ patient information ”. MT1 "and hash table name" HT1 "are acquired (step 2730).
 次に、データベースラッパー部212は、第一の実施例における図11のステップ1140と同様に、ステップ2730の結果が存在するか否かを判定する(ステップ2740)。 Next, the database wrapper unit 212 determines whether or not the result of step 2730 exists as in step 1140 of FIG. 11 in the first embodiment (step 2740).
 ステップ2740の結果が存在しない場合(NO)、第一の実施例における図11のステップ1150と同様に、データベースラッパー部212は、平文の挿入SQLの挿入対象の値を、ステップ2720で生成した暗号文の値に置き換えた暗号文の挿入SQLを出力する。例えば、平文のSQLが(7)である場合、以下の暗号文の挿入SQL(8)を出力する(ステップ2750)。
 
 INSERT INTO 医療情報.患者情報 ( 患者番号, 名前, 病名 )
VALUES ( Enc(1000001), Enc(木下), Enc(胃腸炎) )   (8)再掲
 
If the result of step 2740 does not exist (NO), the database wrapper unit 212 generates the value to be inserted in the plaintext insertion SQL in step 2720 as in step 1150 of FIG. 11 in the first embodiment. The ciphertext insertion SQL replaced with the text value is output. For example, when the plaintext SQL is (7), the following ciphertext insertion SQL (8) is output (step 2750).

INSERT INTO Medical information.Patient information (patient number, name, disease name)
VALUES (Enc (1000001), Enc (Kinoshita), Enc (Gastroenteritis)) (8) Reprint
 一方、ステップ2740の結果が存在する場合(YES)、データベースラッパー部212は、ハッシュテーブル362Bと一貫性を保持した挿入を行うために、ハッシュ値生成から秘匿インデックス用挿入SQL変換(ステップ2760~2790)の処理を行い暗号文の挿入SQLを出力する。 On the other hand, when the result of step 2740 exists (YES), the database wrapper unit 212 performs the insertion of the hash value from the hash value generation to the secret index insertion SQL conversion (steps 2760 to 2790) in order to perform the insertion that is consistent with the hash table 362B. ) To output ciphertext insertion SQL.
 まず、データベースラッパー部212は、第一の実施例における図11のステップ1160と同様に、挿入対象の値のうち、ハッシュテーブル362Bに関連するカラムの値をハッシュ値生成部2123に入力し、出力されるハッシュ値を取得する。例えば、平文の挿入SQLが(7)である場合、以下のハッシュ値を(8)取得する(ステップ2760)。
 
  ハッシュ値 = ハッシュ値生成部(胃腸炎) = "0035"  (8)
 
First, the database wrapper unit 212 inputs the column value related to the hash table 362B among the insertion target values to the hash value generation unit 2123 and outputs the same as in step 1160 of FIG. 11 in the first embodiment. Get the hash value to be used. For example, when the plain text insertion SQL is (7), the following hash value (8) is acquired (step 2760).

Hash value = Hash value generator (gastroenteritis) = “0035” (8)
 次に、データベースラッパー部212は、第一の実施例における図11のステップ1170と異なり、ハッシュテーブル362Bを検索するために、ステップ2760で取得したハッシュ値をインデックス用検索クエリ生成部2128に入力し、出力をインデックス用ハッシュテーブル検索クエリとする。例えば、平文のハッシュ値が(8)である場合、以下のハッシュテーブル検索クエリ(9-2)を取得する(ステップ2770)。
 
  インデックス用ハッシュテーブル検索クエリ(0035)
    =インデックス用検索クエリ生成部(暗号鍵、検索用鍵、"0035")  (9-2)
 
Next, unlike the step 1170 of FIG. 11 in the first embodiment, the database wrapper unit 212 inputs the hash value acquired in step 2760 to the index search query generation unit 2128 in order to search the hash table 362B. The output is an index hash table search query. For example, when the hash value of the plaintext is (8), the following hash table search query (9-2) is acquired (step 2770).

Hash table search query for index (0035)
= Index search query generator (encryption key, search key, “0035”) (9-2)
 次に、データベースラッパー部212は、第一の実施例における図11のステップ1180と異なり、ハッシュ値(8)及び鍵管理部2125から取得したID用鍵をインデックス用暗号化部2120に入力し、出力される暗号化ハッシュ値を取得する。例えば、平文のハッシュ値が(8)であり、かつID用鍵が”ID_key_3”である場合、暗号化ハッシュ値は”INEnc(ID_key_3,0035)”となる(ステップ2780)。 Next, unlike step 1180 in FIG. 11 in the first embodiment, the database wrapper unit 212 inputs the hash value (8) and the ID key acquired from the key management unit 2125 to the index encryption unit 2120, Get the output cryptographic hash value. For example, when the plaintext hash value is (8) and the ID key is “ID_key — 3”, the encrypted hash value is “INEc (ID_key — 3,0035)” (step 2780).
 次に、データベースラッパー部212は、第一の実施例における図11のステップ1190と同様に、ハッシュテーブル362Bをインデックス用ハッシュテーブル検索クエリで検索し、検索で一致しない場合は新しいMapIDと暗号化ハッシュ値からなるレコードをハッシュテーブル362Bへ挿入し、ハッシュテーブル検索クエリに一致するレコードのMapIDを取得し、そのMapIDとステップ2720で取得した暗号文のレコードの値と新しいレコードの識別子であるIDとから構成されるレコードを暗号化メインテーブル361Bへ挿入し、最後に新レコードのIDをID暗号化部3125により暗号化した暗号化IDと新MapIDから成るレコードをマッピングテーブル363に挿入する秘匿インデックス用挿入SQL変換を行う。例えば、平文のSQLが(7)である場合、以下の暗号文の挿入SQL(11-2)、(12-2)及び(13-2)を出力する(ステップ2790)。
 
  INSERT INTO ハッシュテーブルHT1( MapID, 暗号化ハッシュ値 )
    SELECT 新MapID,暗号化ハッシュ値"INEnc(ID_key_3, 0035)"
    FROM ハッシュテーブルHT1 WHERE NOT EXIST
    (
SELECT * FROM ハッシュテーブルHT1
     WHERE インデックス用暗号化一致比較部(暗号化ハッシュ値、
インデックス用ハッシュテーブル検索クエリ(0035) )
    ) LIMIT 1; (11-2)
 
  INSERT INTO 暗号化メインテーブル
  ( 患者番号,名前,病名,ID )
  VALUES
(Enc(1000001),Enc(木下), Enc(胃腸炎), 新ID,
   ( SELECT MapID FROM ハッシュテーブルHT1
 WHERE暗号化一致比較部(暗号化ハッシュ値,
インデックス用ハッシュテーブル検索クエリ(0035) )
); (12-2)
 
INSERT INTO マッピングテーブルMT1 ( 暗号化ID, MapID )
VALUES (
 ( SELECT  ID用暗号化部(@ID用鍵, 新ID
FROM ( 
     ( SELECT @ID用鍵:=ID用鍵取得部(インデックス用ハッシュテーブル検索クエリ、
                                暗号化ハッシュ値)
FROM ハッシュテーブルHT1
WHERE インデックス用一致比較部(
インデックス用ハッシュテーブル検索クエリ、暗号化ハッシュ値)
   ) keytemp
     , ( SELECT @新ID:= MAX(ID) FROM 医療情報.病院情報 ) IDtemp
    )
    , ( SELECT MapID FROM ハッシュテーブルHT1
      WHERE インデックス用一致比較部(
        インデックス用ハッシュテーブル検索クエリ、暗号化ハッシュ値)
)
  );  (13-2)
 
Next, the database wrapper unit 212 searches the hash table 362B with an index hash table search query in the same manner as in step 1190 of FIG. 11 in the first embodiment, and if the search does not match, a new MapID and encrypted hash A record consisting of the value is inserted into the hash table 362B, and the MapID of the record that matches the hash table search query is acquired. From the MapID, the value of the ciphertext record acquired in step 2720 and the ID that is the identifier of the new record Insert the record to be configured into the encryption main table 361B, and finally insert the record composed of the encryption ID obtained by encrypting the ID of the new record by the ID encryption unit 3125 and the new Map ID into the mapping table 363. SQL Perform the conversion. For example, when the plaintext SQL is (7), the following ciphertext insertion SQLs (11-2), (12-2), and (13-2) are output (step 2790).

INSERT INTO hash table HT1 (MapID, encrypted hash value)
SELECT New MapID, encrypted hash value "INEnc (ID_key_3, 0035)"
FROM hash table HT1 WHERE NOT EXIST
(
SELECT * FROM hash table HT1
WHERE index encryption match comparison part (encrypted hash value,
Hash table search query for index (0035)
) LIMIT 1; (11-2)

INSERT INTO encryption main table (patient number, name, disease name, ID)
VALUES
(Enc (1000001), Enc (Kinoshita), Enc (Gastroenteritis), New ID,
(SELECT MapID FROM hash table HT1
WHERE encryption match comparison unit (encrypted hash value,
Hash table search query for index (0035)
); (12-2)

INSERT INTO mapping table MT1 (encryption ID, MapID)
VALUES (
(Encryption part for SELECT ID (@ID key, new ID
FROM (
(SELECT @ID key: = ID key acquisition part (index hash table search query,
Cryptographic hash value)
FROM hash table HT1
WHERE index match comparison part (
Index hash table search query, encrypted hash value)
) keytemp
, (SELECT @New ID: = MAX (ID) FROM Medical Information.Hospital Information) IDtemp
)
, (SELECT MapID FROM Hashtable HT1
WHERE index match comparison part (
(Hash table search query for index, encrypted hash value)
)
); (13-2)
 最後に、データベースラッパー部212は、第一の実施例における図11のステップ2795と同様に、ステップ2750又はステップ2790で出力された暗号文の挿入SQLを、データベースインタフェース部213へ送信する。例えば、平文の挿入SQLが(7)である場合、ステップ2740の結果が存在するため、データベースラッパー部212はステップ2790が出力した暗号文の挿入SQL(11-2)、(12-2)及び(13-2)をデータベースインタフェース部213へ送信する(ステップ2795)。以上で、秘匿インデックス挿入クエリ生成処理(図28)を終了する。 Finally, the database wrapper unit 212 transmits the ciphertext insertion SQL output in step 2750 or step 2790 to the database interface unit 213 as in step 2795 of FIG. 11 in the first embodiment. For example, if the plaintext insertion SQL is (7), the result of step 2740 is present, so the database wrapper unit 212 causes the ciphertext insertion SQL (11-2), (12-2) and (13-2) is transmitted to the database interface unit 213 (step 2795). The secret index insertion query generation process (FIG. 28) is thus completed.
 図29は、第二の実施例の秘匿インデックス挿入処理を示すフローチャートである。第二の実施例の秘匿インデックス挿入処理が、第一の実施例の秘匿インデックス挿入処理(図12)と異なる点は、マッピングテーブル363に対する挿入処理が加わることである。秘匿インデックス挿入処理は、データベース制御部311がデータベースインタフェース部213から暗号文の挿入SQLを受信すると、開始する。例えば、秘匿インデックス挿入処理の開始時にデータベース制御部311が受信する暗号文の挿入SQLは、SQL(11-2)、(12-2)及び(13-2)である。 FIG. 29 is a flowchart showing the secret index insertion process of the second embodiment. The secret index insertion process of the second embodiment is different from the secret index insertion process (FIG. 12) of the first embodiment in that an insertion process for the mapping table 363 is added. The secret index insertion process starts when the database control unit 311 receives the ciphertext insertion SQL from the database interface unit 213. For example, the ciphertext insertion SQL received by the database control unit 311 at the start of the secret index insertion processing is SQL (11-2), (12-2), and (13-2).
 まず、データベース制御部311は、暗号文の検索SQLから、検索対象となるハッシュテーブル362Bとインデックス用ハッシュテーブル検索クエリと暗号化ハッシュ値とを特定し、ユーザ定義機能部312のインデックス用一致比較部3122により当該ハッシュテーブル362Bの”暗号化ハッシュ値”のカラムの値と当該インデックス用ハッシュテーブル検索クエリが一致するレコードが存在するか否かを判定する(ステップ2810)。 First, the database control unit 311 specifies the hash table 362B, index hash table search query, and encrypted hash value to be searched from the ciphertext search SQL, and the index matching comparison unit of the user-defined function unit 312. In 3122, it is determined whether there is a record in which the value of the column of “encrypted hash value” in the hash table 362B matches the index hash table search query (step 2810).
 ステップ2810にて一致するレコードがある場合(YES)、データベース制御部311はそのレコードのMapIDカラムの値をMapID_hitとして取得する(ステップ2820)。例えば、挿入SQLが(11-2)である場合、MapID_hitは”10”となる。 If there is a matching record in step 2810 (YES), the database control unit 311 acquires the value of the MapID column of the record as MapID_hit (step 2820). For example, when the insertion SQL is (11-2), MapID_hit is “10”.
 一方、ステップ2810にて一致するレコードがない場合、データベース制御部311は、新しいMapIDを生成してMapID_hitとし、検索SQLから取得した暗号化ハッシュ値と共に、ハッシュテーブル362Bへレコードとして挿入する(ステップ2830)。 On the other hand, if there is no matching record in step 2810, the database control unit 311 generates a new MapID to make MapID_hit, and inserts it into the hash table 362B as a record together with the encrypted hash value acquired from the search SQL (step 2830). ).
 次に、データベース制御部311は、暗号文の挿入SQLを実行し、暗号化された値及びIDから構成されるレコードを暗号化メインテーブル361Bへ挿入する。例えば、暗号文の挿入SQLが(12-2)である場合、データベース制御部311は、患者番号が”Enc(1000001)”、名前が”Enc(木下)”、 病名が”Enc(胃腸炎)”及びIDが”1000001”であるレコードを暗号化メインテーブル361Bへ挿入する(ステップ2840)。 Next, the database control unit 311 executes the ciphertext insertion SQL, and inserts a record composed of the encrypted value and ID into the encrypted main table 361B. For example, when the ciphertext insertion SQL is (12-2), the database control unit 311 determines that the patient number is “Enc (1000001)”, the name is “Enc (Kinoshita)”, and the disease name is “Enc (gastroenteritis)”. "And a record with ID" 1000001 "are inserted into the encrypted main table 361B (step 2840).
 次に、データベース制御部311は、インデックス用ハッシュテーブル検索クエリ及び暗号化ハッシュ値をID用鍵取得部3123へ入力し、出力としてID用鍵を取得する。例えば、暗号化ハッシュ値が(11-2)の”INEnc(ID_key_3,0035)”であったとすると、ID用鍵としてID_key_3を取得する(ステップ2850)。 Next, the database control unit 311 inputs the index hash table search query and the encrypted hash value to the ID key acquisition unit 3123, and acquires the ID key as an output. For example, if the encrypted hash value is “INEnc (ID_key — 3,0035)” of (11-2), ID_key — 3 is acquired as an ID key (step 2850).
 次に、データベース制御部311は、新IDとステップ2850で取得したID用鍵をID暗号化部3125に入力し、出力として暗号化IDを取得する。例えば、新IDが”1000001”である場合、暗号化IDは”IEnc(1000001)”となる(ステップ2860)。 Next, the database control unit 311 inputs the new ID and the ID key acquired in step 2850 to the ID encryption unit 3125, and acquires the encryption ID as an output. For example, when the new ID is “1000001”, the encryption ID is “IEnc (1000001)” (step 2860).
 次に、データベース制御部311は、マッピングテーブル363へ、ステップ2860で取得した暗号化IDとステップ2820又はステップ2830で取得したMapID_hitからなるレコードを挿入する。例えば、挿入SQLが(11-2)、(12-2)及び(13-2)である場合、暗号化ID”IEnc(1000001)”及びMapID_hit”10”からなるレコードをマッピングテーブル363へ挿入する。なお、”MID”カラムの値は、データベース制御部311が通常の自動採番機能にて付与する(ステップ2870)。 Next, the database control unit 311 inserts a record consisting of the encryption ID acquired in step 2860 and the MapID_hit acquired in step 2820 or step 2830 into the mapping table 363. For example, when the insertion SQL is (11-2), (12-2), and (13-2), a record including the encryption ID “IEnc (1000001)” and MapID_hit “10” is inserted into the mapping table 363. . Note that the value of the “MID” column is assigned by the database control unit 311 using a normal automatic numbering function (step 2870).
 最後に、データベース制御部311は、挿入SQLの実行結果をユーザシステム側サーバ3のデータベースインタフェース部213へ送信する(ステップ2880)。以上で、秘匿インデックス挿入処理(図28)を終了する。 Finally, the database control unit 311 transmits the execution result of the insertion SQL to the database interface unit 213 of the user system side server 3 (step 2880). Thus, the secret index insertion process (FIG. 28) is completed.
(2-4)秘匿化データベースの更新に関する処理の流れ
 図30、図14、図31及び図32を用いて、第二の実施例の秘匿化データベースシステム1において、ハッシュテーブル362B及びマッピングテーブル363を用いた更新である秘匿インデックス更新を行う際の、データベースラッパー部212及びデータベース制御部311が行う一連の処理について、主に第一の実施例との違いを説明する。
(2-4) Flow of processing related to update of concealment database In FIG. 30, FIG. 14, FIG. 31 and FIG. 32, in the concealment database system 1 of the second embodiment, the hash table 362B and the mapping table 363 are stored. The difference between the database wrapper unit 212 and the database control unit 311 when performing the secret index update, which is the update used, is mainly different from the first embodiment.
 図30は、第二の実施例のユーザシステム側サーバ3のデータベースラッパー部212が実行する秘匿インデックス更新クエリ生成処理を示すフローチャートである。秘匿インデックス更新クエリ生成処理は、データベースラッパー部212がアプリケーション部211から平文の更新のSQLを受信すると、開始する。例えば、秘匿インデックス更新クエリ生成処理の開始時にデータベースラッパー部212が受信する平文の更新SQLは、第一の実施例と同様に、平文の更新SQL(13)である。
 
  UPDATE 医療情報.患者情報 SET "病名"="狭心症"
WHERE "病名"="糖尿病"  (13)再掲
 
 この更新SQL(13)は、スキーマ名が”医療情報”であり、テーブル名が”患者情報”であるテーブルの”病名”カラムの値が”糖尿病”であるレコードにおいて、”病名”カラムの値を”狭心症”へ更新することを意味する(ステップ2905)。
FIG. 30 is a flowchart illustrating a secret index update query generation process executed by the database wrapper unit 212 of the user system side server 3 according to the second embodiment. The secret index update query generation process starts when the database wrapper unit 212 receives a plaintext update SQL from the application unit 211. For example, the plaintext update SQL received by the database wrapper unit 212 at the start of the secret index update query generation process is the plaintext update SQL (13), as in the first embodiment.

UPDATE Medical Information.Patient Information SET "Disease name" = "Angina"
WHERE "Disease name" = "Diabetes" (13)
This update SQL (13) is the value of the “disease name” column in the record in which the value of the “disease name” column of the table whose schema name is “medical information” and the table name is “patient information” is “diabetes”. Is updated to “angina” (step 2905).
 次に、データベースラッパー部212は、平文の更新SQLから、更新元カラムの値を取り出し、検索クエリ生成部2122を用いて暗号化メインテーブル361Bにおける一致検索に用いる暗号化検索クエリを取得する。具体的には、データベースラッパー部212は、鍵管理部2125から暗号化鍵及び検索用鍵を取得し、それらを検索クエリ生成部2122に入力し、その出力として暗号化検索クエリを得る。例えば、平文の更新SQLが(13)である場合の例としては、(2)と同様に”暗号化検索クエリ(糖尿病)”を得る(ステップ2910)。 Next, the database wrapper unit 212 extracts the value of the update source column from the plaintext update SQL, and uses the search query generation unit 2122 to acquire the encrypted search query used for matching search in the encrypted main table 361B. Specifically, the database wrapper unit 212 acquires an encryption key and a search key from the key management unit 2125, inputs them to the search query generation unit 2122, and obtains an encrypted search query as its output. For example, as an example when the update SQL of the plaintext is (13), “encrypted search query (diabetes)” is obtained as in (2) (step 2910).
 次に、データベースラッパー部212は、秘匿インデックスマップテーブル262から、更新元のカラムの”マッピングテーブル名”及び”ハッシュテーブル名”を取得する。具体的には、データベースラッパー部212は、平文の検索SQLが検索対象とするスキーマ名、暗号化メインテーブル名及び更新元のカラム名の組をキーとして、秘匿インデックスマップテーブル262Bを検索し、スキーマ名、暗号化メインテーブル名及びカラム名が一致するレコードの”マッピングテーブル名”及び”ハッシュテーブル名”を取得する。例えば、平文の検索SQLが(13)である場合、スキーマ名が”医療情報”であり、かつ暗号化メインテーブル名が”患者情報”であり、かつ更新元のカラム名”病名”を含むレコード2621Bから、マッピングテーブル名”MT1”及びハッシュテーブル名”HT1”を取得する(ステップ2915)。 Next, the database wrapper unit 212 acquires “mapping table name” and “hash table name” of the update source column from the secret index map table 262. Specifically, the database wrapper unit 212 searches the secret index map table 262B using the combination of the schema name, the encrypted main table name, and the update source column name that are to be searched by the plaintext search SQL as a key. The “mapping table name” and “hash table name” of the record having the same name, encrypted main table name, and column name are acquired. For example, when the plain text search SQL is (13), the schema name is “medical information”, the encrypted main table name is “patient information”, and the record includes the update source column name “disease name” The mapping table name “MT1” and the hash table name “HT1” are acquired from 2621B (step 2915).
 次に、データベースラッパー部212は、ステップ2915の結果が存在するか否かを判定する(ステップ2920)。 Next, the database wrapper unit 212 determines whether or not the result of step 2915 exists (step 2920).
 ステップ2915の結果が存在しない場合(NO)、第一の実施例における図13のステップ1330と同様に、データベースラッパー部212は、暗号化メインテーブル361Bから更新対象となるレコードのIDのリストである更新対象IDリストを取得するSQLを、データベースインタフェース部213へ送信し、結果として更新対象IDリストを受信する。例えば、平文の更新SQLが(13)である場合、以下のSQL(14)で更新対象IDリストを取得する(ステップ2925)。
 
 SELECT ID FROM 医療情報.患者情報
   WHERE 暗号文一致比較部(病名、暗号化検索クエリ(糖尿病)) (14)再掲
 
If the result of step 2915 does not exist (NO), the database wrapper unit 212 is a list of IDs of records to be updated from the encryption main table 361B, as in step 1330 of FIG. 13 in the first embodiment. SQL for obtaining the update target ID list is transmitted to the database interface unit 213, and as a result, the update target ID list is received. For example, when the plaintext update SQL is (13), the update target ID list is acquired by the following SQL (14) (step 2925).

SELECT ID FROM Medical Information. Patient Information WHERE Ciphertext Match Comparison Unit (Disease Name, Encrypted Search Query (Diabetes)) (14)
 データベースラッパー部212は、第一の実施例における図13のステップ1335と同様に、ステップ2925で得られた更新IDリストから更新対象IDの個数を取得し、更新対象IDの個数分の、更新後の値の暗号文を生成する。例えば、平文の更新SQLが(13)である場合、更新対象IDの数は”3”及び”1000000”の二つであるため、更新後の値の暗号文はEnc(狭心症)及びEnc(狭心症)の二つとなる。確率的暗号化を用いる場合、これらは異なる暗号文となる(ステップ2930)。 Similarly to step 1335 of FIG. 13 in the first embodiment, the database wrapper unit 212 acquires the number of update target IDs from the update ID list obtained in step 2925, and updates the number of update target IDs. Generate ciphertext with the value of. For example, when the update SQL of the plaintext is (13), the number of update target IDs is “3” and “1000000”, so the ciphertext of the updated value is Enc (Angina) and Enc (Angina pectoris). If probabilistic encryption is used, these are different ciphertexts (step 2930).
 次に、データベースラッパー部212は、第一の実施例における図13のステップ1335で得られた二つの更新後の値の暗号文を、それぞれの更新対象IDの示すレコードの値として更新する暗号文の更新SQLを生成する。例えば、平文の更新SQLが(13)である場合、以下の暗号文の更新SQL(15)が出力される(ステップ2935)。
 
UPDATE 医療情報.患者情報
SET "病名"=
        CASE ID
              WHEN 3 THEN Enc(狭心症)
              WHEN 1000000 THEN Enc(狭心症)
        END
  WHERE 暗号文一致比較部(病名、暗号化検索クエリ(糖尿病)) (15)再掲
 
Next, the database wrapper unit 212 updates the ciphertext of the two updated values obtained in step 1335 of FIG. 13 in the first embodiment as the values of the records indicated by the respective update target IDs. The update SQL is generated. For example, when the plaintext update SQL is (13), the following ciphertext update SQL (15) is output (step 2935).

UPDATE Medical information.Patient information
SET "Disease name" =
CASE ID
WHEN 3 THEN Enc
WHEN 1000000 THEN Enc (angina)
END
WHERE Ciphertext match comparison part (disease name, encrypted search query (diabetes)) (15)
 一方、ステップ2915の結果が存在する場合(YES)、データベースラッパー部212は、暗号化メインテーブル361B、ハッシュテーブル362B及びマッピングテーブル363を更新するために、ハッシュ値生成から秘匿インデックス用更新SQL変換(ステップ2940~2970)を行った暗号文の更新SQLを出力する。 On the other hand, when the result of step 2915 exists (YES), the database wrapper unit 212 updates the encryption main table 361B, the hash table 362B, and the mapping table 363 from the hash value generation to the secret index update SQL conversion ( The ciphertext update SQL for which steps 2940 to 2970) have been performed is output.
 まず、データベースラッパー部212は、第一の実施例における図13のステップ1345と同様に、更新後の値をハッシュ値生成部2123に入力し、出力されるハッシュ値を取得する。例えば、平文の更新SQLが(13)である場合、ハッシュ値(16)を取得する(ステップ2940)。
 
  ハッシュ値 = ハッシュ値生成部(狭心症)="0500" (16)再掲
 
First, the database wrapper unit 212 inputs the updated value to the hash value generation unit 2123 and acquires the output hash value, similarly to step 1345 of FIG. 13 in the first embodiment. For example, when the plaintext update SQL is (13), the hash value (16) is acquired (step 2940).

Hash value = Hash value generator (angina) = "0500" (16)
 次に、データベースラッパー部212は、ハッシュテーブル362Bを検索するために、ステップ2945で取得したハッシュ値をインデックス用検索クエリ生成部2128に入力し、出力をインデックス用ハッシュテーブル検索クエリとする。例えば、平文のハッシュ値が(16)である場合、以下のハッシュテーブル検索クエリ(17-2)を取得する(ステップ2945)。
 
 インデックス用ハッシュテーブル検索クエリ(0500)
  =インデックス用検索クエリ生成部(暗号鍵、検索用鍵、"0500") (17-2)
 
Next, in order to search the hash table 362B, the database wrapper unit 212 inputs the hash value acquired in step 2945 to the index search query generation unit 2128, and uses the output as the index hash table search query. For example, if the hash value of the plaintext is (16), the following hash table search query (17-2) is acquired (step 2945).

Hash table search query for index (0500)
= Index search query generator (encryption key, search key, “0500”) (17-2)
 次に、データベースラッパー部212は、ステップ2940で取得したハッシュ値及び鍵管理部2125から取得したID用鍵をインデックス用暗号化部2120へ入力し、出力としてハッシュテーブル362Bに挿入するための暗号化ハッシュ値を取得する。例えば、平文のハッシュ値(16)が”0500”であり、ID用鍵が”ID_key_4”である場合、暗号化ハッシュ値は”INEnc(ID_key_4,0500)”となる(ステップ2950)。 Next, the database wrapper unit 212 inputs the hash value acquired in step 2940 and the ID key acquired from the key management unit 2125 to the index encryption unit 2120 and performs encryption for insertion into the hash table 362B as output. Get hash value. For example, when the plaintext hash value (16) is “0500” and the ID key is “ID_key — 4”, the encrypted hash value is “INEc (ID_key — 4,0500)” (step 2950).
 次に、データベースラッパー部212は、ハッシュテーブル362B及びマッピングテーブル363を用いて更新対象となるレコード群のIDカラムの値のテーブルを取得する秘匿インデックス用更新対象IDテーブル取得SQLを実行し、更新対象IDテーブルを得る。具体的には、データベースラッパー部212は、ステップ2910で取得した更新元の値の暗号化検索クエリ、ステップ2915で取得した更新元のカラムに関連するマッピングテーブル名とハッシュテーブル名、更新元の値のインデックス用ハッシュテーブル検索クエリを入力とし、ハッシュテーブル362Bとマッピングテーブル363を検索した上で暗号化メインテーブル361Bの検索範囲を限定し、更新対象IDテーブルを取得するSQLを実行し、その結果を更新対象IDテーブルとして出力する。例えば、平文の更新SQLが(13)である場合、暗号文の秘匿インデックス用更新対象IDテーブル取得SQL(18-2)を生成し、データベースインタフェース部213経由でデータベース制御部311へ送信し、その実行結果を更新対象IDテーブルとして取得する(ステップ2955)。
 
  SELECT ID FROM 暗号化メインテーブル361BX
  JOIN
  ( SELECT ID復号化部(@ID用鍵、暗号化ID) AS TempID 
FROM マッピングテーブルMT1 JOIN
( SELECT MapID, @ID用鍵:=ID用鍵取得部(
              インデックス用ハッシュテーブル検索クエリ、暗号化ハッシュ値)
 FROM ハッシュテーブルHT1
 WHERE インデックス用一致比較部(
              インデックス用ハッシュテーブル検索クエリ、暗号化ハッシュ値)
) HitHash ON ( MT1.MapID = HitHash.MapID )
  ) MapResult 
  ON X.ID= MapResult.TempID
  WHERE インデックス用一致比較部(病名,暗号化検索クエリ(糖尿病))(18-2)
 
Next, the database wrapper unit 212 executes a secret index update target ID table acquisition SQL for acquiring a table of ID column values of the record group to be updated using the hash table 362B and the mapping table 363, and performs update target Get the ID table. Specifically, the database wrapper unit 212 uses the encrypted search query for the update source value acquired in step 2910, the mapping table name and hash table name related to the update source column acquired in step 2915, and the update source value. The index hash table search query is input, the hash table 362B and the mapping table 363 are searched, the search range of the encryption main table 361B is limited, and the SQL for obtaining the update target ID table is executed. Output as update target ID table. For example, when the plaintext update SQL is (13), the ciphertext secret index update target ID table acquisition SQL (18-2) is generated and transmitted to the database control unit 311 via the database interface unit 213. The execution result is acquired as an update target ID table (step 2955).

SELECT ID FROM encryption main table 361BX
JOIN
(SELECT ID decryption part (@ID key, encryption ID) AS TempID
FROM mapping table MT1 JOIN
(SELECT MapID, @ID key: = ID key acquisition part (
Index hash table search query, encrypted hash value)
FROM hash table HT1
WHERE index match comparison part (
Index hash table search query, encrypted hash value)
) HitHash ON (MT1.MapID = HitHash.MapID)
) MapResult
ON X.ID = MapResult.TempID
WHERE index match comparison part (disease name, encrypted search query (diabetes)) (18-2)
 次に、データベースラッパー部212は、ステップ2955で得られた更新対象IDテーブルから更新対象IDの個数を取得し、その個数分の、更新後の値の暗号文リストを生成する。例えば、平文の更新SQLが(13)である場合、第一の実施例における図13のステップ1335と同様に、更新対象IDの数は”3”及び”1000000”の二つであるため、更新後の値の暗号文リストはEnc(狭心症)及びEnc(狭心症)の二つとなる。確率的暗号化を用いる場合、これらは異なる暗号文となる(ステップ2960)。 Next, the database wrapper unit 212 acquires the number of update target IDs from the update target ID table obtained in step 2955, and generates an updated value ciphertext list for that number. For example, when the plaintext update SQL is (13), the number of update target IDs is two, “3” and “1000000”, as in step 1335 of FIG. 13 in the first embodiment. The ciphertext lists of the latter values are Enc (angina) and Enc (angina). If probabilistic encryption is used, these are different ciphertexts (step 2960).
 次に、データベースラッパー部212は、平文の更新SQL、ステップ2910、ステップ2915、ステップ2945、ステップ2950、ステップ2955及びステップ2960で取得した各種情報を入力とし、秘匿インデックス用の暗号文の更新SQLを出力する。具体的には、第一に、ハッシュテーブル362Bを更新後の値のインデックス用ハッシュテーブル検索クエリでインデックス用一致検索をし、一致しない場合、更新後の値の暗号化ハッシュ値と新しいMapIDの値から成るレコードをハッシュテーブル362Bへ挿入するSQLを生成する。第二に、ハッシュテーブル362Bから更新後の値のMapIDを取得するSQLを生成する。第三に、暗号化メインテーブル361Bにおいて、更新対象IDをもつレコードごとに、更新後の値の暗号文を置き換える更新SQLを生成する。第四に、マッピングテーブル363において、更新対象IDを持つレコードの”MapID”カラムの値を第二のSQLで得られたMapIDに置き換えるSQLを生成する。例えば、平文の更新SQLが(13)である場合、第一のSQLは以下の更新SQL(19-2)となり、第二のSQLは以下の更新SQL(20-2)となり、第三のSQLは更新SQL(21-2)となり、第四のSQLは以下の更新SQL(22-2)及び(23-2)となる。これら四つのSQL文からなる暗号文の更新SQLを出力する(ステップ2965)。
 
  INSERT INTO ハッシュテーブルHT1( MapID, 暗号化ハッシュ値 )
    SELECT 新MapID,暗号化ハッシュ値"INEnc(ID_key_4, 0500)"
    FROM ハッシュテーブルHT1 WHERE NOT EXIST
    (
SELECT * FROM ハッシュテーブルHT1
     WHERE インデックス用一致比較部(
インデックス用ハッシュテーブル検索クエリ、暗号化ハッシュ値)
    ) LIMIT 1; (19-2)
 
  SELECT MapID FROM ハッシュテーブルHT1
  WHERE インデックス用一致比較部(
インデックス用ハッシュテーブル検索クエリ、暗号化ハッシュ値)) (20-2)
 
  UPDATE 暗号化メインテーブルX  JOIN 更新対象IDテーブルY
ON  X.ID = Y.ID
SET  X.病名 =
    CASE ID
      WHEN  3  THEN  Enc(狭心症)
      WHEN 1000000 THEN  Enc(狭心症)
    END                      (21-2)
 
  DELETE マッピングテーブルMT1 FROM MT1 JOIN
  ( SELECT MID FROM UpID JOIN
( SELECT MID, ID復号化部(@ID用鍵, 暗号化ID) AS TempID
FROM MT1
JOIN
( SELECT MapID,@ID用鍵:=ID用鍵取得部(
インデックス用ハッシュテーブル検索クエリ、暗号化ハッシュ値 )
     FROM HT1
     WHERE インデックス用一致比較部(
                  インデックス用ハッシューテーブル検索クエリ、暗号化ハッシュ値

    ) HitHash
    ON MT1.MapID=HitHash.MapID
   ) Temp
   ON UpID.ID=Temp.TempID
  ) MapResult
  ON MT1.MID = MapResult.MID; (22-2)
 
  INSERT INTO MT1 ( 暗号化ID, MapID )
  SELECT ID用暗号化部(@ID用鍵、ID ) AS EncID, MapID
  FROM UpID JOIN
  ( SELECT MapID, @ID用鍵:=ID用鍵取得部(
                インデックス用ハッシュテーブル検索クエリ,暗号化ハッシュ値)
   FROM ハッシュテーブルHT1
   WHERE インデックス用一致検索部(
インデックス用ハッシュテーブル検索クエリ,暗号化ハッシュ値)
  ) temp ;     (23-2)
 
Next, the database wrapper unit 212 receives plaintext update SQL, various information acquired in Step 2910, Step 2915, Step 2945, Step 2950, Step 2955, and Step 2960 as input, and updates the ciphertext update SQL for the secret index. Output. Specifically, first, an index match search is performed on the hash table 362B with an index hash table search query of the updated value, and if the hash table 362B does not match, the encrypted hash value of the updated value and the new MapID value The SQL for inserting the record consisting of the above into the hash table 362B is generated. Second, SQL for acquiring the MapID of the updated value is generated from the hash table 362B. Thirdly, in the encryption main table 361B, for each record having the update target ID, an update SQL for replacing the ciphertext of the updated value is generated. Fourth, in the mapping table 363, an SQL is generated that replaces the value of the “MapID” column of the record having the update target ID with the MapID obtained in the second SQL. For example, when the plaintext update SQL is (13), the first SQL is the following update SQL (19-2), the second SQL is the following update SQL (20-2), and the third SQL is Is the update SQL (21-2), and the fourth SQL is the following update SQL (22-2) and (23-2). A ciphertext update SQL composed of these four SQL texts is output (step 2965).

INSERT INTO hash table HT1 (MapID, encrypted hash value)
SELECT New MapID, encrypted hash value "INEnc (ID_key_4, 0500)"
FROM hash table HT1 WHERE NOT EXIST
(
SELECT * FROM hash table HT1
WHERE index match comparison part (
Index hash table search query, encrypted hash value)
) LIMIT 1; (19-2)

SELECT MapID FROM hash table HT1
WHERE index match comparison part (
Index hash table search query, encrypted hash value)) (20-2)

UPDATE Encryption main table X JOIN Update target ID table Y
ON X.ID = Y.ID
SET X. Disease name =
CASE ID
WHEN 3 THEN Enc
WHEN 1000000 THEN Enc (angina)
END (21-2)

DELETE Mapping table MT1 FROM MT1 JOIN
(SELECT MID FROM UpID JOIN
(SELECT MID, ID decryption section (@ID key, encryption ID) AS TempID
FROM MT1
JOIN
(SELECT MapID, @ ID key: = ID key acquisition part (
(Hash table search query for index, encrypted hash value)
FROM HT1
WHERE index match comparison part (
Index hash table search query, cryptographic hash value)
) HitHash
ON MT1.MapID = HitHash.MapID
) Temp
ON UpID.ID = Temp.TempID
) MapResult
ON MT1.MID = MapResult.MID; (22-2)

INSERT INTO MT1 (encryption ID, MapID)
SELECT ID encryption part (@ID key, ID) AS EncID, MapID
FROM UpID JOIN
(SELECT MapID, @ID key: = ID key acquisition part (
Index hash table search query, encrypted hash value)
FROM hash table HT1
WHERE index match search part (
Index hash table search query, encrypted hash value)
temp; (23-2)
 最後に、データベースラッパー部212は、ステップ2935又はステップ2965で出力された暗号文の更新SQLを、データベースインタフェース部213へ送信する。平文の更新SQLが(13)である場合、ステップ2915の結果が存在するため、データベースラッパー部212はステップが出力した暗号化されたSQL文(19-2)、(20-2)、(21-2)、(22-2)及び(23-2)をデータベースインタフェース部213へ送信する(ステップ2970)。以上で、データベースラッパー部212は、秘匿インデックス更新クエリ生成処理(図30)を終了する。 Finally, the database wrapper unit 212 transmits the ciphertext update SQL output in step 2935 or step 2965 to the database interface unit 213. When the plaintext update SQL is (13), the result of step 2915 exists, so the database wrapper unit 212 outputs the encrypted SQL statements (19-2), (20-2), (21) output by the step. -2), (22-2) and (23-2) are transmitted to the database interface unit 213 (step 2970). As described above, the database wrapper unit 212 ends the secret index update query generation process (FIG. 30).
 図14は、クラウドシステム側サーバ4において、データベース制御部311が実行する更新対象IDリスト取得処理の流れを示しており、第二の実施例でも、データベース制御部311は図14と同様の処理を行う。更新対象IDリスト取得処理は、データベース制御部311がデータベースインタフェース部213から暗号文の検索SQLを受信すると、開始する。まず、更新対象カラムの値が暗号化検索クエリと一致するレコードのIDを、暗号化メインテーブル361Bからすべて取得する(ステップ1410)。最後に、取得結果をデータベースインタフェース部213へ送信し(ステップ1420)、図14の処理を終了する。例えば、暗号文の検索SQLが(18-2)である場合、更新対象IDリストの要素は”3”及び”1000000”となる。 FIG. 14 shows the flow of the update target ID list acquisition process executed by the database control unit 311 in the cloud system side server 4. In the second embodiment, the database control unit 311 performs the same process as in FIG. Do. The update target ID list acquisition process starts when the database control unit 311 receives the ciphertext search SQL from the database interface unit 213. First, all IDs of records whose update target column values match the encrypted search query are acquired from the encrypted main table 361B (step 1410). Finally, the acquisition result is transmitted to the database interface unit 213 (step 1420), and the process of FIG. For example, when the ciphertext search SQL is (18-2), the elements of the update target ID list are “3” and “1000000”.
 図31は、第二の実施例のクラウドシステム側サーバ4において、データベース制御部311が実行する秘匿インデックス用更新対象IDテーブル取得処理を示すフローチャートである。秘匿インデックス用更新対象IDテーブル取得処理は、データベース制御部311がデータベースインタフェース部213から暗号文の検索SQLを受信すると、開始する。 FIG. 31 is a flowchart showing a secret index update target ID table acquisition process executed by the database control unit 311 in the cloud system side server 4 of the second embodiment. The secret index update target ID table acquisition process starts when the database control unit 311 receives the ciphertext search SQL from the database interface unit 213.
 まず、データベース制御部311は、ハッシュテーブル362Bから、インデックス用ハッシュテーブル検索クエリに一致するレコードのMapIDを取得する(ステップ3010)。次に、データベース制御部311は、マッピングテーブル363から、ステップ3010で取得したMapIDと一致するMapIDを持つレコード群HashResultを取得する(ステップ3020)。次に、データベース制御部311は、ステップ3010で一致したハッシュテーブル362Bのレコードの暗号化ハッシュ値と、インデックス用アッシュテーブル検索クエリをID用鍵取得部3123に入力し、出力としてID用鍵を取得し、取得したID用鍵及びHashResultの暗号化IDをID復号化部3124に入力し、出力として得たID群をIDResultとする(3030)。 First, the database control unit 311 acquires the MapID of a record that matches the index hash table search query from the hash table 362B (step 3010). Next, the database control unit 311 acquires a record group HashResult having a MapID that matches the MapID acquired in Step 3010 from the mapping table 363 (Step 3020). Next, the database control unit 311 inputs the encrypted hash value of the record of the hash table 362B matched in step 3010 and the index ash table search query to the ID key acquisition unit 3123, and acquires the ID key as an output. Then, the acquired ID key and HashResult encryption ID are input to the ID decryption unit 3124, and the ID group obtained as an output is defined as IDResult (3030).
 次に、データベース制御部311は、暗号化メインテーブル361Bから、ステップ3030で取得したIDResultが含むID群に含まれるIDを持ち、かつ更新元カラムである”病名”カラムの値が暗号化検索クエリと一致するレコードのIDをすべて取得し、更新対象IDテーブルとして格納する(ステップ3040)。最後に、データベース制御部311は、取得結果をデータベースインタフェース部213へ送信し(3050)、秘匿インデックス用更新対象IDテーブル取得処理(図31)を終了する。例えば、暗号文の検索SQLが(18-2)である場合、更新対象IDテーブルはIDカラムの値として”3”及び”1000000”を格納したテーブルとなる。 Next, the database control unit 311 has the ID included in the ID group included in the ID Result acquired in Step 3030 from the encryption main table 361B, and the value of the “disease name” column that is the update source column is the encrypted search query. Are acquired and stored as an update target ID table (step 3040). Finally, the database control unit 311 transmits the acquisition result to the database interface unit 213 (3050), and ends the confidential index update target ID table acquisition process (FIG. 31). For example, when the ciphertext search SQL is (18-2), the update target ID table is a table storing “3” and “1000000” as ID column values.
 図32は、第二の実施例のクラウドシステム側サーバ4において、データベース制御部311が実行する秘匿インデックス更新処理を示すフローチャートである。秘匿インデックス更新処理は、データベース制御部311がデータベースインタフェース部213から暗号文の更新SQLを受信すると、開始する。例えば、秘匿インデックス更新処理の開始時にデータベース制御部311が受信する暗号文の更新SQLは、SQL(19-2)、(20-2)、(21-2)、(22-2)及び(23-2)である。 FIG. 32 is a flowchart showing a secret index update process executed by the database control unit 311 in the cloud system side server 4 of the second embodiment. The secret index update process starts when the database control unit 311 receives the ciphertext update SQL from the database interface unit 213. For example, the update SQL of the ciphertext received by the database control unit 311 at the start of the secret index update process is SQL (19-2), (20-2), (21-2), (22-2), and (23 -2).
 まず、データベース制御部311は、暗号文の更新SQLの第一のSQLである(19-2)から、更新対象となるハッシュテーブル362B及びインデックス用ハッシュテーブル検索クエリを取得し、ユーザ定義機能部312のインデックス用一致比較部3122により当該ハッシュテーブルの”暗号化ハッシュ値”カラムの値と当該インデックス用ハッシュテーブル検索クエリが一致するレコードを検索する(ステップ3110)。 First, the database control unit 311 acquires the hash table 362B and index hash table search query to be updated from the first SQL of the ciphertext update SQL (19-2), and the user definition function unit 312 The index match comparison unit 3122 searches for a record in which the value of the “encrypted hash value” column of the hash table matches the index hash table search query (step 3110).
 ステップ3110の結果が存在する場合(YES)、データベース制御部311は、一致したレコードからMapIDを取得し、取得したMapIDをMapID_Newとする(ステップ3120)。 If the result of step 3110 exists (YES), the database control unit 311 acquires MapID from the matched record, and sets the acquired MapID as MapID_New (step 3120).
 一方、ステップ3110の結果が存在しない場合、データベース制御部311は、新しいMapIDを生成して、生成したMapIDをMapID_newとし、暗号化ハッシュ値”INEnc(ID_key_4,0500)”と共にハッシュテーブル362Bへ挿入する(ステップ3130)。 On the other hand, if the result of step 3110 does not exist, the database control unit 311 generates a new MapID, sets the generated MapID to MapID_new, and inserts it into the hash table 362B together with the encrypted hash value “INEnc (ID_key — 4,0500)”. (Step 3130).
 次に、データベース制御部311は、暗号化メインテーブル361Bのうち、更新対象IDを持つレコードについて、当該レコードの更新対象カラムの値を更新し、さらに、当該レコードのIDと一致する暗号化IDを持つマッピングテーブル363のレコードの”MapID”カラムの値をMapID_Newとする(ステップ3140)。 Next, the database control unit 311 updates the value of the update target column of the record for the record having the update target ID in the encryption main table 361B, and further selects an encryption ID that matches the ID of the record. The value in the “MapID” column of the record of the mapping table 363 is MapID_New (step 3140).
 次に、データベース制御部311は、ハッシュテーブル362Bから、マッピングテーブル363の”MapID”カラムに存在しないMapIDを持つレコードを削除する(ステップ3150)。 Next, the database control unit 311 deletes the record having the MapID that does not exist in the “MapID” column of the mapping table 363 from the hash table 362B (Step 3150).
 最後に、データベース制御部311は、更新結果をデータベースインタフェース部213へ送信する(3160)。以上で、秘匿インデックス更新処理(図32)を終了する。 Finally, the database control unit 311 transmits the update result to the database interface unit 213 (3160). Thus, the secret index update process (FIG. 32) is completed.
 (2-5)秘匿化データベースの削除に関する処理の流れ
 図33及び図34を用いて、第二の実施例の秘匿化データベースシステム1において、ハッシュテーブル362B及びマッピングテーブル363を用いた削除である秘匿インデックス削除を行う際の、データベースラッパー部212及びデータベース制御部311が行う一連の処理の流れを示す。
(2-5) Process Flow Regarding Deletion of Concealment Database Using FIG. 33 and FIG. 34, concealment that is deletion using the hash table 362B and the mapping table 363 in the concealment database system 1 of the second embodiment. A flow of a series of processes performed by the database wrapper unit 212 and the database control unit 311 when deleting an index is shown.
 図33は、第二の実施例のユーザシステム側サーバ3において、データベースラッパー部212が実行する秘匿インデックス削除クエリ生成処理を示すフローチャートである。秘匿インデックス削除クエリ生成処理は、データベースラッパー部212がアプリケーション部211から平文の削除のSQLを受信すると、開始する。例えば、秘匿インデックス削除クエリ生成処理の開始時にデータベースラッパー部212が受信する平文の削除のSQLは、以下のSQL(22)である。この削除SQL(22)は、スキーマ名が”医療情報”であり、テーブル名が”患者情報”であるテーブルから、”病名”カラムの値が”糖尿病”であるレコードをすべて削除することを意味する(ステップ3210)。
 
DELETE FROM 医療情報.患者情報 WHERE 病名=糖尿病 (22)
 
FIG. 33 is a flowchart showing a secret index deletion query generation process executed by the database wrapper unit 212 in the user system side server 3 of the second embodiment. The secret index deletion query generation process starts when the database wrapper unit 212 receives a plaintext deletion SQL from the application unit 211. For example, the plaintext deletion SQL received by the database wrapper unit 212 at the start of the secret index deletion query generation process is the following SQL (22). This deletion SQL (22) means that all records having a “disease name” column value of “diabetes” are deleted from a table whose schema name is “medical information” and whose table name is “patient information”. (Step 3210).

DELETE FROM Medical Information. Patient Information WHERE Disease Name = Diabetes (22)
 次に、データベースラッパー部212は、平文の削除SQLから、削除条件の対象カラムの値を取り出し、鍵管理部2125から暗号化鍵及び検索用鍵を取得し、それらを検索クエリ生成部2122に入力し、その出力として暗号化検索クエリを得る。例えば、平文のSQLが(21)である場合、暗号化検索クエリは以下の実行式(2)である(ステップ3220)。
 
暗号化検索クエリ(糖尿病) = 検索クエリ生成部(暗号化鍵、検索用鍵、"糖尿病") (2)
 
Next, the database wrapper unit 212 extracts the value of the target column of the deletion condition from the plaintext deletion SQL, acquires the encryption key and the search key from the key management unit 2125, and inputs them to the search query generation unit 2122. And an encrypted search query is obtained as its output. For example, when the plaintext SQL is (21), the encrypted search query is the following execution expression (2) (step 3220).

Encrypted search query (diabetes) = search query generator (encryption key, search key, "diabetes") (2)
 次に、データベースラッパー部212は、秘匿インデックスマップテーブル262Bから、検索対象カラムの”マッピングテーブル名”及び”ハッシュテーブル名”を取得する。具体的には、データベースラッパー部212は、平文の削除SQLが削除条件の対象とするスキーマ名、暗号化メインテーブル名及びカラム名の組をキーとして、秘匿インデックスマップテーブル262Bを検索し、スキーマ名、暗号化メインテーブル名及びカラム名が一致するレコードの”マッピングテーブル名”及び”ハッシュテーブル名”を取得する。例えば、平文の検索SQLが(22)である場合、スキーマ名が”医療情報”であり、かつ暗号化メインテーブル名が”患者情報”であり、かつカラム名が”病名”であるレコード2621から、マッピングテーブル名”MT1”及びハッシュテーブル名”HT1”を取得する(ステップ3230)。 Next, the database wrapper unit 212 acquires “mapping table name” and “hash table name” of the search target column from the secret index map table 262B. Specifically, the database wrapper unit 212 searches the secret index map table 262B using the combination of the schema name, encryption main table name, and column name that is the object of the deletion condition in the plaintext deletion SQL as a schema name. Then, the “mapping table name” and “hash table name” of the record whose encrypted main table name and column name match are acquired. For example, when the plain text search SQL is (22), from the record 2621 where the schema name is “medical information”, the encrypted main table name is “patient information”, and the column name is “disease name”. The mapping table name “MT1” and the hash table name “HT1” are acquired (step 3230).
 次に、データベースラッパー部212は、ステップ3230の結果が存在するか否かを判定する(ステップ3240)。 Next, the database wrapper unit 212 determines whether or not the result of step 3230 exists (step 3240).
 ステップ3240の結果が存在しない場合(NO)、データベースラッパー部212は、ハッシュテーブル362Bを用いない削除SQL変換の処理を行う。具体的には、データベースラッパー部212は、平文のSQLの削除条件の対象カラムの値を、ステップ3220で生成した暗号化検索クエリに置き換え、さらに、WHERE句の一致比較文を、ユーザ定義機能部312の暗号文一致比較部3121を呼び出す形式に置き換えた、暗号文の削除SQLを出力する。例えば、平文のSQLが(22)であり、暗号化検索クエリが(2)である場合、暗号文の削除SQLは以下の暗号文のSQL(23)である(ステップ3250)。
 
DELETE  FROM 医療情報.患者情報 
WHERE 暗号文一致比較部(病名、暗号化検索クエリ(糖尿病)) (23)
 
When the result of step 3240 does not exist (NO), the database wrapper unit 212 performs a deletion SQL conversion process that does not use the hash table 362B. Specifically, the database wrapper unit 212 replaces the value of the target column of the plaintext SQL deletion condition with the encrypted search query generated in step 3220, and further converts the match comparison sentence of the WHERE clause to the user-defined function unit. The ciphertext deletion SQL replaced with the format for calling the ciphertext match comparison unit 3121 of 312 is output. For example, when the plaintext SQL is (22) and the encrypted search query is (2), the ciphertext deletion SQL is the following ciphertext SQL (23) (step 3250).

DELETE FROM Medical information.Patient information
WHERE Ciphertext match comparison unit (disease name, encrypted search query (diabetes)) (23)
 一方、ステップ3230の結果が存在する場合(YES)、データベースラッパー部212は、ハッシュテーブル362Bを用いた削除を行うために、ハッシュ値生成から秘匿インデックス用削除SQL変換(ステップ3260~3280)の処理を行った暗号文の削除SQLを出力する。 On the other hand, if the result of step 3230 exists (YES), the database wrapper unit 212 performs processing from hash value generation to secret index deletion SQL conversion (steps 3260 to 3280) in order to perform deletion using the hash table 362B. The deletion SQL of the ciphertext that has been performed is output.
 まず、データベースラッパー部212は、削除条件の対象カラムの値をハッシュ値生成部2123に入力し、出力されるハッシュ値を取得する。例えば、平文の削除SQLが(22)である場合、ハッシュ値(4)を取得する(ステップ3260)。
 
ハッシュ値 = ハッシュ値生成部(糖尿病)="1012" (4)
 
First, the database wrapper unit 212 inputs the value of the target column of the deletion condition to the hash value generation unit 2123 and acquires the output hash value. For example, when the plaintext deletion SQL is (22), the hash value (4) is acquired (step 3260).

Hash value = Hash value generator (diabetes) = "1012" (4)
 次に、データベースラッパー部212は、ハッシュテーブル362Bを検索するために、ステップ3260で取得したハッシュ値をインデックス用検索クエリ生成部2128に入力し、出力をインデックス用ハッシュテーブル検索クエリとする。例えば、平文のハッシュ値が(4)である場合、以下のインデックス用ハッシュテーブル検索クエリ(5-2)を取得する(ステップ3770)。
 
インデックス用ハッシュテーブル検索クエリ(1012)=インデックス用検索クエリ生成部(暗号鍵、検索用鍵、"1012") (5-2)
 
Next, in order to search the hash table 362B, the database wrapper unit 212 inputs the hash value acquired in step 3260 to the index search query generation unit 2128, and uses the output as an index hash table search query. For example, if the hash value of the plaintext is (4), the following index hash table search query (5-2) is acquired (step 3770).

Index hash table search query (1012) = index search query generation unit (encryption key, search key, “1012”) (5-2)
 次に、データベースラッパー部212は、秘匿インデックス用SQL変換部2127により、まずハッシュテーブル362Bを検索して検索範囲を限定した上で、暗号化メインテーブル361Bからの削除を実行するためのSQLを生成する秘匿インデックス用検索SQL変換を行う。具体的には、ステップ3220で得た暗号化検索クエリと、ステップ3230で得たマッピングテーブル名及びハッシュテーブル名と、ステップ3770で得たインデックス用ハッシュテーブル検索クエリを入力とし、ハッシュテーブル362Bをインデックス用ハッシュテーブル検索クエリで検索して該当したレコードの”MapID”カラムの値を取得し、その値と等しい”MapID”カラムの値を持つマッピングテーブル363のレコードについて、暗号化IDを復号化してIDを取得し、そのIDを持つ暗号化メインテーブル361Bのレコードから、暗号化検索クエリと一致する値を持つレコードをユーザ定義機能部312の暗号文一致比較部3121を用いて判定し、一致したレコードを暗号化メインテーブル361Bから削除するSQLを生成する。さらに、ハッシュテーブル362Bから、マッピングテーブル363のマップIDカラム”MapID”に存在しないMapIDを含むレコードを削除するSQLを生成する。例えば、平文の削除SQLが(22)である場合、三つのSQL文からなる暗号文の削除SQL(24-2)(25-2)及び(26-2)を出力する(ステップ3280)。
 
  CREATE TABLE UpID ( ID INT, INDEX(ID )
  SELECT ID FROM 暗号化メインテーブル X JOIN
  ( SELECT  ID用復号化部(@ID用鍵、暗号化ID) AS TempID FROM MT1 JOIN
   ( SELECT MapID, @ID用鍵:=ID用鍵取得部(
        インデックス用ハッシュテーブル検索クエリ、暗号化ハッシュ値)
    FROM HT1 WHERE インデックス用一致比較部(
        インデックス用ハッシュテーブル検索クエリ、暗号化ハッシュ値)
   ) HitHash
   ON MT1.MapID = HitHash.MapID
  ) MapResult
  ON X.ID = MapResult.TempID
  WHERE 暗号化一致比較部(暗号化検索クエリ、病名);    (24-2)
 
  DELETE 暗号化メインテーブルX FROM 暗号化メインテーブル
JOIN UpID ON X.ID = UpID.ID ;             (25-2)
 
DELETE MT1 FROM MT1 JOIN
( SELECT MID FROM UpID JOIN
 ( SELECT MID, ID用復号化部(@ID用鍵、暗号化ID) AS TempID
  FROM MT1 JOIN
  ( SELECT MapID, @ID用鍵:=ID用鍵取得部(
                       インデックス用ハッシュテーブル検索クエリ、暗号化ハッシュ値)
   FROM HT1 WHERE インデックス用一致比較部(
インデックス用ハッシュテーブル検索クエリ、暗号化ハッシュ値)
    ) HitHash ON MT1.MapID = temp.TempID
  ) MapResult ON MT1.MID = MapResult.MID;  (26-2)
 
Next, the database wrapper unit 212 uses the secret index SQL conversion unit 2127 to search the hash table 362B to limit the search range, and then generate an SQL for executing deletion from the encrypted main table 361B. The search SQL conversion for the secret index is performed. Specifically, the encrypted search query obtained in step 3220, the mapping table name and hash table name obtained in step 3230, and the index hash table search query obtained in step 3770 are input, and hash table 362B is indexed. The value of the “MapID” column of the corresponding record is obtained by searching with the hash table search query for the mapping, and the ID of the mapping table 363 having the value of the “MapID” column equal to that value is decrypted to obtain the ID , And a record having a value that matches the encrypted search query is determined from the records of the encrypted main table 361B having the ID by using the ciphertext match comparison unit 3121 of the user definition function unit 312. Is deleted from the encryption main table 361B. To generate the SQL that. Furthermore, an SQL for deleting a record including a MapID that does not exist in the map ID column “MapID” of the mapping table 363 is generated from the hash table 362B. For example, if the plaintext deletion SQL is (22), ciphertext deletion SQLs (24-2) (25-2) and (26-2) consisting of three SQL texts are output (step 3280).

CREATE TABLE UpID (ID INT, INDEX (ID)
SELECT ID FROM encryption main table X JOIN
(Decryption part for SELECT ID (@ID key, encryption ID) AS TempID FROM MT1 JOIN
(SELECT MapID, @ID key: = ID key acquisition part (
Index hash table search query, encrypted hash value)
FROM HT1 WHERE Index match comparison part (
Index hash table search query, encrypted hash value)
) HitHash
ON MT1.MapID = HitHash.MapID
) MapResult
ON X.ID = MapResult.TempID
WHERE encrypted match comparison unit (encrypted search query, disease name); (24-2)

DELETE Encryption main table X FROM Encryption main table
JOIN UpID ON X.ID = UpID.ID; (25-2)

DELETE MT1 FROM MT1 JOIN
(SELECT MID FROM UpID JOIN
(SELECT MID, ID decryption part (@ID key, encryption ID) AS TempID
FROM MT1 JOIN
(SELECT MapID, @ID key: = ID key acquisition part (
Index hash table search query, encrypted hash value)
FROM HT1 WHERE Index match comparison part (
Index hash table search query, encrypted hash value)
) HitHash ON MT1.MapID = temp.TempID
) MapResult ON MT1.MID = MapResult.MID; (26-2)
 最後に、データベースラッパー部212は、ステップ3250又はステップ3280で出力された暗号文の削除SQLを、データベースインタフェース部213へ送信する。平文の削除SQLが(22)である場合、ステップ3240の結果が存在するため、データベースラッパー部212はステップ3280が出力した暗号文の検索SQL(24-2)、(25-2)及び(26-2)をデータベースインタフェース部213へ送信する(ステップ3290)。以上で、データベースラッパー部212は、秘匿インデックス削除クエリ生成処理(図32)を終了する。 Finally, the database wrapper unit 212 transmits the ciphertext deletion SQL output in step 3250 or step 3280 to the database interface unit 213. If the plaintext deletion SQL is (22), the result of step 3240 exists, so the database wrapper unit 212 causes the ciphertext search SQL (24-2), (25-2), and (26) output by step 3280 to exist. -2) is transmitted to the database interface unit 213 (step 3290). As described above, the database wrapper unit 212 ends the secret index deletion query generation process (FIG. 32).
 図34は、第二の実施例のクラウドシステム側サーバ4において、データベース制御部311が実行する秘匿インデックス削除処理を示すフローチャートである。秘匿インデックス削除処理は、データベース制御部311がデータベースインタフェース部213から暗号文の削除SQLを受信すると、開始する。例えば、秘匿インデックス削除処理の開始時にデータベース制御部311が受信する暗号文の削除SQLは、SQL(24-2)(25-2)及び(26-2)である。 FIG. 34 is a flowchart showing a secret index deletion process executed by the database control unit 311 in the cloud system side server 4 of the second embodiment. The secret index deletion process starts when the database control unit 311 receives the ciphertext deletion SQL from the database interface unit 213. For example, the ciphertext deletion SQL received by the database control unit 311 at the start of the secret index deletion processing is SQL (24-2) (25-2) and (26-2).
 まず、データベース制御部311は、暗号文の削除SQLから、削除条件の対象となるハッシュテーブル362Bとインデックス用ハッシュテーブル検索クエリを特定し、ユーザ定義機能部312のインデックス用一致比較部3122により当該ハッシュテーブル362Bの”暗号化ハッシュ値”カラムの値と当該インデックス用ハッシュテーブル検索クエリが一致するレコードを特定し、そのレコードの”MapID”カラムの値をMapID_hitとして取得する。例えば、暗号文の削除SQLが(24-2)(25-2)及び(26-2)である場合、ハッシュテーブル362Bはハッシュテーブル362Bであり、インデックス用一致比較部3122による一致比較の結果、ハッシュテーブル362Bのレコード3622Bの暗号化ハッシュ値”INEnc(ID_key_2,1012)”と一致し、当該レコードのMapID”2”をMapID_hitとして取得する(ステップ3310)。 First, the database control unit 311 identifies the hash table 362B and the index hash table search query that are subject to the deletion condition from the ciphertext deletion SQL, and the hash match search unit 3122 of the user definition function unit 312 performs the hash search. The record in which the value of the “encrypted hash value” column of the table 362B matches the hash table search query for the index is specified, and the value of the “MapID” column of the record is acquired as MapID_hit. For example, when the ciphertext deletion SQL is (24-2) (25-2) and (26-2), the hash table 362B is the hash table 362B, and as a result of the match comparison by the index match comparison unit 3122, Matches the encrypted hash value “INEnc (ID_key — 2, 1012)” of the record 3622B of the hash table 362B, and acquires MapID “2” of the record as MapID_hit (step 3310).
 次に、データベース制御部311は、マッピングテーブル363から、”MapID”カラムの値がMapID_hitと一致するレコード群HashResultを特定する。例えば、暗号文の削除SQLが(24-2)(25-2)及び(26-2)である場合、MapID_hitが”2”であるレコード3632及び3633がHashResultとなる(ステップ3320)。 Next, the database control unit 311 specifies a record group HashResult whose value in the “MapID” column matches MapID_hit from the mapping table 363. For example, when the ciphertext deletion SQL is (24-2) (25-2) and (26-2), the records 3632 and 3633 whose MapID_hit is “2” are HashResult (step 3320).
 次に、データベース制御部311は、インデックス用ハッシュテーブル検索クエリとステップ3310でヒットしたレコードの暗号化ハッシュ値をID用鍵取得部3123に入力し、出力としてID用鍵を取得し、そのID用鍵とHashResultの暗号化IDをID復号化部3124に入力し、出力として取得したID群をIDResultとする。ここで、暗号文の削除SQLが(24-2)(25-2)及び(26-2)である場合の例としては、IDResultは”3、1000000”となる(ステップ3330)。 Next, the database control unit 311 inputs the index hash table search query and the encrypted hash value of the record hit in step 3310 to the ID key acquisition unit 3123, acquires the ID key as an output, and acquires the ID key. The key and the encryption ID of HashResult are input to the ID decryption unit 3124, and the ID group acquired as an output is defined as IDResult. Here, as an example of the case where the ciphertext deletion SQL is (24-2) (25-2) and (26-2), the IDResult is “3, 1000000” (step 3330).
 次に、データベース制御部311は、暗号化メインテーブル361Bから、IDResultが含むIDを持ちかつ暗号化検索クエリと一致する値を持つレコードを削除し、さらに当該レコードと一致する暗号化IDを持つマッピングテーブル363のレコードを削除する(ステップ3340)。 Next, the database control unit 311 deletes the record having the ID included in the IDResult and the value matching the encrypted search query from the encryption main table 361B, and further mapping with the encryption ID matching the record The record in the table 363 is deleted (step 3340).
 次に、データベース制御部311は、ハッシュテーブル362Bから、マッピングテーブル363に存在しないMapIDを含むレコードを削除する(ステップ3350)。 Next, the database control unit 311 deletes the record including the MapID that does not exist in the mapping table 363 from the hash table 362B (Step 3350).
 最後に、データベース制御部311は、暗号文の削除SQLの結果をデータベースインタフェース部213へ送信する(ステップ3360)。以上で、秘匿インデックス削除処理(図34)を終了する。 Finally, the database control unit 311 transmits the ciphertext deletion SQL result to the database interface unit 213 (step 3360). Thus, the secret index deletion process (FIG. 34) is completed.
 (2-6)マッピングテーブルの並べ替えに関する処理の流れ
 図35は、第二の実施例のマッピングテーブルの並べ替えクエリ生成処理を示すフローチャートである。データベースラッパー部212は、マッピングテーブル363のレコードの順序が、と暗号化メインテーブル361Bの対応するレコードのIDの順序と一致しないように、マッピングテーブル363の生成時又は任意のタイミングで、マッピングテーブル363のレコードの順序をランダムに並べ替える並べ替えSQLを生成し(ステップ3410)、データベース制御部311へ送信する(ステップ3420)。
(2-6) Process Flow for Mapping Table Rearrangement FIG. 35 is a flowchart showing the mapping table rearrangement query generation process of the second embodiment. The database wrapper unit 212 sets the mapping table 363 at the time of generating the mapping table 363 or at an arbitrary timing so that the order of the records in the mapping table 363 does not match the order of the IDs of the corresponding records in the encrypted main table 361B. A rearrangement SQL for rearranging the records in a random order is generated (step 3410) and transmitted to the database control unit 311 (step 3420).
 図36は、第二の実施例のマッピングテーブルの並べ替え処理を示すフローチャートである。データベース制御部311は、データベースラッパー部212から並べ替えSQLを受信すると、マッピングテーブル363のレコードをランダムに並べ替え(ステップ3510)、その結果をデータベースラッパー部212へ送信する(ステップ3520)。 FIG. 36 is a flowchart showing the mapping table rearrangement process of the second embodiment. Upon receiving the rearrangement SQL from the database wrapper unit 212, the database control unit 311 rearranges the records in the mapping table 363 at random (step 3510), and transmits the result to the database wrapper unit 212 (step 3520).
 (2-7)第二の実施例の効果
 以上に説明したように、第二の実施例の秘匿化データベースシステム1では、暗号化メインテーブル361Bから検索を高速化するハッシュテーブル362Bとの対応関係を示すMapIDカラムを取り除き、対応関係を暗号化したままマッピングテーブル363に保持することによって、暗号化メインテーブル361BのレコードとMapIDの対応関係を隠蔽するため、第一の実施例より安全な検索を行うことができる。
(2-7) Effect of Second Embodiment As described above, in the concealed database system 1 of the second embodiment, the correspondence relationship with the hash table 362B that speeds up the search from the encrypted main table 361B. In order to conceal the correspondence between the record of the encrypted main table 361B and the MapID by removing the MapID column indicating, and holding the correspondence in the mapping table 363 in an encrypted state, a safer search than the first embodiment is performed. It can be carried out.
 (3)第三の実施例
 (3-1)第三の実施例による情報処理システムの構成
 本発明の第三の実施例による秘匿化データベースシステム1のハードウェア及びソフトウェア構成は、第二の実施例(図19)で前述した構成と同じである。第三の実施例が、第二の実施例と異なる点は、マッピングテーブル363BのマップIDの頻度の偏りを平準化し、出現頻度を隠蔽することである。
(3) Third Embodiment (3-1) Configuration of Information Processing System According to Third Embodiment The hardware and software configuration of the concealment database system 1 according to the third embodiment of the present invention is the second embodiment. The configuration is the same as that described in the example (FIG. 19). The third embodiment differs from the second embodiment in that the frequency deviation of map IDs in the mapping table 363B is leveled and the appearance frequency is concealed.
 図37は、第三の実施例のデータベースラッパー部212の論理構成を示す。第三の実施例のデータベースラッパー部212が第二の実施例(図20)と異なる点は、マッピングテーブル363BのマップIDの出現頻度を平準化するマップID頻度分布平準化クエリ生成部21201を有することである。 FIG. 37 shows a logical configuration of the database wrapper unit 212 of the third embodiment. The database wrapper unit 212 of the third embodiment is different from the second embodiment (FIG. 20) in that it has a map ID frequency distribution leveling query generation unit 21201 for leveling the appearance frequency of map IDs in the mapping table 363B. That is.
 図38は、第三の実施例の頻度分布平準化前のマッピングテーブル363Bのデータ構造を示す。第三の実施例のマッピングテーブル363Bが、第二の実施例(図24)のマッピングテーブル363と異なる点は、MapIDの頻度の偏りを示すためにサンプルレコードを追加していることである。例えば、第三の実施例のマッピングテーブル363Bでは、MapID”1”の頻度が2であり、MapID”2”の頻度が3でありMapID”3”及び”10”の頻度が1である。それ以外は、第二の実施例と同じである。 FIG. 38 shows the data structure of the mapping table 363B before the frequency distribution leveling of the third embodiment. The difference between the mapping table 363B of the third embodiment and the mapping table 363 of the second embodiment (FIG. 24) is that a sample record is added to indicate the deviation in the frequency of MapID. For example, in the mapping table 363B of the third embodiment, the frequency of MapID “1” is 2, the frequency of MapID “2” is 3, and the frequencies of MapID “3” and “10” are 1. The rest is the same as the second embodiment.
 図39は、第三の実施例の頻度分布平準化後のマッピングテーブル363Cのデータ構造を示す。平準化後のマッピングテーブル363Cが、平準化前のマッピングテーブル363Bと異なる点は、MapIDの頻度を平準化するための模擬レコードを備えることである。模擬レコードは、暗号化IDの代わりに、暗号化IDと同じ型のビット列を乱数で生成した値を持つ。例えば、図39では、模擬レコード3631C~3635Cを加えた結果、全てのMapIDの頻度が3となっている。 FIG. 39 shows the data structure of the mapping table 363C after frequency distribution leveling in the third embodiment. The mapping table 363C after leveling differs from the mapping table 363B before leveling in that it includes a simulated record for leveling the frequency of MapID. The simulated record has a value generated by a random number of bit strings of the same type as the encryption ID instead of the encryption ID. For example, in FIG. 39, as a result of adding simulated records 3631C to 3635C, the frequency of all MapIDs is 3.
 図37、図38及び図39以外の第三の実施例による情報処理システムの構成は、2-1項で説明した第二の実施例と同じである。 The configuration of the information processing system according to the third embodiment other than FIGS. 37, 38 and 39 is the same as that of the second embodiment described in the section 2-1.
 (3-2)秘匿化データベースの検索に関する処理の流れ
 第三の実施例の秘匿化データベースの検索に関する処理は、2-2項で説明した第二の実施例と同じである。
(3-2) Flow of processing related to search of concealment database The processing related to search of the concealment database of the third embodiment is the same as that of the second embodiment described in the section 2-2.
 (3-3)秘匿化データベースへの挿入に関する処理の流れ
 第三の実施例の秘匿化データベースへの挿入に関する処理は、2-3項で説明した第二の実施例と同様である。
(3-3) Flow of processing related to insertion into concealment database The processing related to insertion into the concealment database of the third embodiment is the same as that of the second embodiment described in section 2-3.
 (3-4)秘匿化データベースの更新に関する処理の流れ
 第三の実施例の秘匿化データベースの更新に関する処理は、2-4項で説明した第二の実施例と同じである。
(3-4) Flow of processing related to update of concealment database The processing related to update of the concealment database of the third embodiment is the same as that of the second embodiment described in the section 2-4.
 (3-5)秘匿化データベースの削除に関する処理の流れ
 第三の実施例の秘匿化データベースの削除に関する処理は、2-5項で説明した第二の実施例と同じである。
(3-5) Process Flow Regarding Deletion of Concealment Database The process regarding deletion of the concealment database of the third embodiment is the same as that of the second embodiment described in the section 2-5.
 (3-6)マッピングテーブルの並べ替えに関する処理の流れ
 第三の実施例のマッピングテーブル363Bの並べ替えに関する処理は、2-6項で説明した第二の実施例と同じである。
(3-6) Flow of processing concerning rearrangement of mapping table The processing concerning rearrangement of the mapping table 363B of the third embodiment is the same as that of the second embodiment described in the section 2-6.
 (3-7)マッピングテーブルの頻度分布の平準化に関する処理の流れ
 図40及び図41を用いて、第三の実施例の秘匿化データベースシステム1において、マッピングテーブル363Bの平準化を行う際の処理を説明する。
(3-7) Process Flow for Leveling Mapping Table Frequency Distribution Processing when leveling the mapping table 363B in the concealment database system 1 of the third embodiment with reference to FIGS. 40 and 41 Will be explained.
 図40は、第三の実施例のユーザシステム側サーバ3において、データベースラッパー部212が実行するマップID頻度分布平準化クエリ生成処理を示すフローチャートである。マップID頻度分布平準化クエリ生成処理は、データベースラッパー部212がアプリケーション部211等からの平準化要求を受けると、開始する。 FIG. 40 is a flowchart showing map ID frequency distribution leveling query generation processing executed by the database wrapper unit 212 in the user system side server 3 of the third embodiment. The map ID frequency distribution leveling query generation process starts when the database wrapper unit 212 receives a leveling request from the application unit 211 or the like.
 まず、データベースラッパー部212は、平準化前のマッピングテーブル363Bから”MapID”カラムの各値毎の頻度を取得する。例えば、図38に示す平準化前のマッピングテーブル363Bの場合、MapID”1”の頻度が2であり、MapID”2”の頻度が3でありMapID”3”及び”10”の頻度が1である。 First, the database wrapper unit 212 acquires the frequency for each value of the “MapID” column from the mapping table 363B before leveling. For example, in the mapping table 363B before leveling shown in FIG. 38, the frequency of MapID “1” is 2, the frequency of MapID “2” is 3, and the frequencies of MapID “3” and “10” are 1. is there.
 次に、データベースラッパー部212は、MapIDの各値の頻度が同一かを判定し、同一の場合(YES)、処理を終了する。 Next, the database wrapper unit 212 determines whether the frequency of each value of MapID is the same, and if it is the same (YES), ends the process.
 一方、ステップ3920の結果が(NO)である場合、データベースラッパー部212は、ステップ3910で取得した頻度のうち最大頻度をNmaxとする。例えば、平準化前のマッピングテーブル363Bの場合、NmaxはMapID”2”の頻度である3となる(ステップ3930)。 On the other hand, when the result of step 3920 is (NO), the database wrapper unit 212 sets the maximum frequency among the frequencies acquired in step 3910 as Nmax. For example, in the case of the mapping table 363B before leveling, Nmax is 3 which is the frequency of MapID “2” (step 3930).
 次に、データベースラッパー部212は、最大頻度以外のMapIDの各値について、Nmaxと各値の頻度との差分の数だけ乱数を生成し、その乱数の各値のペアから構成されるレコードをマッピングテーブル363Bに挿入する頻度分布平準化SQLを生成する。例えば、平準化前のマッピングテーブル363Bの場合、図39に示す模擬レコード3631C~3635Cを挿入するSQLを生成する(ステップ3940)。 Next, the database wrapper unit 212 generates random numbers for each value of MapID other than the maximum frequency by the number of differences between Nmax and the frequency of each value, and maps a record composed of a pair of each value of the random number A frequency distribution leveling SQL to be inserted into the table 363B is generated. For example, in the case of the mapping table 363B before leveling, SQL for inserting the simulation records 3631C to 3635C shown in FIG. 39 is generated (step 3940).
 最後に、データベースラッパー部212は、ステップ3940で生成した頻度分布平準化SQLをデータベースインタフェース部213へ送信し、マップID頻度分布平準化クエリ生成処理(図40)を終了する。 Finally, the database wrapper unit 212 transmits the frequency distribution leveling SQL generated in step 3940 to the database interface unit 213, and ends the map ID frequency distribution leveling query generation process (FIG. 40).
 図41は、第三の実施例のクラウドシステム側サーバ4において、データベース制御部311が実行するマップID頻度分布平準化処理を示すフローチャートである。この処理は、データベース制御部311が、データベースラッパー部212からの頻度分布平準化SQLを受信すると、SQLに指定されたレコードをマッピングテーブル363Bに挿入する(ステップ4010)。そして、挿入結果をデータベースラッパーへ送信する(ステップ4020)。 FIG. 41 is a flowchart showing map ID frequency distribution leveling processing executed by the database control unit 311 in the cloud system side server 4 of the third embodiment. In this process, when the database control unit 311 receives the frequency distribution leveling SQL from the database wrapper unit 212, the record specified in the SQL is inserted into the mapping table 363B (step 4010). Then, the insertion result is transmitted to the database wrapper (step 4020).
 (3-8)第三の実施例の効果
 以上のように、第三の実施例の秘匿化データベースシステム1では、マッピングテーブル363のMapIDの出現頻度の分布を平準化することにより、MapIDの出現頻度を隠蔽するため、第二の実施例より安全な検索を行うことができる。
(3-8) Effect of Third Embodiment As described above, in the concealment database system 1 according to the third embodiment, the appearance of MapID is obtained by leveling the distribution of the appearance frequency of MapID in the mapping table 363. Since the frequency is concealed, a safer search can be performed than in the second embodiment.
 以上に説明したように、本発明の実施例によると、データベースラッパー部212は、暗号化データを検索するための平文のSQL文を受信すると、前記暗号化データをクラウドシステム側サーバ4上で処理する暗号化SQL文に変換し、クラウドシステム側サーバ4が前記暗号化SQL文を受信すると、受信した暗号化SQL文を実行することによって、データベース制御部311が前記ハッシュテーブルを検索して前記暗号化データの範囲を限定し、ユーザ定義機能部312(暗号文一致比較部3121)が前記限定された範囲の暗号化データについて前記暗号化SQL文が指示する一致比較を行い、データベース制御部311が前記暗号化SQL文の実行結果をユーザシステム側サーバ3へ送信するので、暗号化された大容量の暗号化メインテーブル361への検索に際して、ハッシュテーブル362を事前に検索することで検索対象とするレコードを少なくして、高速に検索することができる。 As described above, according to the embodiment of the present invention, the database wrapper unit 212 processes the encrypted data on the cloud system side server 4 when receiving the plain text SQL text for searching the encrypted data. When the cloud system side server 4 receives the encrypted SQL sentence, the database control unit 311 searches the hash table by executing the received encrypted SQL sentence, and the encryption The range of the encrypted data is limited, the user-defined function unit 312 (ciphertext match comparison unit 3121) performs a match comparison indicated by the encrypted SQL statement on the limited range of encrypted data, and the database control unit 311 Since the execution result of the encrypted SQL statement is transmitted to the server 3 on the user system side, the encrypted large-capacity encryption In search of the main table 361, by reducing the record to be retrieved by searching the hash table 362 in advance, it can be retrieved at a high speed.
 また、ユーザシステム側サーバ3は、前記暗号化データを処理するSQL文を、データ所有者が使用するユーザ端末2から、ユーザシステム側サーバ3が設けられた設備のユーザ内部ネットワーク5を経由して受信し、ユーザシステム側サーバ3は、前記暗号化データを処理するSQL文を、外部ネットワーク6を介してクラウドシステム側サーバ4に送信するので、クラウド構成の秘匿化データベースシステムにおいて、大容量の暗号化データを高速に検索することができる。 In addition, the user system side server 3 sends the SQL statement for processing the encrypted data from the user terminal 2 used by the data owner via the user internal network 5 of the equipment provided with the user system side server 3. The user system side server 3 receives the SQL statement for processing the encrypted data and sends it to the cloud system side server 4 via the external network 6. Data can be retrieved at high speed.
 また、ハッシュテーブル362は、暗号化メインテーブル361の各レコードの識別子であるマップID及び前記ハッシュ値を含み、暗号化メインテーブル361は、ハッシュテーブル362に格納されたハッシュ値に対応する識別子であるマップIDを含み、データベース制御部311は、前記ハッシュ値をキーワードとしてハッシュテーブル362を検索し、一致したハッシュ値を持つレコードのマップIDを取得し、前記取得したマップIDを持つ暗号化メインテーブル361のレコードを検索対象とするので、ハッシュテーブル362に記録されたマップIDを用いて検索対象を絞り込むことができる。 The hash table 362 includes a map ID that is an identifier of each record of the encrypted main table 361 and the hash value, and the encrypted main table 361 is an identifier corresponding to the hash value stored in the hash table 362. The database control unit 311 includes the map ID, the database control unit 311 searches the hash table 362 using the hash value as a keyword, acquires the map ID of the record having the matched hash value, and the encrypted main table 361 having the acquired map ID. Therefore, the search target can be narrowed down using the map ID recorded in the hash table 362.
 また、データベース制御部311は、暗号化メインテーブル361のマップIDと前記ハッシュテーブルのマップIDとを対応付け、暗号化メインテーブル361に存在しないがハッシュテーブル362に存在するマップIDを含むレコードをハッシュテーブル362から削除するので、不要なデータを削除して、検索を高速化し、使用リソースを削減することができる。 Further, the database control unit 311 associates the map ID of the encrypted main table 361 with the map ID of the hash table, and hashes the record including the map ID that does not exist in the encrypted main table 361 but exists in the hash table 362. Since the data is deleted from the table 362, unnecessary data can be deleted to speed up the search and reduce the resources used.
 また、データベースラッパー部212は、検索するデータのハッシュ値とハッシュテーブル362に格納された暗号化ハッシュ値との一致検索を行うハッシュテーブル検索クエリを生成し、データベース制御部311は、前記生成されたハッシュテーブル検索クエリと前記暗号化ハッシュ値との一致判定を暗号文一致比較部3121に行わせるので、ハッシュテーブル362の肥大化を防止することができる。 Further, the database wrapper unit 212 generates a hash table search query for performing a match search between the hash value of the data to be searched and the encrypted hash value stored in the hash table 362, and the database control unit 311 Since the ciphertext match comparison unit 3121 makes a match determination between the hash table search query and the encrypted hash value, enlargement of the hash table 362 can be prevented.
 また、ユーザシステム側サーバ3は、元データに対応する暗号化ハッシュ値を格納するハッシュテーブルとの関係を示す情報を格納する秘匿インデックスマップテーブル262を有し、データベースラッパー部212は、秘匿インデックスマップテーブル262を検索した結果、検索対象のデータに対応する暗号化ハッシュ値を格納するハッシュテーブル362が存在しない場合、ハッシュテーブル362を検索するSQL文を生成せず、暗号化メインテーブル361を検索するSQL文を生成するので、ハッシュ値によるインデックスを使用できない場合でも、高速に検索することができる。 Further, the user system side server 3 has a secret index map table 262 that stores information indicating a relationship with a hash table that stores an encrypted hash value corresponding to the original data, and the database wrapper unit 212 includes a secret index map. As a result of searching the table 262, if there is no hash table 362 that stores the encrypted hash value corresponding to the data to be searched, the SQL main statement 361 is searched without generating the SQL statement for searching the hash table 362. Since an SQL sentence is generated, even when an index based on a hash value cannot be used, a high-speed search can be performed.
 また、データベースラッパー部212は、確率的暗号化を行った暗号化データで暗号化メインテーブル361を更新する場合、暗号化メインテーブル361の更新対象レコードの識別子を全て取得し、前記取得した識別子の個数分の更新後のデータの暗号文を生成し、当該識別子の個数分の複数のレコードを更新するSQL文を生成するので、暗号の強度を低下させずに、高速に検索することができる。 When the database wrapper unit 212 updates the encryption main table 361 with the encrypted data subjected to the stochastic encryption, the database wrapper unit 212 acquires all the identifiers of the update target records in the encryption main table 361, and acquires the identifier of the acquired identifier. Since the ciphertext of the updated data corresponding to the number is generated and the SQL text for updating the plurality of records corresponding to the number of the identifiers is generated, the search can be performed at high speed without reducing the strength of the cipher.
 また、データベースラッパー部212は、SQL文の最大長の制限により前記識別子の個数分の複数のレコードの更新を一文で記述できない場合、SQL文の最大長の制限を超えない長さの複数のSQL文を生成するので、複数の書込処理を並列して実行して、処理を高速化することができる。 If the update of the plurality of records corresponding to the number of identifiers cannot be described in one sentence due to the restriction on the maximum length of the SQL sentence, the database wrapper unit 212 has a plurality of SQLs having a length that does not exceed the restriction on the maximum length of the SQL sentence. Since a sentence is generated, a plurality of writing processes can be executed in parallel to speed up the process.
 また、暗号化メインテーブル361Bは、ハッシュテーブル362Bに格納された暗号化ハッシュ値に対応する識別子マップIDを含まず、クラウドシステム側サーバ4は、暗号化メインテーブル361Bの各レコードに対応する識別子を暗号化した暗号化IDと、当該暗号化IDに対応するハッシュテーブル362に格納されたハッシュ値に対応する識別子であるマップIDとを含むマッピングテーブル363を有し、データベースラッパー部212は、ハッシュテーブル362Bから取得したマップIDに対応するマッピングテーブルの暗号化IDを取得し、前記取得した暗号化IDを一時的に復号化し、前記暗号化IDを復号化した識別子によって、前記暗号化データの検索範囲を限定するので、暗号化メインテーブル361BのレコードとマップIDとの対応関係を隠蔽して、より安全な検索を行うことができる。 Further, the encryption main table 361B does not include an identifier map ID corresponding to the encryption hash value stored in the hash table 362B, and the cloud system side server 4 stores an identifier corresponding to each record of the encryption main table 361B. The database wrapper unit 212 includes a mapping table 363 including an encrypted encryption ID and a map ID that is an identifier corresponding to a hash value stored in the hash table 362 corresponding to the encryption ID. The encryption ID of the mapping table corresponding to the map ID acquired from 362B is acquired, the acquired encryption ID is temporarily decrypted, and the search range of the encrypted data is determined by the identifier obtained by decrypting the encryption ID. The encryption main table 361B To hide the correspondence between the over soil and map ID, it is possible to perform a more secure search.
 また、データベースラッパー部212は、前記マッピングテーブルのレコードを並べ替えるためのクエリを生成するマッピングテーブル並べ替えクエリ生成部を有し、データベース制御部311は、マッピングテーブル並べ替えクエリ生成部が生成したSQL文に従って、前記マッピングテーブルのレコードを並び替えるので、暗号化メインテーブル361Bとマッピングテーブル363のレコード順序が同一にならないようにして、暗号化メインテーブル361Bとマッピングテーブル363の各レコードの対応関係を隠蔽し、より安全に検索することができる。 In addition, the database wrapper unit 212 includes a mapping table rearrangement query generation unit that generates a query for rearranging the mapping table records, and the database control unit 311 includes an SQL generated by the mapping table rearrangement query generation unit. Since the mapping table records are rearranged according to the sentence, the correspondence between the records in the encrypted main table 361B and the mapping table 363 is concealed so that the record order of the encrypted main table 361B and the mapping table 363 is not the same. And you can search more safely.
 また、データベースラッパー部212は、前記マッピングテーブルのマップIDの頻度を取得し、前記取得した頻度を等しくするための擬似レコードを前記マッピングテーブルに挿入するためのクエリを生成するマップID頻度分布平準化クエリ生成部を有し、データベース制御部311は、マップID頻度分布平準化クエリ生成部が生成したSQL文に従って、前記マッピングテーブルへ前記擬似レコードを挿入するので、マッピングテーブル363のマップIDの出現頻度の分布を平準化して、マップIDの出現頻度を隠蔽して、より安全な検索を行うことができる。 Further, the database wrapper unit 212 acquires the map ID frequency of the mapping table, and generates a query for inserting a pseudo record for equalizing the acquired frequency into the mapping table. The database control unit 311 has a query generation unit, and inserts the pseudo record into the mapping table in accordance with the SQL statement generated by the map ID frequency distribution leveling query generation unit, so the appearance frequency of the map ID in the mapping table 363 Can be leveled and the appearance frequency of map IDs can be concealed for safer search.
 なお、本発明は前述した実施例に限定されるものではなく、添付した特許請求の範囲の趣旨内における様々な変形例及び同等の構成が含まれる。例えば、前述した実施例は本発明を分かりやすく説明するために詳細に説明したものであり、必ずしも説明した全ての構成を備えるものに本発明は限定されない。また、ある実施例の構成の一部を他の実施例の構成に置き換えてもよい。また、ある実施例の構成に他の実施例の構成を加えてもよい。また、各実施例の構成の一部について、他の構成の追加・削除・置換をしてもよい。 The present invention is not limited to the above-described embodiments, and includes various modifications and equivalent configurations within the scope of the appended claims. For example, the above-described embodiments have been described in detail for easy understanding of the present invention, and the present invention is not necessarily limited to those having all the configurations described. A part of the configuration of one embodiment may be replaced with the configuration of another embodiment. Moreover, you may add the structure of another Example to the structure of a certain Example. In addition, for a part of the configuration of each embodiment, another configuration may be added, deleted, or replaced.
 また、前述した各構成、機能、処理部、処理手段等は、それらの一部又は全部を、例えば集積回路で設計する等により、ハードウェアで実現してもよく、プロセッサがそれぞれの機能を実現するプログラムを解釈し実行することにより、ソフトウェアで実現してもよい。 In addition, each of the above-described configurations, functions, processing units, processing means, etc. may be realized in hardware by designing a part or all of them, for example, with an integrated circuit, and the processor realizes each function. It may be realized by software by interpreting and executing the program to be executed.
 各機能を実現するプログラム、テーブル、ファイル等の情報は、メモリ、ハードディスク、SSD(Solid State Drive)等の記憶装置、又は、ICカード、SDカード、DVD等の記録媒体に格納することができる。 Information such as programs, tables, and files that realize each function can be stored in a storage device such as a memory, a hard disk, and an SSD (Solid State Drive), or a recording medium such as an IC card, an SD card, and a DVD.
 また、制御線や情報線は説明上必要と考えられるものを示しており、実装上必要な全ての制御線や情報線を示しているとは限らない。実際には、ほとんど全ての構成が相互に接続されていると考えてよい。 Also, the control lines and information lines indicate what is considered necessary for the explanation, and do not necessarily indicate all control lines and information lines necessary for mounting. In practice, it can be considered that almost all the components are connected to each other.
 本発明は、ユーザシステム側が鍵を持ち暗号化したデータをクラウド事業者に預託し、クラウド事業者が預託された多量の暗号化データを暗号化したまま検索し、分析する機能を顧客に提供する情報処理システムに広く適用することができる。 The present invention provides a customer with a function of depositing encrypted data with a key on the user system side to a cloud operator, and searching and analyzing a large amount of encrypted data deposited by the cloud operator while encrypting the data. It can be widely applied to information processing systems.

Claims (15)

  1.  ユーザシステムが所有する元データをデータ所有者が管理する暗号鍵によって暗号化した暗号化データが預託されるセンタシステムによって構成される秘匿化データベースシステムであって、
     前記センタシステムは、前記預託された暗号化データを元データに復号化することなく検索する機能を提供するものであって、
     前記ユーザシステムは、前記暗号化データを処理するための平文のSQL文を、前記暗号化データを前記センタシステム上で処理する暗号化SQL文に変換し、前記センタシステムから受信した暗号化データの処理結果を復号化するデータベースラッパー部を有し、
     前記センタシステムは、
     前記暗号化データを格納する暗号化預託データテーブルと、
     前記元データのハッシュ値を暗号化した暗号化ハッシュ値を格納し、前記暗号化預託データテーブルの検索範囲を限定するために参照されるハッシュテーブルと、
     前記暗号化預託データテーブルに格納された暗号化データを検索するデータベース制御部と、
     前記暗号化データと検索クエリとの一致を判定する暗号文一致比較部と、を有し、
     前記データベースラッパー部は、前記暗号化データを検索するための平文のSQL文を、前記暗号化データを前記センタシステム上で処理する暗号化SQL文に変換し、
     前記センタシステムが受信した前記暗号化SQL文を実行することによって、前記データベース制御部が前記ハッシュテーブルを検索して前記暗号化データの範囲を限定し、前記暗号文一致比較部が前記限定された範囲の暗号化データについて前記暗号化SQL文が指示する一致比較を行い、前記データベース制御部が前記暗号化SQL文の実行結果を前記ユーザシステムへ送信し、
     前記データベースラッパー部は、前記データベース制御部から受信したSQL文の実行結果を復号化し、前記暗号化データの検索結果を出力することを特徴とする秘匿化データベースシステム。
    A concealment database system configured by a center system in which encrypted data obtained by encrypting original data owned by a user system with an encryption key managed by a data owner is deposited,
    The center system provides a function of searching the deposited encrypted data without decrypting the original data,
    The user system converts a plain text SQL sentence for processing the encrypted data into an encrypted SQL sentence for processing the encrypted data on the center system, and transmits the encrypted data received from the center system. It has a database wrapper part that decrypts the processing results,
    The center system is
    An encrypted deposit data table for storing the encrypted data;
    An encrypted hash value obtained by encrypting the hash value of the original data, and a hash table referred to for limiting a search range of the encrypted depository data table;
    A database control unit for retrieving encrypted data stored in the encrypted deposit data table;
    A ciphertext match comparison unit that determines a match between the encrypted data and the search query,
    The database wrapper unit converts a plain text SQL sentence for searching the encrypted data into an encrypted SQL sentence for processing the encrypted data on the center system,
    By executing the encrypted SQL sentence received by the center system, the database control unit searches the hash table to limit the range of the encrypted data, and the ciphertext match comparison unit is limited. A match comparison indicated by the encrypted SQL statement is performed on a range of encrypted data, and the database control unit transmits the execution result of the encrypted SQL statement to the user system,
    The concealment database system, wherein the database wrapper unit decrypts an execution result of the SQL sentence received from the database control unit and outputs a search result of the encrypted data.
  2.  請求項1に記載の秘匿化データベースシステムであって、
     前記ユーザシステムは、前記暗号化データを処理するための平文のSQL文を、前記データ所有者が使用するユーザ端末から、前記ユーザシステムが設けられた設備の内部ネットワークを経由して受信し、
     前記ユーザシステムは、前記暗号化データを処理する暗号化SQL文を、外部ネットワークを介して前記センタシステムに送信することを特徴とする秘匿化データベースシステム。
    The concealment database system according to claim 1,
    The user system receives a plain text SQL sentence for processing the encrypted data from a user terminal used by the data owner via an internal network of a facility in which the user system is provided,
    The concealment database system, wherein the user system transmits an encrypted SQL sentence for processing the encrypted data to the center system via an external network.
  3.  請求項1に記載の秘匿化データベースシステムであって、
     前記ユーザシステムは、
     前記データ所有者が使用するユーザ端末からの要求を受け、前記要求に対する処理の結果を返信するアプリケーション部と、
     前記データベースラッパー部から暗号化SQL文を受信して前記センタシステムの前記データベース制御部へ送信し、また、前記データベース制御部から前記暗号化SQL文の実行結果を受信して前記データベースラッパー部へ送信するデータベースインタフェース部と、を有し、
     前記データベースラッパー部は、
     前記元データを暗号化する暗号化部と、
     前記センタシステムから受信した暗号化データを元データに復号化する復号化部と、
     前記暗号化データを検索するための検索クエリを生成する検索クエリ生成部と、
     前記元データのハッシュ値を生成するハッシュ値生成部と、
     暗号化処理を実行するための暗号鍵及び検索用鍵を管理する鍵管理部と、
     前記暗号化データを検索するための平文のSQL文を、前記暗号化データを検索して結果を得るための暗号化SQL文に変換するSQL変換部と、を有することを特徴とする秘匿化データベースシステム。
    The concealment database system according to claim 1,
    The user system is:
    An application unit that receives a request from a user terminal used by the data owner and returns a result of processing for the request;
    An encrypted SQL statement is received from the database wrapper unit and transmitted to the database control unit of the center system, and an execution result of the encrypted SQL statement is received from the database control unit and transmitted to the database wrapper unit. A database interface unit,
    The database wrapper part is
    An encryption unit for encrypting the original data;
    A decryption unit for decrypting encrypted data received from the center system into original data;
    A search query generator for generating a search query for searching the encrypted data;
    A hash value generator for generating a hash value of the original data;
    A key management unit for managing an encryption key and a search key for executing encryption processing;
    A concealment database comprising: a SQL conversion unit that converts a plain SQL sentence for searching the encrypted data into an encrypted SQL sentence for searching the encrypted data and obtaining a result system.
  4.  請求項1に記載の秘匿化データベースシステムであって、
     前記ハッシュテーブルは、前記暗号化預託データテーブルの各レコードの識別子であるマップID及び前記暗号化ハッシュ値を含み、
     前記暗号化預託データテーブルは、前記ハッシュテーブルに格納された暗号化ハッシュ値に対応する識別子であるマップIDを含み、
     前記データベース制御部は、暗号化ハッシュ値をキーワードとして前記ハッシュテーブルを検索し、一致した暗号化ハッシュ値を持つレコードのマップIDを取得し、前記取得したマップIDを持つ前記暗号化預託データテーブルのレコードを検索対象とすることを特徴とする秘匿化データベースシステム。
    The concealment database system according to claim 1,
    The hash table includes a map ID that is an identifier of each record of the encrypted deposit data table and the encrypted hash value,
    The encrypted deposit data table includes a map ID that is an identifier corresponding to the encrypted hash value stored in the hash table;
    The database control unit searches the hash table using an encrypted hash value as a keyword, acquires a map ID of a record having a matched encrypted hash value, and stores the encrypted depository data table having the acquired map ID. A concealed database system characterized in that a record is a search target.
  5.  請求項4に記載の秘匿化データベースシステムであって、
     前記データベース制御部は、
     前記暗号化預託データテーブルのマップIDと前記ハッシュテーブルのマップIDとを対応付け、
     前記暗号化預託データテーブルに存在しないが前記ハッシュテーブルに存在するマップIDを含むレコードを前記ハッシュテーブルから削除することを特徴とする秘匿化データベースシステム。
    The concealment database system according to claim 4,
    The database control unit
    Associating the map ID of the encrypted deposit data table with the map ID of the hash table,
    A concealing database system, wherein a record including a map ID that does not exist in the encrypted deposit data table but exists in the hash table is deleted from the hash table.
  6.  請求項1に記載の秘匿化データベースシステムであって、
     前記データベースラッパー部は、検索するデータの暗号化ハッシュ値と前記ハッシュテーブルに格納された暗号化ハッシュ値との一致検索を行うハッシュテーブル検索クエリを生成し、
     前記データベース制御部は、前記生成されたハッシュテーブル検索クエリと前記暗号化ハッシュ値との一致判定を前記暗号文一致比較部に行わせることを特徴とする秘匿化データベースシステム。
    The concealment database system according to claim 1,
    The database wrapper unit generates a hash table search query for performing a match search between an encrypted hash value of data to be searched and an encrypted hash value stored in the hash table,
    The concealment database system, wherein the database control unit causes the ciphertext match comparison unit to perform a match determination between the generated hash table search query and the encrypted hash value.
  7.  請求項1に記載の秘匿化データベースシステムであって、
     前記ユーザシステムは、前記元データに対応する暗号化ハッシュ値を格納するハッシュテーブルと、前記暗号化データの格納場所との関係を示す情報を格納する秘匿インデックスマップテーブルを有し、
     前記データベースラッパー部は、前記秘匿インデックスマップテーブルを検索した結果、検索対象のデータに対応する暗号化ハッシュ値を格納するハッシュテーブルが存在しない場合、前記ハッシュテーブルを検索するSQL文を生成せず、前記暗号化預託データテーブルを検索するSQL文を生成することを特徴とする秘匿化データベースシステム。
    The concealment database system according to claim 1,
    The user system has a hash table that stores an encrypted hash value corresponding to the original data, and a secret index map table that stores information indicating a relationship between a storage location of the encrypted data,
    As a result of searching the secret index map table, the database wrapper unit does not generate an SQL statement for searching the hash table when there is no hash table that stores an encrypted hash value corresponding to data to be searched, A concealment database system that generates an SQL sentence for searching the encrypted deposit data table.
  8.  請求項1に記載の秘匿化データベースシステムであって、
     前記データベースラッパー部は、確率的暗号化を行った暗号化データで前記暗号化預託データテーブルを更新する場合、前記暗号化預託データテーブルの更新対象レコードの識別子を全て取得し、前記取得した識別子の個数分の更新後の暗号化データを生成し、当該識別子の個数分の複数のレコードを更新するSQL文を生成することを特徴とする秘匿化データベースシステム。
    The concealment database system according to claim 1,
    The database wrapper unit, when updating the encrypted depository data table with the encrypted data subjected to the stochastic encryption, acquires all the identifiers of the record to be updated of the encrypted depository data table, the identifier of the acquired identifier A concealment database system, characterized in that encrypted data after update for a number is generated and an SQL sentence for updating a plurality of records for the number of identifiers is generated.
  9.  請求項8に記載の秘匿化データベースシステムであって、
     前記データベースラッパー部は、SQL文の最大長の制限により前記識別子の個数分の複数のレコードの更新を一文で記述できない場合、SQL文の最大長の制限を超えない長さの複数のSQL文を生成することを特徴とする秘匿化データベースシステム。
    The concealment database system according to claim 8,
    If the update of the plurality of records corresponding to the number of identifiers cannot be described in one sentence due to the restriction on the maximum length of the SQL sentence, the database wrapper unit stores a plurality of SQL sentences having a length not exceeding the restriction on the maximum length of the SQL sentence. A concealment database system characterized by generating.
  10.  請求項1に記載の秘匿化データベースシステムであって、
     前記暗号化預託データテーブルは、前記ハッシュテーブルに格納された暗号化ハッシュ値に対応する識別子マップIDを含まず、
     前記センタシステムは、前記暗号化預託データテーブルの各レコードに対応する識別子を暗号化した暗号化IDと、当該暗号化IDに対応して前記ハッシュテーブルに格納されたハッシュ値に対応する識別子であるマップIDとを含むマッピングテーブルを有し、
     前記データベースラッパー部は、
     前記ハッシュテーブルから取得したマップIDに対応するマッピングテーブルの暗号化IDを取得し、
     前記取得した暗号化IDを一時的に復号化し、
     前記暗号化IDを復号化した識別子によって、前記暗号化データの検索範囲を限定することを特徴とする秘匿化データベースシステム。
    The concealment database system according to claim 1,
    The encrypted deposit data table does not include an identifier map ID corresponding to the encrypted hash value stored in the hash table,
    The center system is an encryption ID obtained by encrypting an identifier corresponding to each record of the encrypted deposit data table, and an identifier corresponding to a hash value stored in the hash table corresponding to the encryption ID. A mapping table including a map ID;
    The database wrapper part is
    Obtain the encryption ID of the mapping table corresponding to the map ID obtained from the hash table;
    Temporarily decrypting the obtained encryption ID;
    The concealed database system, wherein a search range of the encrypted data is limited by an identifier obtained by decrypting the encryption ID.
  11.  請求項10に記載の秘匿化データベースシステムであって、
     前記データベースラッパー部は、前記マッピングテーブルのレコードを並べ替えるためのクエリを生成するマッピングテーブル並べ替えクエリ生成部を有し、
     前記データベース制御部は、マッピングテーブル並べ替えクエリ生成部が生成したクエリに従って、前記マッピングテーブルのレコードを並び替えることを特徴とする秘匿化データベースシステム。
    The concealment database system according to claim 10,
    The database wrapper unit includes a mapping table rearrangement query generation unit that generates a query for rearranging the records of the mapping table,
    The said database control part rearranges the record of the said mapping table according to the query which the mapping table rearrangement query production | generation part produced | generated, The concealment database system characterized by the above-mentioned.
  12.  請求項10に記載の秘匿化データベースシステムであって、
     前記データベースラッパー部は、前記マッピングテーブルのマップIDの頻度を取得し、前記取得した頻度を等しくするための擬似レコードを前記マッピングテーブルに挿入するためのクエリを生成するマップID頻度分布平準化クエリ生成部を有し、
     前記データベース制御部は、マップID頻度分布平準化クエリ生成部が生成したクエリに従って、前記マッピングテーブルへ前記擬似レコードを挿入することを特徴とする秘匿化データベースシステム。
    The concealment database system according to claim 10,
    The database wrapper unit acquires a map ID frequency of the mapping table, and generates a map ID frequency distribution leveling query generation for generating a query for inserting a pseudo record for equalizing the acquired frequency into the mapping table Part
    The said database control part inserts the said pseudo record into the said mapping table according to the query which the map ID frequency distribution leveling query production | generation part produced | generated, The concealment database system characterized by the above-mentioned.
  13.  秘匿化データベースシステムにおける秘匿化データ管理方法であって、
     前記秘匿化データベースシステムは、ユーザシステムが所有する元データをデータ所有者が管理する暗号鍵によって暗号化した暗号化データが預託されるセンタシステムによって構成され、
     前記センタシステムは、前記預託された暗号化データを元データに復号化することなく検索する機能を提供するものであって、
     前記ユーザシステムは、前記暗号化データを処理するための平文のSQL文を、前記暗号化データを前記センタシステム上で処理する暗号化SQL文に変換し、前記センタシステムから受信した暗号化データの処理結果を復号化するデータベースラッパー部を有し、
     前記センタシステムは、
     前記暗号化データを格納する暗号化預託データテーブルと、
     前記元データのハッシュ値を暗号化した暗号化ハッシュ値を格納し、前記暗号化預託データテーブルの検索範囲を限定するために参照されるハッシュテーブルと、
     前記暗号化預託データテーブルに格納された暗号化データを検索するデータベース制御部と、
     前記暗号化データと検索クエリとの一致を判定する暗号文一致比較部と、を有し、
     前記方法は、
     前記データベースラッパー部が、前記暗号化データを検索するための平文のSQL文を、前記暗号化データを前記センタシステム上で処理する暗号化SQL文に変換し、
     前記センタシステムが受信した前記暗号化SQL文を実行することによって、前記データベース制御部が前記ハッシュテーブルを検索して前記暗号化データの範囲を限定し、前記暗号文一致比較部が前記限定された範囲の暗号化データについて前記暗号化SQL文が指示する一致比較を行い、前記データベース制御部が前記暗号化SQL文の実行結果を前記ユーザシステムへ送信し、
     前記データベースラッパー部が、前記データベース制御部から受信したSQL文の実行結果を復号化し、前記暗号化データの検索結果を出力することを特徴とする秘匿化データ管理方法。
    A method for managing concealed data in a concealed database system,
    The concealment database system is constituted by a center system in which encrypted data obtained by encrypting original data owned by a user system with an encryption key managed by a data owner is deposited,
    The center system provides a function of searching the deposited encrypted data without decrypting the original data,
    The user system converts a plain text SQL sentence for processing the encrypted data into an encrypted SQL sentence for processing the encrypted data on the center system, and transmits the encrypted data received from the center system. It has a database wrapper part that decrypts the processing results,
    The center system is
    An encrypted deposit data table for storing the encrypted data;
    An encrypted hash value obtained by encrypting the hash value of the original data, and a hash table referred to for limiting a search range of the encrypted depository data table;
    A database control unit for retrieving encrypted data stored in the encrypted deposit data table;
    A ciphertext match comparison unit that determines a match between the encrypted data and the search query,
    The method
    The database wrapper unit converts a plain text SQL sentence for searching the encrypted data into an encrypted SQL sentence for processing the encrypted data on the center system,
    By executing the encrypted SQL sentence received by the center system, the database control unit searches the hash table to limit the range of the encrypted data, and the ciphertext match comparison unit is limited. A match comparison indicated by the encrypted SQL statement is performed on a range of encrypted data, and the database control unit transmits the execution result of the encrypted SQL statement to the user system,
    The concealed data management method, wherein the database wrapper unit decrypts the execution result of the SQL sentence received from the database control unit, and outputs the search result of the encrypted data.
  14.  請求項13に記載の秘匿化データ管理方法であって、
     前記ハッシュテーブルは、前記暗号化預託データテーブルの各レコードの識別子であるマップID及び前記ハッシュ値を含み、
     前記暗号化預託データテーブルは、前記ハッシュテーブルに格納された暗号化ハッシュ値に対応する識別子マップIDを含み、
     前記方法は、前記データベース制御部が、暗号化ハッシュ値をキーワードとして前記ハッシュテーブルを検索し、一致した暗号化ハッシュ値を持つレコードのマップIDを取得し、前記取得したマップIDを持つ前記暗号化預託データテーブルのレコードを検索対象とすることを特徴とする秘匿化データ管理方法。
    The concealed data management method according to claim 13,
    The hash table includes a map ID that is an identifier of each record of the encrypted deposit data table and the hash value,
    The encrypted deposit data table includes an identifier map ID corresponding to an encrypted hash value stored in the hash table;
    In the method, the database control unit searches the hash table using an encrypted hash value as a keyword, acquires a map ID of a record having a matching encrypted hash value, and the encrypted having the acquired map ID A concealed data management method, wherein a record of a deposit data table is a search target.
  15.  請求項14に記載の秘匿化データ管理方法であって、
     前記データベース制御部が、前記暗号化預託データテーブルのマップIDと前記ハッシュテーブルのマップIDとを対応付け、
     前記データベース制御部が、前記暗号化預託データテーブルに存在しないが前記ハッシュテーブルに存在するマップIDを含むレコードを前記ハッシュテーブルから削除することを特徴とする秘匿化データ管理方法。
    The concealed data management method according to claim 14,
    The database control unit associates the map ID of the encrypted deposit data table with the map ID of the hash table,
    The concealed data management method, wherein the database control unit deletes a record including a map ID that does not exist in the encrypted deposit data table but exists in the hash table from the hash table.
PCT/JP2016/062826 2015-04-22 2016-04-22 Encrypted database system and encrypted data management method WO2016171271A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
JP2015-087303 2015-04-22
JP2015087303A JP6449093B2 (en) 2015-04-22 2015-04-22 Concealed database system and concealed data management method

Publications (1)

Publication Number Publication Date
WO2016171271A1 true WO2016171271A1 (en) 2016-10-27

Family

ID=57144518

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/JP2016/062826 WO2016171271A1 (en) 2015-04-22 2016-04-22 Encrypted database system and encrypted data management method

Country Status (2)

Country Link
JP (1) JP6449093B2 (en)
WO (1) WO2016171271A1 (en)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP6351890B1 (en) * 2017-05-18 2018-07-04 三菱電機株式会社 Search device, secret search system, and search program
WO2018154581A1 (en) * 2017-02-22 2018-08-30 Kindite Ltd. Encrypting data records and processing encrypted records without exposing plaintext
CN110008448A (en) * 2019-04-02 2019-07-12 中国工商银行股份有限公司 The method and apparatus that SQL code is automatically converted to Java code
CN113050878A (en) * 2019-12-27 2021-06-29 北京兆易创新科技股份有限公司 Method and device for dividing blocks by opening cards
CN115694921A (en) * 2022-10-12 2023-02-03 浪潮卓数大数据产业发展有限公司 Data storage method, device and medium

Families Citing this family (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR101979320B1 (en) * 2017-05-18 2019-05-16 뱅크웨어글로벌 주식회사 System and Method for automatic generation and execution of encryption SQL statements using meta-information and enterprise framework
US10846423B2 (en) * 2017-08-11 2020-11-24 Palo Alto Research Center Incorporated System and architecture for analytics on encrypted databases
KR101881856B1 (en) * 2017-08-31 2018-08-24 주식회사 스파이스웨어 Data encryption/decryption process method under cloud network environment
US10728022B2 (en) * 2017-12-28 2020-07-28 Fujitsu Limited Secure hash operations in a trusted execution environment
JPWO2020158842A1 (en) * 2019-02-01 2020-08-06
JP7249248B2 (en) * 2019-08-30 2023-03-30 株式会社日立製作所 Confidential Information Processing System and Confidential Information Processing Method
JP7381893B2 (en) 2020-04-14 2023-11-16 富士通株式会社 Search method, search program, and secret information retrieval system

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH11143780A (en) * 1997-11-05 1999-05-28 Hitachi Ltd Method and device for managing secret information in database
JP2012084084A (en) * 2010-10-14 2012-04-26 Fujitsu Ltd Cooperation device, cooperation source device, cooperation destination device, cooperation program and cooperation method
JP2012248940A (en) * 2011-05-25 2012-12-13 Mitsubishi Electric Corp Data generation device, data generation method, data generation program and database system
JP2014098990A (en) * 2012-11-13 2014-05-29 Fujitsu Ltd Retrieval processing method, data generation method, and information processor

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH11143780A (en) * 1997-11-05 1999-05-28 Hitachi Ltd Method and device for managing secret information in database
JP2012084084A (en) * 2010-10-14 2012-04-26 Fujitsu Ltd Cooperation device, cooperation source device, cooperation destination device, cooperation program and cooperation method
JP2012248940A (en) * 2011-05-25 2012-12-13 Mitsubishi Electric Corp Data generation device, data generation method, data generation program and database system
JP2014098990A (en) * 2012-11-13 2014-05-29 Fujitsu Ltd Retrieval processing method, data generation method, and information processor

Cited By (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2018154581A1 (en) * 2017-02-22 2018-08-30 Kindite Ltd. Encrypting data records and processing encrypted records without exposing plaintext
US11361099B2 (en) 2017-02-22 2022-06-14 Ringcentral, Inc. Encrypting data records and processing encrypted records without exposing plaintext
US11366921B2 (en) 2017-02-22 2022-06-21 Ringcentral, Inc. Encrypting data records and processing encrypted records without exposing plaintext
JP6351890B1 (en) * 2017-05-18 2018-07-04 三菱電機株式会社 Search device, secret search system, and search program
CN110008448A (en) * 2019-04-02 2019-07-12 中国工商银行股份有限公司 The method and apparatus that SQL code is automatically converted to Java code
CN110008448B (en) * 2019-04-02 2023-10-17 中国工商银行股份有限公司 Method and device for automatically converting SQL code into Java code
CN113050878A (en) * 2019-12-27 2021-06-29 北京兆易创新科技股份有限公司 Method and device for dividing blocks by opening cards
CN115694921A (en) * 2022-10-12 2023-02-03 浪潮卓数大数据产业发展有限公司 Data storage method, device and medium
CN115694921B (en) * 2022-10-12 2024-05-28 浪潮卓数大数据产业发展有限公司 Data storage method, device and medium

Also Published As

Publication number Publication date
JP6449093B2 (en) 2019-01-09
JP2016206918A (en) 2016-12-08

Similar Documents

Publication Publication Date Title
JP6449093B2 (en) Concealed database system and concealed data management method
US11726993B1 (en) Systems and methods for cryptographically-secure queries using filters generated by multiple parties
US11709948B1 (en) Systems and methods for generation of secure indexes for cryptographically-secure queries
US7519835B2 (en) Encrypted table indexes and searching encrypted tables
US9235725B2 (en) Client computer for querying a database stored on a server via a network
US8533489B2 (en) Searchable symmetric encryption with dynamic updating
US10685132B1 (en) Methods and apparatus for encrypted indexing and searching encrypted data
EP3356988A1 (en) Method and system for verifiable searchable symmetric encryption
CN112800088A (en) Database ciphertext retrieval system and method based on bidirectional security index
US7930560B2 (en) Personal information management system, personal information management program, and personal information protecting method
US11256662B2 (en) Distributed ledger system
CN101587479A (en) Database management system kernel oriented data encryption/decryption system and method thereof
CN103607405A (en) Ciphertext search authentication method oriented towards cloud storage
US9946720B1 (en) Searching data files using a key map
WO2013084957A1 (en) Encoded-search database device, method for adding and deleting data for encoded search, and addition/deletion program
EP3296980B1 (en) Database system and database processing method
CN115455463A (en) Hidden SQL query method based on homomorphic encryption
US20210182314A1 (en) Systems and methods for on-chain / off-chain storage using a cryptographic blockchain
Li et al. Forward and backward secure searchable encryption scheme supporting conjunctive queries over bipartite graphs
Almarwani et al. Release-aware encryption adjustment query processing for document database
Demertzis Improving Efficiency, Expressiveness and Security of Searchable Encryption
JPWO2016002198A1 (en) Search auxiliary data storage device, search device, add device, delete device, search request device, add request device, delete request device, data search system, data search method, and computer program
EP4154147A1 (en) Data storage server and client devices for securely storing data
Jammalamadaka et al. A middleware approach for building secure network drives over untrusted internet data storage
CN116089976A (en) Relational database management method and device

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 16783292

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 16783292

Country of ref document: EP

Kind code of ref document: A1