JP2004206025A - Random number generating method, computer program for random number generation, computer network system, and computer - Google Patents

Random number generating method, computer program for random number generation, computer network system, and computer Download PDF

Info

Publication number
JP2004206025A
JP2004206025A JP2002381727A JP2002381727A JP2004206025A JP 2004206025 A JP2004206025 A JP 2004206025A JP 2002381727 A JP2002381727 A JP 2002381727A JP 2002381727 A JP2002381727 A JP 2002381727A JP 2004206025 A JP2004206025 A JP 2004206025A
Authority
JP
Japan
Prior art keywords
random number
time
error
computer
access
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
JP2002381727A
Other languages
Japanese (ja)
Inventor
Masakatsu Morii
昌克 森井
Yoshiaki Shiraishi
善明 白石
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
INES CORP
Original Assignee
INES CORP
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 INES CORP filed Critical INES CORP
Priority to JP2002381727A priority Critical patent/JP2004206025A/en
Publication of JP2004206025A publication Critical patent/JP2004206025A/en
Pending legal-status Critical Current

Links

Images

Abstract

<P>PROBLEM TO BE SOLVED: To provide a random number generating method and a computer program for random number generation capable of generating a random number satisfying contingency, unpredictability and nonreproducibility from a general purpose computer, and to provide a computer network system and a computer using the method and the program. <P>SOLUTION: A packet reciprocation time necessary for packet reciprocation between a first communication device 1 and a second communication device 2 which are connected to each other by a computer network 3 is predicted. The actual packet reciprocation time is measured by reciprocating a packet between the first communication device 1 and the second communication device 2. The error between the predicted packet reciprocation time and the actually measured packet reciprocation time is calculated and, by using the error, the random number is generated. Thereby, the random number having the unpredictability, contingency and nonreproducibility can be easily generated. <P>COPYRIGHT: (C)2004,JPO&NCIPI

Description

【0001】
【発明の属する技術分野】
本発明は、乱数生成方法及び乱数生成用コンピュータプログラム等に関し、乱数が必要となる分野で、たとえばセッション鍵やワンタイムパスワードなどで利用するシード(種)に使用する乱数を生成する乱数生成方法及び乱数生成用コンピュータプログラム等に関する。
【0002】
【従来技術】
従来より、有線や無線により情報通信を行う際に、内容が第三者に漏れないように情報を暗号化して送信することが行われている。暗号化するために使用される秘密鍵は、ランダムに作成し、予測されないようにする必要がある。
【0003】
秘密鍵は、ユーザを識別するためのパスワード認証の場合には、ユーザが自ら生成するのに対し、通常の暗号化アプリケーションや、SSL(Secure Sockets Layer)、IPsec(IP Security Protocol)のような暗号化通信用プロトコルの場合には、ユーザは秘密鍵の生成に直接関与せず、ソフトウエアが自動的に生成する。
【0004】
暗号化アプリケーションや暗号化通信用プロトコル等の場合、ソフトウエアは、シード(種)と呼ばれる入力ビットパターンに所定の演算処理を施して乱数を生成し、その乱数を基に秘密鍵を生成している。この入力ビットパターンには、サーバーのホスト名の一部や日付、時刻等が利用されており、また、乱数を求める演算には、SHA−1、MD5、MDC2、MD2などのアルゴリズムやUNIX(登録商標)、Linuxで付属しているシステム関数(r)などが利用されている。
【0005】
また、タイマと乱数の一部を記憶する記憶部を備え、乱数生成時に、タイマの計数値と記憶部のデータを用いて乱数を生成する装置が提案されている(例えば、特許文献1参照)。
【0006】
【特許文献1】
特開2000−242470号公報
【0007】
【発明が解決しようとする課題】
ソフトウエアが秘密鍵をある一定の規則に基づいて生成してしまうと、その規則を利用した攻撃者にその秘密鍵を推定される危険性が存在する。したがって、秘密鍵を生成するためのシードには、偶然性、予測不可能性、非再現性が必要である。
【0008】
しかしながら、上述のように、乱数を求める演算には周知のアルゴリズムが利用されており、また、サーバーのホスト名の一部や日付、時刻を利用しているので、生成した乱数には一様性(規則性)が出現し、予測が可能で、再現性もあり、偶然性に乏しい。このため、秘密鍵が解読されるおそれがあり、安全性に問題がある。
【0009】
また、従来より、安全にシードを作成するために、物理乱数を使用する方法が知られているが、物理乱数の生成には特別な装置が必要であり、端末ごとにそのような特別な装置を設けることは、現実的には困難である。
【0010】
本発明は、上述の点に鑑みなされたものであり、偶然性、予測不可能性、非再現性を満たす乱数を、通常に利用しているコンピュータ装置から生成することができる乱数生成方法及び乱数生成用コンピュータプログラム及びコンピュータネットワークシステム及びコンピュータを提供することを目的とするものである。
【0011】
【課題を解決するための手段】
上記課題を解決する請求項1に記載の発明による乱数生成方法は、コンピュータネットワークによって相互に接続された第1の通信装置と第2の通信装置との間を所定のデータが往復するのに必要なデータ往復時間を予測し、実際に計測したデータ往復時間との誤差を用いて乱数を生成することを特徴とする。
【0012】
請求項2に記載の発明による乱数生成方法は、コンピュータネットワークによって相互に接続された第1の通信装置と第2の通信装置との間をパケットが往復するのに必要なパケット往復時間を予測するパケット往復時間予測ステップと、第1の通信装置と第2の通信装置との間でパケットを往復させて実際のパケット往復時間を計測するパケット往復時間計測ステップと、予測したパケット往復時間と計測したパケット往復時間との誤差を算出する誤差算出ステップと、誤差を用いて乱数を生成する乱数生成ステップと、を有することを特徴とする。
【0013】
請求項3に記載の発明は、請求項2に記載の乱数生成方法において、パケット往復時間予測ステップが、過去に計測したパケット往復時間に基づいてパケット往復時間時間を予測することを特徴とする。
【0014】
請求項4に記載の発明は、請求項2または3に記載の乱数生成方法において、乱数生成ステップが、誤差を2進数に変換し、その2進数に変換した数値の最下位の1ビットを乱数に用いることを特徴とする。
【0015】
請求項5に記載の発明による乱数生成用コンピュータプログラムは、コンピュータネットワークによって相互に接続された第1の通信装置と第2の通信装置との間を所定のデータが往復するのに必要な往復時間を予測するデータ往復時間予測手順と、第1の通信装置と第2の通信装置との間でデータを往復させて実際のデータ往復時間を計測するデータ往復時間計測手順と、予測したデータ往復時間と計測したデータ往復時間との誤差を算出する誤差算出手順と、誤差を用いて乱数を生成する乱数生成手順と、をコンピュータに実行させるプログラムであることを特徴とする。
【0016】
請求項6に記載の発明によるコンピュータネットワークシステムは、コンピュータネットワークによって相互に接続された第1の通信装置と第2の通信装置との間をパケットが往復するのに必要なパケット往復時間を予測し、第1の通信装置と第2の通信装置との間でパケットを往復させて実際のパケット往復時間を計測し、その予測したパケット往復時間と計測したパケット往復時間との誤差を算出し、その誤差を用いて乱数を生成することを特徴とする。
【0017】
請求湖1〜6に記載の乱数生成方法及び乱数生成用コンピュータプログラム及びコンピュータネットワークシステムによれば、第1の通信装置と第2の通信装置との間のパケット往復時間を予測し、実際に計測したパケット往復時間との誤差を乱数源とするので、コンピュータネットワークのトラフィックの不確実性を利用して、予測不可能性、偶然性及び非再現性を有する乱数を容易に生成することができる。
【0018】
請求項7に記載の発明による乱数生成方法は、処理装置と記憶装置を有するコンピュータにおいて、処理装置から記憶装置にアクセスするのに必要なアクセス時間を予測するアクセス時間予測ステップと、処理装置から記憶装置にアクセスさせて実際のアクセス時間を計測するアクセス時間計測ステップと、その予測したアクセス時間と計測したアクセス時間との誤差を算出する誤差算出ステップと、その誤差を用いて乱数を生成する乱数生成ステップと、を有することを特徴とする。
【0019】
請求項8に記載の発明は、請求項7に記載の乱数生成方法において、アクセス時間予測ステップが、過去に計測したアクセス時間に基づいてアクセス時間を予測することを特徴とする。
【0020】
請求項9に記載の発明は、請求項7または8に記載の乱数生成方法において、乱数生成ステップが、誤差を2進数に変換し、その2進数に変換した数値の最下位の1ビットを乱数に用いることを特徴とする。
【0021】
請求項10に記載の発明による乱数生成用コンピュータプログラムは、処理装置と記憶装置を有するコンピュータに、処理装置から記憶装置にアクセスするのに必要なアクセス時間を予測するアクセス時間予測手順と、処理装置から記憶装置にアクセスさせて実際のアクセス時間を計測するアクセス時間計測手順と、予測したアクセス時間と計測したアクセス時間との誤差を算出する誤差算出手順と、誤差を用いて乱数を生成する乱数生成手順とを実行させることを特徴とする。
【0022】
請求項11に記載の発明によるコンピュータは、処理装置と記憶装置を有するコンピュータにおいて、処理装置から前記記憶装置にアクセスするのに必要なアクセス時間を予測し、処理装置から記憶装置にアクセスさせて実際のアクセス時間を計測し、予測したアクセス時間と計測したアクセス時間との誤差を算出し、誤差を用いて乱数を生成することを特徴とする。
【0023】
請求湖7〜11に記載の乱数生成方法及び乱数生成用コンピュータプログラム及びコンピュータによれば、処理装置から記憶装置へのアクセス時間を予測し、実際に計測したアクセス時間との誤差を乱数源として用いるので、アクセス時間の不規則性を利用して、予測不可能性、偶然性及び非再現性を有する乱数を1台のコンピュータ内で容易に生成することができる。
【0024】
請求項12に記載の発明による乱数生成方法は、コンピュータが所定のプログラムを処理するのに必要な処理時間を予測する処理時間予測ステップと、コンピュータに所定のプログラムを処理させて実際の処理時間を計測する処理時間計測ステップと、予測した処理時間と計測した処理時間との誤差を算出する誤差算出ステップと、誤差を用いて乱数を生成する乱数生成ステップと、を有することを特徴とする。
【0025】
請求項13に記載の発明は、請求項12に記載の乱数生成方法において、処理時間予測ステップが、過去に計測した処理時間に基づいて処理時間を予測することを特徴とする。
【0026】
請求項14に記載の発明は、請求項12または13に記載の乱数生成方法において、乱数生成ステップが、誤差を2進数に変換し、その2進数に変換した数値の最下位の1ビットを乱数に用いることを特徴とする。
【0027】
請求項15に記載の発明による乱数生成用コンピュータプログラムは、コンピュータが所定のプログラムを処理するのに必要な処理時間を予測する処理時間予測手順と、コンピュータに所定のプログラムを処理させて実際の処理時間を計測する処理時間計測手順と、その予測した処理時間と計測した処理時間との誤差を算出する誤差算出手順と、その誤差を用いて乱数を生成する乱数生成手順と、をコンピュータに実行させることを特徴とする。
【0028】
請求項16に記載の発明によるコンピュータは、所定のプログラムの実行を開始してから完了するまでの処理時間を予測し、所定のプログラムの実行を開始してから完了するまでの実際の処理時間を計測し、その予測した処理時間と計測した処理時間との誤差を算出し、その誤差を用いて乱数を生成することを特徴とする。
【0029】
請求湖12〜16に記載の乱数生成方法及び乱数生成用コンピュータプログラム及びコンピュータによれば、コンピュータによるプログラムの処理時間を予測し、実際に計測した処理時間との誤差を乱数源として用いるので、コンピュータの状況に応じた処理時間の不規則性を利用して、予測不可能性、偶然性及び非再現性を有する乱数を1台のコンピュータ内で容易に生成することができる。
【0030】
【発明の実施の形態】
次に、本発明の実施の形態について図に基づいて説明する。
【0031】
(第1の実施の形態)
図1は、第1の実施の形態を説明する全体構成図である。第1の通信装置1と第2の通信装置2は、PCやサーバなどのコンピュータ端末であり、パケット等の所定のデータを送受信できるように、コンピュータネットワーク3によって互いに接続されている。ネットワーク3には、図示していない他の端末が複数接続され、様々なプロトコルが混在している。本実施の形態における乱数生成方法は、コンピュータネットワーク3に接続された第1の通信装置1にインストールされたコンピュータソフトウエアプログラムによって実現されるものであり、第1の通信装置1と第2の通信装置2との間で所定のデータを往復させた場合に、その往復時間を予測し、実際の往復時間との誤差を用いて乱数を生成するものである。
【0032】
具体的には、図2のフローチャートを用いて以下に説明する。図2は、第1の実施の形態における乱数生成方法を説明するフローチャートである。
【0033】
先ず、ステップS1では、所定時刻におけるパケット往復時間を予測する。予測する方法は、例えば、過去に実際に計測したパケット往復時間に基づいて予測してもよく、また、他の端末の接続状況や、ネットワーク3の利用率などの種々のパラメータに基づいて予測してもよい。
【0034】
そして、ステップS2では、所定時刻における実際のパケット往復時間を計測する。計測には、例えばリクエストパケットとレスポンスパケットを使用する。リクエストパケットとは、例えば第1の通信装置から第2の通信装置に対してそのリクエストパケットを送信した場合に、そのリクエストパケットを受信した第2の通信装置2によって第1の通信装置1にレスポンスパケットを返信させる機能を有するものである。第1の通信装置1でリクエストパケットを送信した時刻と、レスポンスパケットを受信した時刻を計測することで、実際のパケット往復時間を計測することができる。
【0035】
それから、ステップS3では、予測したパケット往復時間と実際に計測したパケット往復時間との誤差を算出する。この誤差の算出は、予測したパケット往復時間から実際に計測したパケット往復時間を減算し、その絶対値をとるによって求めることができる。
【0036】
そして、ステップS4では、誤差を使って乱数を生成する。複数の端末が接続され、様々なプロトコルが存在するコンピュータネットワーク3では、例えば第1の通信装置1と第2の通信装置2との間で同じアプリケーションを実行したとしても、バースト的なトラフィックなどの原因によって厳密に同一時刻にパケットが送受信されることは現実的にはあり得ない。また、人為的にコンピュータネットワーク3に流れるパケット数を変化させた場合であっても、パケット往復時間は、ある程度の幅で変化するだけで、0.01秒が10時間になるような極端な変化は生じない。したがって、予測したパケット往復時間と実際に計測したパケット往復時間との間には、必ず所定範囲内の誤差が発生し、その誤差は、予測不可能であり、偶然性及び非再現性を有する。したがって、この誤差をそのまま乱数として使用することができ、更に実用的で性質の良い乱数を得るべく、その誤差の一部を乱数として使用しても良い。
【0037】
上述の乱数生成方法によれば、第1の通信装置1と第2の通信装置2との間のパケット往復時間を予測し、実際に計測した時間との誤差を乱数源とするので、コンピュータネットワーク3のトラフィックの不確実性を利用して、予測不可能性、偶然性、及び非再現性を有する乱数を容易に生成することができる。
【0038】
次に、第1の実施の形態における具体的な実施例について以下に説明する。
【0039】
図3は、本実施例の全体構成図である。図中で符号10は、コンピュータネットワークシステムの一例であるクライアントサーバシステムであり、クライアント11とサーバ12がLAN13を介して互いに接続されており、互いにIPパケットを送受信可能なIPネットワークを構成している。このLAN13には、図示していない複数の端末が接続され、様々なプロトコルが混在している。そして、クライアント11には、本実施例における乱数生成用コンピュータプログラムがインストールされている。尚、上記のIPネットワークは、LAN13に限定されるものではなく、LAN13の代わりにWAN(Wide Area Network)やインターネットであってもよい。
【0040】
図4は、乱数生成用コンピュータプログラムによる乱数の生成方法を説明するフローチャートである。
【0041】
まず最初に、ステップS11〜ステップS14によって、往復伝搬遅延時間の予測値x’を算出するために必要な初期値の設定処理を行う。
【0042】
ステップS11では、クライアント11とサーバ12との間でIPパケットを往復させ、クライアント11におけるIPパケットの送信時刻と受信時刻を計測する処理が行われる。ここで、クライアント11は、サーバ12に対してリクエストIPパケットを送信し、その送信時刻tを計測する。一方、サーバ12は、クライアント11からのリクエストIPパケットを受信すると、それに応じて直ぐにクライアント11にレスポンスIPパケットを送信する。そして、クライアント11は、サーバ12からのレスポンスIPパケットを受信すると、その受信時刻tを計測する。
【0043】
次に、ステップS12では、クライアント11とサーバ12との間をIPパケットが往復するのに必要な往復伝搬遅延時間の実測値xを算出する処理が行われる。往復伝搬遅延時間の実測値xは、上述の受信時刻tから送信時刻tを減算することによって算出される(x=t−t)。本実施例では、オペレーティングシステム(OS)にLinuxを使用してレスポンスIPパケットの受信時刻の計測に、マイクロ秒の精度で時刻を計測できるgettimeofday関数を利用しており、秒の表現にlong型の変数(tv_sec)、マイクロ秒の表現に(tv_usec)を用いている。尚、他のオペレーティングシステム(OS)を使用する場合は、マイクロ秒の精度で時刻を計測できる関数を使用する。
【0044】
ステップS13では、往復伝搬遅延時間の実測値xをクライアント11内に予め設定されている往復伝搬遅延時間記憶領域14に記憶する処理が行われる。図5は、往復伝搬遅延時間記憶領域14を図式化したものである。往復伝搬遅延時間記憶領域14は、往復伝搬遅延時間の実測値xを記憶可能な記憶枠を予め設定された個数だけ一列に並べた構造を有している(図5(a)参照)。そして、新たな往復伝搬遅延時間の実測値xが算出されると、各記憶枠に既に記憶されている実測値xを、全体で左側に向かって1枠ずつシフト移動させ、最左端の記憶枠内の実測値xを破棄し、新たに算出された実測値xを、最右端の記憶枠に記憶させるように構成されている(図5(b)参照)。尚、往復伝搬遅延時間記憶領域14の記憶枠の個数は、後述するARモデルのモデル数と同じ個数(k個)に設定されている。
【0045】
ステップS14では、往復伝搬遅延時間記憶領域14の全ての記憶枠に往復伝搬遅延時間の実測値xが記憶されているか否かが判断され、記憶されていない場合(NO)には、ステップS11に戻り、全ての記憶枠に記憶されている(YES)と判断されるまで、ステップS11〜ステップS14までの処理を繰り返す。これにより、往復伝搬遅延時間記憶領域14には、所定個数分(K個分)の往復伝搬遅延時間の実測値xが記憶される。
【0046】
次に、ステップS15では、所定時刻iにおける往復伝搬遅延時間の予測値x’を算出する処理が行われる。往復伝搬遅延時間の予測値x’は、過去に計測し、往復伝搬記憶領域14に記憶されている往復伝搬遅延時間の実測値(xi−k、xi−k+1、…、xi−1)に基づいて算出される。ここでは、離散系の時系列モデルとして時系列解析の代表的なモデルである、ARモデル(自己回帰モデル)を利用して、往復伝搬遅延時間の予測値x’を算出する。
【0047】
ARモデルは、時系列の現時点における値が、自らの過去の時点での値の線形結合によって表されるモデルである。対象とする時系列をxとすると、ARモデルは、次式(1)で表される。
【0048】
【数1】

