JP4050050B2 - Relational database, index table creation method in the relational database, range search method in the relational database, and rank search method for the range search - Google Patents

Relational database, index table creation method in the relational database, range search method in the relational database, and rank search method for the range search Download PDF

Info

Publication number
JP4050050B2
JP4050050B2 JP2001383739A JP2001383739A JP4050050B2 JP 4050050 B2 JP4050050 B2 JP 4050050B2 JP 2001383739 A JP2001383739 A JP 2001383739A JP 2001383739 A JP2001383739 A JP 2001383739A JP 4050050 B2 JP4050050 B2 JP 4050050B2
Authority
JP
Japan
Prior art keywords
item
value
relational database
search
record
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Expired - Fee Related
Application number
JP2001383739A
Other languages
Japanese (ja)
Other versions
JP2003186725A (en
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 株式会社アクアキャスト
Priority to JP2001383739A priority Critical patent/JP4050050B2/en
Publication of JP2003186725A publication Critical patent/JP2003186725A/en
Application granted granted Critical
Publication of JP4050050B2 publication Critical patent/JP4050050B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Images

Landscapes

  • Storage Device Security (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Description

【0001】
【発明の属する技術分野】
本発明は、データベースに関し、特にデータを暗号化して格納するリレーショナルデータベースに関する。
【0002】
【従来の技術】
インターネットやLANが広く普及した現在では、データベースはインターネットやLANといった通信網を介してアクセスされることが多い。図15は、インターネットを介してデータベース(図ではDBと略記。他の図においても同じ)のファイルにデータベースクライアント(図ではDB Clientと略記。他の図においても同じ)がアクセスしているときに、ハッカー等の不正な利用者がそのデータベースファイルにアクセスしている状態を模式的に示す図である。正当な利用者であるデータベースクライアントが1つのデータベースアクセスチャンネルを介し、DBサーバプロセスを経てデータベースファイルにアクセスしている。DBサーバプロセスは、リレーショナルデータベースマネージメントシステム(RDBMS)の一部分である。他方、ハッカーはデータベース・サーバのセキュリティホールを見つけ、不正にデータベースファイルにアクセスし、データベースファイルの窃盗や改竄を行っている。また、図において成りすましと記したように、不正な利用者は、データベースクライアントがデータベースアクセスチャンネルを介してデータベースファイルにアクセスしているとき、そのデータベースアクセスチャンネルにおける通信を傍受している。インターネットやLANといった通信網を介してアクセスされるデータベースファイルは、このような窃盗や改竄、或いは成りすましといった行為により、データの安全が常に脅かされている。更に、データベースファイル自体が物理的に盗まれるということもある。
【0003】
平文で記録されたデータベースファイルはこのような脅威に晒されるので、データベースファイルを暗号化することによりその脅威を軽減し、データベースファイルの安全性を向上しようという試みもある。現在広く利用されているデータベースはリレーショナルデータベースである。データの暗号化に留意した従来のリレーショナルデータベースとして、特表平11−509349「SQLリレーショナルデータベース用エミュレータ」に記載された技術がある。特表平11−509349には、その請求項3に、「秘密を保持するためにデータファイルがアルゴリズムに従って暗号化され、データへのアクセスが暗号化/復号モジュール(M3)によって処理される」と記載され、また発明の詳細な説明の欄には、「必要に応じて、暗号化/復号モジュールを使用してデータファイルにアクセスすることによって、ユーザデータのセキュリティを保証できるので有利である」等と記載されている。
【0004】
【発明が解決しようとする課題】
前掲の特表平11−509349の記載は具体性に欠け、どのような手段や方法によりユーザデータのセキュリティを保証できるのか不明であり、この従来の技術によっては、窃盗や改竄、或いは成りすましといった不正行為、又はデータベースファイル自体の物理的盗難があったとき、データフィルの安全性を保全できない。また、単にデータベースファイルを暗号化するだけでは、正当利用者によるデータベースファイルの検索に要する手間と時間が著しく増大し、実用に供し得るデータベースを構成することはできない。
【0005】
そこで、本発明の目的は、例えデータベースファイルに対し窃盗や改竄、或いは成りすましといった不正行為あり、又はデータベースファイル自体の物理的盗難があったとしても、そのデータベースファイルの秘密が保持され、しかも、正当利用者によるデータベースファイルの検索に要する手間と時間が、著しく増大することのない(データベースファイルが平文であるときに比べ)、リレーショナルデータベース及びそのリレーショナルデータベースにおけるインデックステーブルの作成方法の提供にある。
【0006】
【課題を解決するための手段】
前述の課題を解決するために本発明は次の手段を提供する。
【0007】
[1]レコードが項目単位で暗号化されている暗号化テーブルと、該暗号化テーブルに対応する平文テーブルの各項目における項目値の順位を記録したインデックステーブルとを有することを特徴とするリレーショナルデータベース。
【0008】
[2]前記暗号化テーブルでは、少なくとも1つの項目が暗号化されていることを特徴とする前記[1]に記載のリレーショナルデータベース。
【0009】
[3]前記暗号化テーブルでは、少なくとも一意な値の項目が平文であることを特徴とする前記[1]又は[2]に記載のリレーショナルデータベース。
【0010】
[4]前記暗号化テーブルでは、一意な値の項目が暗号化されていることを特徴とする前記[1]又は[2]に記載のリレーショナルデータベース。
【0011】
[5]前記暗号化テーブルでは、一意な値の項目だけが平文であり、一意な値の項目以外の項目は暗号化されていることを特徴とする前記[1]乃至[3]に記載のリレーショナルデータベース。
【0012】
[6]前記暗号化テーブルでは、全ての項目が暗号化されていることを特徴とする前記[1],[2]又は[4]に記載のリレーショナルデータベース。
【0013】
[7]前記インデックステーブルにおける各項目名は、前記平文テーブルにおける各項目名と対を成し、該両テーブルにおける該対をなす両項目名は同じであることを特徴とする前記[1]乃至[6]に記載のリレーショナルデータベース。
【0014】
[8]前記インデックステーブルにおける各項目名は、前記平文テーブルにおける各項目名と対を成し、該両テーブルにおける該対をなす両項目名は互いに相違することを特徴とする前記[1]乃至[6]に記載のリレーショナルデータベース。
【0015】
[9]前記順位は、昇順又は降順のうちのどちらか一方の順位付け方式による順位であることを特徴とする前記[1]乃至[8]に記載のリレーショナルデータベース。
【0016】
[10]レコードが項目単位で暗号化されている暗号化テーブルと、該暗号化テーブルに対応する平文テーブルの各項目における項目値の順位を記録したインデックステーブルとを有するリレーショナルデータベースにおける該インデックステーブルの作成方法において、
ポインター値iを1に設定する第1のステップと、
前記平文テーブルを参照することにより、該平文テーブルにおける第1の暗号化対象項目に関しソート処理を行い、該ソート処理により得た順位の順に一意な値の項目の項目値A()を取得し、該一意な値の項目の項目値A()を該順位に対応付けて配列する第2のステップと、
前記ポインター値iに対応する前記一意な値の項目の項目値A(i)と、該ポインター値iとを前記インデックステーブルに記録する第3のステップと、
前記iをi+1に替える第4のステップと、
前記第3のステップ乃至第4のステップを前記平文テーブルの全レコード数分繰り返す第5のステップと、
前記第1のステップ乃至第5のステップを前記平文テーブルにおける第1の暗号化対象項目以外の暗号化対象項目について順次に行う第6のステップと
からなることを特徴とするインデックステーブルの作成方法。
【0017】
[11]レコードが項目単位で暗号化されている暗号化テーブルと、該暗号化テーブルに対応する平文テーブルの各項目における項目値の順位を記録したインデックステーブルとを有するリレーショナルデータベースにおける所定項目の範囲検索のための検索であって、該範囲検索の下限値および上限値を検索値とし、該下限値以上であり、かつ最も小さい値の該インデックステーブルにおける該所定項目の項目値を第1の順位とし、該上限値以下であり、かつ最も大きい値の該インデックステーブルにおける該所定項目の項目値を第2の順位とするとき、該第1および第2の順位を検索する方法において、
前記インデックステーブルにおける所定項目の最大項目値を検索し、該最大項目値を基に該インデックステーブルにおけるレコード数を仮定し、該仮定レコード数を変数MAXとする第1のステップと、
変数MINを1に、変数MAX/2の整数部を変数Pに、前記下限値を検査するときは該下限値を検索値とするともに、前記上限値を検索するときは該上限値を検索値とし、該検索値を変数Sに、検索条件Wを“以上”に、該範囲検索における上限値を検索するときは該検索条件Wを“以下”に、それぞれ設定する第2のステップと、
ループを開始する第3のステップと、
前記暗号化テーブル及びインデックステーブルを検索し、該インデックステーブルにおける前記所定項目の項目値が変数Pと同じであるレコードにおける一意な値の項目の項目値を取得し、該暗号化テーブルにおける該一意な値の項目の項目値が属するレコードの該所定項目の項目値を取得し、取得した該項目値の復号により平文の項目値を生成し、変数Aを該平文の項目値とする第4のステップ、
検索値Sと変数Aとを比較し、S=Aであるとき、前記第4のステップでインデックステーブルから取得した前記一意な値の項目が属する該インデックステーブルにおけるレコードの前記所定項目の項目値を前記第1または第2の順位として取得し、S<Aのとき、変数MAXを変数Pとし、変数Pを(P−MIN)/2+MINに変更するとともに、S>Aのとき、変数MIN を変数Pとし、変数Pを(MAX−P)/2+Pに変更する第5のステップと、
前記第5のステップの結果がP=MAX又はP=MINに至ったとき、ループを終了する第6のステップと、
前記暗号化テーブル及びインデックステーブルを検索し、該インデックステーブルにおける前記所定項目の項目値が変数MINからMAXまでの範囲にあるレコードの一意な値の項目を選択し、該暗号化テーブルにおいて該一意は値の項目を同じくするレコードの該所定項目の項目値を取得し、復号する第7のステップと、
前記検索条件Wが“以上”であるとき、前記第7のステップで復号した項目値のうちで検索値S以上であり、かつ最小である項目値が属するレコードの一意な値の項目の項目値を取得し、前記検索条件Wが“以下”であるとき、前記第7のステップで復号した項目値のうちで検索値S以下であり、かつ最大である項目値が属するレコードの一意な値の項目の項目値を取得する第8のステップと、
前記第8のステップで取得した前記一意な値の項目と同じ項目が属する前記インデックステーブルにおけるレコードの前記所定項目の項目値を前記第1または第2の順位とする第9のステップと
からなり、
前記第2のステップにおいて検索条件を“以上”に設定したときは、第5および第9のステップでは、前記所定項目の項目値を前記第1の順位として取得し、前記第2のステップにおいて検索条件を“以下”に設定したときは、第5および第9のステップでは、前記所定項目の項目値を前記第2の順位として取得する
ことを特徴とするリレーショナルデータベースにおける所定項目の範囲検索のための順位検索方法。
【0018】
[12]レコードが項目単位で暗号化されている暗号化テーブルと、該暗号化テーブルに対応する平文テーブルの各項目における項目値の順位を記録したインデックステーブルとを有するリレーショナルデータベースにおける範囲検索の方法において、
所定の項目に関する第1の順位をキーとして前記インデックステーブルを検索し、該所定の項目における項目値が該第1の順位以上または以下であるレコードの一意な値の項目の項目値を取得し、
前記インデックステーブルの検索で取得された前記一意な値の項目の項目値をキーとして前記暗号化テーブルを検索することにより、前記所定の項目に関する順位が前記第1の順位以上または以下であるレコードの暗号化項目値を取得する
ことを特徴とする範囲検索の方法。
【0019】
[13]レコードが項目単位で暗号化されている暗号化テーブルと、該暗号化テーブルに対応する平文テーブルの各項目における項目値の順位を記録したインデックステーブルとを有するリレーショナルデータベースにおける範囲検索の方法において、
所定の項目に関する第1及び第2の順位をキーとして前記インデックステーブルを検索し、該所定の項目における項目値が該第1の順位以上であり、かつ該第2の順位以下であるレコードの一意な値の項目の項目値を取得し、
前記インデックステーブルの検索で取得された前記一意な値の項目の項目値をキーとして前記暗号化テーブルを検索することにより、前記所定の項目に関する順位が前記第1の順位以上であり、かつ前記第2の順位以下であるレコードの暗号化項目値を取得する
ことを特徴とする範囲検索の方法。
【0020】
[14] 前記第1の順位が前記[11]の方法で検索された前記第1の順位である前記[12]に記載の範囲検索の方法。
【0021】
[15] 前記第1および第2の順位が前記[11]の方法で検索された前記第1および第2の順位である前記[13]に記載の範囲検索の方法。
【0022】
[16]取得した前記暗号化項目値を平文に復号することを特徴とする前記[12]乃至[15]に記載の範囲検索の方法。
【0023】
【発明の実施の形態】
次に図面を参照し、本発明の実施の形態を説明する。図1は、本発明の一実施の形態のリレーショナルデータベースにおけるテーブルの構成例を示す図である。図2は、本実施の形態におけるインデックステーブルの作成方法を模式的に示す図である。図3は、本実施の形態における暗号化テーブルの一例を示す図である。図4は、本実施の形態において、暗号化テーブルに格納した1つのレコード内のデータをキーワードで検索する方法を示す概念図である。図5及び図6は、本実施の形態において、暗号化テーブルに格納した多数のレコード内からある範囲を指定し、その範囲内のレコードを検索する方法を示す概念図である。図7及び図8は、本実施の形態において、新規にレコードを暗号化テーブルに格納する方法を示す概念図である。図9は、本実施の形態において、暗号化テーブルからレコードを削除する方法を示す概念図である。図10は、本実施の形態において、暗号化テーブルに格納されているレコードを修正する方法を示す概念図である。図11は、本実施の形態におけるインデックステーブルの一括更新の方法を示す概念図である。図12は、本実施の形態におけるインデックステーブルの作成方法を示す流れ図である。図13及び図14は、本実施の形態に2分検索法を適用し、データの検索をする方法を示す流れ図である。
【0024】
本実施の形態のリレーショナルデータベースにおけるデータベースファイルは、暗号化テーブル及びインデックステールで構成される。暗号化テーブルは、平文テーブルにおける各項目を暗号化することにより生成できる。また、暗号化テーブルは、未だレコードが格納されてない新規のテーブルに、各項目が暗号化されたレコードを順次に格納することによっても作成できる。図1は、平文テーブルが既に生成されているときに、平文テーブルから暗号化テーブル及びインデックステーブルを作成する様子を概念的に示している。平文テーブルにおける項目名は、「NO」、「会員番号」、「氏名」、「住所」である。暗号化テーブルでは暗号化される項目のデータ属性はすべて文字型である。例えば、平文テーブルにおける会員番号のデーア属性は数値型であるが、暗号化テーブルにおける会員番号のデータ属性は文字列型である。
【0025】
この「NO」項目は、前述の一意な値の項目の例であり、オラクル(登録商標)などのリレーショナルデータベースで主キーとか、プライマリーキーとか称されている項目に相当する。「NO」項目の項目値を特定することにより、レコードが一意に特定さるので、本願では「NO」項目の項目値をレコードNO又は単にNOと称することにする。また、「NO」項目の項目名を「レコードNO」と記すこととする。いわゆるユーザデータは、項目名「会員番号」、「氏名」、および「住所」における項目値であり、暗号化テーブルでは暗号化されて格納されている。ここでは、項目名「会員番号」、「氏名」、および「住所」における項目値は、それぞれ会員番号、氏名、および住所と記す。そして、これら項目値を具体的なデータとして示すときは、該項目値を“”で囲んで表記することとする。例えば、暗号化テーブルにおける”3mfj4340snswlw”は平文テーブルにおける“田中一郎”を本実施の形態のリレーショナルデータベースにおける暗号アルゴリズムで暗号化したデータである。
【0026】
図のテーブルにおいて紙面(背景)をグレーに変換した領域は、暗号化項目が格納される項目である。暗号化テーブルにおいてもレコードNOは平文のままである。レコードNOを暗号化しても本発明は実現できるが、この実施の形態ではレコードNOは平文のままとし、検索処理の簡単化および高速化を図っている。各レコードNOには唯一のNOが付与されている。そこで、レコードNOはレコードを一意に特定する機能を有し、NOを指定することによりレコードを一意に指定できる。各レコードは1行のデータから構成されており、レコードNOとして“1”を指定することにより、図1における平文テーブルでは、レコードNO=“1”、会員番号=“001”、氏名=“鈴木 太郎”、住所=“東京都品川区”で構成されるレコードが指定される。同様に、暗号化テーブルでは、レコードNOとして“1”を指定することにより、レコードNO=“1”、会員番号=”gtxUcA”、氏名=”iLFeC0P8o0Yf”、住所=”zksi3m4394”でなるレコードが指定される。実際の暗号化テーブルは、図1と同様に項目名が「NO」、「会員番号」、「氏名」および「住所」でなる会員テーブルでも、図3に例示するように、多数のレコードでもって構成されるのが一般的である。
【0027】
インデックステーブルは本発明に特徴的なテーブルであり、各暗号化テーブルにはそれぞれ1つづつのインデックステーブルが対応している。インデックステーブルでは、各項目は平文である。インデックステーブルにおける項目名は平文テーブルにおける項目名と同じである。したがって、インデックステーブルにおける各項目は平文テーブルにおける各項目に1対1に対応している。インデックステーブルにおける各項目値は、平文テーブルにおける該対応項目の順位値である。図1の平文テーブルでは、項目名「会員番号」では、項目名「NO」が“1”の順位は1位、項目名「NO」が“2”の順位は2、項目名「NO」が“3”の順位は3である。また、図1の平文テーブルにおける、項目名「氏名」では、アルファベット順に順位をつけることとし、レコードNOが“1”の順位は1位、レコードNOが“2”の順位は3、レコードNOが“3”の順位は2である。
【0028】
図2を参照し、インデックステーブルの作成方法を説明する。図2では、説明の簡潔化のために、平文テーブルのデータを図1の平文テーブルのものより一層簡単なものとしてある。「項目1」の順位は数字の昇順、「項目2」の順位はアルファベット順、また「項目3」の順位はアイウエオ順である。
【0029】
インデックステーブルを作成するために、まず平文テーブルの項目名=「項目1」についてソート処理を行う。このソート処理により、順位1位、2位及び3位にはレコードNOがそれぞれ“3”,“1”及び“2”の項目が選ばれ、レコードNOがこの順(“3”,“1”,“2”の順)に並び替えられる。図2の例では、レコードNOが“1”のレコードでは、「項目1」の項目値は2となる。レコードNOが“1”のレコードにおける「項目2」及び「項目3」の項目値は、この段階では決められていないので、空欄である。また、レコードNOが“2”のレコードでは、「項目1」の項目値は3となる。レコードNOが“2”のレコードにおける「項目2」及び「項目3」の項目値は、この段階では決められていないので、空欄である。また、レコードNOが“3”のレコードでは、「項目1」の項目値は1となる。レコードNOが“3”のレコードにおける「項目2」及び「項目3」の項目値は、この段階では決められていないので、空欄である。
【0030】
同様に、「項目2」についてソート処理を行う。「項目2」のソート処理により、順位1位、2位及び3位にはレコードNOがそれぞれ“1”,“2”及び“3”の項目が選ばれ、レコードNOがこの順(“1”,“2”,“3”の順)に並び替えられる(この例では、並び替えられた結果のレコードNOの順は元の平文テーブルにおける順と同じになる)。図2の例では、レコードNOが“1”のレコードでは、「項目2」の項目値は1となる。レコードNOが“1”のレコードにおける「項目3」の項目値は、この段階では決められていないので、空欄である。また、レコードNOが“2”のレコードでは、「項目2」の項目値は2となる。レコードNOが“2”のレコードにおける「項目3」の項目値は、この段階では決められていないので、空欄である。また、レコードNOが“3”のレコードでは、「項目2」の項目値は3となる。レコードNOが“3”のレコードにおける「項目3」の項目値は、この段階では決められていないので、空欄である。
【0031】
同様に、「項目3」についてソート処理を行う。「項目3」のソート処理により、順位1位、2位及び3位にはレコードNOがそれぞれ“3”,“2”及び“1”の項目が選ばれ、NO項目がこの順(“3”,“2”,“1”の順)に並び替えられる。図2の例では、レコードNOが“1”のレコードでは、「項目3」の項目値は3となる。レコードNOが“1”のレコードにおける「項目1」、「項目2」及び「項目3」の項目値は、この段階で全て決められ、それぞれ2,1,3である。また、レコードNOが“2”のレコードでは、「項目3」の項目値は2となる。レコードNOが“2”のレコードにおける「項目1」,「項目2」及び「項目3」の項目値は、この段階では全て決められ、それぞれ3,2,2である。また、レコードNOが“3”のレコードでは、「項目3」の項目値は1となる。レコードNOが“3”のレコードにおける「項目1」,「項目2」及び「項目3」の項目値は、この段階で全て決められ、それぞれ“1”,“3”,“1”である。かくして図2のインデックステーブルが作成された。
【0032】
次に、図4を参照し、図1の如くに暗号化テーブルとインデックステーブルとを有する本実施の形態のリレーショナルデータベースにおいて、キーワードによりレコードの検索を行う例を説明する。図4の暗号化会員テーブルは、図1に示すように、項目名が「NO」、「会員番号」、「氏名」および「住所」でなる会員テーブルであるとする。暗号化会員テーブルは、データベース・サーバに格納され、同じデータベース・サーバに格納されているリレーショナルデータベースマネージメントシステム(RDBMS)により制御されている。いま、クライアントは、検索キーワード“田中一郎”で暗号化会員テーブルにおける住所を検索するものとする。このとき、クライアント側の暗号データベースプログラムにより“田中一郎”を暗号化し、“田中一郎”を”3mfj340snswlw”なる暗号データに変換する。クライアント側の暗号データベースプログラムは、例えばオラクル(登録商標)のSQL*PLUSに暗号・復号機能を付加したデータベースプログラムであり、SQL言語によりサーバー側のRDBMSと交信し、データの検索・追加・修正・削除、テーブルの更新などを行うとともに、暗号・復号用のアルゴリズムにより、レコードの項目毎にデータの暗号・復号を行う。
【0033】
“田中一郎”の暗号”3mfj340snswlw”なるキーワードで暗号化会員テーブルを検索し、田中一郎の住所を取得するためには、クライアント側の暗号データベースプログラムは、Select住所from会員テーブルwhere氏名=” 3mfj340snswlw”なるいわゆるSelect文で暗号化会員テーブルに問合せをする。すると、平文の会員テーブルを検索するときと同様に、田中一郎の住所のデータが暗号化会員テーブルから返信される。しかし、このときに得られる返信データは、その住所を暗号化したデータ”kdsnw948nwkwnw”である。クライアント側の暗号データベースプログラムは、その暗号データを暗号アルゴリズムで復号し、“東京都港区”なる住所を取得する。
【0034】
次に図5及び図6を参照して、本実施の形態のリレーショナルデータベースによる範囲検索の例を説明する。いま、本実施の形態のリレーショナルデータベースは、前述のところと同様に、項目名が「NO」、「会員番号」、「氏名」および「住所」でなる暗号化会員テーブルとそのインデックステーブルを格納しているものとする(後に説明する図7乃至図11においても同様とする)。本実施の形態において範囲検索を行うときは、インデックステーブルを参照し、開始レコードと終了レコードのレコードナンバーを取得し、取得したレコードナンバーをキーとして、暗号化テーブルを検索し、該当するレコードを取得する。ここで挙げる範囲検索の例は、暗号化会員テーブルにおける会員番号が50から60のレコードを取得することである。図5及び図6における▲1▼乃至▲6▼はその範囲検索における処理のステップを示す。これら各ステップでは、その範囲検索のためのSQL文及びその検索で取得される結果が示してある。図5及び図6では、図の左側にはクライアント側の暗号データベースプログラムで行う処理および検索結果を図示し、図の右側には実施の形態のリレーショナルデータベースにおける暗号化会員テーブル又はこの暗号化会員テーブルに対応するインデックステーブルを示す(後に説明する図7乃至図14においても同様である)。
【0035】
ステップ▲1▼では、2分検索法によるインデックステーブルの検索の開始を示す。2分検索法は、既に周知の検索法であるが、本実施の形態に適用するのに適した具体的な2分検索法が図13及び図14に詳しい流れ図で示してある。Select文において、“レコード数÷2”の部分にアンダーラインを入れてある。このアンダーラインは、“レコード数÷2”なる記述そのものがこの位置に入力されるのではないことを示すために付してある。
【0036】
そのSelect文の発行に先立って、インデックステーブルをまず検索し、対象項目(今の例では、「会員番号」の項目)における最大インデックス値を取得する。インデックステーブルでは、各項目には順位が格納されている。そこで、インデックス値は、図11を参照して後述するインデックステーブルの一括更新をすると、最小順位から最大順位まで欠番の無い整数になる。しかしながら、インデックステーブルの一括更新の前では、図8のステップ▲5▼を参照して後述するように、インデックス値は小数点を含むことが有り、また図9のレコード削除などによりインデックス値に欠番が生じることもある。そこで、その最大インデックス値は必ずしもレコード数と一致しない。しかし、最大インデックス値は概ねレコード数に近似するので、図5のステップ▲1▼では、インデックステーブルの対象項目(ここでは、「会員番号」項目)における最大インデックス値を検索し、その最大インデックス値に1を加えた値をレコード数としている。最大インデックス値が少数点のときも、その最大インデックス値のレコードが検索対象から除かれることを防ぐために、最大インデックス値に1を加えた値をレコード数としているのである。
【0037】
そのSelect文において、レコード数÷2なる式による具体的な計算結果の数字をこのアンダーラインの位置に入力する。“レコード数÷2”の部分のアンダーラインはこのこと(別途に検索し、計算して得た値を入れるということ)を示している。▲1▼の検索により、インデックステーブルにおける「会員番号」項目の項目値(順位)が中間値であるレコードNOが取得される。なお、他の図面におけるSelect文におけるアンダーラインも同様な目的で付されている。
【0038】
ステップ▲2▼では、取得したレコードNOをキーとして、暗号化会員テーブルを検索する。この検索により、そのレコードNOの会員番号(暗号化された会員番号)が取得される。この会員番号をクライアント側の暗号データベースプログラムで解読し、平文の会員番号を生成する。ステップ▲2▼のSelect文における「検索するNO」のアンダーラインは、ステップ1おけるアンダーラインと同様な趣旨で付されており、「検索するNO」なる文字が入力されるのではなく、ステップ▲1▼で得られたレコードNOがこの位置に入力されることを示している。
【0039】
ステップ▲3▼では、検索したい“会員番号”とステップ▲2▼で取得し、復号した“会員番号”とを比較する。検索したい“会員番号”は、範囲検索における範囲の下限値(=50)と上限値(=60)である。比較した両者が一致し、会員番号の下限値または上限値が判明したときは、他方の限界値を検索したい“会員番号”とし、再びステップ▲1▼とステップ▲3▼間の検索を繰り返し、他方の限界値を取得する。比較した両者が不一致であり、会員番号の下限値または上限値が判明しないときは、下限値または上限値の一方の限界値にステップ▲2▼の復号化会員番号が一致するまで再びステップ▲1▼とステップ▲3▼間の検索を繰り返し、更にステップ▲1▼からステップ▲3▼までの検索により他方の限界値の検索をし、取得する。下限値の会員番号を検索開始の会員番号と称し、上限値の会員番号を検索終了の会員番号と称し、検索開始の会員番号が存するレコードにおけるレコードNOを開始レコードNOと称し、検索終了の会員番号が存するレコードにおけるレコードNOを終了レコードNOと称することにする。ステップ▲1▼からステップ▲3▼は、前述の「リレーショナルデータベースにおける所定項目の範囲検索のための順位検索方法」における第1乃至第8のステップに相当する。ステップ▲1▼からステップ▲3▼で行う2分検索法の一層詳しい処理の手順は、図13及び図14に示してある。
【0040】
ステップ▲4▼では、前述の「リレーショナルデータベースにおける所定項目の範囲検索のための順位検索方法」における第9のステップに相当し、開始レコードNO及び終了レコードNOをキーとして、インデックステーブルを検索し、それぞれのレコードNOのレコードにおける会員番号の順位を取得する。インデックステーブルでは、会員番号項目には,会員番号の順位が格納されているので、ステップ▲4▼の検索により、開始会員番号の順位(開始順位)及び終了会員番号の順位(終了順位)が取得される。
【0041】
ステップ▲5▼では、会員番号の開始順位および終了順位でインデックステーブルを検索し、それら開始順位と終了順位との間(開始順位と終了順位を含む)のレコードNOを所得する。
【0042】
ステップ▲6▼では、ステップ▲5▼で取得したレコードNOをキーとして、暗号化会員テーブルを検索し、それらレコードNOのレコードを取得する。かくして、ステップ▲1▼からステップ▲6▼の検索により、会員番号が50から60の間(50及び60を含む)にある全ての会員のレコードが取得できた。
【0043】
図5および図6を参照して説明した範囲検索の例で明らかなように、本実施の形態では、暗号化テーブルと、この暗号化テーブルに対応するインデックステーブルとを備えるので、範囲検索が高速に行える。もし、データベースの安全性を向上するために、平文テーブルを単純に暗号化した暗号化テーブルだけを備えるリレーショナルデータベースを構築したとすると、範囲検索の度に暗号化テーブルにおける全てのレコードを復号しなければならない。なぜなら、範囲検索では項目の順位を生成しなければならないのであるが、暗号データのままでは順位を知ることができないからである。範囲検索の度に全てのレコードを平文に復号すると、検索時間が非常に長くなるのは避けられない。これに対し、本実施の形態のリレーショナルデータベースでは、平文のときの項目の順位をインデックステーブルに予め格納しておくので、範囲検索においては、項目の順位をそのインデックステーブルの検索で取得でき、暗号化テーブルの復号を要しない。したがって、本実施の形態では、レコードの復号範囲および順位データ取得のための比較処理が大幅に減少し、処理を高速に行うことができる。また、このインデックステーブルを利用することにより、レコードの並び替えが高速にできるから、レコードを並び替えたテーブルを高速に取得(出力)できる。
【0044】
次に、図7及び図8を参照し、本実施の形態のリレーショナルデータベースに新規にレコードを追加する処理を説明する。既存の暗号化テーブルに新規のレコードを追加するには、インデックステーブルを参照し、新規レコードの順位を求め、インデックス値を作成し、インデックステーブル及び暗号化テーブルにレコードを挿入する。ここで挙げるレコード追加の例は、会員番号が“100”、氏名が“山田 太郎”、住所が“東京都品川区”である新規レコードを暗号化会員テーブルに追加することである。図7及び図8における▲1▼乃至▲7▼はそのレコード追加における処理のステップを示す。これら各ステップでは、そのレコード追加のためのSQL文及びその検索で取得される結果が示してある。
【0045】
図7におけるステップ▲1▼,▲2▼及び▲3▼は、図5におけるステップ▲1▼,▲2▼及び▲3▼にそれぞれ相当する。図7のステップ▲1▼及び▲2▼は図5のステップ▲1▼及び▲2▼と同じ処理を行う。図7のステップ▲3▼は、図5のステップ▲3▼とほぼ同じ処理を行う。ただし、図5のステップ▲3▼では、復号した“会員番号”と比較される検索対象は、範囲検索の開始会員番号と終了会員番号との2つであったが、これに対し、図7のステップ▲3▼では、復号した“会員番号”と比較される検索対象は、追加したいレコードの会員番号という1つの会員番号だけである点で、両図におけるステップ▲3▼は相違している。この図7の処理では、ステップ▲1▼から▲3▼の処理を繰り返し、会員番号の値が“100”より小さく、その中で最も大きい会員番号の値を持つレコードNOを暗号化会員テーブルから取得する。
【0046】
図8のステップ▲4▼は、図6のステップ▲4▼とほぼ同じ処理を行う。但し、図6のステップ▲4▼では開始レコードNO及び終了レコードNOの2つのレコードNOで検索したのに対し、図8のステップ▲4▼では1つの検索レコードNOだけで検索する点で、図8のステップ▲4▼は図6のステップ▲4▼と相違している。
【0047】
ステップ▲5▼では、ステップ▲4▼で取得した“会員番号”の“順位”に小数点以下の数値を付加し、新規のインデックス値、すなわち順位を作成する。例えば、ステップ▲4▼で取得した“会員番号”の“順位”が“95”であれば、95+0.001=95.001を追加会員番号用レコードにおける会員番号のインデックス値、すなわち順位とする。95.001なる順位の既存のレコードがあり、追加用の順位と既存順位が重複するときは、順位95と96との間に既にあるレコード及び追加レコードにつき、ソート処理を施し、各レコードの順位を付け直す処理をして、レコードの順位を更新する。
【0048】
また、別の方法として、95.001なる順位の既存のレコードがインデックステーブルに既にあるときは、既にある順位95.001に0.001を加えた95.002を既存のレコードの順位とする。すなわち、既存のレコードの順位を更新する。もし、95.001なる順位の既存のレコード及び95.002なる順位の既存のレコードがインデックステーブルに既にあるときは、既にある順位95.001及び95.002にそれぞれ0.001を加えた95.002及び95.003を既存のレコードの順位とする。順位95と96との間に既に3つ以上の既存のレコードが存在するときは、前記と同様に既存のレコードの順位を更新する。
【0049】
ステップ▲6▼では、クライアント側の暗号データベースプログラムで新規レコードを暗号化し、暗号化会員テーブルに追加する。ステップ▲7▼では、ステップ▲5▼で作成したインデックス値を基にに、新規レコードをインデックステーブルに追加する。かくして、ステップ▲1▼からステップ7の処理により、新規レコードが暗号化テーブル及びインデックステーブルに追加された。
【0050】
次に、図9を参照して、本実施の形態のリレーショナルデータベースにおけるレコードを削除する処理を説明する。図9における▲1▼及び▲2▼はそのレコード削除における処理のステップを示す。これら各ステップでは、そのレコード削除のためのSQL文及びその検索で取得される結果が示してある。ステップ▲1▼では、暗号化会員テーブルにおける削除対象レコードのレコードNOを負の値に変更する。ステップ▲2▼では、インデックステーブルにおける削除対象レコードのレコードNOを負の値に変更する。このように負の値に変更されたレコードNOのレコードは、通常の検索処理では検索されないように、クライアント側の暗号データベースプログラムを設定しておく。但し、このリレーショナルデータベースの管理者は必要に応じて、レコードNOが負の値のレコードにもアクセスできるようにその暗号データベースプログラムを設定しておく。
【0051】
次に、図10を参照して、本実施の形態のリレーショナルデータベースにおけるレコードを修正する処理を説明する。図10における▲1▼及び▲2▼はそのレコードの修正における処理のステップを示す。ステップ▲1▼では、暗号化テーブル及びインデックステーブルにおける対象レコードの削除処理を図9の方法で行う。ステップ▲2▼では、暗号化テーブル及びインデックステーブルにおける対象レコードの追加処理を図7及び図8の方法で行う。このステップ▲1▼及び▲2▼の処理により、レコードの修正が行われる。
【0052】
次に、図11を参照して、本実施の形態のリレーショナルデータベースにおけるインデックステーブルを一括更新する処理を説明する。図11における▲1▼,▲2▼及び▲3▼はインデックステーブルの一括更新処理のステップを示す。ステップ▲1▼では、レコードNOが負数であるレコードを削除する。ステップ▲2▼では、インデックステーブルにおける「会員番号」の項目値、すなわち順位の順番にレコードNOを取得する。ステップ▲3▼では、ステップ▲2▼で取得したレコードNOの順番をシーケンス番号として、各レコードNOのレコードの“会員番号”をこのシーケンス番号に更新する。「住所」及び「氏名」についてもステップ▲2▼及びステップ▲3▼の処理を行い、インデックステーブルの一括更新を完了する。
【0053】
図12は、本実施の形態におけるインデックステーブルの作成方法を示す流れ図である。本実施の形態におけるインデックステーブルの作成方法については図2を参照して前に説明したが、図12はその作成方法を流れ図で示している。このインデックステーブルの作成方法は、レコードが項目単位で暗号化されている暗号化テーブルと、該暗号化テーブルに対応する平文テーブルの各項目における項目値の順位を記録したインデックステーブルとを有するリレーショナルデータベースにおける該インデックステーブルの作成方法である。
【0054】
ステップP1では、ポインター値iを1に設定する。ステップP2では、平文テーブルを参照することにより、該平文テーブルにおける第1の暗号化対象項目に関しソート処理を行い、該ソート処理により得た順位の順に項目名「レコードNO」の項目値A()を取得し〔項目値A()は前述のレコードNOに相当する〕、該項目値A()を該順位に対応付けて配列する。ステップP3では、ループ処理に入る。ステップP4では、ポインター値iに対応する項目値A(i)と、該ポインター値iとをインデックステーブルに記録する。ステップP5では、ポインター値iをi+1に替える。ステップP6では、第3のステップ乃至第5のステップを平文テーブルの全レコード数分繰り返す。ステップP1乃至P6は、平文テーブルにおける第1の暗号化対象項目以外の暗号化対象項目について行う。前述の会員テーブルの例では、第1の暗号化対象項目を「会員番号」、第2の暗号化対象項目を「氏名」、第3の暗号化対象項目を「住所」とすることにより、平文テーブルにおける「レコードNO」(一意な値の項目)以外の全ての項目に関するインデックステーブルが作成される。
【0055】
図13及び図14は本実施の形態に適用する2分検索法を示す流れ図である。2分検索法は、図5(範囲検索)のステップ▲1▼から▲3▼及び図7(レコードの追加)のステップ▲1▼から▲3▼において利用した。図13及び図14は、図5のステップ▲1▼から▲3▼に適用するときの2分検索法の手順を詳しく示している。2分検索法のプログラムはクライアント側の暗号データベースプログラムに組み込まれている。本実施の形態のリレーショナルデータベースでは、暗号化テーブルだけではなく、暗号化テーブルに対応した平文のインデックステーブルを備え、図5のステップ▲1▼から▲3▼を参照して説明したように、インデックステーブルの参照により各項目名ごとに項目の順位を取得できるので、暗号化したデータを2分検索法により効率よく検索できる。暗号化テーブルにつき範囲検索を行うには、図5及び図6を参照して説明したように、その範囲の下限値(図5の例では会員番号=50)及び上限値(図5の例では会員番号=60)を暗号化テーブルにおいて検索することが必要である。暗号化テーブルには、下限値または上限値に一致する項目値(図5の例では会員番号)が無いことがあり得る。このようなときには、2分検索法では、下限値以上であって最も小さい値(以下、下限検索値という)および上限値以下であって最も大きい値(以下、上限検索値という)を検索する。範囲検索においては、その下限検索値から上限検索値までの項目値のレコードを検索する。
【0056】
図13及び図14におけるQ1からQ12までのステップにより、まず下限値を検索し、次にQ1からQ13までのステップを再度実行して上限値を検索する。下限値の検索ではステップQ2における検索条件を“以上”とし、上限値の検索ではステップQ2における検索条件を“以下”とする。その他のステップにおける処理は下限値の検索と上限値の検索とで差はないので、以下では下限値の検索を主として説明する。以下の説明においては、理解を容易にするために具体例を挙げる。その具体例として、本実施の形態のリレーショナルデータベースは、前述のところと同様に、項目名が「NO」、「会員番号」、「氏名」および「住所」でなる暗号化会員テーブルとそのインデックステーブルを格納しているものとする。本実施の形態において範囲検索を行うときは、インデックステーブルを参照し、開始レコード及び終了レコードのレコードNO並びに両レコードNOの間の順位のレコードNOを取得し、取得したレコードNOをキーとして、暗号化テーブルを検索し、該当するレコードを取得する。ここで挙げる範囲検索の例では、暗号化会員テーブルにおける会員番号が50から60の範囲(50及び60を含む)にあるレコードを取得することとする。したがって、下限値の検索では検索値は50であり、上限値の検索では検索値は60である。
【0057】
暗号化会員テーブルにおける会員番号が下限値50又は50以上であって最も小さい値(下限検索値)であるレコードを2分検索法で検索する手順をまず説明する。ステップQ1では、インデックステーブルを検索し、対象項目の最大インデックス値を取得し、この最大インデックス値に1を加えた値を生成する。2分検索法プログラムにおける変数MAXを最大インデックス値に1を加えた値とする。従って、仮にインデックステーブルにおける最大インデックス値が79.1であったとすると、小数点以下は切れ捨て、MAXは80となる。この処理により得た最大インデックス値に1を加えた値(小数点以下切れ捨て)を、暗号化テーブル及びインデックステーブルのレコード数と仮定して以下のステップにおいて2分検索法を行うこととなる。以下では、ステップQ1においてレコード数が80と仮定され、ひいてはステップQ1でMAXが80に設定された場合を例に説明する。
【0058】
インデックステーブルにおけるレコード数を取得する際に、最大インデックス値に1を加えた値をレコード数(小数点以下切り捨て)と仮定し、最大インデックス値をレコード数としない理由は次のとおりである。インデックステーブルでは、各項目には順位が格納されている。そこで、インデックス値は、図11を参照して説明したインデックステーブルの一括更新をすると、最小順位(1位)から最大順位まで欠番の無い整数になる。しかしながら、インデックステーブルの一括更新の前では、図8のステップ▲5▼を参照して説明したように、インデックス値は小数点を含むことが有り、また図9のレコード削除などによりインデックス値に欠番が生じることもある。そこで、その最大インデックス値は必ずしもレコード数と一致しない。もっとも、小数点や欠番のインデックス値は整数のインデックス値に比べ圧倒的に少ないのが通常であるから、レコード数は最大インデックス値に概ね近似すると仮定しても、実用上差し支えない。但し、ステップQ1からステップQ13に関する以下の説明で明らかなように、2分検索ではレコード数をインデックス値(順位)の最大値(図13及び図14の例ではMAX)とみなし、この最大値を検索の最大範囲とするので、レコード数を順位の最大値、すなわち最大インデックス値、より小さく仮定すると、その仮定レコード数を越えたインデックス値のレコードは検索対象から漏れる。例えば、最大インデックス値が、79.1であったとき、小数点以下を切り捨て、レコード数を79とするならば、インデックス値が79.1であるレコードは範囲検索の対象外となる。範囲検索における検索対象は暗号化テーブルの全レコードであるから、検索対象外となるレコードが生ずれば、範囲検索における検索の範囲に誤りが生じる。そこで、本実施の形態では、検索された最大インデックス値が小数点であったとき、その最大インデックス値のレコードが検索範囲から外されるのを防ぐために、最大インデックス値+1(小数点切り捨て)をレコード数と仮定して、2分検索を行うようにしたのである。最大インデックス値+1であって、小数点以下を切り捨てた値は、最大インデックス値の小数点以下を切り上げた値に等しい。
【0059】
ステップQ2では、2分検索法プログラムにおける変数MINを“1”に、変数Pを“MAX/2”に、変数Sを“検索値”(=“50”)に、変数Wを下限値検索用の“以上”にそれぞれ設定する。両テーブルのレコード数が80のとき、P=80/2=MAX/2=40となる。ステップQ2により、インデックステーブルで第1回目(ステップQ3からステップQ9でなるループのにおける1回目のループ)に検索する対象の順位Pは、レコード数(=80)の2分値(MAX/2=40)に指定される。第2回目以降のインデックステーブルの検索は、ステップQ7又はステップQ8で設定されたPの順位について行われる。ステップQ3では、ループに入る。
【0060】
ステップQ4では、図示のSelect文を発行し、インデックステーブルにおいて項目名「会員番号」の項目値(「会員番号」項目における順位)がP(=40)であるレコードNOを取得し、暗号化テーブルの該レコードNOにおける項目名「会員番号」の項目値を取得し、その項目値を復号し、変数Aを復号した項目値とする。
【0061】
ステップQ5では、変数SとAとを比較する。ここで、S=Aであれば、検索値Sが復号値Aであったこととなり、下限値が検索できたことになるので、2分検索法の処理は終了する。ステップQ2では、インデックステーブルで第1回目に検索する対象の順位Pをレコード数(=80)の2分値(MAX/2=40)に指定しておいたので、ステップQ5では、順位がPである項目の項目値(会員番号)が検索値Sに一致するか否かを判定する。変数SとAとが不一致であり、S<A又はS>Aであれば、ステップQ6へ進む。ステップQ6では、変数SとAとを再び比較する。S<AならステップQ7へ進み、S>AならステップQ8へ進む。
【0062】
ステップQ7では、まず変数MAX(=80)を変数Pとする。いま、ここではPはMAX/2(=40)であるから、MAXは80から40へ変更される。次にPを(P−MIN)/2+MINとする。いま、PはMAX/2(=40)、MINは1であるから、Pが(MAX/2−1)/2+1となる。(MAX/2−1)/2+1は、ここでは20.5となるが、小数点以下は切り捨て、Pは20となる。ステップQ7は、直前のステップQ4で取得したレコード数(=80)の2分値(MAX/2=40)の順位より下方(小さい方の側)の範囲にインデックステーブルの項目値(順位)があるレコードを、次回のステップQ4で検索するように、変数Pを変更するステップである。
【0063】
ステップQ8では、まず変数MINを変数Pにする。いま、ここではPはMAX/2(=40)であるから、MINは1から40へ変更される。次にPを(MAX−P)/2+Pとする。いま、MAXは80、PはMAX/2(=40)であるから、Pが(MAX−40)/2+40となる。(MAX−40)/2+40は、ここでは60となる。このステップQ8は、直前のステップQ4で取得したレコード数(=80)の2分値(=40)の順位より上方の範囲にインデックステーブルの項目値(順位)があるレコードを、次回のステップQ4で検索するように、変数Pを変更するステップである。
【0064】
ステップQ9では、P=MAX又はP=MINであれば次のステップQ10へ進み、そうでなければステップQ3へ戻る。したがって、ステップQ9でP=MAX又はP=MIN になるまで上記Q3からQ9のステップが繰り返される。上述の例ではステップQ7の終了時にP=20,MAX=40,MIN=1である。また、ステップQ8の終了時にP=60,MAX=80,MIN=40である。従って、ステップQ3からステップQ9までの第1回目のループでは、ステップQ7又はステップQ8のいずれの径路を通ったとしても、ステップQ3へ戻る(但し、ステップQ5でS=Aとなればループは終了する)。ステップQ3からステップQ9までのループを繰り返すことにより、必ずP=MAX又はP=MINとなる。いま、レコード数が80であり、会員番号1〜80までであり、欠番が無く、しかも56.001といった小数点が無ければ、ステップQ3からステップQ9のループを繰り返すことにより、ステップQ5においてS=Aとなり、検索値は検索される。しかし、レコード数は同じく80であっても、会員番号に欠番があったり、小数点があったりすると、ステップQ3からステップQ9のループを繰り返しても、ステップQ5においてS=Aとはならないことがある。このようなときに、ステップQ9で、P=MAX又はP=MINとなる。MAXとMINとは、整数値であり、違いが1とかの近接した値となる。
【0065】
ステップQ10では、ステップQ9でP=MAX又はP=MINとなったときに、対象項目のインデックス値がMINからMAXまでの項目値Aを全て取得し、復号する。ステップQ1からステップQ10までの処理が図5におけるステップ▲1▼及び▲2▼の処理に相当する。
【0066】
ステップQ11では、検索条件Wを判定し、Wが“以上”であればステップQ12へ進み、Wが“以下”であればステップQ13へ進む。ステップQ12では、ステップQ10で復号した項目値の中からS以上であり、しかも最も小さい項目値のレコードNOを取得する。この項目値が範囲検索の下限値である。かくして、2分検索法における検索値Sが取得されたことになり、2分検索の処理はここで終了となる。範囲検索においては、その検索値が範囲の下限値であるので、引き続き上限値の検索に移行するため、ステップQ1に戻る。上限値の検索ではステップQ2において検索条件を“以下”とし、変数Wに“以下”を設定するので、ステップQ11における検索条件Wの判定を受け、ステップQ13へ進む。
【0067】
ステップQ13では、ステップQ10で復号した項目値の中からS以下であり、しかも最も大きい項目値のレコードNOを取得する。この項目値が上限値である。かくして、範囲検索における上限値が取得できたことになるので、2分検索の処理は終了する。以上のステップQ11からステップQ13までの処理が図5におけるステップ▲3▼の処理に相当する。ステップQ1乃至Q13の処理は前述の「リレーショナルデータベースにおける所定項目の範囲検索のための順位検索方法」における第1乃至第8のステップに相当する。
【0068】
図16乃至図18は本発明の効果を示す概念図である。図16では、本発明のリレーショナルデータベースは、ハッカー等の不正利用者によりアクセスされたとしても安全であることが示してある。暗号化テーブルでは、秘密を要する項目のデータは暗号化されているので、窃盗、通信傍受、成りすまし等によりデータを入手した不正利用者は、入手した暗号データを解読できない。データベースファイル自体の物理的盗難があったとしても、暗号データが解読されることはない。また、不正なアクセスにより暗号化テーブルのデータを改竄しようとしても、暗号アルゴリズムを知らない不正アクセス者には、意図した改竄はできない。このように、本発明のリレーショナルデータベースは、平文のデータベースに比べ、不正な第三者の攻撃に対する防御能力において極めて優れてた、安全性の高いデータベースである。
【0069】
図17には、本発明のリレーショナルデータベースは、稼動中でもデータの加入、修正、削除が可能であることを概念図で示してある。図7乃至図10を参照して説明したように、本実施の形態のリレーショナルデータベースでは、暗号化テーブルにおける暗号化が項目単位で行われているので、データの追加、削除、修正などがレコード単位で行える。即ち、この実施の形態のリレーショナルデータベースにおいて、データの追加、削除、修正の必要が生じたときに、ファイル全体を変更するのではなく、レコード単位で変更が可能になり、リレーショナルデータベースを稼動させたままで、データの追加、削除、修正などの変更ができる。
【0070】
図18には、本発明のリレーショナルデータベースにネットワークを介してアクセスするとき、ネットワークには暗号化されたデータが伝送されることが概念図で示してある。データの暗号化及び複合化は、クライアント側の暗号データベースプログラムで行われる。そこで、平文は、クライアントのパーソナルコンピュータのメモリに一時的に存在するだけであり、そのクライアントのパーソナルコンピュータから出力されるデータは暗号化されており、ネットワークを伝送するデータがたとえ傍受されたとしても、そのデータが解読されることはない。SQL言語により会員テーブルに問合せをし、例えば会員番号001の会員の氏名を検索する場合、平文の会員テーブルに送るSelect文は、
Select 氏名from 会員テーブルwhere 会員番号=“001”
となり、取得結果は、
カラム名“氏名”:値“鈴木太郎”
となる。これに対し、本実施の形態のリレーショナルデータベースに問合せをするときは、暗号化した会員テーブルに送るSelect文は、
Select 氏名from 会員テーブルwhere 会員番号=“ngai83b”
となり、取得結果は、
カラム名“氏名”:値“94nf8jamwn”
なる。“ngai83b” は“001”の暗号化データであり、“94nf8jamwn”は“鈴木太郎”の暗号化データである。従って、ネットワークで第三者が通信を傍受したとしても、秘密にするべきユーザデータがその第三者に知られることはない。
【0071】
以上に実施の形態を挙げ、本発明を具体的に説明した。しかし、これらの実施の形態が本発明の範囲を限定するものでないことはもちろんである。例えば、例示された各処理の手順は必ずしもその通りでなくても実施できる場合が多い。本発明を適用するネットワークの例としてインターネットを示したが、ネットワークはLANでも差し支えない。
【0072】
実施の形態では、一意な項目であるレコードNOは暗号化テーブルでも平文のままとしたが、これを暗号化しても本発明は実施できる。暗号化テーブルにおいてもレコードNOが暗号化されておれば、例えば、図5のステップ▲2▼や図6のステップ▲6▼において、レコードNOをキーとして暗号化テーブルを検索する際に、そのレコードNOをまず暗号化し、暗号化レコードNOで暗号化テーブルを検索すればよい。このとき、暗号化テーブルから取得された暗号化レコードNOはクライアント側の暗号データベースプログラムで復号すれば、その復号したレコードNOをキーとしてインデックステーブルを検索できる(例えば図6のステップ▲4▼)。
【0073】
また、実施の形態では、インデックステーブルにおける項目名は平文テーブルの項目名と同じにしたが、インデックステーブルにおける項目名は平文テーブルの項目名とは相違しても差し支えない。クライアント側の暗号データベースプログラムに変換テーブル備え、インデックステーブルを検索するときは、項目名をその変換テーブルでインデックステーブル用の項目名に変換し、またインデックステーブルからその項目名を取得したときは、その変換テーブルで平文の項目名に変換するようにすれば、前述の実施の形態は同様に実施できる。
【0074】
【発明の効果】
以上に実施の形態を挙げ、詳しく説明したように、本発明によれば、データベースファイルの窃盗や改竄、或いは成りすましといった不正行為、又はデータベースファイル自体の物理的盗難があったとしても、そのデータベースファイルの秘密が保持され、しかも、正当利用者によるデータベースファイルの検索に要する手間と時間が、さして増大することのない、リレーショナルデータベース及びそのリレーショナルデータベースにおけるインデックステーブルの作成方法が提供できる。
【図面の簡単な説明】
【図1】本発明の一実施の形態のリレーショナルデータベースにおけるテーブルの構成例を示す図である。
【図2】図1の実施の形態におけるインデックステーブルの作成方法を模式的に示す図である。
【図3】図1の実施の形態における暗号化テーブルの一例を示す図である。
【図4】図1の実施の形態において、暗号化テーブルに格納した1つのレコード内のデータをキーワードで検索する方法を示す概念図である。
【図5】図1の実施の形態において、暗号化テーブルに格納した多数のレコード内からある範囲を指定し、その範囲内のレコードを検索する方法を示す概念図(前半部)である。
【図6】図1の実施の形態において、暗号化テーブルに格納した多数のレコード内からある範囲を指定し、その範囲内のレコードを検索する方法を示す概念図(後半部)である。
【図7】図1の実施の形態において、暗号化テーブルに新規レコードを追加する方法を示す概念図(前半部)である。
【図8】図1の実施の形態において、暗号化テーブルに新規レコードを追加する方法を示す概念図(後半部)である。
【図9】本実施の形態において、暗号化テーブルからレコードを削除する方法を示す概念図である。
【図10】図1の実施の形態において、暗号化テーブルに格納されているレコードを修正する方法を示す概念図である。
【図11】図1の実施の形態におけるインデックステーブルの一括更新の方法を示す概念図である。
【図12】図1の実施の形態におけるインデックステーブルの作成方法を示す流れ図である。
【図13】図1の実施の形態に2分検索法を適用し、データの検索をする方法を示す流れ図(前半部)である。
【図14】図1の実施の形態に2分検索法を適用し、データの検索をする方法を示す流れ図(後半部)である。
【図15】インターネットを介してデータベースのファイルにデータベースクライアントがアクセスしているときに、ハッカー等の不正な利用者がそのデータベースファイルにアクセスしている状態を模式的に示す図である。
【図16】本発明のリレーショナルデータベースは、ハッカー等の不正利用者によりアクセスされたとしても安全であることを示す概念図である。
【図17】本発明のリレーショナルデータベースは、稼動中でもデータの加入、修正、削除が可能であることを示す概念図である。
【図18】本発明のリレーショナルデータベースにネットワークを介してアクセスするとき、ネットワークには暗号化されたデータが伝送されることを示す概念図である。
[0001]
BACKGROUND OF THE INVENTION
The present invention relates to a database, and more particularly to a relational database that encrypts and stores data.
[0002]
[Prior art]
At present, when the Internet and LAN are widely used, the database is often accessed via a communication network such as the Internet or LAN. FIG. 15 shows a case where a database client (abbreviated as DB Client in the figure and the same in other figures) accesses a file of a database (abbreviated as DB in the figure and the same in other figures) via the Internet. It is a figure which shows typically the state in which unauthorized users, such as a hacker, are accessing the database file. A database client who is a legitimate user accesses a database file through a database server process via one database access channel. The DB server process is part of a relational database management system (RDBMS). On the other hand, hackers find security holes in database servers, illegally access database files, and steal and tamper with database files. Further, as described in the figure as impersonation, an unauthorized user intercepts communication on the database access channel when the database client is accessing the database file via the database access channel. Database files accessed via a communication network such as the Internet or a LAN are constantly threatened by the safety of data due to such actions as theft, falsification, or impersonation. In addition, the database file itself may be physically stolen.
[0003]
Since database files recorded in plain text are exposed to such threats, there are attempts to reduce the threats by encrypting the database files and improve the security of the database files. A database that is widely used at present is a relational database. As a conventional relational database in consideration of data encryption, there is a technique described in JP-T 11-509349 “Emulator for SQL Relational Database”. In Japanese Patent Application Laid-Open No. 11-509349, claim 3 states that “a data file is encrypted according to an algorithm in order to keep a secret, and access to the data is processed by the encryption / decryption module (M3)”. In the detailed description section of the invention described, “accessing the data file using an encryption / decryption module as necessary can ensure the security of user data,” etc. It is described.
[0004]
[Problems to be solved by the invention]
The description of the above-mentioned special table 11-509349 is lacking in concreteness, and it is unclear what means or method can guarantee the security of user data. Depending on this conventional technology, fraud such as theft, falsification, or impersonation When there is an act or physical theft of the database file itself, the security of the data file cannot be maintained. Further, simply encrypting a database file significantly increases the time and effort required for a legitimate user to search for a database file, and a database that can be used practically cannot be constructed.
[0005]
Therefore, the object of the present invention is to maintain the confidentiality of the database file even if there is an illegal act such as theft, falsification, or impersonation of the database file, or even if the database file itself is physically stolen. It is an object of the present invention to provide a relational database and a method for creating an index table in the relational database that does not significantly increase the time and effort required for a user to search for a database file (compared to when the database file is plain text).
[0006]
[Means for Solving the Problems]
In order to solve the above-mentioned problems, the present invention provides the following means.
[0007]
[1] A relational database comprising: an encryption table in which records are encrypted in item units; and an index table that records the ranking of item values in each item of a plaintext table corresponding to the encryption table .
[0008]
[2] The relational database according to [1], wherein at least one item is encrypted in the encryption table.
[0009]
[3] The relational database according to [1] or [2], wherein in the encryption table, at least an item having a unique value is plain text.
[0010]
[4] The relational database according to [1] or [2], wherein an item having a unique value is encrypted in the encryption table.
[0011]
[5] The items [1] to [3] are characterized in that in the encryption table, only items with unique values are plaintext, and items other than items with unique values are encrypted. Relational database.
[0012]
[6] The relational database according to [1], [2], or [4], wherein all items are encrypted in the encryption table.
[0013]
[7] Each item name in the index table forms a pair with each item name in the plaintext table, and both item names forming the pair in both tables are the same. The relational database according to [6].
[0014]
[8] Each item name in the index table is paired with each item name in the plaintext table, and both item names forming the pair in the two tables are different from each other. The relational database according to [6].
[0015]
[9] The relational database according to any one of [1] to [8], wherein the rank is a rank according to any one of an ascending order and a descending order.
[0016]
[10] An index table in a relational database having an encryption table in which records are encrypted in units of items, and an index table in which the order of item values in each item of a plaintext table corresponding to the encryption table is recorded. In the creation method,
A first step of setting a pointer value i to 1;
By referring to the plaintext table, sort processing is performed on the first encryption target item in the plaintext table, and the item value A () of the item having a unique value in the order of rank obtained by the sort processing is acquired, A second step of arranging the item value A () of the unique value item in association with the rank;
A third step of recording the item value A (i) of the unique value item corresponding to the pointer value i and the pointer value i in the index table;
A fourth step of changing i to i + 1;
A fifth step in which the third to fourth steps are repeated for the total number of records in the plaintext table;
A sixth step of sequentially performing the first step to the fifth step for items to be encrypted other than the first item to be encrypted in the plaintext table;
A method for creating an index table, comprising:
[0017]
[11] A range of predetermined items in a relational database having an encryption table in which records are encrypted in units of items and an index table in which the order of item values in each item of a plaintext table corresponding to the encryption table is recorded A search for a search, wherein a lower limit value and an upper limit value of the range search are set as search values, and an item value of the predetermined item in the index table that is equal to or higher than the lower limit value and has the smallest value is a first rank When the item value of the predetermined item in the index table that is not more than the upper limit value and is the largest value is set as the second order, the method of searching the first and second order,
A first step of searching a maximum item value of a predetermined item in the index table, assuming a number of records in the index table based on the maximum item value, and setting the assumed number of records as a variable MAX;
The variable MIN is set to 1, the integer part of the variable MAX / 2 is set to the variable P, and when the lower limit value is checked, the lower limit value is used as a search value, and when the upper limit value is searched, the upper limit value is used as the search value. A second step of setting the search value to the variable S, the search condition W to “above”, and the search condition W to be set to “below” when searching for the upper limit value in the range search;
A third step of starting a loop;
The encryption table and the index table are searched, the item value of the item having a unique value in the record in which the item value of the predetermined item in the index table is the same as the variable P is obtained, and the unique value in the encryption table is acquired. A fourth step of acquiring the item value of the predetermined item of the record to which the item value of the item of value belongs, generating a plaintext item value by decoding the acquired item value, and setting the variable A as the item value of the plaintext ,
The search value S is compared with the variable A, and when S = A, the item value of the predetermined item of the record in the index table to which the item of the unique value acquired from the index table in the fourth step belongs is calculated. Obtained as the first or second order. When S <A, the variable MAX is changed to the variable P, the variable P is changed to (P−MIN) / 2 + MIN, and when S> A, the variable MIN is changed to the variable P. And a fifth step of changing the variable P to (MAX−P) / 2 + P,
A sixth step of ending the loop when the result of the fifth step reaches P = MAX or P = MIN;
Search the encryption table and index table, select an item with a unique value of a record in which the item value of the predetermined item in the index table is in the range from variable MIN to MAX, and the unique value in the encryption table A seventh step of acquiring and decoding the item value of the predetermined item of the record having the same value item;
When the search condition W is “greater than or equal to”, the item value of the item of the unique value of the record to which the item value that is equal to or greater than the search value S among the item values decoded in the seventh step belongs When the search condition W is “below”, the unique value of the record to which the item value that is equal to or smaller than the search value S among the item values decoded in the seventh step belongs is stored. An eighth step of acquiring the item value of the item;
A ninth step of setting the item value of the predetermined item of the record in the index table to which the same item as the item of the unique value acquired in the eighth step belongs to the first or second order;
Consists of
When the search condition is set to “above” in the second step, in the fifth and ninth steps, the item value of the predetermined item is acquired as the first rank, and the search is performed in the second step. When the condition is set to “below”, the item value of the predetermined item is acquired as the second order in the fifth and ninth steps.
A rank search method for searching a range of a predetermined item in a relational database.
[0018]
[12] A range search method in a relational database having an encryption table in which records are encrypted in units of items, and an index table in which the order of item values in each item of a plaintext table corresponding to the encryption table is recorded In
Searching the index table using a first rank for a predetermined item as a key, and obtaining an item value of an item having a unique value in a record whose item value in the predetermined item is equal to or higher than the first rank;
By searching the encryption table using the item value of the item of the unique value acquired by the search of the index table as a key, the rank of the predetermined item is higher or lower than the first rank. Get encrypted field value
A range search method characterized by the above.
[0019]
[13] A range search method in a relational database having an encryption table in which records are encrypted in units of items, and an index table in which the order of item values in each item of a plaintext table corresponding to the encryption table is recorded In
The index table is searched using the first and second ranks relating to a predetermined item as a key, and the record value in which the item value in the predetermined item is equal to or higher than the first rank and equal to or lower than the second rank. Get the item value of the item with the correct value,
By searching the encryption table using the item value of the item of the unique value acquired by the search of the index table as a key, the rank regarding the predetermined item is equal to or higher than the first rank, and the first Get encrypted field value of records that are less than or equal to 2
A range search method characterized by the above.
[0020]
[14] The range search method according to [12], wherein the first order is the first order searched by the method of [11].
[0021]
[15] The range search method according to [13], wherein the first and second orders are the first and second orders searched by the method of [11].
[0022]
[16] The range search method according to [12] to [15], wherein the acquired encrypted item value is decrypted into plaintext.
[0023]
DETAILED DESCRIPTION OF THE INVENTION
Next, an embodiment of the present invention will be described with reference to the drawings. FIG. 1 is a diagram illustrating a configuration example of a table in the relational database according to the embodiment of this invention. FIG. 2 is a diagram schematically illustrating an index table creation method according to the present embodiment. FIG. 3 is a diagram showing an example of the encryption table in the present embodiment. FIG. 4 is a conceptual diagram showing a method for searching for data in one record stored in the encryption table by using a keyword in the present embodiment. FIG. 5 and FIG. 6 are conceptual diagrams showing a method of designating a range from a number of records stored in the encryption table and searching for records within the range in the present embodiment. 7 and 8 are conceptual diagrams showing a method of newly storing a record in the encryption table in the present embodiment. FIG. 9 is a conceptual diagram showing a method for deleting a record from the encryption table in the present embodiment. FIG. 10 is a conceptual diagram showing a method for correcting a record stored in the encryption table in the present embodiment. FIG. 11 is a conceptual diagram showing a method for batch updating of index tables in the present embodiment. FIG. 12 is a flowchart showing a method for creating an index table in the present embodiment. FIG. 13 and FIG. 14 are flowcharts showing a method for searching for data by applying the binary search method to the present embodiment.
[0024]
A database file in the relational database according to the present embodiment includes an encryption table and an index tail. The encryption table can be generated by encrypting each item in the plaintext table. The encryption table can also be created by sequentially storing records in which each item is encrypted in a new table in which no records are stored yet. FIG. 1 conceptually shows how an encryption table and an index table are created from a plaintext table when the plaintext table has already been generated. The item names in the plaintext table are “NO”, “membership number”, “name”, and “address”. In the encryption table, all data attributes of items to be encrypted are character type. For example, the data attribute of the membership number in the plaintext table is a numeric type, whereas the data attribute of the membership number in the encryption table is a character string type.
[0025]
This “NO” item is an example of the above-described unique value item, and corresponds to an item referred to as a primary key or a primary key in a relational database such as Oracle (registered trademark). Since the record is uniquely specified by specifying the item value of the “NO” item, the item value of the “NO” item is referred to as a record NO or simply NO in the present application. In addition, the item name of the “NO” item is described as “record NO”. The so-called user data is item values in the item names “membership number”, “name”, and “address”, and is encrypted and stored in the encryption table. Here, the item values in the item names “member number”, “name”, and “address” are referred to as a member number, name, and address, respectively. When these item values are indicated as specific data, the item values are enclosed in “”. For example, “3mfj4340snswlw” in the encryption table is data obtained by encrypting “Ichiro Tanaka” in the plaintext table with the encryption algorithm in the relational database of this embodiment.
[0026]
In the table of the figure, the area where the paper (background) is converted to gray is an item in which the encrypted item is stored. Even in the encryption table, the record NO remains in plain text. Although the present invention can be realized by encrypting the record NO, in this embodiment, the record NO is kept in plain text to simplify and speed up the search process. Each record NO is given a unique NO. Therefore, the record NO has a function for uniquely identifying the record, and the record can be uniquely specified by specifying NO. Each record is composed of one line of data. By specifying “1” as the record NO, in the plaintext table in FIG. 1, record NO = “1”, member number = “001”, name = “Suzuki” A record consisting of “Taro” and address = “Shinagawa-ku, Tokyo” is designated. Similarly, in the encryption table, by specifying “1” as the record NO, the record NO = “1”, membership number = “gtxUcA”, name = “iLFeC0P8o0Yf”, address = “zksi3m4394” is specified. Is done. The actual encryption table is a member table having item names “NO”, “membership number”, “name”, and “address” as in FIG. 1, and includes a large number of records as illustrated in FIG. 3. Generally composed.
[0027]
The index table is a table characteristic of the present invention, and one encryption table corresponds to each encryption table. In the index table, each item is plain text. The item names in the index table are the same as the item names in the plaintext table. Therefore, each item in the index table has a one-to-one correspondence with each item in the plaintext table. Each item value in the index table is a ranking value of the corresponding item in the plaintext table. In the plaintext table of FIG. 1, in the item name “membership number”, the item name “NO” is ranked “1” in the first rank, the item name “NO” is “2” in the rank 2, and the item name “NO” is The rank of “3” is 3. Also, in the plaintext table of FIG. 1, the item name “name” is ranked in alphabetical order, the record NO “1” is ranked first, the record NO “2” is ranked 3, and the record NO is The rank of “3” is 2.
[0028]
A method for creating an index table will be described with reference to FIG. In FIG. 2, for simplicity of explanation, the data in the plaintext table is simpler than that in the plaintext table of FIG. "Item 1" is in ascending numerical order, "Item 2" is in alphabetical order, and "Item 3" is in Iweo order.
[0029]
In order to create an index table, first, sort processing is performed for item name = “item 1” in the plaintext table. As a result of this sort processing, items of record No. “3”, “1” and “2” are selected for the first rank, second rank and third rank, respectively, and record NO is selected in this order (“3”, “1”). , “2” in this order). In the example of FIG. 2, the item value of “item 1” is 2 in the record whose record NO is “1”. The item values of “item 2” and “item 3” in the record whose record number is “1” are not determined at this stage, and are blank. Further, the item value of “item 1” is 3 in the record having the record number “2”. The item values of “item 2” and “item 3” in the record whose record number is “2” are blank because they are not determined at this stage. In addition, the item value of “item 1” is 1 in the record whose record NO is “3”. The item values of “item 2” and “item 3” in the record whose record number is “3” are not determined at this stage, and are blank.
[0030]
Similarly, sort processing is performed for “item 2”. By the sorting process of “item 2”, the record No. items “1”, “2” and “3” are selected for the first rank, the second rank and the third rank, respectively, and the record NO is in this order (“1”). , “2”, “3” in this order) (in this example, the order of the record NO as the result of the rearrangement is the same as the order in the original plaintext table). In the example of FIG. 2, the item value of “item 2” is 1 in the record whose record NO is “1”. The item value of “item 3” in the record whose record number is “1” is not determined at this stage, and is blank. In addition, the item value of “item 2” is 2 in the record whose record NO is “2”. The item value of “item 3” in the record whose record number is “2” is not determined at this stage, and is blank. Further, the item value of “item 2” is 3 in the record with the record number “3”. The item value of “item 3” in the record whose record number is “3” is not determined at this stage, and is blank.
[0031]
Similarly, sort processing is performed for “item 3”. By the sorting process of “item 3”, the records No. “3”, “2”, and “1” are selected for the first rank, the second rank, and the third rank, respectively. , “2”, “1” in this order). In the example of FIG. 2, the item value of “item 3” is 3 in the record whose record NO is “1”. The item values of “item 1”, “item 2”, and “item 3” in the record whose record number is “1” are all determined at this stage and are 2, 1, and 3, respectively. Further, the item value of “item 3” is 2 in the record having the record No “2”. The item values of “item 1”, “item 2”, and “item 3” in the record whose record number is “2” are all determined at this stage and are 3, 2, and 2, respectively. Further, the item value of “item 3” is 1 in the record with the record number “3”. The item values of “item 1”, “item 2”, and “item 3” in the record whose record number is “3” are all determined at this stage, and are “1”, “3”, and “1”, respectively. Thus, the index table of FIG. 2 was created.
[0032]
Next, with reference to FIG. 4, an example in which a record is searched for using a keyword in the relational database of this embodiment having an encryption table and an index table as shown in FIG. 1 will be described. The encrypted member table in FIG. 4 is a member table having item names “NO”, “member number”, “name”, and “address” as shown in FIG. The encrypted member table is stored in a database server and is controlled by a relational database management system (RDBMS) stored in the same database server. Now, assume that the client searches for an address in the encrypted member table using the search keyword “Ichiro Tanaka”. At this time, “Ichiro Tanaka” is encrypted by the encryption database program on the client side, and “Ichiro Tanaka” is converted into encrypted data “3mfj340snswlw”. The encryption database program on the client side is a database program that adds an encryption / decryption function to, for example, Oracle (registered trademark) SQL * PLUS, and communicates with the RDBMS on the server side using the SQL language to retrieve, add, modify, In addition to deleting, updating the table, etc., data is encrypted / decrypted for each item of the record by an encryption / decryption algorithm.
[0033]
To search the encrypted member table with the keyword “3mfj340snswlw” in the cipher “3mfj340snswlw” and obtain the address of Ichiro Tanaka, the client-side cryptographic database program uses the Select address from member table where name = ”3mfj340snswlw” Queries the encrypted member table with the so-called Select statement. Then, the address data of Ichiro Tanaka is returned from the encrypted member table in the same manner as when searching the plaintext member table. However, the reply data obtained at this time is data “kdsnw948nwkwnw” obtained by encrypting the address. The encryption database program on the client side decrypts the encryption data with an encryption algorithm, and acquires an address “Minato-ku, Tokyo”.
[0034]
Next, an example of a range search using the relational database according to the present embodiment will be described with reference to FIGS. Now, the relational database of the present embodiment stores an encrypted member table and its index table whose item names are “NO”, “membership number”, “name” and “address”, as described above. (The same applies to FIGS. 7 to 11 described later). When performing a range search in this embodiment, refer to the index table, acquire the record number of the start record and end record, search the encryption table using the acquired record number as a key, and acquire the corresponding record To do. An example of the range search given here is to acquire records with member numbers 50 to 60 in the encrypted member table. In FIG. 5 and FIG. 6, (1) to (6) indicate processing steps in the range search. In each of these steps, an SQL sentence for the range search and a result obtained by the search are shown. 5 and 6, the left side of the figure shows the processing and search results performed by the client-side encryption database program, and the right side of the figure shows the encrypted member table or the encrypted member table in the relational database of the embodiment. (The same applies to FIGS. 7 to 14 described later).
[0035]
Step {circle over (1)} indicates the start of index table search by the binary search method. The binary search method is a well-known search method, but a specific binary search method suitable for application to the present embodiment is shown in detail in FIGS. 13 and 14. In the Select statement, an underline is put in the part of “number of records ÷ 2”. This underline is added to indicate that the description itself “number of records ÷ 2” is not input at this position.
[0036]
Prior to issuing the Select statement, the index table is first searched to obtain the maximum index value in the target item (in the present example, the item “membership number”). In the index table, each item stores a rank. Therefore, when the index table, which will be described later with reference to FIG. 11, is updated collectively, the index value becomes an integer with no missing number from the lowest order to the highest order. However, before the batch update of the index table, as will be described later with reference to step (5) in FIG. 8, the index value may include a decimal point. Sometimes it happens. Therefore, the maximum index value does not necessarily match the number of records. However, since the maximum index value approximates the number of records, in step (1) in FIG. 5, the maximum index value in the target item (here, “member number” item) in the index table is searched, and the maximum index value is obtained. The value obtained by adding 1 to is the number of records. Even when the maximum index value is a decimal point, a value obtained by adding 1 to the maximum index value is used as the number of records in order to prevent the record of the maximum index value from being removed from the search target.
[0037]
In the Select statement, the number of the specific calculation result by the formula of the number of records divided by 2 is input at the position of this underline. The underline in the part of “number of records ÷ 2” indicates this (to search separately and enter the value obtained by calculation). As a result of the search of {circle around (1)}, a record NO in which the item value (rank) of the “membership number” item in the index table is an intermediate value is acquired. In addition, the underline in the Select sentence in other drawings is also attached for the same purpose.
[0038]
In step (2), the encrypted member table is searched using the acquired record NO as a key. By this search, the member number (encrypted member number) of the record NO is acquired. This member number is decrypted by a client-side encryption database program to generate a plaintext member number. The underline of “NO to search” in the Select sentence in step (2) is given in the same meaning as the underline in step 1, and the character “NO to search” is not input, but step ▲ It shows that the record NO obtained in 1 ▼ is input at this position.
[0039]
In step (3), the “member number” to be searched is compared with the “member number” obtained and decrypted in step (2). The “member number” to be searched is the lower limit value (= 50) and upper limit value (= 60) of the range in the range search. If the compared values match and the lower limit or upper limit of the member number is found, the other limit value is set as the “member number” to be searched, and the search between step (1) and step (3) is repeated again. Get the other limit value. If the two compared do not match and the lower limit or upper limit of the membership number cannot be determined, repeat step ▲ 1 until the decryption membership number in step ▲ 2 matches one of the lower limit or upper limit. The search between ▼ and step (3) is repeated, and the other limit value is searched and acquired by the search from step (1) to step (3). The lower limit member number is called the search start member number, the upper limit member number is called the search end member number, the record NO in the record in which the search start member number exists is called the start record NO, and the search end member A record NO in a record having a number is referred to as an end record NO. Steps {circle around (1)} to {circle around (3)} correspond to the first to eighth steps in the above-mentioned “order search method for range search of predetermined items in relational database”. A more detailed processing procedure of the binary search method performed from step (1) to step (3) is shown in FIGS.
[0040]
Step {circle over (4)} corresponds to the ninth step in the above-mentioned “rank search method for range search of predetermined items in relational database”, and searches the index table using start record NO and end record NO as keys, The rank of the member number in each record NO record is acquired. In the index table, since the member number rank is stored in the member number item, the start member number rank (start rank) and the end member number rank (end rank) are obtained by the search in step (4). Is done.
[0041]
In step {circle around (5)}, the index table is searched by the start rank and end rank of the member number, and the record NO between the start rank and the end rank (including the start rank and end rank) is obtained.
[0042]
In step (6), the encrypted member table is searched using the record NO acquired in step (5) as a key, and records of those record NO are acquired. Thus, the records of all members whose membership numbers are between 50 and 60 (including 50 and 60) can be acquired by the search from step (1) to step (6).
[0043]
As is clear from the example of the range search described with reference to FIGS. 5 and 6, the present embodiment includes an encryption table and an index table corresponding to the encryption table. Can be done. If you have built a relational database that has only an encrypted table that simply encrypts the plaintext table to improve the security of the database, you must decrypt all the records in the encrypted table for each range search. I must. This is because the rank of the items must be generated in the range search, but the rank cannot be known if the encrypted data remains. If all records are decrypted into plaintext for each range search, it is inevitable that the search time will be very long. On the other hand, in the relational database of the present embodiment, the order of items in plain text is stored in the index table in advance, so in the range search, the order of items can be obtained by searching the index table, and encryption is performed. Decryption table is not required. Therefore, in the present embodiment, the comparison process for acquiring the record decoding range and rank data is greatly reduced, and the process can be performed at high speed. In addition, by using this index table, the records can be rearranged at a high speed, so that the table in which the records are rearranged can be acquired (output) at a high speed.
[0044]
Next, processing for newly adding a record to the relational database of the present embodiment will be described with reference to FIGS. In order to add a new record to an existing encryption table, the index table is referred to, the order of the new record is obtained, an index value is created, and the record is inserted into the index table and the encryption table. An example of record addition described here is to add a new record having a membership number of “100”, a name of “Taro Yamada”, and an address of “Shinagawa-ku, Tokyo” to the encrypted membership table. In FIGS. 7 and 8, {circle over (1)} to {circle over (7)} indicate processing steps in the record addition. In each of these steps, an SQL sentence for adding the record and a result obtained by the search are shown.
[0045]
Steps (1), (2) and (3) in FIG. 7 correspond to steps (1), (2) and (3) in FIG. 5, respectively. Steps (1) and (2) in FIG. 7 perform the same processing as steps (1) and (2) in FIG. Step (3) in FIG. 7 performs substantially the same processing as step (3) in FIG. However, in step {circle around (3)} in FIG. 5, there are two search targets to be compared with the decrypted “member number”, that is, the start member number and end member number of the range search. Step (3) is different from step (3) in both figures in that the search target compared with the decrypted “member number” is only one member number, which is the member number of the record to be added. . In the process of FIG. 7, the processes of steps (1) to (3) are repeated, and the record NO with the member number value smaller than “100” and the largest member number value is retrieved from the encrypted member table. get.
[0046]
Step (4) in FIG. 8 performs substantially the same processing as step (4) in FIG. However, in step (4) in FIG. 6, the search is performed with two record NOs, that is, the start record NO and the end record NO, whereas in step (4) in FIG. 8, the search is performed with only one search record NO. Step (4) in FIG. 8 is different from step (4) in FIG.
[0047]
In step (5), a numerical value after the decimal point is added to the “rank” of the “member number” acquired in step (4) to create a new index value, that is, a rank. For example, if the “order” of the “member number” acquired in step (4) is “95”, 95 + 0.001 = 95.001 is set as the index value of the member number in the additional member number record, that is, the order. When there is an existing record with a rank of 95.001, and the rank for addition and the existing rank overlap, the sort process is performed on the records already existing between rank 95 and 96 and the additional record, and the rank of each record The process of re-adding is performed to update the record order.
[0048]
As another method, when an existing record with a rank of 95.001 already exists in the index table, the existing record rank is set to 95.002, which is obtained by adding 0.001 to the existing rank 95.001. That is, the order of existing records is updated. If an existing record with a rank of 95.001 and an existing record with a rank of 95.002 already exist in the index table, 0.001 is added to the existing ranks 95.001 and 95.002, respectively. Let 002 and 95.003 be the ranks of the existing records. When three or more existing records already exist between the ranks 95 and 96, the rank of the existing records is updated in the same manner as described above.
[0049]
In step {circle around (6)}, the new record is encrypted by the client-side encryption database program and added to the encrypted member table. In step (7), a new record is added to the index table based on the index value created in step (5). Thus, new records are added to the encryption table and the index table by the processing from step (1) to step.
[0050]
Next, processing for deleting a record in the relational database of this embodiment will be described with reference to FIG. In FIG. 9, (1) and (2) indicate processing steps in the record deletion. In each of these steps, an SQL sentence for deleting the record and a result obtained by the search are shown. In step {circle around (1)}, the record NO of the record to be deleted in the encrypted member table is changed to a negative value. In step {circle around (2)}, the record NO of the record to be deleted in the index table is changed to a negative value. In this way, the client-side encryption database program is set so that the record of record NO that has been changed to a negative value is not searched in the normal search process. However, the administrator of the relational database sets the encryption database program so that the record NO can be accessed even if necessary.
[0051]
Next, processing for correcting a record in the relational database of this embodiment will be described with reference to FIG. In FIG. 10, (1) and (2) indicate processing steps in correcting the record. In step {circle around (1)}, the target record in the encryption table and index table is deleted by the method shown in FIG. In step {circle around (2)}, target record addition processing in the encryption table and index table is performed by the method shown in FIGS. The records are corrected by the processes of steps (1) and (2).
[0052]
Next, with reference to FIG. 11, the process of batch updating the index table in the relational database of the present embodiment will be described. In FIG. 11, {circle over (1)}, {circle around (2)} and {circle around (3)} denote steps of batch update processing of the index table. In step {circle around (1)}, a record having a negative record number is deleted. In step {circle around (2)}, record NOs are acquired in the item value of “membership number” in the index table, that is, in order of rank. In step (3), the order of the record NO acquired in step (2) is used as a sequence number, and the “member number” of the record of each record NO is updated to this sequence number. The “address” and “name” are also processed in steps (2) and (3) to complete the batch update of the index table.
[0053]
FIG. 12 is a flowchart showing a method for creating an index table in the present embodiment. The index table creation method in the present embodiment has been described above with reference to FIG. 2, but FIG. 12 shows the creation method in a flowchart. This index table creation method includes an encryption table in which records are encrypted in units of items and a relational database having an index table that records the order of item values in each item of a plaintext table corresponding to the encryption table. This index table creation method in FIG.
[0054]
In step P1, the pointer value i is set to 1. In step P2, by referring to the plaintext table, the first encryption target item in the plaintext table is sorted, and the item value A () of the item name “record NO” is in order of rank obtained by the sort processing. [The item value A () corresponds to the above-mentioned record NO], and the item value A () is arranged in association with the rank. In Step P3, a loop process is entered. In step P4, the item value A (i) corresponding to the pointer value i and the pointer value i are recorded in the index table. In step P5, the pointer value i is changed to i + 1. In step P6, the third to fifth steps are repeated for the total number of records in the plaintext table. Steps P1 to P6 are performed for items to be encrypted other than the first item to be encrypted in the plaintext table. In the example of the member table described above, the first encryption target item is “member number”, the second encryption target item is “name”, and the third encryption target item is “address”. An index table for all items other than “record NO” (unique value item) in the table is created.
[0055]
13 and 14 are flowcharts showing the binary search method applied to this embodiment. The binary search method was used in steps (1) to (3) in FIG. 5 (range search) and steps (1) to (3) in FIG. 7 (add record). FIG. 13 and FIG. 14 show in detail the procedure of the binary search method when applied to steps (1) to (3) in FIG. The binary search method program is incorporated in the encryption database program on the client side. The relational database according to the present embodiment includes not only the encryption table but also a plaintext index table corresponding to the encryption table. As described with reference to steps (1) to (3) in FIG. Since the order of items can be acquired for each item name by referring to the table, the encrypted data can be efficiently searched by the binary search method. In order to perform a range search for the encryption table, as described with reference to FIGS. 5 and 6, the lower limit value (member number = 50 in the example of FIG. 5) and the upper limit value (in the example of FIG. 5). It is necessary to search for the membership number = 60) in the encryption table. The encryption table may not have an item value (membership number in the example of FIG. 5) that matches the lower limit value or the upper limit value. In such a case, the binary search method searches for the smallest value (hereinafter referred to as the lower limit search value) that is not less than the lower limit value and the largest value (hereinafter referred to as the upper limit search value) that is not more than the upper limit value. In the range search, records of item values from the lower limit search value to the upper limit search value are searched.
[0056]
First, the lower limit value is searched by the steps from Q1 to Q12 in FIGS. 13 and 14, and then the steps from Q1 to Q13 are executed again to search the upper limit value. In the search for the lower limit value, the search condition in step Q2 is set to “above”, and in the search for the upper limit value, the search condition in step Q2 is set to “below”. Since there is no difference between the search for the lower limit value and the search for the upper limit value in the processing in other steps, the search for the lower limit value will be mainly described below. In the following description, specific examples will be given to facilitate understanding. As a specific example, the relational database according to the present embodiment is similar to the relational database described above, the encrypted member table having the item names “NO”, “membership number”, “name” and “address” and its index table. Is stored. When performing a range search in this embodiment, the index table is referenced, the record NO of the start record and the end record, and the record NO of the rank between both records NO are acquired, and the obtained record NO is used as a key for encryption Search the conversion table and get the corresponding record. In the range search example given here, it is assumed that records whose membership numbers in the encrypted membership table are in the range of 50 to 60 (including 50 and 60) are acquired. Accordingly, the search value is 50 in the search for the lower limit value, and the search value is 60 in the search for the upper limit value.
[0057]
First, a procedure for searching for a record whose membership number in the encrypted member table is the lower limit value 50 or 50 and the smallest value (lower limit search value) by the binary search method will be described. In step Q1, the index table is searched to obtain the maximum index value of the target item, and a value obtained by adding 1 to the maximum index value is generated. The variable MAX in the binary search method program is set to a value obtained by adding 1 to the maximum index value. Accordingly, if the maximum index value in the index table is 79.1, the decimal part is discarded and MAX is 80. Assuming a value obtained by adding 1 to the maximum index value obtained by this processing (truncated after the decimal point) as the number of records in the encryption table and index table, the binary search method is performed in the following steps. In the following description, it is assumed that the number of records is 80 in step Q1, and that MAX is set to 80 in step Q1.
[0058]
When acquiring the number of records in the index table, the value obtained by adding 1 to the maximum index value is assumed to be the number of records (rounded down), and the reason for not using the maximum index value as the number of records is as follows. In the index table, each item stores a rank. Therefore, when the index table described with reference to FIG. 11 is collectively updated, the index value becomes an integer with no missing number from the lowest order (first place) to the highest order. However, before the batch update of the index table, as described with reference to step (5) in FIG. 8, the index value may include a decimal point, and the index value may be missing due to the record deletion in FIG. Sometimes it happens. Therefore, the maximum index value does not necessarily match the number of records. However, since the index value of the decimal point and the missing number is usually overwhelmingly smaller than the integer index value, even if it is assumed that the number of records is approximately approximate to the maximum index value, there is no problem in practical use. However, as will be apparent from the following description regarding steps Q1 to Q13, in the binary search, the number of records is regarded as the maximum value of the index value (rank) (MAX in the examples of FIGS. 13 and 14), and this maximum value is Since the maximum range of search is assumed, assuming that the number of records is smaller than the maximum value of rank, that is, the maximum index value, records with index values exceeding the assumed number of records are leaked from the search target. For example, when the maximum index value is 79.1, if the number after the decimal point is rounded down and the number of records is 79, the record with the index value of 79.1 is excluded from the range search target. Since the search target in the range search is all the records in the encryption table, an error occurs in the search range in the range search if a record that is not the search target is generated. Therefore, in this embodiment, when the retrieved maximum index value is a decimal point, the maximum index value + 1 (decimal point truncation) is set to the number of records in order to prevent the record of the maximum index value from being removed from the search range. Assuming that, the binary search is performed. The maximum index value +1, rounded down after the decimal point, is equal to the maximum index value rounded up after the decimal point.
[0059]
In step Q2, the variable MIN in the binary search method program is set to “1”, the variable P is set to “MAX / 2”, the variable S is set to “search value” (= “50”), and the variable W is used to search the lower limit value. Set to “above”. When the number of records in both tables is 80, P = 80/2 = MAX / 2 = 40. The order P to be searched for in the index table for the first time (the first loop in the loop consisting of steps Q3 to Q9) in step Q2 is the binary value (MAX / 2 = number of records) (= 80). 40). The second and subsequent index table searches are performed for the P rank set in step Q7 or Q8. In step Q3, a loop is entered.
[0060]
In step Q4, the illustrated Select statement is issued, and a record NO in which the item value of the item name “membership number” (order in the “membership number” item) is P (= 40) in the index table is acquired, and the encryption table is obtained. The item value of the item name “membership number” in the record NO is acquired, the item value is decoded, and the variable A is set as the decoded item value.
[0061]
In step Q5, the variables S and A are compared. Here, if S = A, the search value S is the decoded value A, and the lower limit value can be searched, so the binary search method processing ends. In step Q2, the rank P to be searched for in the index table for the first time is designated as the binary value (MAX / 2 = 40) of the number of records (= 80). It is determined whether the item value (membership number) of the item is equal to the search value S or not. If the variables S and A do not match and S <A or S> A, the process proceeds to step Q6. In step Q6, the variables S and A are compared again. If S <A, the process proceeds to step Q7, and if S> A, the process proceeds to step Q8.
[0062]
In step Q7, first, a variable MAX (= 80) is set as a variable P. Here, since P is MAX / 2 (= 40) here, MAX is changed from 80 to 40. Next, P is set to (P−MIN) / 2 + MIN. Now, since P is MAX / 2 (= 40) and MIN is 1, P is (MAX / 2-1) / 2 + 1. Here, (MAX / 2-1) / 2 + 1 is 20.5, but the decimal part is rounded down and P is 20. In step Q7, the item value (rank) of the index table is in a range lower (smaller side) than the rank of the binary value (MAX / 2 = 40) of the number of records (= 80) acquired in the previous step Q4. In this step, the variable P is changed so that a certain record is searched in the next step Q4.
[0063]
In step Q8, first, the variable MIN is set to the variable P. Here, since P is MAX / 2 (= 40) here, MIN is changed from 1 to 40. Next, P is set to (MAX−P) / 2 + P. Since MAX is 80 and P is MAX / 2 (= 40), P is (MAX−40) / 2 + 40. (MAX−40) / 2 + 40 is 60 here. In this step Q8, the record having the index table item value (rank) in the range above the binary value (= 40) rank of the number of records (= 80) acquired in the immediately preceding step Q4 is set to the next step Q4. In this step, the variable P is changed so as to be searched.
[0064]
In step Q9, if P = MAX or P = MIN, the process proceeds to the next step Q10, and if not, the process returns to step Q3. Therefore, steps Q3 to Q9 are repeated until P = MAX or P = MIN in step Q9. In the above example, P = 20, MAX = 40, MIN = 1 at the end of step Q7. At the end of step Q8, P = 60, MAX = 80, MIN = 40. Therefore, in the first loop from step Q3 to step Q9, the process returns to step Q3 regardless of the path of step Q7 or step Q8 (however, if S = A in step Q5, the loop is completed). To do). By repeating the loop from step Q3 to step Q9, P = MAX or P = MIN is always obtained. If the number of records is 80, the membership numbers are 1 to 80, there is no missing number, and there is no decimal point such as 56.001, the loop from step Q3 to step Q9 is repeated, so that S = A in step Q5, The search value is searched. However, even if the number of records is 80, if the member number is missing or has a decimal point, S = A may not be satisfied in step Q5 even if the loop from step Q3 to step Q9 is repeated. . In such a case, P = MAX or P = MIN in step Q9. MAX and MIN are integer values, and the difference is a close value such as 1.
[0065]
In step Q10, when P = MAX or P = MIN in step Q9, all the item values A with the target item index values from MIN to MAX are acquired and decoded. The processing from step Q1 to step Q10 corresponds to the processing of steps (1) and (2) in FIG.
[0066]
In step Q11, the search condition W is determined. If W is “greater than or equal to”, the process proceeds to step Q12, and if W is “less than or equal to”, the process proceeds to step Q13. In step Q12, the record NO of the smallest item value is acquired from the item values decoded in step Q10. This item value is the lower limit of the range search. Thus, the search value S in the binary search method is acquired, and the binary search process ends here. In the range search, since the search value is the lower limit value of the range, the process returns to step Q1 in order to continue the search for the upper limit value. In the search for the upper limit value, the search condition is set to “below” in step Q2, and “below” is set to the variable W. Therefore, the search condition W is determined in step Q11, and the process proceeds to step Q13.
[0067]
In step Q13, the record NO of the largest item value is acquired from the item values decoded in step Q10, which is equal to or less than S. This item value is the upper limit value. Thus, since the upper limit value in the range search has been acquired, the two-minute search process ends. The processes from step Q11 to step Q13 described above correspond to the process of step (3) in FIG. The processes in steps Q1 to Q13 correspond to the first to eighth steps in the above-mentioned “order search method for range search of predetermined items in relational database”.
[0068]
16 to 18 are conceptual diagrams showing the effects of the present invention. FIG. 16 shows that the relational database of the present invention is safe even if accessed by an unauthorized user such as a hacker. In the encryption table, since the data of items that require secrecy is encrypted, an unauthorized user who has obtained data by theft, interception of communication, or impersonation cannot decrypt the obtained encrypted data. Even if the database file itself is physically stolen, the encrypted data is never decrypted. Further, even if an attempt is made to tamper with data in the encryption table by unauthorized access, an unauthorized access person who does not know the encryption algorithm cannot perform the intended alteration. As described above, the relational database of the present invention is a highly secure database that is extremely superior in defense capability against unauthorized third party attacks compared to a plain text database.
[0069]
FIG. 17 is a conceptual diagram showing that the relational database of the present invention can join, modify, and delete data even during operation. As described with reference to FIGS. 7 to 10, in the relational database of the present embodiment, encryption in the encryption table is performed in item units, so data addition, deletion, modification, etc. are performed in record units. You can do it. In other words, in the relational database of this embodiment, when data needs to be added, deleted, or modified, the entire file can be changed instead of being changed, and the relational database can be operated. Until then, you can make changes such as adding, deleting, and correcting data.
[0070]
FIG. 18 is a conceptual diagram showing that encrypted data is transmitted to the network when the relational database of the present invention is accessed via the network. Data encryption and decryption are performed by a client-side encryption database program. Therefore, the plaintext is only temporarily stored in the memory of the client personal computer, and the data output from the client personal computer is encrypted, even if the data transmitted through the network is intercepted. The data is never decrypted. When querying the member table in the SQL language and searching for the name of the member with the member number 001, for example, the Select statement sent to the plaintext member table is:
Select Name from Member table where Member number = “001”
The acquisition result is
Column name “Name”: Value “Taro Suzuki”
It becomes. In contrast, when making a query to the relational database of the present embodiment, the Select statement sent to the encrypted member table is:
Select Name from Member table where Member number = “ngai83b”
The acquisition result is
Column name "Name": Value "94nf8jamwn"
Become. “Ngai83b” is encrypted data of “001”, and “94nf8jamwn” is encrypted data of “Taro Suzuki”. Therefore, even if a third party intercepts communication on the network, user data that should be kept secret is not known to the third party.
[0071]
The present invention has been specifically described with reference to the embodiments. However, it goes without saying that these embodiments do not limit the scope of the present invention. For example, the illustrated procedure of each process is often not necessarily the case, and can be performed. Although the Internet is shown as an example of a network to which the present invention is applied, the network may be a LAN.
[0072]
In the embodiment, the record NO, which is a unique item, is left as plain text in the encryption table, but the present invention can be implemented even if this is encrypted. If the record NO is also encrypted in the encryption table, for example, when the encryption table is searched using the record NO as a key in step (2) in FIG. 5 or step (6) in FIG. It is sufficient to first encrypt NO and search the encryption table with the encrypted record NO. At this time, if the encrypted record NO acquired from the encryption table is decrypted by the encryption database program on the client side, the index table can be searched using the decrypted record NO as a key (for example, step (4) in FIG. 6).
[0073]
In the embodiment, the item name in the index table is the same as the item name in the plaintext table. However, the item name in the index table may be different from the item name in the plaintext table. The client side encryption database program has a conversion table. When searching the index table, the item name is converted to the item name for the index table using the conversion table, and when the item name is obtained from the index table, If the conversion table is converted to plain text item names, the above-described embodiment can be similarly implemented.
[0074]
【The invention's effect】
As described above in detail with reference to the embodiment, according to the present invention, even if there is an illegal act such as theft, falsification, or impersonation of the database file, or the physical theft of the database file itself, the database file It is possible to provide a relational database and a method for creating an index table in the relational database, in which a secret user is maintained and the labor and time required for searching a database file by a legitimate user are not increased.
[Brief description of the drawings]
FIG. 1 is a diagram showing a configuration example of a table in a relational database according to an embodiment of the present invention.
FIG. 2 is a diagram schematically showing a method for creating an index table in the embodiment of FIG. 1;
FIG. 3 is a diagram showing an example of an encryption table in the embodiment of FIG. 1;
4 is a conceptual diagram showing a method for searching data in one record stored in an encryption table by using a keyword in the embodiment of FIG.
FIG. 5 is a conceptual diagram (first half) showing a method for designating a range from a number of records stored in an encryption table and searching for records within the range in the embodiment of FIG. 1;
6 is a conceptual diagram (second half) showing a method for designating a range from a number of records stored in an encryption table and searching for records within the range in the embodiment of FIG. 1; FIG.
7 is a conceptual diagram (first half) showing a method for adding a new record to the encryption table in the embodiment of FIG. 1; FIG.
FIG. 8 is a conceptual diagram (second half) showing a method for adding a new record to the encryption table in the embodiment of FIG. 1;
FIG. 9 is a conceptual diagram showing a method for deleting a record from an encryption table in the present embodiment.
FIG. 10 is a conceptual diagram showing a method of correcting a record stored in an encryption table in the embodiment of FIG.
FIG. 11 is a conceptual diagram showing a method for batch updating of index tables in the embodiment of FIG. 1;
12 is a flowchart showing a method of creating an index table in the embodiment of FIG.
FIG. 13 is a flowchart (first half) showing a method for searching for data by applying the binary search method to the embodiment of FIG. 1;
FIG. 14 is a flowchart (second half) showing a method of searching for data by applying the binary search method to the embodiment of FIG. 1;
FIG. 15 is a diagram schematically illustrating a state in which an unauthorized user such as a hacker is accessing a database file when the database client is accessing the database file via the Internet.
FIG. 16 is a conceptual diagram showing that the relational database of the present invention is safe even if accessed by an unauthorized user such as a hacker.
FIG. 17 is a conceptual diagram showing that the relational database of the present invention can join, modify, and delete data even during operation.
FIG. 18 is a conceptual diagram showing that encrypted data is transmitted to the network when the relational database of the present invention is accessed via the network.