Figure 2004206025
式(1)で、xt−iは、xよりi個だけ過去の時刻の実測値である。また、eは、tの時点におけるモデル化の誤差であり、この値が0であれば誤差がないことになる。そして、a(i=1、2、…、k)は、式(1)を表す自己回帰係数である。
【0049】
図6は、1次のARモデルを示すものである。xは、図に示すように1次遅れを持つフィードバック制御系の出力である。尚、図中のz−1は、遅れの演算子である。このARモデルを推定するためには、式(1)の自己回帰係数aを推定する必要がある。本実施例では、以下の方法によって式(1)の自己回帰係数aを推定している。
【0050】
まず、式(1)の両辺にxt−lを乗算して平均をとると次式(2)の関係式が成り立つ。
【0051】
【数2】
Figure 2004206025
【0052】
ここで、rは、期待値の関数であり、x、xt−lの積の平均で表される。予め(r、r、…、r)をそれぞれ計算しておく。式(2)において、l=1、2、…、k)を考えると、以下の方程式が導かれる。
【0053】
【数3】
Figure 2004206025
【0054】
尚、このk次の連立方程式は、Yule−Walkerの方程式という。自己回帰係数aは式(3)を解くことによってその推定値が求められる。そして、この自己回帰係数aからモデルの推定および、往復伝搬遅延時間の予測値x’を算出することができる。
【0055】
次に、ステップS16では、所定時刻iにおいて、実際にクライアント11とサーバ12との間でIPパケットを往復させ、クライアント11におけるIPパケットの送信時刻と受信時刻Tを計測する処理が行われる。そして、その送信時刻と受信時刻Tから、所定時刻iにおける往復伝搬遅延時刻の実測値xを算出する処理が行われる。
【0056】
ステップS17では、所定時刻iにおけるレスポンスIPパケットの予測受信時刻T’を算出する処理が行われる。予測受信時刻T’は、ステップS16で計測したリクエストIPパケットの送信時刻に、ステップS15で算出した往復伝搬遅延時間の予測値x’を加算することによって求めることができる(予測受信時刻T’=リクエストIPパケットの送信時刻+往復伝搬遅延時間の予測値x’)。
【0057】
ステップS18では、ステップS16で計測した実際の受信時刻Tと、ステップS17で算出した予測受信時刻T’との誤差dを算出する処理が行われる。この誤差dは、予測受信時刻T’から受信時刻Tを減算して、その絶対値をとることによって、求められる(d=|T’−T|)。
【0058】
ステップS19では、乱数として実用的で性質が良いものを得るべく、誤差dの一部を乱数として取り出す処理が行われる。具体的には、まず、10進数で得られた誤差dを2進数に変換し、その2進数に変換した数値の最下位の1ビットを取得して乱数に用いる。例えば、誤差dが9マイクロ秒であった場合(0.0009秒)、この「9」(10進表記)を2進変換すると「1001」となる。この「1001」の最下位の1ビット、すなわち「1」を取得して乱数に用いる。尚、下位1ビットを乱数に用いた理由については後述する。
【0059】
ステップS20では、ステップS16で算出した所定時刻iにおける往復伝搬遅延時間の実測値xを往復伝搬遅延時間記憶領域14に記憶させることによって、往復伝搬遅延時間記憶領域14の記憶内容を更新する処理が行われる。そして、ステップS20での処理が終了すると再びステップS15に戻り、ステップS15からステップS20までの処理を繰り返し行う。これにより、乱数列を得ることができる。
【0060】
本実施例の場合、誤差dの下位何ビットを利用するのが最適化なのかについて実験を行った。そして、誤差dの最下位1ビットのみを利用した場合に、特に性質が良く実用的な乱数が得られるとの結果を得た。以下に、その実験内容及び実験結果について説明する。
【0061】
実験に使用したコンピュータは、CPU:Pentium(登録商標)3(1GHz)、メモリ:256MB、OS:RedHat Linux 7.2、であり、レスポンスIPパケットの受信時刻の測定には、gettimeofday関数を利用した。実験は、LAN上の2台のコンピュータ間で行い、クライアント11とサーバ12との間のパケット往復時間を往復伝搬遅延時間xとして測定し、予測受信時刻T’と実際の受信時刻Tとの差の絶対値をとった値dを誤差とした場合のネットワーク環境について行った。
【0062】
まず、取得した誤差dを2進表記した場合に、下位何ビットまでが乱数として使用できるかを考察すべく、取得した誤差の有効桁数を調べた。尚、誤差の有効桁数とは、取得した誤差を2進表記した場合の系列長さをいう。例えば、得られた誤差が9マイクロ秒であった場合(0.0009秒)、この「9」(10進表記)を2進変換すると「1001」となり、この数値の有効桁数は4桁である。
【0063】
図7は、上述の乱数生成方法によって10(1000000)回の誤差を取得して2進数の有効桁数の分布を調べた表である。このとき使用したARモデルの次数は10であり、実験は、10回行い、その平均を示している。表1の桁数は、2進数に変換した場合の有効桁数であり、個数は、1000000回の中で当該桁数に当てはまった回数である。この表から、桁数が1〜8ビットまでの誤差が全体の約90%を占めることがわかる。したがって、誤差dの有効桁数は、8ビット以下であると考えられる。
【0064】
そこで次に、誤差の下位1ビットのみを乱数として利用した場合と、下位2ビットまでを乱数として利用した場合について、それぞれNISTとDIEHARDという2種類の検定実験を行った。但し、誤差の下位2ビットを利用する方法では、誤差の有効桁数が2(10進数で2か3)の場合には下位から2ビット目のビットが1となってしまうために、有効桁数が2の場合には誤差の下位1ビットのみを使用し下位2ビット目は使用しないこととした。
【0065】
NISTとは、物理乱数及び疑似乱数生成器からの出力データについて乱数性のテストを行うツールであり、16項目からのテストからなる統計のパッケージである。NISTについては、http://crsc.nist.gov/rug.に詳しく説明されている。尚、図8は、本検定に利用したNISTのパラメータを示す表である。各種テストを行うことによって出力されたp−valueが0<p−value<1を満たす場合に、そのテスト項目をパスしたとみなしている。
【0066】
一方、DIEHARDは、フロリダ州立大学で開発された乱数検定用プログラムであり、15項目のテストを行う。この15項目のテストを行うことによって出力されたp−valueが「0<p−value<1」を満たし、KSTESTが「0<KSTEST<1」を満たす場合に、そのテスト項目をパスしたとみなしている。DIEHARDについては、http://stat.fsu.edu/geo/diehard.htmlに詳しく説明されている。
【0067】
誤差の下位1ビットのみを乱数として利用した場合でNISTの検定を実験1、DIEHARDの検定を実験3、誤差の下位2ビットまでを乱数として利用した場合でNISTの検定を実験2、DIEHARDの検定を実験4として実験を行ったところ、図9に示す実験結果が得られた。
【0068】
これによれば、下位1ビットのみから得られた乱数列においては、全ての検定項目に合格することができたが、下位2ビットまでを乱数とした場合、NIST、DIEHARDともにいくつかの検定項目が不合格となった。図10は、検定に不合格となった項目を示す表である。この実験結果から、特に、誤差の最下位1ビットのみを利用した場合に、性質が良く実用的な乱数が得られることがわかる。
【0069】
上述の実施例では、ARモデルのモデル数、すなわち、往復伝搬遅延時刻記憶領域14の記憶枠数を10に設定した場合を例に説明したが、この記憶枠数をコンピュータの特性に応じて、ある範囲で増加させることによって、乱数の性質をさらに向上させることができ、より真性乱数に近い乱数を生成することができる。
【0070】
また、実施例では、予測受信時刻T’と実際の受信時刻Tとから誤差dを算出する場合を例に説明したが、往復伝搬遅延時間の予測値x’と実測値xとから算出しても良い。
【0071】
更に、実施例では、クライアントサーバシステムの場合を例に説明したが、クライアント11とクライアント11、サーバ12とサーバ12など、コンピュータとコンピュータをネットワークで接続したものであればよい。また、ネットワーク環境もIPネットワーク13に限定されるものではなく、他のプロトコルを利用したネットワークであっても良い。
【0072】
また、実施例では、クライアント11にインストールされるコンピュータソフトウエアプログラムの場合を例に説明したが、その一部或いは前部をハードウエアによって構成し、乱数生成装置としても良い。
【0073】
(第2の実施の形態)
図11は、第2の実施の形態を説明する図であり、コンピュータの構成を示す図である。コンピュータ20は、入力装置21と、出力装置22と、主記憶装置23と補助記憶装置24を備えた記憶装置25と、演算装置26と制御装置27を備えた処理装置28の4つの構成要素によって構成されている。
【0074】
本実施の形態における乱数生成方法は、1台のコンピュータ20内で、そのコンピュータ20にインストールされたコンピュータソフトウエアプログラムによって実現されるものであり、処理装置28から記憶装置25に対して読み込みや書き込みなどのアクセスを行い、そのアクセス時間を予測し、実際のアクセス時間との誤差を用いて乱数を生成するものである。
【0075】
具体的には、図12のフローチャートを用いて以下に説明する。図12は、第2の実施の形態における乱数生成方法を説明するフローチャートである。先ず、ステップS21では、処理装置から記憶装置に対して、Read(読み込み)、Write(書き込み)、Update(更新)、Delete(削除)などのアクセスを行った場合にそのアクセス開始からアクセス終了までのアクセス時間を予測する。このアクセス時間を予測する方法は、例えば、過去に実際に計測したデータに基づいて予測してもよく、また、記憶装置の容量などの種々のパラメータに基づいて予測してもよい。
【0076】
そして、ステップS22では、実際に処理装置28から記憶装置25にアクセスを行い、そのアクセス時間を計測する。実際のアクセス時間は、処理装置28が記憶装置25に対してアクセスを開始した時点と、記憶装置25へのアクセスを完了した時点とを計測することで、求めることができる。
【0077】
それから、ステップS23では、予測したアクセス時間と実際に計測したアクセス時間との誤差を算出する。この誤差の算出は、予測したアクセス時間から計測したアクセス時間を減算し、その絶対値をとることによって求めることができる。
【0078】
そして、ステップS24では、その誤差を使って乱数を生成する。コンピュータは、入力装置21、出力装置22、処理装置28、記憶装置25など複数の装置が接続され、これらの装置間で種々の信号が送受信されており、また、処理装置28では種々の処理が実行されている。したがって、例えば処理装置28から記憶装置25に同じアクセスを行った場合でも、そのタイミングによってズレを生じ、同一のアクセス時間となることは現実的にはあり得ない。また、人為的に種々の処理を実行させた場合であっても、そのアクセスを実行するプログラムから見ると、記憶装置25に対する1回の書き込み時間や読み出し時間は、ある程度の幅で変化するだけで、0.01秒が10時間になるような極端な変化は生じない。
【0079】
したがって、予測したアクセス時間と計測したアクセス時間との間には、必ず所定範囲内の誤差が発生し、その誤差は、予測不可能であり、偶然性及び非再現性を有する。したがって、この誤差をそのまま乱数として使用することができ、更に実用的で性質の良い乱数を得るべく、その誤差の一部を乱数として使用してもよい。
【0080】
上述の乱数生成方法によれば、処理装置28から記憶装置25に対するアクセス時間を予測し、実際に処理装置28から記憶装置25にアクセスを行ってそのアクセス時間を計測し、予測したアクセス時間と計測したアクセス時間との誤差を乱数源とするので、コンピュータ内部におけるアクセス時間の不規則性を利用して、予測不可能性、偶然性、及び非再現性を有する乱数を容易に生成することができる。
【0081】
次に、第2の実施の形態における具体的な実施例について以下に説明する。
【0082】
図13は、本実施例におけるコンピュータの構成を説明する図である。本実施例におけるコンピュータ30は、コンピュータ本体31、キーボード及びマウス(入力装置)32、ディスプレイ(出力装置)33を備えており、コンピュータ本体内31には、制御装置と演算装置を備えた中央演算処理装置を構成するCPU34と、主記憶装置を構成するROMやRAM等のメモリ35と、補助記憶装置を構成するハードディスク36が設けられている。そして、本実施例における乱数生成用コンピュータプログラムがインストールされている。尚、本実施例では、CPU34とハードディスク36が共通のコンピュータ本体31内に組み込まれた場合を例に説明するが、ハードディスク36をコンピュータ本体31の外に置いた、いわゆる外付けの場合であってもよい。
【0083】
図14は、乱数生成用コンピュータプログラムによる乱数の生成方法を説明するフローチャートである。まず最初に、ステップS31〜ステップS34によって、アクセス時間の予測値y’を算出するために必要な初期値の設定処理を行う。
【0084】
ステップS31では、CPU34がハードディスク36にアクセスを開始したアクセス開始時刻tと、CPU34がハードディスク36へのアクセスを終了したアクセス終了時刻tを計測する処理が行われる。
【0085】
ここで、CPU34は、ハードディスク36に対して所定の命令やデータの読み込み等を要求する信号を送信し、その信号を送信した時刻をアクセス開始時刻tとして計測する。ハードディスク36は、CPU34からのアクセス要求を受けると、該当する命令やデータを読み出して、直ぐにCPU34に送信する。CPU34は、ハードディスク36から送られてきた命令やデータを受信し、その受信を完了した時刻をアクセス終了時刻tとして計測する。
【0086】
ステップS32では、アクセス時間の実測値yを算出する処理が行われる。アクセス時間の実測値yは、上述のアクセス終了時刻tからアクセス開始時刻tを減算することによって算出される(y=t−t)。
【0087】
ステップS33では、アクセス時間の実測値yをメモリ35内に予め設定されているアクセス時間記憶領域に記憶する処理が行われる。アクセス時間記憶領域の構造については、第1の実施の形態における往復伝搬遅延時間記憶領域14と同様であるので、その詳細な説明を省略する。
【0088】
ステップS34では、アクセス時間記憶領域の全ての記憶枠にアクセス時間の実測値yが記憶されているか否かが判断され、記憶されていない場合(NO)には、ステップS31に戻り、全ての記憶枠に記憶されている(YES)と判断されるまで、ステップS31〜ステップS34までの処理を繰り返す。これにより、アクセス時間記憶領域には、所定個数分(K個分)のアクセス時間の実測値yが記憶される。
【0089】
次に、ステップS35では、所定時刻iにおけるアクセス時間の予測値y’を算出する処理が行われる。アクセス時間の予測値y’は、メモリ35のアクセス時間記憶領域に記憶されたアクセス時間の実測値(yi−k、yi−k+1、…、yi−1)に基づき、ARモデルを利用して算出される。尚、ARモデルについては、第1の実施の形態と同様であるので、その詳細な説明を省略する。
【0090】
ステップS36では、所定時刻iにおいて、実際にCPU34からハードディスク36にアクセスを行い、そのアクセス開始時刻と、アクセス終了時刻Tを計測する処理が行われる。そして、そのアクセス開始時刻とアクセス終了時刻Tから、所定時刻iにおけるアクセス時間の実測値yを算出する。
【0091】
ステップS37では、アクセス終了予測時刻T’を算出する処理が行われる。アクセス終了予測時刻T’は、ステップS36で計測したアクセス開始時刻に、ステップS35で算出したアクセス時間の予測値y’を加算することによって求めることができる(アクセス終了予測時刻T’=アクセス要求信号の送信開始時刻+アクセス時間の予測値y’)。
【0092】
ステップS38では、ステップS36で計測したアクセス終了時刻Tと、ステップS37で算出したアクセス終了予測時刻T’との誤差dを算出する処理が行われる。この誤差dは、アクセス終了予測時刻T’からアクセス終了時刻Tを減算して、その絶対値をとることによって求められる(d=|T’−T|)。
【0093】
ステップS39では、乱数として実用的で性質が良いものを得るべく、誤差dの一部を乱数として取り出す処理が行われる。具体的には、まず、10進数で得られた誤差dを2進数に変換し、その2進数に変換した数値の最下位の1ビットを取得して乱数に用いる。例えば、誤差dが9マイクロ秒であった場合(0.0009秒)、この「9」(10進表記)を2進変換すると「1001」となる。この「1001」の最下位の1ビット、すなわち「1」を取得して乱数に用いる。
【0094】
ステップS40では、ステップS36で算出した所定時刻iにおけるアクセス時間の実測値yをアクセス時間記憶領域に記憶させることによって、アクセス時間記憶領域の記憶内容を更新する処理が行われる。そして、ステップS40での処理が終了すると再びステップS35に戻り、ステップS35からステップS40までの処理を繰り返し行う。これにより、乱数列を得ることができる。
【0095】
上述の実施例では、アクセス終了予測時刻T’とアクセス終了時刻Tとから誤差dを算出する場合を例に説明したが、アクセス時間の予測値y’と実測値yとから算出しても良い。また、実施例では、記憶手段の例としてハードディスク36の場合を例に説明したが、他の記憶手段であってもよい。
【0096】
(第3の実施の形態)
本実施の形態における乱数生成方法は、コンピュータに所定のプログラム命令を実行させ、コンピュータがそのプログラム命令の実行を開始してから終了するまでの命令処理時間を予測し、実際の命令処理時間との誤差を用いて乱数を生成するものである。
【0097】
具体的には、図15のフローチャートを用いて以下に説明する。図15は、第3の実施の形態における乱数生成方法を説明するフローチャートである。先ず、ステップS41では、所定のプログラム命令をコンピュータに実行させた場合に、そのプログラム命令の実行を開始してから終了するまでの処理時間を予測する。予測する方法は、例えば、過去に実際に計測した処理時間に基づいて予測してもよく、また、実行するプログラム命令の種類などの種々のパラメータに基づいて予測してもよい。また、所定のプログラム命令は、例えばコンピュータに1000までの中での素数を求めさせる素数計算処理命令などが挙げられる。
【0098】
そして、ステップS42では、実際にそのプログラム命令をコンピュータに実行させ、命令処理時間を計測する。実際の命令処理時間は、コンピュータがそのプログラム命令の処理を開始した時刻と、処理を終了した時刻とを計測することで求めることができる。
【0099】
それから、ステップS43では、予測した命令処理時間と実際に計測した命令処理時間との誤差を算出する。この誤差の算出は、予測した命令処理時間から実際に計測した命令処理時間を減算し、その絶対値をとることによって求めることができる。
【0100】
そして、ステップS44では、その誤差を使って乱数を生成する。コンピュータがプログラム命令を実行する場合には、複数の機械命令や主記憶装置を使用するため、コンピュータの状況によって、単位時間当たりにコンピュータが処理できる仕事量(スループット)が異なる。したがって、所定のプログラム命令を実行した場合でも、そのタイミングによって処理離間が異なり、同一の時間となることは現実的にはあり得ない。また、人為的にコンピュータの状況を変化させた場合であっても、そのプログラム命令を実行するプログラムから見ると、ある程度の幅で変化するだけで、0.01秒が10時間になるような極端な変化は生じない。
【0101】
したがって、予測した命令処理時間と実際に計測した命令処理時間との間には、必ず所定範囲内の誤差が発生し、その誤差は、予測不可能であり、偶然性及び非再現性を有する。したがって、この誤差をそのまま乱数として使用することができ、また、更に実用的で性質の良い乱数を得るべく、乱数源として、その誤差の一部を乱数として使用してもよい。
【0102】
上述の乱数生成方法によれば、コンピュータによる所定のプログラム命令の処理時間を予測し、実際に計測した命令処理時間との誤差を乱数源とするので、コンピュータの状況に応じた命令処理時間の不規則性を利用して、予測不可能性、偶然性、及び非再現性を有する乱数を容易に生成することができる。
【0103】
次に、第3の実施の形態における具体的な実施例について以下に説明する。
【0104】
本実施例における乱数生成用コンピュータプログラムは、実行可能な状態でコンピュータにインストールされている。尚、コンピュータの構成については、第2の実施の形態における実施例の場合と同様であるので、その詳細な説明を省略する。
【0105】
図16は、乱数生成用コンピュータプログラムによる乱数の生成方法を説明するフローチャートである。まず最初に、ステップS51〜ステップS54によって、命令処理時間の予測値z’を算出するために必要な初期値の設定処理を行う。
【0106】
ステップS51では、プログラム命令の単位であるソフトウエア命令の処理をコンピュータが開始した命令処理開始時刻tと、コンピュータがソフトウエア命令の処理を終了した命令処理終了時刻tの計測が行われる。ソフトウエア命令の処理は、本実施例では、コンピュータに1000までの中での素数を求めさせる素数計算処理が設定されている。
【0107】
ステップS52では、命令処理時間の実測値zを算出する。命令処理時間の実測値zは、上述の命令処理終了時刻tから命令処理開始時刻tを減算することによって算出される(z=t−t)。
【0108】
ステップS53では、命令処理時間の実測値zをメモリ内に予め設定されている命令処理時間記憶領域に記憶する処理が行われる。命令処理時間記憶領域の構造については、第1の実施の形態における往復伝搬遅延時間記憶領域14と同様であるので、その詳細な説明を省略する。
【0109】
ステップS54では、命令処理時間記憶領域の全ての記憶枠に命令処理時間の実測値zが記憶されているか否かが判断され、記憶されていない場合(NO)には、ステップS51に戻り、全ての記憶枠に記憶されている(YES)と判断されるまで、ステップS51〜ステップS54までの処理を繰り返す。これにより、処理時間記憶領域には、所定個数分(K個分)の命令処理時間の実測値zが記憶される。
【0110】
次に、ステップS55では、所定時刻iにおける命令処理時間の予測値z’を算出する処理が行われる。命令処理時間の予測値z’は、命令処理時間記憶領域に記憶された命令処理時間の実測値(zi−k、zi−k+1、…、zi−1)に基づき、ARモデルを利用して算出される。尚、ARモデルについては、第1の実施の形態と同様であるので、その詳細な説明を省略する。
【0111】
ステップS56では、所定時刻iにおいて、実際にソフトウエア命令をコンピュータに処理させ、コンピュータがその処理を開始した命令処理開始時刻と、処理を終了した命令処理終了時刻Tを計測する処理が行われる。そして、その命令処理開始時刻と命令処理終了時刻Tから、所定時刻iにおける命令処理時間の実測値zを算出する。
【0112】
ステップS57では、命令処理終了予測時刻T’を算出する処理が行われる。命令処理終了予測時刻T’は、ステップS56で計測した命令処理開始時刻に、ステップS55で算出した命令処理時間の予測値z’を加算することによって求めることができる(命令処理終了時刻T’=命令処理開始時刻+命令処理時間の予測値z’)。
【0113】
ステップS58では、ステップS56で計測した命令処理終了時刻Tと、ステップS57で算出した命令処理終了予測時刻T’との誤差dを算出する処理が行われる。この誤差dは、命令処理終了予測時刻T’から命令処理終了時刻Tを減算して、その絶対値をとることによって、求められる(d=|T’−T|)。
【0114】
ステップS59では、乱数として実用的で性質が良いものを得るべく、誤差dを乱数源として用い、誤差dの一部を乱数として取り出す処理が行われる。具体的には、まず、10進数で得られた誤差dを2進数に変換し、その2進数に変換した数値の最下位の1ビットを取得して乱数に用いる。例えば、誤差dが9マイクロ秒であった場合(0.0009秒)、この「9」(10進表記)を2進変換すると「1001」となる。この「1001」の最下位の1ビット、すなわち「1」を取得して乱数に用いる。
【0115】
ステップS60では、ステップS56で算出した所定時刻iにおける命令処理時間の実測値zを命令処理時間記憶領域に記憶させることによって、命令処理時間記憶領域の記憶内容を更新する処理が行われる。そして、ステップS60での処理が終了すると再びステップS55に戻り、ステップS55からステップS60までの処理を繰り返し行う。これにより、乱数列を得ることができる。
【0116】
上述の実施例では、命令処理終了予測時刻T’と命令処理終了時刻Tとから誤差dを算出する場合を例に説明したが、命令処理時間の予測値z’と実測値zとから算出しても良い。
【0117】
尚、本発明は、上述の実施の形態に限定されるものではなく、本発明の趣旨を逸脱しない範囲で種々の変更が可能である。
【0118】
【発明の効果】
以上説明したように、本発明による乱数生成方法及び乱数生成用コンピュータプログラム及びコンピュータネットワークシステムによれば、第1の通信装置と第2の通信装置との間のパケット往復時間を予測し、実際に計測したパケット往復時間との誤差を乱数源とするので、コンピュータネットワークのトラフィックの不確実性を利用して、予測不可能性、偶然性及び非再現性を有する乱数を容易に生成することができる。
【0119】
また、他の発明による乱数生成方法及び乱数生成用コンピュータプログラム及びコンピュータによれば、処理装置から記憶装置へのアクセス時間を予測し、実際に計測したアクセス時間との誤差を乱数源として用いるので、アクセス時間の不規則性を利用して、予測不可能性、偶然性及び非再現性を有する乱数を1台のコンピュータ内で容易に生成することができる。
【0120】
更に他の発明による乱数生成方法及び乱数生成用コンピュータプログラム及びコンピュータによれば、コンピュータによるプログラム命令の命令処理時間を予測し、実際に計測した命令処理時間との誤差を乱数源として用いるので、コンピュータの状況に応じた命令処理時間の不規則性を利用して、予測不可能性、偶然性及び非再現性を有する乱数を1台のコンピュータ内で容易に生成することができる。
【図面の簡単な説明】
【図1】本実施の形態を説明する全体構成図である。
【図2】本実施の形態における乱数生成方法を説明するフローチャートである。
【図3】本実施例の全体構成図である。
【図4】乱数生成用コンピュータプログラムによる乱数の生成方法を説明するフローチャートである。
【図5】クライアント内に設定される往復伝搬遅延時間記憶領域を図式化したものである。
【図6】1次のARモデルを示すものである。
【図7】誤差の2進数の有効桁数の分布を調べた表である。
【図8】本検定に利用したNISTのパラメータを示す表である。
【図9】実験結果を説明する表である。
【図10】不合格となった項目を示す表である。
【図11】第2の実施の形態を説明する図である。
【図12】第2の実施の形態における乱数生成方法を説明するフローチャートである。
【図13】本実施例におけるコンピュータの構成を説明する図である。
【図14】乱数生成用コンピュータプログラムによる乱数の生成方法を説明するフローチャートである。
【図15】第3の実施の形態における乱数生成方法を説明するフローチャートである。
【図16】乱数生成用コンピュータプログラムによる乱数の生成方法を説明するフローチャートである。
【符号の説明】
1 第1の通信装置
2 第2の通信装置
3 コンピュータネットワーク
10 クライアントサーバシステム
11 クライアント
12 サーバ
13 LAN
14 往復伝搬遅延時間記憶領域
20 コンピュータ
21 入力装置
22 出力装置
23 主記憶装置
24 補助記憶装置
25 記憶装置
26 演算装置
27 制御装置
28 処理装置
30 コンピュータ
31 コンピュータ本体
32 キーボード&マウス(入力装置)
33 ディスプレイ(出力装置)
34 CPU(中央演算処理装置)
35 メモリ(主記憶装置)
36 ハードディスク[0001]
TECHNICAL FIELD OF THE INVENTION
The present invention relates to a random number generation method, a random number generation computer program, and the like, and relates to a random number generation method for generating a random number used as a seed used in a field requiring a random number, such as a session key or a one-time password. The present invention relates to a computer program for generating random numbers and the like.
[0002]
[Prior art]
2. Description of the Related Art Conventionally, when performing wired or wireless information communication, information is encrypted and transmitted so that the contents do not leak to a third party. The private key used for encryption must be randomly generated and unpredictable.
[0003]
In the case of password authentication for identifying a user, the secret key is generated by the user by himself / herself. On the other hand, the encryption key such as an ordinary encryption application, SSL (Secure Sockets Layer), and IPsec (IP Security Protocol) is used. In the case of the encrypted communication protocol, the user is not directly involved in the generation of the secret key, but is generated automatically by software.
[0004]
In the case of an encryption application or an encryption communication protocol, the software performs a predetermined arithmetic process on an input bit pattern called a seed to generate a random number, and generates a secret key based on the random number. I have. The input bit pattern uses a part of the host name of the server, the date, the time, and the like. The calculation of the random number is performed by using an algorithm such as SHA-1, MD5, MDC2, MD2 or UNIX (registered). (Trademark), the system function (r) attached to Linux and the like are used.
[0005]
Further, there has been proposed a device that includes a timer and a storage unit that stores a part of the random number, and that generates a random number using a count value of the timer and data of the storage unit when the random number is generated (for example, see Patent Document 1). .
[0006]
[Patent Document 1]
JP 2000-242470 A
[0007]
[Problems to be solved by the invention]
If the software generates a secret key based on a certain rule, there is a risk that an attacker using the rule may guess the secret key. Therefore, seeds for generating a secret key need to be coincidental, unpredictable, and non-reproducible.
[0008]
However, as described above, a well-known algorithm is used for the calculation of the random number, and a part of the host name of the server, the date, and the time are used. (Regularity) appears, is predictable, reproducible and poor in chance. For this reason, the secret key may be decrypted, and there is a problem in security.
[0009]
Conventionally, a method of using a physical random number in order to safely create a seed is known. However, a special device is required to generate the physical random number, and such a special device is required for each terminal. Is difficult in practice.
[0010]
The present invention has been made in view of the above points, and provides a random number generation method and a random number generation method capable of generating a random number satisfying randomness, unpredictability, and non-reproducibility from a computer device normally used. It is an object to provide a computer program for use, a computer network system, and a computer.
[0011]
[Means for Solving the Problems]
According to the first aspect of the present invention, there is provided a random number generating method which is required for predetermined data to reciprocate between a first communication device and a second communication device interconnected by a computer network. It is characterized in that a random data round-trip time is predicted, and a random number is generated using an error from the actually measured data round-trip time.
[0012]
According to a second aspect of the present invention, there is provided a random number generation method for estimating a packet round trip time required for a packet to make a round trip between a first communication device and a second communication device interconnected by a computer network. A packet round trip time prediction step, a packet round trip time measuring step of measuring the actual packet round trip time by reciprocating a packet between the first communication device and the second communication device, and the predicted packet round trip time were measured. An error calculation step for calculating an error from the packet round trip time and a random number generation step for generating a random number using the error are provided.
[0013]
According to a third aspect of the present invention, in the random number generating method according to the second aspect, the packet round trip time prediction step predicts a packet round trip time based on a packet round trip time measured in the past.
[0014]
According to a fourth aspect of the present invention, in the random number generating method according to the second or third aspect, the random number generating step converts the error into a binary number and converts the least significant bit of the numerical value converted into the binary number into a random number. It is characterized by being used for.
[0015]
A computer program for generating a random number according to claim 5, wherein a round-trip time required for predetermined data to and fro between a first communication device and a second communication device interconnected by a computer network. Round trip time prediction procedure for predicting the data round trip time, a data round trip time measuring procedure for measuring the actual data round trip time by reciprocating data between the first communication device and the second communication device, and a predicted data round trip time And a program for causing a computer to execute an error calculation procedure for calculating an error between the measured data round trip time and a random number generation procedure for generating a random number using the error.
[0016]
A computer network system according to a sixth aspect of the present invention predicts a packet round trip time required for a packet to make a round trip between a first communication device and a second communication device interconnected by a computer network. , A packet is reciprocated between the first communication device and the second communication device, an actual packet round trip time is measured, and an error between the predicted packet round trip time and the measured packet round trip time is calculated. It is characterized in that a random number is generated using an error.
[0017]
According to the random number generation method, the random number generation computer program and the computer network system described in claims 1 to 6, the packet round trip time between the first communication device and the second communication device is predicted and actually measured. Since the error from the calculated packet round-trip time is used as a random number source, random numbers having unpredictability, randomness and non-reproducibility can be easily generated by using the uncertainty of the traffic of the computer network.
[0018]
According to a seventh aspect of the present invention, in a computer having a processing device and a storage device, a random number generation method predicts an access time required to access the storage device from the processing device; An access time measuring step of measuring an actual access time by causing the apparatus to access, an error calculating step of calculating an error between the predicted access time and the measured access time, and a random number generation generating a random number using the error And step.
[0019]
According to an eighth aspect of the present invention, in the random number generating method according to the seventh aspect, the access time prediction step predicts the access time based on the access time measured in the past.
[0020]
According to a ninth aspect of the present invention, in the random number generating method according to the seventh or eighth aspect, the random number generating step converts the error into a binary number and converts the least significant one bit of the binary number into a random number. It is characterized by being used for.
[0021]
A computer program for generating a random number according to the invention according to claim 10, comprising: a computer having a processing device and a storage device for predicting an access time required for accessing the storage device from the processing device; , An access time measurement procedure for measuring an actual access time by accessing a storage device, an error calculation procedure for calculating an error between the predicted access time and the measured access time, and a random number generation for generating a random number using the error And executing the procedure.
[0022]
A computer according to claim 11, wherein in a computer having a processing device and a storage device, an access time required for the processing device to access the storage device is predicted, and the processing device is made to access the storage device. , An error between the predicted access time and the measured access time is calculated, and a random number is generated using the error.
[0023]
According to the random number generation method, the random number generation computer program, and the computer according to claims 7 to 11, the access time from the processing device to the storage device is predicted, and an error from the actually measured access time is used as a random number source. Therefore, by utilizing the irregularity of the access time, a random number having unpredictability, randomness and non-reproducibility can be easily generated in one computer.
[0024]
According to a twelfth aspect of the present invention, there is provided a random number generation method, comprising: a processing time estimating step of estimating a processing time required for a computer to execute a predetermined program; The method includes a processing time measuring step of measuring, an error calculating step of calculating an error between the predicted processing time and the measured processing time, and a random number generating step of generating a random number using the error.
[0025]
According to a thirteenth aspect of the present invention, in the random number generation method according to the twelfth aspect, the processing time prediction step predicts a processing time based on a processing time measured in the past.
[0026]
According to a fourteenth aspect of the present invention, in the random number generating method according to the twelfth or thirteenth aspect, the random number generating step converts the error into a binary number and converts the least significant one bit of the binary number into a random number. It is characterized by being used for.
[0027]
A computer program for generating a random number according to the invention of claim 15 includes a processing time prediction procedure for predicting a processing time required for the computer to process the predetermined program, and an actual process for causing the computer to process the predetermined program. Causing the computer to execute a processing time measurement procedure for measuring time, an error calculation procedure for calculating an error between the predicted processing time and the measured processing time, and a random number generation procedure for generating a random number using the error. It is characterized by the following.
[0028]
The computer according to claim 16 predicts a processing time from the start of execution of the predetermined program to completion thereof, and calculates an actual processing time from the start of execution of the predetermined program to completion thereof. The method is characterized in that an error is calculated between the measured processing time and the measured processing time, and a random number is generated using the error.
[0029]
According to the random number generation method, the random number generation computer program and the computer according to claims 12 to 16, the processing time of the program by the computer is predicted, and an error from the actually measured processing time is used as a random number source. Utilizing the irregularity of the processing time according to the situation, random numbers having unpredictability, chance and non-reproducibility can be easily generated in one computer.
[0030]
BEST MODE FOR CARRYING OUT THE INVENTION
Next, an embodiment of the present invention will be described with reference to the drawings.
[0031]
(First Embodiment)
FIG. 1 is an overall configuration diagram for explaining the first embodiment. The first communication device 1 and the second communication device 2 are computer terminals such as a PC and a server, and are connected to each other by a computer network 3 so that predetermined data such as packets can be transmitted and received. A plurality of other terminals (not shown) are connected to the network 3 and various protocols are mixed. The random number generation method according to the present embodiment is realized by a computer software program installed in the first communication device 1 connected to the computer network 3, and performs the second communication with the first communication device 1. When predetermined data is reciprocated with the device 2, the reciprocation time is predicted, and a random number is generated using an error with the actual reciprocation time.
[0032]
Specifically, this will be described below with reference to the flowchart of FIG. FIG. 2 is a flowchart illustrating a random number generation method according to the first embodiment.
[0033]
First, in step S1, a packet round trip time at a predetermined time is predicted. For example, the prediction method may be based on the packet round-trip time actually measured in the past, or may be based on various parameters such as the connection status of other terminals and the utilization rate of the network 3. You may.
[0034]
Then, in step S2, the actual packet round trip time at a predetermined time is measured. For the measurement, for example, a request packet and a response packet are used. The request packet is, for example, when the request packet is transmitted from the first communication device to the second communication device, the second communication device 2 receiving the request packet sends a response to the first communication device 1. It has a function to return a packet. By measuring the time at which the first communication device 1 transmits the request packet and the time at which the response packet is received, the actual packet round trip time can be measured.
[0035]
Then, in step S3, an error between the predicted packet round trip time and the actually measured packet round trip time is calculated. This error can be calculated by subtracting the actually measured packet round trip time from the predicted packet round trip time and taking the absolute value thereof.
[0036]
Then, in step S4, a random number is generated using the error. In a computer network 3 to which a plurality of terminals are connected and in which various protocols exist, even if the same application is executed between the first communication device 1 and the second communication device 2, for example, burst-like traffic or the like is generated. It is not realistic that packets are transmitted and received at exactly the same time depending on the cause. Even when the number of packets flowing through the computer network 3 is artificially changed, the packet round-trip time only changes within a certain range, and an extreme change such that 0.01 seconds becomes 10 hours. Does not occur. Therefore, an error within a predetermined range always occurs between the predicted packet round-trip time and the actually measured packet round-trip time, and the error is unpredictable and has randomness and non-reproducibility. Therefore, this error can be used as a random number as it is, and a part of the error may be used as a random number in order to obtain a more practical random number with good properties.
[0037]
According to the above-described random number generation method, a packet round trip time between the first communication device 1 and the second communication device 2 is predicted, and an error from the actually measured time is used as a random number source. Utilizing the traffic uncertainty of No. 3, random numbers having unpredictability, randomness, and non-reproducibility can be easily generated.
[0038]
Next, a specific example of the first embodiment will be described below.
[0039]
FIG. 3 is an overall configuration diagram of the present embodiment. In the figure, reference numeral 10 denotes a client-server system as an example of a computer network system, in which a client 11 and a server 12 are connected to each other via a LAN 13 and constitute an IP network capable of transmitting and receiving IP packets to each other. . A plurality of terminals (not shown) are connected to the LAN 13 and various protocols are mixed. Further, the computer program for generating a random number according to the present embodiment is installed in the client 11. The above-mentioned IP network is not limited to the LAN 13, but may be a WAN (Wide Area Network) or the Internet instead of the LAN 13.
[0040]
FIG. 4 is a flowchart illustrating a method of generating random numbers by a computer program for generating random numbers.
[0041]
First, in steps S11 to S14, the predicted value x ′ of the round-trip propagation delay time is calculated. i Is performed to set an initial value necessary for calculating.
[0042]
In step S11, a process of reciprocating an IP packet between the client 11 and the server 12 and measuring a transmission time and a reception time of the IP packet in the client 11 is performed. Here, the client 11 transmits a request IP packet to the server 12, and the transmission time t 1 Is measured. On the other hand, upon receiving the request IP packet from the client 11, the server 12 immediately transmits a response IP packet to the client 11 in response thereto. Then, when the client 11 receives the response IP packet from the server 12, the reception time t 2 Is measured.
[0043]
Next, in step S12, a process of calculating an actually measured value x of the round-trip propagation delay time required for the IP packet to reciprocate between the client 11 and the server 12 is performed. The measured value x of the round-trip propagation delay time is the above-described reception time t 2 From transmission time t 1 Is calculated by subtracting (x = t 2 -T 1 ). In the present embodiment, a gettimeofday function capable of measuring time with microsecond accuracy is used to measure the reception time of a response IP packet using Linux as an operating system (OS). The variable (tv_sec) and (tv_usec) are used to represent microseconds. When another operating system (OS) is used, a function that can measure time with microsecond accuracy is used.
[0044]
In step S13, a process of storing the measured value x of the round-trip propagation delay time in the round-trip propagation delay time storage area 14 preset in the client 11 is performed. FIG. 5 schematically shows the round-trip propagation delay time storage area 14. The round-trip propagation delay time storage area 14 has a structure in which a predetermined number of storage frames capable of storing the measured value x of the round-trip propagation delay time are arranged in a line (see FIG. 5A). When the new measured value x of the round-trip propagation delay time is calculated, the measured value x already stored in each storage frame is shifted by one frame toward the left as a whole, and the leftmost storage frame is shifted. Is discarded and the newly calculated actual value x is stored in the rightmost storage frame (see FIG. 5B). The number of storage frames in the round-trip propagation delay time storage area 14 is set to the same number (k) as the number of AR models described later.
[0045]
In step S14, it is determined whether or not the measured value x of the round-trip propagation delay time is stored in all the storage frames of the round-trip propagation delay time storage area 14. If the measured value x is not stored (NO), the process proceeds to step S11. Returning, the processing from step S11 to step S14 is repeated until it is determined that the information is stored in all storage frames (YES). As a result, the round-trip propagation delay time storage area 14 stores a predetermined number (K pieces) of actually measured values x of the round-trip propagation delay times.
[0046]
Next, in step S15, the predicted value x ′ of the round-trip propagation delay time at the predetermined time i i Is calculated. Predicted value x 'of round-trip propagation delay time i Is the measured value (x) of the round-trip propagation delay time measured in the past and stored in the round-trip propagation storage area 14. i-k , X i−k + 1 , ..., x i-1 ). Here, a predicted value x ′ of the round-trip propagation delay time is utilized using an AR model (autoregressive model), which is a typical model of time series analysis, as a discrete time series model. i Is calculated.
[0047]
The AR model is a model in which values at the present time in a time series are represented by a linear combination of values at the past in the time series. X is the time series of interest t Then, the AR model is expressed by the following equation (1).
[0048]
(Equation 1)
Figure 2004206025
In equation (1), x t-i Is x t It is an actual measurement value of i times earlier in time. Also, e t Is the modeling error at time t. If this value is 0, there is no error. And a i (I = 1, 2,..., K) are auto-regression coefficients representing the equation (1).
[0049]
FIG. 6 shows a first-order AR model. x t Is an output of a feedback control system having a first-order lag as shown in FIG. In addition, z in the figure -1 Is the delay operator. In order to estimate this AR model, the auto-regression coefficient a of equation (1) i Needs to be estimated. In this embodiment, the autoregression coefficient a of the equation (1) is calculated by the following method. i Is estimated.
[0050]
First, x on both sides of equation (1) tl Are multiplied and averaged, the following equation (2) holds.
[0051]
(Equation 2)
Figure 2004206025
[0052]
Where r l Is a function of the expected value, x t , X tl It is expressed as the average of the product of In advance (r 0 , R 1 , ..., r k ) Is calculated in advance. Considering l = 1, 2,..., K) in equation (2), the following equation is derived.
[0053]
[Equation 3]
Figure 2004206025
[0054]
The k-th simultaneous equation is referred to as a Yule-Walker equation. Autoregression coefficient a i Is estimated by solving equation (3). And this autoregressive coefficient a i From the model and the predicted value x 'of the round-trip propagation delay time i Can be calculated.
[0055]
Next, in step S16, at a predetermined time i, the IP packet is actually reciprocated between the client 11 and the server 12, and the transmission time and the reception time T of the IP packet in the client 11 are determined. i Is measured. Then, the transmission time and the reception time T i From the actual measured value x of the round-trip propagation delay time at the predetermined time i i Is calculated.
[0056]
In step S17, the predicted reception time T ′ of the response IP packet at the predetermined time i i Is calculated. Predicted reception time T ' i Is the predicted value x ′ of the round trip propagation delay time calculated in step S15 at the transmission time of the request IP packet measured in step S16. i (Predicted reception time T ′ i = Request IP packet transmission time + Round trip propagation delay time predicted value x ' i ).
[0057]
In step S18, the actual reception time T measured in step S16 i And the predicted reception time T ′ calculated in step S17 i Error d i Is calculated. This error d i Is the predicted reception time T ′ i From reception time T i Is subtracted and its absolute value is obtained (d i = | T ' i -T i |).
[0058]
In step S19, in order to obtain a practical random number with good properties, the error d i Is extracted as a random number. Specifically, first, an error d obtained in a decimal number i Is converted into a binary number, and the least significant bit of the numerical value converted into the binary number is obtained and used as a random number. For example, the error d i Is 9 microseconds (0.0009 second), this "9" (in decimal notation) is converted to "1001". The least significant bit of “1001”, that is, “1” is obtained and used as a random number. The reason for using the lower one bit for the random number will be described later.
[0059]
In step S20, the measured value x of the round-trip propagation delay time at the predetermined time i calculated in step S16 i Is stored in the round-trip propagation delay time storage area 14, whereby a process of updating the storage content of the round-trip propagation delay time storage area 14 is performed. When the processing in step S20 ends, the process returns to step S15 again, and the processing from step S15 to step S20 is repeatedly performed. Thereby, a random number sequence can be obtained.
[0060]
In the case of the present embodiment, the error d i An experiment was conducted on how many lower-order bits are used for optimization. And the error d i When only the least significant bit is used, a practical random number with particularly good properties can be obtained. Hereinafter, the contents and results of the experiment will be described.
[0061]
The computer used for the experiment was a CPU: Pentium (registered trademark) 3 (1 GHz), a memory: 256 MB, and an OS: RedHat Linux 7.2, and a gettimeofday function was used to measure the reception time of a response IP packet. . The experiment was performed between two computers on the LAN, and the packet round trip time between the client 11 and the server 12 was calculated as a round trip propagation delay time x t And the predicted reception time T ′ i And the actual reception time T i D, which is the absolute value of the difference from i The network environment when the error was taken as an error.
[0062]
First, the obtained error d i In binary notation, the number of significant digits of the obtained error was examined in order to consider how many lower bits can be used as a random number. The number of significant digits of the error refers to the sequence length when the obtained error is represented in binary. For example, if the obtained error is 9 microseconds (0.0009 seconds), when this "9" (decimal notation) is converted into binary, it becomes "1001", and the number of significant digits of this numerical value is 4 digits. is there.
[0063]
FIG. 7 shows that 10 6 10 is a table obtained by acquiring (1,000,000) times of errors and examining the distribution of the number of significant digits of a binary number. The order of the AR model used at this time is 10, the experiment is performed 10 times, and the average is shown. The number of digits in Table 1 is the number of significant digits when converted to a binary number, and the number is the number of times corresponding to the number of digits out of 1,000,000. From this table, it can be seen that an error of 1 to 8 bits occupies about 90% of the whole. Therefore, the error d i Is considered to be 8 bits or less.
[0064]
Therefore, next, two types of test experiments, NIST and DIEHARD, were performed for the case where only the lower 1 bit of the error was used as a random number and the case where the lower 2 bits were used as a random number. However, in the method using the lower 2 bits of the error, when the number of significant digits of the error is 2 (2 or 3 in decimal number), the second bit from the lower bit becomes 1, so that When the number is 2, only the lower 1 bit of the error is used and the lower 2 bits are not used.
[0065]
The NIST is a tool for performing a randomness test on output data from a physical random number and a pseudo random number generator, and is a statistical package including tests from 16 items. For NIST, see http: // crsc. nest. gov / rug. Is described in detail. FIG. 8 is a table showing NIST parameters used for the main test. When the p-value output by performing various tests satisfies 0 <p-value <1, it is considered that the test item has passed.
[0066]
DIEHARD, on the other hand, is a random number test program developed at Florida State University, and tests 15 items. If the p-value output by performing the test of these 15 items satisfies “0 <p-value <1” and KSTEST satisfies “0 <KSTEST <1”, it is considered that the test item has passed. ing. For DIEHARD, see http: // stat. fsu. edu / geo / diehard. html.
[0067]
Test 1 for NIST when using only the lower 1 bit of error as random number, Test 3 for DIEHARD test, Test 2 for NIST test when using lower 2 bits of error as random number, Test for DIEHARD Was performed as Experiment 4, and the experiment results shown in FIG. 9 were obtained.
[0068]
According to this, in the random number sequence obtained from only the lower one bit, all the test items were able to pass, but when the lower two bits were random numbers, several test items were used for both NIST and DIEHARD. Was rejected. FIG. 10 is a table showing items that failed the test. From this experimental result, it can be seen that particularly when only the least significant bit of the error is used, a practical random number having good properties can be obtained.
[0069]
In the above-described embodiment, the case where the number of models of the AR model, that is, the number of storage frames of the round-trip propagation delay time storage area 14 is set to 10 has been described as an example. By increasing the number within a certain range, the properties of random numbers can be further improved, and random numbers closer to true random numbers can be generated.
[0070]
In the embodiment, the predicted reception time T ′ i And the actual reception time T i And the error d i Has been described as an example, but the predicted value x ′ of the round-trip propagation delay time has been described. i And measured value x i And may be calculated from
[0071]
Furthermore, in the embodiment, the case of the client-server system has been described as an example, but any computer-to-computer connection, such as the client 11 and the client 11, and the server 12 and the server 12, may be used. Further, the network environment is not limited to the IP network 13, but may be a network using another protocol.
[0072]
Further, in the embodiment, the case of the computer software program installed in the client 11 has been described as an example. However, a part or the front part thereof may be configured by hardware to be a random number generation device.
[0073]
(Second embodiment)
FIG. 11 is a diagram illustrating the second embodiment, and is a diagram illustrating a configuration of a computer. The computer 20 includes four components: an input device 21, an output device 22, a storage device 25 including a main storage device 23 and an auxiliary storage device 24, and a processing device 28 including a calculation device 26 and a control device 27. It is configured.
[0074]
The random number generation method according to the present embodiment is realized in one computer 20 by a computer software program installed in the computer 20, and reads and writes data from the processing device 28 to the storage device 25. The access time is predicted, the access time is predicted, and a random number is generated using an error from the actual access time.
[0075]
Specifically, this will be described below using the flowchart of FIG. FIG. 12 is a flowchart illustrating a random number generation method according to the second embodiment. First, in step S21, when an access such as Read (read), Write (write), Update (update), and Delete (delete) is performed from the processing device to the storage device, from the start of access to the end of access. Predict access time. The method of estimating the access time may be based on, for example, data actually measured in the past, or may be based on various parameters such as the capacity of the storage device.
[0076]
In step S22, the processing device 28 actually accesses the storage device 25, and measures the access time. The actual access time can be obtained by measuring the time when the processing device 28 starts accessing the storage device 25 and the time when the access to the storage device 25 is completed.
[0077]
Then, in step S23, an error between the predicted access time and the actually measured access time is calculated. This error can be calculated by subtracting the measured access time from the predicted access time and taking its absolute value.
[0078]
Then, in step S24, a random number is generated using the error. The computer is connected to a plurality of devices such as an input device 21, an output device 22, a processing device 28, and a storage device 25, and various signals are transmitted and received between these devices. In the processing device 28, various processes are performed. It is running. Therefore, for example, even when the same access is performed from the processing device 28 to the storage device 25, there is a deviation due to the timing, and it is practically impossible to have the same access time. Further, even when various processes are executed artificially, from the point of view of a program executing the access, one write time or one read time to the storage device 25 only changes within a certain range. , 0.01 seconds becomes 10 hours.
[0079]
Therefore, an error within a predetermined range always occurs between the predicted access time and the measured access time, and the error is unpredictable and has randomness and non-reproducibility. Therefore, this error can be used as a random number as it is, and a part of the error may be used as a random number in order to obtain a more practical random number with good properties.
[0080]
According to the above-described random number generation method, the access time from the processing device 28 to the storage device 25 is predicted, the storage device 25 is actually accessed from the processing device 28, and the access time is measured. Since an error from the calculated access time is used as a random number source, it is possible to easily generate a random number having unpredictability, randomness, and non-reproducibility by utilizing the irregularity of the access time inside the computer.
[0081]
Next, a specific example of the second embodiment will be described below.
[0082]
FIG. 13 is a diagram illustrating a configuration of a computer according to the present embodiment. The computer 30 according to the present embodiment includes a computer main body 31, a keyboard and a mouse (input device) 32, and a display (output device) 33. The computer main body 31 has a central processing unit including a control device and an arithmetic device. A CPU 34 constituting the device, a memory 35 such as a ROM or a RAM constituting a main storage device, and a hard disk 36 constituting an auxiliary storage device are provided. Then, the computer program for generating a random number in the present embodiment is installed. In this embodiment, the case where the CPU 34 and the hard disk 36 are incorporated in the common computer main body 31 will be described as an example. However, this is a so-called external case where the hard disk 36 is placed outside the computer main body 31. Is also good.
[0083]
FIG. 14 is a flowchart illustrating a method of generating random numbers by the computer program for generating random numbers. First, at steps S31 to S34, the predicted access time y ' i Is performed to set an initial value necessary for calculating.
[0084]
In step S31, the access start time t at which the CPU 34 starts accessing the hard disk 36 1 And the access end time t at which the CPU 34 has finished accessing the hard disk 36. 2 Is measured.
[0085]
Here, the CPU 34 transmits a signal for requesting reading of a predetermined command or data to the hard disk 36, and sets the time at which the signal was transmitted to the access start time t. 1 Measured as Upon receiving an access request from the CPU 34, the hard disk 36 reads out the corresponding command or data and immediately transmits it to the CPU 34. The CPU 34 receives the command or data sent from the hard disk 36 and sets the time at which the reception was completed to the access end time t. 2 Measured as
[0086]
In step S32, a process of calculating the actual measured value y of the access time is performed. The actual measured value y of the access time is the access end time t described above. 2 Access start time t 1 (Y = t 2 -T 1 ).
[0087]
In step S33, a process of storing the actual measured value y of the access time in an access time storage area preset in the memory 35 is performed. The structure of the access time storage area is the same as that of the round-trip propagation delay time storage area 14 in the first embodiment, and a detailed description thereof will be omitted.
[0088]
In step S34, it is determined whether or not the actual measured value y of the access time is stored in all the storage frames of the access time storage area. If the measured value is not stored (NO), the process returns to step S31, and all the storages are performed. Steps S31 to S34 are repeated until it is determined that the information is stored in the frame (YES). As a result, the access time storage area stores a predetermined number (K) of access time actually measured values y.
[0089]
Next, in step S35, the predicted value y ′ of the access time at the predetermined time i is i Is calculated. Access time prediction value y ' i Is the actually measured access time (y) stored in the access time storage area of the memory 35. i-k , Y i−k + 1 , ..., y i-1 ) Is calculated using an AR model. The AR model is the same as in the first embodiment, and a detailed description thereof will be omitted.
[0090]
In step S36, at a predetermined time i, the CPU 34 actually accesses the hard disk 36, and the access start time and the access end time T i Is measured. Then, the access start time and the access end time T i From the actual measured value y of the access time at the predetermined time i. i Is calculated.
[0091]
In step S37, the predicted access end time T ′ i Is calculated. Access end predicted time T ' i Is the predicted access time y ′ calculated at step S35 at the access start time measured at step S36. i (The estimated access end time T ′). i = Transmission start time of access request signal + Predicted value y 'of access time i ).
[0092]
In step S38, the access end time T measured in step S36 i And the predicted access end time T ′ calculated in step S37 i Error d i Is calculated. This error d i Is the predicted access end time T ′ i To access end time T i Is subtracted, and its absolute value is obtained (d i = | T ' i -T i |).
[0093]
In step S39, in order to obtain a practical random number with good properties, the error d i Is extracted as a random number. Specifically, first, an error d obtained in a decimal number i Is converted into a binary number, and the least significant bit of the numerical value converted into the binary number is obtained and used as a random number. For example, the error d i Is 9 microseconds (0.0009 second), this "9" (in decimal notation) is converted to "1001". The least significant bit of “1001”, that is, “1” is obtained and used as a random number.
[0094]
In step S40, the actual measured value y of the access time at the predetermined time i calculated in step S36 i Is stored in the access time storage area, thereby performing a process of updating the storage content of the access time storage area. When the process in step S40 ends, the process returns to step S35 again, and the processes from step S35 to step S40 are repeatedly performed. Thereby, a random number sequence can be obtained.
[0095]
In the above-described embodiment, the predicted access end time T ′ i And access end time T i And the error d i Has been described as an example, but the predicted access time y ′ i And measured value y i And may be calculated from Further, in the embodiment, the case of the hard disk 36 has been described as an example of the storage unit, but another storage unit may be used.
[0096]
(Third embodiment)
The random number generation method according to the present embodiment causes a computer to execute a predetermined program instruction, predicts an instruction processing time from when the computer starts executing the program instruction to when the program instruction ends, and calculates a difference between the actual instruction processing time and the actual instruction processing time. A random number is generated using the error.
[0097]
Specifically, this will be described below with reference to the flowchart in FIG. FIG. 15 is a flowchart illustrating a random number generation method according to the third embodiment. First, in step S41, when a predetermined program instruction is executed by a computer, a processing time from the start of the execution of the program instruction to the end thereof is predicted. The prediction method may be based on, for example, a processing time actually measured in the past, or may be based on various parameters such as a type of a program instruction to be executed. Further, the predetermined program instruction includes, for example, a prime number calculation processing instruction for causing a computer to calculate a prime number up to 1000.
[0098]
In step S42, the computer actually causes the computer to execute the program instruction, and measures the instruction processing time. The actual instruction processing time can be obtained by measuring the time when the computer starts processing the program instruction and the time when the processing ends.
[0099]
Then, in step S43, an error between the predicted instruction processing time and the actually measured instruction processing time is calculated. This error can be calculated by subtracting the actually measured instruction processing time from the predicted instruction processing time and taking its absolute value.
[0100]
Then, in step S44, a random number is generated using the error. When a computer executes a program instruction, a plurality of machine instructions and a main storage device are used. Therefore, the amount of work (throughput) that the computer can process per unit time varies depending on the state of the computer. Therefore, even when a predetermined program instruction is executed, the processing interval differs depending on the timing, and it is practically impossible to have the same time. Further, even when the computer situation is changed artificially, from the point of view of the program that executes the program instruction, an extreme change such that 0.01 second becomes 10 hours only by a certain degree of change. No significant change occurs.
[0101]
Therefore, an error within a predetermined range always occurs between the predicted instruction processing time and the actually measured instruction processing time, and the error is unpredictable and has randomness and non-reproducibility. Therefore, this error can be used as a random number as it is, and a part of the error may be used as a random number as a random number source in order to obtain a more practical and good random number.
[0102]
According to the random number generation method described above, the processing time of a predetermined program instruction by the computer is predicted, and an error from the actually measured instruction processing time is used as a random number source. Using the regularity, random numbers having unpredictability, randomness, and non-reproducibility can be easily generated.
[0103]
Next, a specific example of the third embodiment will be described below.
[0104]
The computer program for generating a random number in this embodiment is installed in a computer in an executable state. Since the configuration of the computer is the same as that of the example in the second embodiment, a detailed description thereof will be omitted.
[0105]
FIG. 16 is a flowchart illustrating a method of generating random numbers by the computer program for generating random numbers. First, at steps S51 to S54, the predicted value z ′ of the instruction processing time is calculated. i Is performed to set an initial value necessary for calculating.
[0106]
In step S51, an instruction processing start time t at which the computer starts processing of a software instruction which is a unit of a program instruction. 1 And an instruction processing end time t at which the computer has finished processing the software instruction. 2 Is measured. In this embodiment, a prime number calculation process for causing the computer to calculate a prime number up to 1000 is set for the processing of the software instruction.
[0107]
In step S52, an actual measurement value z of the command processing time is calculated. The actually measured value z of the instruction processing time is the instruction processing end time t described above. 2 To instruction processing start time t 1 (Z = t) 2 -T 1 ).
[0108]
In step S53, a process of storing the actually measured value z of the command processing time in a command processing time storage area preset in the memory is performed. The structure of the instruction processing time storage area is the same as that of the round-trip propagation delay time storage area 14 in the first embodiment, and a detailed description thereof will be omitted.
[0109]
In step S54, it is determined whether or not the actual measurement value z of the instruction processing time is stored in all the storage frames of the instruction processing time storage area. If not (NO), the process returns to step S51, and Steps S51 to S54 are repeated until it is determined that the information is stored in the storage frame (YES). As a result, a predetermined number (K) of actually measured values z of the command processing time are stored in the processing time storage area.
[0110]
Next, in step S55, the predicted value z ′ of the instruction processing time at the predetermined time i is i Is calculated. Instruction processing time prediction value z ' i Is the actual measured value of the instruction processing time stored in the instruction processing time storage area (z i-k , Z i−k + 1 , ..., z i-1 ) Is calculated using an AR model. The AR model is the same as in the first embodiment, and a detailed description thereof will be omitted.
[0111]
In step S56, at a predetermined time i, the computer actually causes the computer to process the software instruction, and the instruction processing start time at which the computer starts the processing and the instruction processing end time T at which the processing ends. i Is measured. Then, the instruction processing start time and the instruction processing end time T i From the actual measured value z of the instruction processing time at the predetermined time i. i Is calculated.
[0112]
In step S57, the instruction processing end predicted time T ′ i Is calculated. Instruction processing end predicted time T ' i Is the predicted value z ′ of the command processing time calculated in step S55 at the command processing start time measured in step S56. i (Instruction processing end time T ′). i = Instruction processing start time + instruction processing time predicted value z ' i ).
[0113]
In step S58, the command processing end time T measured in step S56 i And the predicted instruction processing end time T ′ calculated in step S57. i Error d i Is calculated. This error d i Is the instruction processing end predicted time T ′ i From instruction processing end time T i Is subtracted and its absolute value is obtained (d i = | T ' i -T i |).
[0114]
In step S59, in order to obtain a practical random number with good properties, the error d i Is used as a random number source, and the error d i Is extracted as a random number. Specifically, first, an error d obtained in a decimal number i Is converted into a binary number, and the least significant bit of the numerical value converted into the binary number is obtained and used as a random number. For example, the error d i Is 9 microseconds (0.0009 second), this "9" (in decimal notation) is converted to "1001". The least significant bit of “1001”, that is, “1” is obtained and used as a random number.
[0115]
In step S60, the measured value z of the instruction processing time at the predetermined time i calculated in step S56 i Is stored in the instruction processing time storage area, thereby performing processing for updating the storage content of the instruction processing time storage area. When the processing in step S60 ends, the process returns to step S55, and the processing from step S55 to step S60 is repeatedly performed. Thereby, a random number sequence can be obtained.
[0116]
In the above-described embodiment, the instruction processing end predicted time T ′ i And instruction processing end time T i And the error d i Has been described as an example, but the predicted value z ′ of the instruction processing time has been described. i And the measured value z i And may be calculated from
[0117]
Note that the present invention is not limited to the above-described embodiment, and various changes can be made without departing from the spirit of the present invention.
[0118]
【The invention's effect】
As described above, according to the random number generation method, the random number generation computer program, and the computer network system of the present invention, the packet round trip time between the first communication device and the second communication device is predicted, and Since the error from the measured packet round trip time is used as a random number source, random numbers having unpredictability, randomness and non-reproducibility can be easily generated by using the uncertainty of the traffic of the computer network.
[0119]
According to the random number generation method, the random number generation computer program, and the computer according to the other invention, the access time from the processing device to the storage device is predicted, and an error from the actually measured access time is used as a random number source. By utilizing the irregularity of the access time, random numbers having unpredictability, randomness and non-reproducibility can be easily generated in one computer.
[0120]
According to the random number generation method, the random number generation computer program, and the computer according to still another aspect of the present invention, an instruction processing time of a program instruction by the computer is predicted, and an error from an actually measured instruction processing time is used as a random number source. Utilizing the irregularity of the instruction processing time according to the situation, random numbers having unpredictability, chance and non-reproducibility can be easily generated in one computer.
[Brief description of the drawings]
FIG. 1 is an overall configuration diagram illustrating an embodiment.
FIG. 2 is a flowchart illustrating a random number generation method according to the present embodiment.
FIG. 3 is an overall configuration diagram of the present embodiment.
FIG. 4 is a flowchart illustrating a method of generating random numbers by a computer program for generating random numbers.
FIG. 5 schematically shows a round-trip propagation delay time storage area set in a client.
FIG. 6 shows a first-order AR model.
FIG. 7 is a table showing the distribution of the number of significant digits of a binary number of an error.
FIG. 8 is a table showing NIST parameters used in this test.
FIG. 9 is a table illustrating experimental results.
FIG. 10 is a table showing failed items.
FIG. 11 is a diagram illustrating a second embodiment.
FIG. 12 is a flowchart illustrating a random number generation method according to the second embodiment.
FIG. 13 is a diagram illustrating a configuration of a computer according to the present embodiment.
FIG. 14 is a flowchart illustrating a method of generating random numbers by a computer program for generating random numbers.
FIG. 15 is a flowchart illustrating a random number generation method according to the third embodiment.
FIG. 16 is a flowchart illustrating a method of generating random numbers by a computer program for generating random numbers.
[Explanation of symbols]
1 First communication device
2 Second communication device
3 Computer network
10 Client server system
11 clients
12 servers
13 LAN
14 Round-trip propagation delay time storage area
20 computers
21 Input device
22 Output device
23 Main storage device
24 Auxiliary storage device
25 Storage device
26 arithmetic unit
27 Control device
28 Processing equipment
30 Computer
31 Computer
32 Keyboard & Mouse (Input device)
33 Display (output device)
34 CPU (Central Processing Unit)
35 memory (main storage)
36 Hard Disk

Claims (16)

コンピュータネットワークによって相互に接続された第1の通信装置と第2の通信装置との間を所定のデータが往復するのに必要なデータ往復時間を予測し、実際に計測したデータ往復時間との誤差を用いて乱数を生成することを特徴とする乱数生成方法。Estimate a data round trip time required for predetermined data to reciprocate between a first communication device and a second communication device interconnected by a computer network, and calculate an error from an actually measured data round trip time. A random number generation method, wherein a random number is generated by using a random number. コンピュータネットワークによって相互に接続された第1の通信装置と第2の通信装置との間をパケットが往復するのに必要なパケット往復時間を予測するパケット往復時間予測ステップと、
前記第1の通信装置と前記第2の通信装置との間で前記パケットを往復させて実際のパケット往復時間を計測するパケット往復時間計測ステップと、
前記予測したパケット往復時間と前記計測したパケット往復時間との誤差を算出する誤差算出ステップと、
前記誤差を用いて乱数を生成する乱数生成ステップと、
を有することを特徴とする乱数生成方法。
A packet round trip time estimating step for estimating a packet round trip time required for a packet to make a round trip between a first communication device and a second communication device interconnected by a computer network;
A packet reciprocating time measuring step of reciprocating the packet between the first communication device and the second communication device to measure an actual packet reciprocating time;
An error calculation step of calculating an error between the predicted packet round trip time and the measured packet round trip time,
A random number generation step of generating a random number using the error,
A random number generation method comprising:
前記パケット往復時間予測ステップは、
過去に計測したパケット往復時間に基づいてパケット往復時間時間を予測することを特徴とする請求項2に記載の乱数生成方法。
The packet round trip time prediction step includes:
3. The random number generation method according to claim 2, wherein the packet round trip time is predicted based on the packet round trip time measured in the past.
前記乱数生成ステップは、
前記誤差を2進数に変換し、該2進数に変換した数値の最下位の1ビットを乱数に用いることを特徴とする請求項2または3に記載の乱数生成方法。
The random number generation step includes:
4. The random number generating method according to claim 2, wherein the error is converted into a binary number, and the least significant bit of the numerical value converted into the binary number is used as a random number.
コンピュータネットワークによって相互に接続された第1の通信装置と第2の通信装置との間を所定のデータが往復するのに必要な往復時間を予測するデータ往復時間予測手順と、
前記第1の通信装置と前記第2の通信装置との間で前記データを往復させて実際のデータ往復時間を計測するデータ往復時間計測手順と、
前記予測したデータ往復時間と前記計測したデータ往復時間との誤差を算出する誤差算出手順と、
前記誤差を用いて乱数を生成する乱数生成手順と、
をコンピュータに実行させるための乱数生成用コンピュータプログラム。
A data round-trip time prediction procedure for predicting a round-trip time required for predetermined data to reciprocate between a first communication device and a second communication device interconnected by a computer network;
A data round trip time measuring procedure for measuring the actual data round trip time by reciprocating the data between the first communication device and the second communication device;
An error calculation procedure for calculating an error between the predicted data round trip time and the measured data round trip time,
A random number generation procedure for generating a random number using the error,
Is a computer program for generating random numbers for causing a computer to execute.
コンピュータネットワークによって相互に接続された第1の通信装置と第2の通信装置との間をパケットが往復するのに必要なパケット往復時間を予測し、
前記第1の通信装置と前記第2の通信装置との間で前記パケットを往復させて実際のパケット往復時間を計測し、
前記予測したパケット往復時間と前記計測したパケット往復時間との誤差を算出し、
前記誤差を用いて乱数を生成することを特徴とするコンピュータネットワークシステム。
Predicting the packet round trip time required for a packet to make a round trip between a first communication device and a second communication device interconnected by a computer network;
Reciprocating the packet between the first communication device and the second communication device to measure an actual packet round trip time,
Calculate the error between the predicted packet round trip time and the measured packet round trip time,
A computer network system, wherein a random number is generated using the error.
処理装置と記憶装置を有するコンピュータにおいて、
前記処理装置から前記記憶装置にアクセスするのに必要なアクセス時間を予測するアクセス時間予測ステップと、
前記処理装置から前記記憶装置にアクセスさせて実際のアクセス時間を計測するアクセス時間計測ステップと、
前記予測したアクセス時間と前記計測したアクセス時間との誤差を算出する誤差算出ステップと、
前記誤差を用いて乱数を生成する乱数生成ステップと、
を有することを特徴とする乱数生成方法。
In a computer having a processing device and a storage device,
An access time prediction step of predicting an access time required to access the storage device from the processing device;
An access time measuring step of measuring the actual access time by allowing the processing device to access the storage device;
An error calculation step of calculating an error between the predicted access time and the measured access time,
A random number generation step of generating a random number using the error,
A random number generation method comprising:
前記アクセス時間予測ステップは、
過去に計測したアクセス時間に基づいてアクセス時間を予測することを特徴とする請求項7に記載の乱数生成方法。
The access time prediction step includes:
The random number generation method according to claim 7, wherein the access time is predicted based on the access time measured in the past.
前記乱数生成ステップは、
前記誤差を2進数に変換し、該2進数に変換した数値の最下位の1ビットを乱数に用いることを特徴とする請求項7または8に記載の乱数生成方法。
The random number generation step includes:
9. The random number generation method according to claim 7, wherein the error is converted into a binary number, and the least significant bit of the numerical value converted into the binary number is used as a random number.
処理装置と記憶装置を有するコンピュータに、
前記処理装置から前記記憶装置にアクセスするのに必要なアクセス時間を予測するアクセス時間予測手順と、
前記処理装置から前記記憶装置にアクセスさせて実際のアクセス時間を計測するアクセス時間計測手順と、
前記予測したアクセス時間と前記計測したアクセス時間との誤差を算出する誤差算出手順と、
前記誤差を用いて乱数を生成する乱数生成手順と、
を実行させるための乱数生成用コンピュータプログラム。
A computer having a processing device and a storage device,
An access time prediction procedure for predicting an access time required to access the storage device from the processing device;
An access time measurement procedure for measuring the actual access time by allowing the processing device to access the storage device,
An error calculation procedure for calculating an error between the predicted access time and the measured access time,
A random number generation procedure for generating a random number using the error,
Computer program for generating random numbers for executing
処理装置と記憶装置を有するコンピュータにおいて、
前記処理装置から前記記憶装置にアクセスするのに必要なアクセス時間を予測し、前記処理装置から前記記憶装置にアクセスさせて実際のアクセス時間を計測し、前記予測したアクセス時間と前記計測したアクセス時間との誤差を算出し、前記誤差を用いて乱数を生成することを特徴とするコンピュータ。
In a computer having a processing device and a storage device,
Estimate the access time required to access the storage device from the processing device, measure the actual access time by allowing the processing device to access the storage device, the predicted access time and the measured access time And calculating a random number by using the error.
コンピュータが所定のプログラムを処理するのに必要な処理時間を予測する処理時間予測ステップと、
前記コンピュータに前記所定のプログラムを処理させて実際の処理時間を計測する処理時間計測ステップと、
前記予測した処理時間と前記計測した処理時間との誤差を算出する誤差算出ステップと、
前記誤差を用いて乱数を生成する乱数生成ステップと、
を有することを特徴とする乱数生成方法。
A processing time estimating step of estimating a processing time required for the computer to process the predetermined program;
A processing time measuring step of measuring the actual processing time by causing the computer to process the predetermined program;
An error calculation step of calculating an error between the predicted processing time and the measured processing time,
A random number generation step of generating a random number using the error,
A random number generation method comprising:
前記処理時間予測ステップは、
過去に計測した処理時間に基づいて処理時間を予測することを特徴とする請求項12に記載の乱数生成方法。
The processing time prediction step includes:
The random number generation method according to claim 12, wherein the processing time is predicted based on the processing time measured in the past.
前記乱数生成ステップは、
前記誤差を2進数に変換し、該2進数に変換した数値の最下位の1ビットを乱数に用いることを特徴とする請求項12または13に記載の乱数生成方法。
The random number generation step includes:
14. The random number generation method according to claim 12, wherein the error is converted into a binary number, and the least significant bit of the numerical value converted into the binary number is used as a random number.
コンピュータが所定のプログラムを処理するのに必要な処理時間を予測する処理時間予測手順と、
前記コンピュータに前記所定のプログラムを処理させて実際の処理時間を計測する処理時間計測手順と、
前記予測した処理時間と前記計測した処理時間との誤差を算出する誤差算出手順と、
前記誤差を用いて乱数を生成する乱数生成手順と、
をコンピュータに実行させるための乱数生成用コンピュータプログラム。
A processing time estimation procedure for estimating the processing time required for the computer to process the predetermined program;
A processing time measurement procedure for measuring the actual processing time by causing the computer to process the predetermined program;
An error calculation procedure for calculating an error between the predicted processing time and the measured processing time,
A random number generation procedure for generating a random number using the error,
Is a computer program for generating random numbers for causing a computer to execute.
所定のプログラムの実行を開始してから完了するまでの処理時間を予測し、前記所定のプログラムの実行を開始してから完了するまでの実際の処理時間を計測し、前記予測した処理時間と前記計測した処理時間との誤差を算出し、前記誤差を用いて乱数を生成することを特徴とするコンピュータ。Predict the processing time from the start of the execution of the predetermined program to the completion thereof, measure the actual processing time from the start of the execution of the predetermined program to the completion thereof, and calculate the predicted processing time and the A computer that calculates an error from a measured processing time and generates a random number using the error.
JP2002381727A 2002-10-30 2002-12-27 Random number generating method, computer program for random number generation, computer network system, and computer Pending JP2004206025A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2002381727A JP2004206025A (en) 2002-10-30 2002-12-27 Random number generating method, computer program for random number generation, computer network system, and computer

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
JP2002315329 2002-10-30
JP2002381727A JP2004206025A (en) 2002-10-30 2002-12-27 Random number generating method, computer program for random number generation, computer network system, and computer

Publications (1)

Publication Number Publication Date
JP2004206025A true JP2004206025A (en) 2004-07-22

Family

ID=32828233

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2002381727A Pending JP2004206025A (en) 2002-10-30 2002-12-27 Random number generating method, computer program for random number generation, computer network system, and computer

Country Status (1)

Country Link
JP (1) JP2004206025A (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2007072731A (en) * 2005-09-06 2007-03-22 Chiba Univ Random number generation system, random number generation method and random number generation program
JP2008058514A (en) * 2006-08-30 2008-03-13 Brother Ind Ltd Communication equipment and program
US8572142B2 (en) 2010-11-03 2013-10-29 General Electric Company Method, device and computer program product for random number generation in a meter
US11080020B2 (en) 2019-04-26 2021-08-03 Megachips Corporation Information processing device and random number generating method

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2007072731A (en) * 2005-09-06 2007-03-22 Chiba Univ Random number generation system, random number generation method and random number generation program
JP2008058514A (en) * 2006-08-30 2008-03-13 Brother Ind Ltd Communication equipment and program
JP4725462B2 (en) * 2006-08-30 2011-07-13 ブラザー工業株式会社 Communication apparatus and program
US8572142B2 (en) 2010-11-03 2013-10-29 General Electric Company Method, device and computer program product for random number generation in a meter
US11080020B2 (en) 2019-04-26 2021-08-03 Megachips Corporation Information processing device and random number generating method

Similar Documents

Publication Publication Date Title
Ambrosin et al. On the feasibility of attribute-based encryption on internet of things devices
JP7033120B2 (en) Methods and systems for quantum key distribution based on trusted computing
US6678707B1 (en) Generation of cryptographically strong random numbers using MISRs
US20030037079A1 (en) True random number generator and entropy calculation device and method
JP7399975B2 (en) Multi-source entropy randomness aggregation and distribution network
CN111158613B (en) Data block storage method and device based on access heat and storage equipment
Abbott et al. On the unpredictability of individual quantum measurement outcomes
JP2005526299A (en) Method and apparatus for generating a random bit string using an environmental sensor
CN108139889A (en) Pseudo-random number sequence is generated by the non-linear mixing of multiple auxiliary pseudo-random number generator
AU2021200062B2 (en) Systems and computer-implemented methods for generating pseudo random numbers
Baybulatov et al. Control system availability assessment via maximum delay calculation
Gammel Hurst’s rescaled range statistical analysis for pseudorandom number generators used in physical simulations
JP2004206025A (en) Random number generating method, computer program for random number generation, computer network system, and computer
US9928370B2 (en) Communication device, communication method, computer program product, and communication system
US6317499B1 (en) Storage device random bit generator
CA3011477A1 (en) Method, system, and device for selecting a winner of a raffle based on content from raffle tickets
CN113228022B (en) Analysis query response system, analysis query response method, and recording medium
JP2005508539A (en) System and method for assigning engine measurement metrics to a computer system
JP2014095966A (en) Information processor, information processing method and program
RU2577201C2 (en) Method for generating a random number using a computer (variants)
JP7116722B2 (en) Methods for checking the availability and integrity of distributed data objects
Darir et al. ProbFlow: Using Probabilistic Programming in Anonymous Communication Networks.
JP4689539B2 (en) Data processing apparatus and method
US9281943B1 (en) Defending against factoring by collision
JP2010231528A (en) Calculation device, calculation method and program for calculating secrecy evaluation value