Claims (7)

レコードが項目単位で暗号化されている暗号化テーブルと、該暗号化テーブルに対応する平文テーブルの各項目における項目値の順位を記録したインデックステーブルとを有するリレーショナルデータベースにおける該インデックステーブルの作成方法において、
前記リレーショナルデータベースを制御するリレーショナルデータベースマネジメントシステムが、ポインター値iを1に設定する第1のステップと、
前記リレーショナルデータベースマネジメントシステムが、前記平文テーブルを参照することにより、該平文テーブルにおける第1の暗号化対象項目に関しソート処理を行い、該ソート処理により得た順位の順に一意な値の項目の項目値A()を取得し、該一意な値の項目の項目値A()を該順位に対応付けて配列する第2のステップと、
前記リレーショナルデータベースマネジメントシステムが、前記ポインター値iに対応する前記一意な値の項目の項目値A(i)と、該ポインター値iとを前記インデックステーブルに記録する第3のステップと、
前記リレーショナルデータベースマネジメントシステムが、前記iをi+1に替える第4のステップと、
前記リレーショナルデータベースマネジメントシステムが、前記第3のステップ乃至第4のステップを前記平文テーブルの全レコード数分繰り返す第5のステップと、
前記リレーショナルデータベースマネジメントシステムが、前記第1のステップ乃至第5のステップを前記平文テーブルにおける第1の暗号化対象項目以外の暗号化対象項目について順次に行う第6のステップと
からなることを特徴とするインデックステーブルの作成方法。
In the creation method of the index table in a relational database having an encryption table in which records are encrypted in item units and an index table in which the order of item values in each item of a plaintext table corresponding to the encryption table is recorded ,
A relational database management system that controls the relational database sets a pointer value i to 1;
The relational database management system refers to the plaintext table to perform sort processing on the first encryption target item in the plaintext table, and item values of items having unique values in order of rank obtained by the sort processing A second step of acquiring A () and arranging the item value A () of the item of the unique value in association with the rank;
A third step in which the relational database management system records the item value A (i) of the unique value item corresponding to the pointer value i and the pointer value i in the index table;
A fourth step in which the relational database management system replaces the i with i + 1;
A fifth step in which the relational database management system repeats the third to fourth steps for the total number of records in the plaintext table;
The relational database management system comprises a sixth step of sequentially performing the first step to the fifth step for items to be encrypted other than the first item to be encrypted in the plaintext table. To create an index table.
レコードが項目単位で暗号化されている暗号化テーブルと、該暗号化テーブルに対応する平文テーブルの各項目における項目値の順位を記録したインデックステーブルとを有するリレーショナルデータベースにおける所定項目の範囲検索のための検索であって、該範囲検索の下限値および上限値を検索値とし、該下限値以上であり、かつ最も小さい値の該インデックステーブルにおける該所定項目の項目値を第1の順位とし、該上限値以下であり、かつ最も大きい値の該インデックステーブルにおける該所定項目の項目値を第2の順位とするとき、該第1および第2の順位を検索する方法において、
前記リレーショナルデータベースを制御するリレーショナルデータベースマネジメントシステムが、前記インデックステーブルにおける所定項目の最大項目値を検索し、該最大項目値を基に該インデックステーブルにおけるレコード数を仮定し、該仮定レコード数を変数MAXとする第1のステップと、
前記リレーショナルデータベースマネジメントシステムが、変数MINを1に、変数MAX/2の整数部を変数Pに、前記下限値を検索するときは該下限値を検索値とするともに、前記上限値を検索するときは該上限値を検索値とし、該検索値を変数Sに、該範囲検索における下限値を検索するときは検索条件Wを“以上”に、該範囲検索における上限値を検索するときは該検索条件Wを“以下”に、それぞれ設定する第2のステップと、
前記リレーショナルデータベースマネジメントシステムが、ループを開始する第3のステップと、
前記リレーショナルデータベースマネジメントシステムが、前記暗号化テーブル及びインデックステーブルを検索し、該インデックステーブルにおける前記所定項目の項目値が変数Pと同じであるレコードにおける一意な値の項目の項目値を取得し、該暗号化テーブルにおける該一意な値の項目の項目値が属するレコードの該所定項目の項目値を取得し、取得した該項目値の復号により平文の項目値を生成し、変数Aを該平文の項目値とする第4のステップ
前記リレーショナルデータベースマネジメントシステムが、検索値Sと変数Aとを比較し、S=Aであるとき、前記第4のステップでインデックステーブルから取得した前記一意な値の項目が属する該インデックステーブルにおけるレコードの前記所定項目の項目値を前記第1または第2の順位として取得し、S<Aのとき、変数MAXを変数Pとし、変数Pを(P−MIN)/2+MINに変更するとともに、S>Aのとき、変数MINを変数Pとし、変数Pを(MAX−P)/2+Pに変更する第5のステップと、
前記リレーショナルデータベースマネジメントシステムが、前記第5のステップの結果がP=MAX又はP=MINに至ったとき、ループを終了する第6のステップと、
前記リレーショナルデータベースマネジメントシステムが、前記暗号化テーブル及びインデックステーブルを検索し、該インデックステーブルにおける前記所定項目の項目値が変数MINからMAXまでの範囲にあるレコードの一意な値の項目を選択し、該暗号化テーブルにおいて該一意値の項目を同じくするレコードの該所定項目の項目値を取得し、復号する第7のステップと、
前記リレーショナルデータベースマネジメントシステムが、前記検索条件Wが“以上”であるとき、前記第7のステップで復号した項目値のうちで検索値S以上であり、かつ最小である項目値が属するレコードの一意な値の項目の項目値を取得し、前記検索条件Wが“以下”であるとき、前記第7のステップで復号した項目値のうちで検索値S以下であり、かつ最大である項目値が属するレコードの一意な値の項目の項目値を取得する第8のステップと、
前記リレーショナルデータベースマネジメントシステムが、前記第8のステップで取得した前記一意な値の項目と同じ項目が属する前記インデックステーブルにおけるレコードの前記所定項目の項目値を前記第1または第2の順位とする第9のステップと
からなり、
前記第6のステップから前記第9のステップは、前記第5のステップにおける検索値Sと変数Aとの比較結果がS=Aのときに実行されず、比較結果がS≠Aであるときに実行され、
前記第2のステップにおいて検索条件を“以上”に設定したときは、第5および第9のステップでは、前記所定項目の項目値を前記第1の順位として取得し、前記第2のステップにおいて検索条件を“以下”に設定したときは、第5および第9のステップでは、前記所定項目の項目値を前記第2の順位として取得する、
ことを特徴とするリレーショナルデータベースにおける所定項目の範囲検索のための順位検索方法。
For a range search of a predetermined item in a relational database having an encryption table in which records are encrypted in item units and an index table in which the order of item values in each item of a plaintext table corresponding to the encryption table is recorded The lower limit value and upper limit value of the range search are set as search values, and the item value of the predetermined item in the index table having the smallest value that is equal to or greater than the lower limit value is set as the first rank, In the method of searching for the first and second ranks when the item value of the predetermined item in the index table having the largest value and not more than the upper limit is set as the second rank,
A relational database management system that controls the relational database searches a maximum item value of a predetermined item in the index table, assumes a record number in the index table based on the maximum item value, and sets the assumed record number to a variable MAX. A first step, and
The relational database management system, a variable MIN to 1, the integer part of the variable MAX / 2 to the variable P, when searching for the lower limit value when the search value the lower limit both looking for the upper limit When the upper limit value is used as a search value, the search value is set to the variable S, when searching for the lower limit value in the range search, the search condition W is set to “above”, and when the upper limit value in the range search is searched, A second step of setting the search condition W to “below”,
A third step in which the relational database management system starts a loop;
The relational database management system searches the encryption table and the index table, acquires the item value of the unique value item in the record in which the item value of the predetermined item in the index table is the same as the variable P, and The item value of the predetermined item of the record to which the item value of the item of the unique value in the encryption table belongs is acquired, a plaintext item value is generated by decrypting the acquired item value, and the variable A is set to the item of the plaintext a fourth step of the value,
The relational database management system compares the search value S with the variable A, and when S = A, the record of the index table to which the item of the unique value acquired from the index table in the fourth step belongs. The item value of the predetermined item is acquired as the first or second order, and when S <A, the variable MAX is changed to the variable P, the variable P is changed to (P−MIN) / 2 + MIN, and S> A A variable MIN is set as a variable P, and the variable P is changed to (MAX−P) / 2 + P;
A sixth step in which the relational database management system terminates the loop when the result of the fifth step reaches P = MAX or P = MIN;
The relational database management system searches the encryption table and index table, selects an item having a unique value in a record in which the item value of the predetermined item in the index table is in a range from a variable MIN to MAX, and a seventh step of acquiring the field value of the predetermined items of the record which have the same item of the unique value, decrypts the encrypted table,
When the relational database management system finds that the search condition W is “greater than or equal to”, the uniqueness of the record to which the item value that is equal to or greater than the search value S among the item values decoded in the seventh step belongs. When the item value of the item with the correct value is acquired and the search condition W is “below”, the item value that is less than or equal to the search value S among the item values decoded in the seventh step is An eighth step of acquiring the item value of the unique value item of the record to which it belongs;
The relational database management system sets the item value of the predetermined item of the record in the index table to which the same item as the item of the unique value acquired in the eighth step belongs to the first or second order. It consists of 9 steps,
The sixth to ninth steps are not executed when the comparison result between the search value S and the variable A in the fifth step is S = A, and when the comparison result is S ≠ A. Executed,
When the search condition is set to “above” in the second step, in the fifth and ninth steps, the item value of the predetermined item is acquired as the first rank, and the search is performed in the second step. When the condition is set to “below”, in the fifth and ninth steps, the item value of the predetermined item is acquired as the second order.
A rank search method for searching a range of a predetermined item in a relational database.
レコードが項目単位で暗号化されている暗号化テーブルと、該暗号化テーブルに対応する平文テーブルの各項目における項目値の順位を記録したインデックステーブルとを有するリレーショナルデータベースにおける範囲検索の方法において、
前記リレーショナルデータベースを制御するリレーショナルデータベースマネジメントシステムが、所定の項目に関する第1の順位をキーとして前記インデックステーブルを検索し、該所定の項目における項目値が該第1の順位以上または以下であるレコードの一意な値の項目の項目値を取得し、
前記リレーショナルデータベースマネジメントシステムが、前記インデックステーブルの検索で取得された前記一意な値の項目の項目値をキーとして前記暗号化テーブルを検索することにより、前記所定の項目に関する順位が前記第1の順位以上または以下であるレコードの暗号化項目値を取得する、
ことを特徴とする範囲検索の方法。
In a range search method in a relational database having an encryption table in which records are encrypted in units of items, and an index table in which the order of item values in each item of a plaintext table corresponding to the encryption table is recorded,
A relational database management system that controls the relational database searches the index table using a first rank relating to a predetermined item as a key, and an item value in the predetermined item is greater than or less than the first rank. Get the field value of a field with a unique value,
The relational database management system searches the encryption table using the item value of the item of the unique value acquired by the search of the index table as a key, so that the rank regarding the predetermined item is the first rank. Get encrypted field value for records that are above or below,
A range search method characterized by the above.
レコードが項目単位で暗号化されている暗号化テーブルと、該暗号化テーブルに対応する平文テーブルの各項目における項目値の順位を記録したインデックステーブルとを有するリレーショナルデータベースにおける範囲検索の方法において、
前記リレーショナルデータベースを制御するリレーショナルデータベースマネジメントシステムが、所定の項目に関する第1及び第2の順位をキーとして前記インデックステーブルを検索し、該所定の項目における項目値が該第1の順位以上であり、かつ該第2の順位以下であるレコードの一意な値の項目の項目値を取得し、
前記リレーショナルデータベースマネジメントシステムが、前記インデックステーブルの検索で取得された前記一意な値の項目の項目値をキーとして前記暗号化テーブルを検索することにより、前記所定の項目に関する順位が前記第1の順位以上であり、かつ前記第2の順位以下であるレコードの暗号化項目値を取得する
ことを特徴とする範囲検索の方法。
In a range search method in a relational database having an encryption table in which records are encrypted in units of items, and an index table in which the order of item values in each item of a plaintext table corresponding to the encryption table is recorded,
The relational database management system that controls the relational database searches the index table using the first and second ranks relating to a predetermined item as a key, and the item value in the predetermined item is equal to or higher than the first rank, And the item value of the item of the unique value of the record which is below the second rank is acquired,
The relational database management system searches the encryption table using the item value of the item of the unique value acquired by the search of the index table as a key, so that the rank regarding the predetermined item is the first rank. A range search method, comprising: obtaining encrypted item values of records that are equal to or lower than the second order.
前記第1の順位が請求項の方法で検索された前記第1の順位である請求項に記載の範囲検索の方法。The range search method according to claim 3 , wherein the first rank is the first rank searched by the method of claim 2 . 前記第1および第2の順位が請求項の方法で検索された前記第1および第2の順位である請求項に記載の範囲検索の方法。The range search method according to claim 4 , wherein the first and second rankings are the first and second rankings searched by the method of claim 2 . 取得した前記暗号化項目値を平文に復号することを特徴とする請求項乃至に記載の範囲検索の方法。Range search method according to claims 3 to 6, characterized in that for decoding the acquired said encrypted field values in the plaintext.
JP2001383739A 2001-12-17 2001-12-17 Relational database, index table creation method in the relational database, range search method in the relational database, and rank search method for the range search Expired - Fee Related JP4050050B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2001383739A JP4050050B2 (en) 2001-12-17 2001-12-17 Relational database, index table creation method in the relational database, range search method in the relational database, and rank search method for the range search

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2001383739A JP4050050B2 (en) 2001-12-17 2001-12-17 Relational database, index table creation method in the relational database, range search method in the relational database, and rank search method for the range search

Publications (2)

Publication Number Publication Date
JP2003186725A JP2003186725A (en) 2003-07-04
JP4050050B2 true JP4050050B2 (en) 2008-02-20

Family

ID=27593697

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2001383739A Expired - Fee Related JP4050050B2 (en) 2001-12-17 2001-12-17 Relational database, index table creation method in the relational database, range search method in the relational database, and rank search method for the range search

Country Status (1)

Country Link
JP (1) JP4050050B2 (en)

Families Citing this family (14)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7519835B2 (en) * 2004-05-20 2009-04-14 Safenet, Inc. Encrypted table indexes and searching encrypted tables
KR20060058546A (en) * 2004-11-25 2006-05-30 펜타시큐리티시스템 주식회사 Method and apparatus for providing database encryption and access control
JP2007272539A (en) * 2006-03-31 2007-10-18 Ns Solutions Corp Security device and application server system
JP4697451B2 (en) * 2006-06-14 2011-06-08 日本電気株式会社 Data input / output device, data input / output method, data input / output program
KR100737359B1 (en) * 2006-10-04 2007-07-10 (주)이글로벌시스템 Method to create Indexes for encrypted column
US20080097954A1 (en) * 2006-10-20 2008-04-24 Microsoft Corporation Ranged lookups
KR100859162B1 (en) * 2007-10-16 2008-09-19 펜타시큐리티시스템 주식회사 Query processing system and methods for a database with encrypted columns by query encryption transformation
KR100995123B1 (en) * 2008-01-16 2010-11-18 재단법인서울대학교산학협력재단 Methods and apparatuses for cipher indexing in order to effective search of ciphered-database
CN102023985B (en) * 2009-09-17 2014-05-28 日电(中国)有限公司 Method and device for generating blind mixed invert index table as well as method and device for searching joint keywords
WO2013069776A1 (en) * 2011-11-11 2013-05-16 日本電気株式会社 Database encryption system, method and program
US9189647B2 (en) 2012-04-24 2015-11-17 Nec Corporation Encrypted database system, linking method, and medium
JP6950162B2 (en) * 2016-10-06 2021-10-13 富士通株式会社 Cryptographic systems, cryptographic methods, cryptographic devices and cryptographic programs
CN108319862B (en) * 2017-01-16 2022-05-17 阿里云计算有限公司 Data file processing method and device
WO2019142268A1 (en) 2018-01-17 2019-07-25 三菱電機株式会社 Registration device, search operation device, data management device, registration program, search operation program, and data management program

Also Published As

Publication number Publication date
JP2003186725A (en) 2003-07-04

Similar Documents

Publication Publication Date Title
Demertzis et al. {SEAL}: Attack mitigation for encrypted databases via adjustable leakage
Poh et al. Searchable symmetric encryption: Designs and challenges
US7606788B2 (en) Method and apparatus for protecting private information within a database
US8626749B1 (en) System and method of analyzing encrypted data in a database in near real-time
JP4050050B2 (en) Relational database, index table creation method in the relational database, range search method in the relational database, and rank search method for the range search
KR100839220B1 (en) Method for searching encrypted database and System thereof
Zhu et al. A novel verifiable and dynamic fuzzy keyword search scheme over encrypted data in cloud computing
CN112989375B (en) Hierarchical optimization encryption lossless privacy protection method
US11082205B2 (en) Methods for securing data
CN106934301B (en) Relational database secure outsourcing data processing method supporting ciphertext data operation
US9946720B1 (en) Searching data files using a key map
Hahn et al. Poly-logarithmic range queries on encrypted data with small leakage
Hu et al. Efficient and secure multi‐functional searchable symmetric encryption schemes
CN116107967B (en) Multi-keyword ciphertext searching method and system based on homomorphic encryption and tree structure
WO2018080857A1 (en) Systems and methods for creating, storing, and analyzing secure data
Venugopal et al. A novel approach for preserving numerical ordering in encrypted data
Liu et al. Efficient dynamic multi-client searchable encryption supporting fuzzy search
Etemad et al. Verifiable dynamic searchable encryption
Liu et al. Algorithms for data and computation privacy
Heidinger et al. Efficient and secure exact-match queries in outsourced databases
Pramanick et al. Searchable encryption with pattern matching for securing data on cloud server
Mu et al. Encrypted data retrieval scheme based on bloom filter
US11669506B2 (en) Searchable encryption
Roisum et al. Completeness integrity protection for outsourced databases using semantic fake data
Aashmi et al. Ranked key search and efficient retrieval of grand data on cloud computing

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20041125

A711 Notification of change in applicant

Free format text: JAPANESE INTERMEDIATE CODE: A711

Effective date: 20060403

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A821

Effective date: 20060403

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20070828

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20071017

TRDD Decision of grant or rejection written
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20071120

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20071128

R150 Certificate of patent or registration of utility model

Free format text: JAPANESE INTERMEDIATE CODE: R150

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20101207

Year of fee payment: 3

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20101207

Year of fee payment: 3

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20101207

Year of fee payment: 3

R350 Written notification of registration of transfer

Free format text: JAPANESE INTERMEDIATE CODE: R350

LAPS Cancellation because of no payment of annual fees