Movatterモバイル変換


[0]ホーム

URL:


WO2012111559A1 - Sensor device and control method thereof - Google Patents

Sensor device and control method thereof
Download PDF

Info

Publication number
WO2012111559A1
WO2012111559A1PCT/JP2012/053119JP2012053119WWO2012111559A1WO 2012111559 A1WO2012111559 A1WO 2012111559A1JP 2012053119 WJP2012053119 WJP 2012053119WWO 2012111559 A1WO2012111559 A1WO 2012111559A1
Authority
WO
WIPO (PCT)
Prior art keywords
random number
pseudo
data
number sequence
initialization
Prior art date
Application number
PCT/JP2012/053119
Other languages
French (fr)
Japanese (ja)
Inventor
田中 毅
健 河本
Original Assignee
株式会社日立製作所
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 株式会社日立製作所filedCritical株式会社日立製作所
Publication of WO2012111559A1publicationCriticalpatent/WO2012111559A1/en

Links

Images

Classifications

Definitions

Landscapes

Abstract

An objective of the present invention is to securely transmit information collected with a sensor node, and to reduce the impact of increased power consumption in processes other than the sensing process. A process which initializes and updates a pseudorandom number string which is used in encryption is executed on the sensor node only when the power is switched on, when charging or receiving power from an external power supply, or when the battery has sufficient capacity. Additionally, the number of output iterations from the initialization of the pseudorandom number string to the outputting of the random number with which the packet is encrypted is appended to the transmitted encrypted data.

Description

センサデバイス、及びその制御方法Sensor device and control method thereof
 本発明は、センサデバイス、及びその制御方法に関し、例えば、人の身体に装着され、或いは、所定の環境下に配置され、測定したデータを出力するセンサデバイス、及びその制御方法に関するものである。The present invention relates to a sensor device and a control method thereof, for example, a sensor device that is mounted on a human body or arranged in a predetermined environment and outputs measured data, and a control method thereof.
 人にセンサノード(センサデバイスともいう)を装着したり、情報端末を所定の環境下に設置したりして、個人情報、生体情報、及び環境情報等を取得することが考えられている。It is considered to acquire personal information, biological information, environmental information, etc. by mounting a sensor node (also called a sensor device) on a person or installing an information terminal in a predetermined environment.
 例えば、特許文献1に示されるように、センサ、無線、マイコン等を搭載した小型のセンサノードが実用化段階にある。特許文献1で開示されるセンサノードでは、センシングや無線通信が必要なタイミングでのみ起動し、それ以外では電源を切って消費電力を削減する間欠動作を実行している。また、このような脈拍を測ることを目的としたセンサノードは電源を内蔵しつつも一般的に小型であり、人が身に付けることも容易である場合が多い。従って、日常生活において、人の生活の中の活動の情報を容易に収集し、収集情報をサーバ装置に送信して集中管理することが可能となっている。For example, as disclosed inPatent Document 1, a small sensor node equipped with a sensor, wireless, microcomputer, etc. is in the practical stage. The sensor node disclosed inPatent Document 1 is activated only when sensing or wireless communication is necessary, and otherwise, an intermittent operation is performed in which the power is turned off to reduce power consumption. In addition, sensor nodes intended to measure such a pulse are generally small in size with a built-in power supply, and are often easy for a person to wear. Therefore, in daily life, it is possible to easily collect information on activities in a person's life and transmit the collected information to a server device for centralized management.
特開2004-234622号公報JP 2004-234622 A
 しかしながら、特許文献1に示されるセンサノードにおいては、センシングして収集した情報は脈拍などの個人情報であり、取り扱いを厳重にしなければならないところ、当該個人情報を単に通信によりサーバ装置に送信することを想定しており、第三者による個人情報の閲覧や改竄を防止するという観点が欠落している。However, in the sensor node shown inPatent Document 1, the information collected by sensing is personal information such as a pulse, and the handling must be strictly performed. However, the personal information is simply transmitted to the server device by communication. The viewpoint of preventing browsing and falsification of personal information by a third party is lacking.
 また、このようなセンサノードや情報端末においては、小型バッテリを電源として駆動するため、低消費電力でセンシングする必要がある。ところが、特許文献1に示されるセンサノードは、センシング処理に特化して、それ以外の時間をスリープ状態にして消費電力を削減する間欠動作であるため、センシング処理以外で処理時間が長くなると、消費電力が大幅に増大し、電池を電源とした場合には日常利用が困難な電池寿命となる。In such sensor nodes and information terminals, since a small battery is driven as a power source, it is necessary to perform sensing with low power consumption. However, the sensor node shown inPatent Document 1 is an intermittent operation that specializes in sensing processing and reduces the power consumption by putting the other time in the sleep state. When the battery is used as a power source, the battery life becomes difficult to use on a daily basis.
 本発明はこのような状況に鑑みてなされたものであり、センサノードで収集した情報を安全に送信すると共に、センシング処理以外の処理における消費電力の増加の影響を軽減することができる技術を提供するものである。The present invention has been made in view of such a situation, and provides a technique capable of safely transmitting information collected by a sensor node and reducing the influence of an increase in power consumption in processing other than sensing processing. To do.
 本発明では、センサノードで暗号化に用いる擬似乱数列を初期化、更新する処理を、パワーオン時や、外部電源による充電や給電時、あるいはバッテリの残量が十分である場合のみ実行する。また、送信する暗号化データには、疑似乱数列の初期化から、そのパケットを暗号化した乱数を出力するまでの出力回数を付加する。In the present invention, the process of initializing and updating the pseudo-random number sequence used for encryption at the sensor node is executed only when the power is turned on, when charging or feeding with an external power source, or when the remaining battery level is sufficient. In addition, the number of outputs from the initialization of the pseudo random number sequence to the output of a random number obtained by encrypting the packet is added to the encrypted data to be transmitted.
 即ち、本発明によるセンサノード(センサデバイス)では、センサによって取得した測定データに対して暗号化処理を実行して暗号化データを生成する。そして、当該センサノードでは、供給電源の電圧値が所定値以上ある場合(例えば、内臓バッテリの電圧残量が所定値以上の場合、或いは、外部電源が接続されていることを検知した場合)に、暗号化処理に用いる擬似乱数列を初期化する処理を実行するようにしている。That is, the sensor node (sensor device) according to the present invention performs encryption processing on the measurement data acquired by the sensor to generate encrypted data. In the sensor node, when the voltage value of the power supply is greater than or equal to a predetermined value (for example, when the voltage remaining in the built-in battery is greater than or equal to the predetermined value, or when it is detected that an external power supply is connected). The process for initializing the pseudo-random number sequence used for the encryption process is executed.
 本発明に関連する更なる特徴は、本明細書の記述、添付図面から明らかになるものである。また、本発明の態様は、要素及び多様な要素の組み合わせ及び以降の詳細な記述と添付される特許請求の範囲の様態により達成され実現される。Further features related to the present invention will become apparent from the description of the present specification and the accompanying drawings. The embodiments of the present invention can be achieved and realized by elements and combinations of various elements and the following detailed description and appended claims.
 本明細書の記述は典型的な例示に過ぎず、本発明の特許請求の範囲又は適用例を如何なる意味に於いても限定するものではないことを理解する必要がある。It should be understood that the descriptions in this specification are merely exemplary, and are not intended to limit the scope of the claims or the application of the present invention in any way.
 本発明によれば、センサノードで収集した情報を安全に格納し、または送信することができ、また、センシング処理以外の処理における消費電力の増加の影響を軽減することができるようになる。According to the present invention, the information collected by the sensor node can be stored or transmitted safely, and the influence of the increase in power consumption in processes other than the sensing process can be reduced.
本発明の実施形態によるセンサノードの概略構成を示すブロック図である。It is a block diagram which shows schematic structure of the sensor node by embodiment of this invention.センサノードで用いられる電源検出回路の構成例を示す図である。It is a figure which shows the structural example of the power supply detection circuit used with a sensor node.センサノードで用いられるOR回路の構成例を示す図であるIt is a figure which shows the structural example of OR circuit used with a sensor node.センサノード、基地局、サーバを含むシステムの概略構成例を示す図である。It is a figure which shows the schematic structural example of the system containing a sensor node, a base station, and a server.本発明の実施形態による基地局の内部構成例を示すブロック図である。It is a block diagram which shows the internal structural example of the base station by embodiment of this invention.本発明の実施形態によるサーバの内部構成例ブロック図である。It is a block diagram of an internal configuration example of a server according to an embodiment of the present invention.本発明の実施形態における、暗号化ファイルのデータフォーマット例を示す図である。It is a figure which shows the data format example of the encryption file in embodiment of this invention.各センサノードの共通鍵を記録した共通鍵テーブルの構成例を示す図である。It is a figure which shows the structural example of the common key table which recorded the common key of each sensor node.本発明の実施形態であるサーバにおける、センサデータ(暗号化データ)を復号化する際に生成される内部情報を保持する内部情報保持データの構成例を示す図である。It is a figure which shows the structural example of the internal information holding data which hold | maintains the internal information produced | generated when the sensor data (encrypted data) are decoded in the server which is embodiment of this invention.センサノードの処理の概要を説明するためのフローチャートである。It is a flowchart for demonstrating the outline | summary of a process of a sensor node.センサノードの初期化処理(S101)の詳細を説明するためのフローチャートである。It is a flowchart for demonstrating the detail of the initialization process (S101) of a sensor node.センサノードの擬似乱数初期化処理(S112及びS202)の詳細を説明するためのフローチャートである。It is a flowchart for demonstrating the detail of the pseudorandom number initialization process (S112 and S202) of a sensor node.センサノードの暗号化処理(S107)の詳細を説明するためのフローチャートである。It is a flowchart for demonstrating the detail of the encryption process (S107) of a sensor node.センサノードやサーバが有する内部状態の構成例を示す図である。It is a figure which shows the structural example of the internal state which a sensor node and a server have.センサノードやサーバが有する秘密鍵の構成例を示す図である。It is a figure which shows the structural example of the secret key which a sensor node or a server has.センサノードやサーバにおいて、ストリーム暗号化アルゴリズムをARCFOURとした場合の、ストリーム暗号化アルゴリズムの初期化処理(S303)の詳細を説明するためのフローチャートである。10 is a flowchart for explaining details of stream encryption algorithm initialization processing (S303) when a stream encryption algorithm is set to ARCFOUR in a sensor node or a server.センサノードやサーバにおいて、ストリーム暗号化アルゴリズムをARCFOURとした場合の、ストリーム暗号化アルゴリズムの擬似乱数出力処理(S306及びS403)の詳細を説明するためのフローチャートである。10 is a flowchart for explaining details of a pseudo-random number output process (S306 and S403) of a stream encryption algorithm when a stream encryption algorithm is set to ARCFOUR in a sensor node or a server.センサノードの通信処理(S102)の詳細を説明するためのフローチャートである。It is a flowchart for demonstrating the detail of the communication process (S102) of a sensor node.基地局におけるデータ受信処理の詳細を説明するためのフローチャートである。It is a flowchart for demonstrating the detail of the data reception process in a base station.サーバの暗号化ファイル復号化処理の詳細を説明するためのフローチャートである。It is a flowchart for demonstrating the detail of the encryption file decoding process of a server.サーバの擬似乱数列初期化処理(S911)の詳細を説明するためのフローチャートである。It is a flowchart for demonstrating the detail of the pseudorandom number sequence initialization process (S911) of a server.サーバの復号化処理(S905)の詳細を説明するためのフローチャートである。It is a flowchart for demonstrating the detail of a decoding process (S905) of a server.センサノードの消費電流の変化を示す図である。It is a figure which shows the change of the consumption current of a sensor node.
 本発明は、例えば人体に装着可能な、或いは所定の環境下に設置可能な超小型のセンサノードにおいて、測定データを暗号化する際に生じる電力消費の影響を軽減することができる技術を提供するものである。The present invention provides a technique capable of reducing the influence of power consumption that occurs when measuring data is encrypted in an ultra-compact sensor node that can be worn on a human body or installed in a predetermined environment. Is.
 以下、添付図面を参照して本発明の実施形態について説明する。添付図面では、機能的に同じ要素は同じ番号で表示される場合もある。なお、添付図面は本発明の原理に則った具体的な実施形態と実装例を示しているが、これらは本発明の理解のためのものであり、決して本発明を限定的に解釈するために用いられるものではない。Hereinafter, embodiments of the present invention will be described with reference to the accompanying drawings. In the accompanying drawings, functionally identical elements may be denoted by the same numbers. The attached drawings show specific embodiments and implementation examples based on the principle of the present invention, but these are for understanding the present invention and are not intended to limit the present invention. Not used.
 本実施形態では、当業者が本発明を実施するのに十分詳細にその説明がなされているが、他の実装・形態も可能で、本発明の技術的思想の範囲と精神を逸脱することなく構成・構造の変更や多様な要素の置き換えが可能であることを理解する必要がある。従って、以降の記述をこれに限定して解釈してはならない。This embodiment has been described in sufficient detail for those skilled in the art to practice the present invention, but other implementations and configurations are possible without departing from the scope and spirit of the technical idea of the present invention. It is necessary to understand that the configuration and structure can be changed and various elements can be replaced. Therefore, the following description should not be interpreted as being limited to this.
 更に、本発明の実施形態は、後述されるように、汎用コンピュータ上で稼動するソフトウェアで実装しても良いし専用ハードウェア又はソフトウェアとハードウェアの組み合わせで実装しても良い。Furthermore, as will be described later, the embodiment of the present invention may be implemented by software running on a general-purpose computer, or may be implemented by dedicated hardware or a combination of software and hardware.
 なお、本明細書の図では、テーブルやリストを例にして本発明で用いられる情報について説明しているが、テーブルやリストの構造で提供される情報に限られるものではなく、データ構造に依存しない情報であっても良い。In the drawings in this specification, information used in the present invention is described using a table or list as an example. However, the information is not limited to the information provided in the table or list structure, and depends on the data structure. It may be information that does not.
 また、各情報の内容を説明する際に、「識別情報」、「識別子」、「名」、「名前」、「ID」という表現を用いるが、これらについてはお互いに置換が可能である。Also, in describing the contents of each information, the expressions “identification information”, “identifier”, “name”, “name”, “ID” are used, but these can be replaced with each other.
 以後の説明では「プログラム」を主語として各処理の説明を行うことがあるが、プログラムはプロセッサによって実行されることで定められた処理をメモリ及び通信ポート(通信制御装置)を用いながら行うため、プロセッサを主語とした説明としてもよい。また、プログラムを主語として開示された処理は管理サーバ等の計算機、情報処理装置が行う処理としてもよい。プログラムの一部または全ては専用ハードウェアで実現してもよく、また、モジュール化されていても良い。各種プログラムはプログラム配布サーバや記憶メディアによって各計算機にインストールされてもよい。In the following description, each process may be described with “program” as the subject. However, since the program uses the memory and the communication port (communication control device) to perform the process defined by being executed by the processor, The description may be based on the processor. Further, the processing disclosed with the program as the subject may be processing performed by a computer such as a management server or an information processing apparatus. Part or all of the program may be realized by dedicated hardware, or may be modularized. Various programs may be installed in each computer by a program distribution server or a storage medium.
 <センサノードの構成>
 図1は、本発明の第1の実施形態によるセンサノード1(センサデバイス、センサ装置、センサ端末、情報端末などと言うこともできる)の概略構成を示す図である。
<Configuration of sensor node>
FIG. 1 is a diagram showing a schematic configuration of a sensor node 1 (also referred to as a sensor device, a sensor device, a sensor terminal, an information terminal, etc.) according to the first embodiment of the present invention.
 センサノード1は、マイコン10と、センサ2と、リアルタイムクロック(RTC)3と、センサノード1の内部の所定の電源電圧を生成するレギュレータ4と、バッテリ(例えば、内蔵された充電池)5と、外部から供給される電源によってバッテリ5の充電を制御する充電回路6と、シリアル-USB変換回路7と、無線通信部9と、USBポート8と、EEPROM40と、フラッシュメモリ50と、電源検出回路60と、OR回路70と、を有する。Thesensor node 1 includes amicrocomputer 10, asensor 2, a real time clock (RTC) 3, aregulator 4 that generates a predetermined power supply voltage inside thesensor node 1, and a battery (for example, a built-in rechargeable battery) 5. A charging circuit 6 for controlling the charging of thebattery 5 by an externally supplied power, a serial-USB conversion circuit 7, awireless communication unit 9, aUSB port 8, anEEPROM 40, aflash memory 50, and apower detection circuit 60 and anOR circuit 70.
 センサノード1のUSBポート8に外部から電源が供給されると、電源検出回路60がマイコン10の入力検出部14に信号を発生させ、マイコン10が演算部12でストリーム暗号アルゴリズム22、ハッシュ関数23及び乱数生成器(乱数生成プログラム)24によって、暗号化処理に用いる擬似乱数列を初期化し、RAM30に記録されている秘密鍵33、初期化ベクトル34、及び内部状態35を更新する。When power is supplied from the outside to theUSB port 8 of thesensor node 1, thepower detection circuit 60 generates a signal to theinput detection unit 14 of themicrocomputer 10, and themicrocomputer 10 uses thecalculation unit 12 to generate thestream encryption algorithm 22 and thehash function 23. The random number generator (random number generation program) 24 initializes a pseudo-random number sequence used for the encryption process, and updates thesecret key 33, theinitialization vector 34, and theinternal state 35 recorded in theRAM 30.
 センサノード1は、人に装着され、或いは所定の環境下に設置され、一定間隔でセンサ2によって検知した情報を取得して内部のメモリ(図示せず)に記録する。また、センサノード1は、記録した検知情報をフラッシュメモリ50から読み出し、当該情報を無線部9による通信機能を用いて、外部(例えば、サーバ(後述))に送信する。なお、センサノード1は、特に人が身につける場合においては、その利便性のため、内蔵電池(満充電した充電池:バッテリ5)で1、2週間以上駆動することが望ましい。Thesensor node 1 is worn by a person or installed in a predetermined environment, acquires information detected by thesensor 2 at regular intervals, and records it in an internal memory (not shown). Thesensor node 1 reads the recorded detection information from theflash memory 50, and transmits the information to the outside (for example, a server (described later)) using the communication function of thewireless unit 9. Thesensor node 1 is preferably driven with a built-in battery (a fully charged rechargeable battery: battery 5) for one or two weeks or more for convenience, especially when worn by a person.
 センサ2は、人の動きや温度、脈拍等の生体情報、周辺環境の光や音等を所定の時間間隔で検出して内部のメモリに記録し、シリアル通信によって当該メモリから情報を読み出し可能となっている。センサ2として、検出した値をアナログ値の電圧等で出力するセンサを使用することも可能である。アナログ出力のセンサを用いる場合には、センサ2をA/D変換部15に接続する必要がある。Thesensor 2 can detect biological information such as a person's movement, temperature, and pulse, light and sound in the surrounding environment at predetermined time intervals, record them in an internal memory, and read the information from the memory by serial communication. It has become. As thesensor 2, a sensor that outputs a detected value as an analog voltage or the like can be used. When an analog output sensor is used, thesensor 2 needs to be connected to the A /D converter 15.
 RTC3は、時計機能を持ったICであり、内部の時計情報を保持、及び更新する。RTC3は、シリアル通信によって、保持した時計情報(時刻)を読み出し、読み出した時刻と所定の処理のタイミングを同期させることや所定の時間間隔で信号を発することが可能である。典型的には、マイコン10の消費電力よりもRTC3のそれの方が小さいため、RTC3からマイコン10に測定周期の割込みを発生させることにより、マイコン10は欠かさず測定処理を実行しながら、処理の空き時間は内部のクロックを停止してスリープ状態にして消費電力を削減することができる。RTC3 is an IC having a clock function, and holds and updates internal clock information. TheRTC 3 can read the held clock information (time) by serial communication, and can synchronize the read time with the timing of a predetermined process or emit a signal at a predetermined time interval. Typically, the power consumption of theRTC 3 is smaller than the power consumption of themicrocomputer 10, so that themicrocomputer 10 always performs the measurement process while generating the interruption of the measurement cycle from theRTC 3 to themicrocomputer 10. During the idle time, the internal clock is stopped and the sleep state can be set to reduce power consumption.
 マイコン10は、接続されたセンサ2や各メモリ(EEPROM40、フラッシュメモリ50など)等とシリアル通信をするシリアル通信部11及び16と、プログラムコードに従って演算やメモリを書き換える演算部12と、入力される信号によって所定のプログラムの実行を開始させる割込み検出部13と、入力される信号の値を保持、または割込みとする入力検出部14と、入力される信号の電圧をデジタル値に変換するアナログ-デジタル変換部(A/D変換部)15と、大容量の不揮発メモリであるフラッシュメモリ20と、揮発メモリであるRAM30と、を有している。Themicrocomputer 10 is input withserial communication units 11 and 16 that perform serial communication with theconnected sensor 2 and each memory (EEPROM 40,flash memory 50, etc.), and acalculation unit 12 that rewrites calculations and memory according to program codes. An interruptdetection unit 13 that starts execution of a predetermined program by a signal, aninput detection unit 14 that holds or interrupts the value of an input signal, and an analog-digital that converts the voltage of the input signal into a digital value A conversion unit (A / D conversion unit) 15, aflash memory 20 that is a large-capacity nonvolatile memory, and aRAM 30 that is a volatile memory are included.
 フラッシュメモリ20は、マイコン10の演算部12で処理するプログラムのコードを記録するコード領域21と、演算部12で処理するプログラムから参照するデータを記録するデータ記録領域26と、を含む。データ領域26は、マイコン10の動作中に書き換えることが可能である。コード領域21は、ストリーム暗号アルゴリズム22と、ハッシュ関数23と、乱数生成器(乱数生成プログラム)24と、制御プログラム25と、を有する。Theflash memory 20 includes acode area 21 for recording a code of a program processed by thecalculation unit 12 of themicrocomputer 10 and adata recording area 26 for recording data referred to from the program processed by thecalculation unit 12. Thedata area 26 can be rewritten during the operation of themicrocomputer 10. Thecode area 21 includes astream encryption algorithm 22, ahash function 23, a random number generator (random number generation program) 24, and acontrol program 25.
 制御プログラム25は、マイコン10のメイン処理を記述したプログラムコードであり、マイコン10の起動時に演算部12に呼び出されて実行される。ストリーム暗号アルゴリズム22、ハッシュ関数23、及び乱数生成器24はそれぞれ、制御プログラム25に記述される処理から呼び出して実行される。データ記録領域26は、センサノード1に固有な識別子である機器ID27と、マイコン10のリセット及び起動回数を記録するリセットカウンタ28と、擬似乱数列の初期化に使用し、センサノード1ごとに固有な共通鍵29と、を含んでいる。Thecontrol program 25 is a program code describing the main process of themicrocomputer 10 and is called and executed by thearithmetic unit 12 when themicrocomputer 10 is activated. Each of thestream encryption algorithm 22, thehash function 23, and therandom number generator 24 is called and executed from the processing described in thecontrol program 25. Thedata recording area 26 is used to initialize adevice ID 27 that is an identifier unique to thesensor node 1, areset counter 28 that records the number of resets and activations of themicrocomputer 10, and a pseudo-random number sequence. Thecommon key 29 is included.
 RAM30は、センサ2で測定した情報やセンサ2で測定したタイミングの時刻情報を記録するセンサデータバッファ領域31と、センサデータバッファ領域31のデータを暗号化したデータを記録する暗号化データバッファ領域32と、擬似乱数列の基になる秘密鍵を格納する秘密鍵格納領域33と、乱数生成器24によって生成されるランダムな値であり、共通鍵から秘密鍵を生成する際に用いる初期化ベクトルを格納する初期化ベクトル格納領域34と、ストリーム暗号アルゴリズム22で擬似乱数列を生成する過程でメモリに書かれた必要な情報である内部状態(擬似ランダムなバイト列:例えば、0番目から255番目までバイト列を擬似的にランダムに配列したもの(図14参照))を格納する内部状態格納領域35と、内部状態の配列を入れ替えるときに用いる2個のインデックスであるインデックスi及びインデックスjを格納するインデックスi格納領域37及びインデックスj格納領域38と、擬似乱数列の初期化から乱数を出力した回数を記録する出力カウンタ値を格納する出力カウンタ値格納領域36と、暗号化データバッファ32のデータをセクタ51の暗号化データ55の領域に記録するのに適したサイズまで蓄積する記録用暗号化データ蓄積領域65と、記録用暗号化データ65に記録されるデータの先頭値を暗号化する直前の出力カウンタの値を格納する記録用出力カウンタ格納領域63と、記録用暗号化データ65に含まれるセンサデータを測定した時刻情報を記録する記録用タイムスタンプ格納領域62と、を含んでいる。なお、図1では、領域、格納領域、及び蓄積領域の文言は省略されている。また、本明細書では、例えば、秘密鍵格納領域33に格納される秘密鍵を、秘密鍵33と称する場合があり、その他のデータについても同様である。TheRAM 30 is a sensordata buffer area 31 that records information measured by thesensor 2 and time information of timing measured by thesensor 2, and an encrypteddata buffer area 32 that records data obtained by encrypting data in the sensordata buffer area 31. And a secretkey storage area 33 for storing the secret key that is the basis of the pseudorandom number sequence, and a random value generated by therandom number generator 24, and an initialization vector used when generating the secret key from the common key Initializationvector storage area 34 to be stored, and internal state (pseudorandom byte sequence: for example, from 0th to 255th) which is necessary information written in the memory in the process of generating the pseudorandom sequence by thestream encryption algorithm 22 An internalstate storage area 35 for storing a pseudo-random array of byte strings (see FIG. 14), and an internal The indexi storage area 37 and the indexj storage area 38 for storing the index i and index j, which are the two indexes used when the state array is exchanged, and the number of times random numbers are output from the initialization of the pseudo random number sequence are recorded. An output countervalue storage area 36 for storing the output counter value, and a recording encrypteddata storage area 65 for storing data in theencrypted data buffer 32 to a size suitable for recording the data in the encrypted data 55 area of thesector 51. A recording outputcounter storage area 63 for storing the value of the output counter immediately before encrypting the head value of the data recorded in the recordingencrypted data 65, and sensor data included in the recordingencrypted data 65. And a recording timestamp storage area 62 for recording the measured time information. In FIG. 1, the terms “area”, “storage area”, and “storage area” are omitted. In this specification, for example, a secret key stored in the secretkey storage area 33 may be referred to as asecret key 33, and the same applies to other data.
 ストリーム暗号アルゴリズム22によって生成される擬似乱数列は、秘密鍵33によって一意に定まる。秘密鍵33は、例えば、センサノード固有の共通鍵29と初期化ベクトル34を結合した値を基づいてハッシュ関数23で生成したハッシュ値であることが望ましい。一般的に、ARCFOURなどの公知のストリーム暗号アルゴリズムにおいては、同じ秘密鍵から生成した擬似乱数列を繰り返し使用すると解読されやすいため、使用する秘密鍵が循環することがない程度のバリエーションがあり、予測や再現されにくい十分ランダムな初期化ベクトル34を組み合わせて使用する。本実施形態によるセンサノード1においては、初期化ベクトル34はリセットカウンタ28をもとに乱数生成器24によって生成される。ソフトウェアで構成できる乱数生成器24としては、線形帰還シフトレジスタ(LFSR)等が望ましい。The pseudo-random number sequence generated by thestream encryption algorithm 22 is uniquely determined by thesecret key 33. Thesecret key 33 is preferably a hash value generated by thehash function 23 based on a value obtained by combining thecommon key 29 unique to the sensor node and theinitialization vector 34, for example. Generally, in a known stream encryption algorithm such as ARCFOUR, since a pseudo-random number sequence generated from the same secret key is easily deciphered, there is a variation that prevents the secret key used from circulating. Or a sufficientlyrandom initialization vector 34 that is difficult to reproduce is used in combination. In thesensor node 1 according to the present embodiment, theinitialization vector 34 is generated by therandom number generator 24 based on thereset counter 28. As therandom number generator 24 that can be configured by software, a linear feedback shift register (LFSR) or the like is desirable.
 また、初期化ベクトル34は揮発性のRAM30に記録され、リセットカウンタ28はマイコン10内部のフラッシュメモリ20に記録されている。このため、マイコン10の開発用のポート(典型的にはJTAGポート)を使用不可にすれば外部から読み出すことができない。つまり、後から暗号化データを第三者が解読する目的で、任意の初期化ベクトル34を再現させることは困難であるため、初期化ベクトル34は必要十分にランダムであるといえる。なお、万が一、秘密鍵33が第三者に解読された場合においても、共通鍵29が復元されないようにするために、秘密鍵33は、ハッシュ関数でハッシュ化されている。Theinitialization vector 34 is recorded in thevolatile RAM 30, and thereset counter 28 is recorded in theflash memory 20 inside themicrocomputer 10. For this reason, if the development port of the microcomputer 10 (typically the JTAG port) is disabled, it cannot be read from the outside. That is, since it is difficult to reproduce anarbitrary initialization vector 34 for the purpose of a third party decrypting the encrypted data later, it can be said that theinitialization vector 34 is sufficiently random. Even if thesecret key 33 is decrypted by a third party, thesecret key 33 is hashed with a hash function so that thecommon key 29 is not restored.
 センサデータバッファ31の値は、典型的には先頭から順に擬似乱数列とのXOR(排他的論理和)演算によって暗号化される。擬似乱数列は秘密鍵33によって定まるが、長期的に擬似乱数列を初期化しない場合においては、初期化直後ではない擬似乱数列によって暗号化した暗号化データのみを受け取ることがほとんどであるため、秘密鍵33のみを同期しても、復号化に必要な乱数を出力することができない。これを解決するため、擬似乱数列を初期化してからの乱数の出力回数である出力カウンタ36の値を暗号化データに付加して復号化側に送信する。この出力カウンタ36の値によって、複号化で用いる擬似乱数列の先頭を特定することが可能となる。The value of thesensor data buffer 31 is typically encrypted by an XOR (exclusive OR) operation with a pseudo-random number sequence in order from the top. Although the pseudo random number sequence is determined by thesecret key 33, in the case where the pseudo random number sequence is not initialized in the long term, it is almost the case that only encrypted data encrypted by the pseudo random number sequence that is not immediately after initialization is received. Even if only thesecret key 33 is synchronized, a random number required for decryption cannot be output. In order to solve this, the value of theoutput counter 36, which is the number of times the random number is output after the pseudorandom number sequence is initialized, is added to the encrypted data and transmitted to the decryption side. With the value of theoutput counter 36, it is possible to specify the head of the pseudo random number sequence used for decoding.
 フラッシュメモリ50には、主にRAM30の暗号化データバッファに一時的に記録された情報が記録される。例えば、SDカードなどの大容量のフラッシュメモリ50は、一般的に512バイト程度の書き換え単位が定められており、この単位がセクタ51とされている。それぞれのセクタ51には、保存されたデータの時刻情報であるタイムスタンプ52と、暗号化データバッファ32の値をコピーした暗号化データ55と、暗号化データ55に対応する記録用出力カウンタである出力カウンタ53と、暗号化データ55に対応する初期化ベクトル54とが記録される。つまり、復号化側においてはセクタ51ごとに読み出されて受信した際に、共通鍵29と、初期化ベクトル54と、出力カウンタ53と、ストリーム暗号アルゴリズム22と、ハッシュ関数23と、乱数生成器24を暗号側と共有することで、暗号化データ55を復号化することができる。また、任意の時刻に測定されたデータを含むセクタ51のみを読み出したい場合においては、タイムスタンプ52のみを読みだしていくことで検索することもできる。In theflash memory 50, information temporarily recorded mainly in the encrypted data buffer of theRAM 30 is recorded. For example, a large-capacity flash memory 50 such as an SD card generally has a rewrite unit of about 512 bytes, and this unit is asector 51. Eachsector 51 includes atime stamp 52 which is time information of stored data, encrypted data 55 obtained by copying the value of theencrypted data buffer 32, and a recording output counter corresponding to the encrypted data 55. Anoutput counter 53 and aninitialization vector 54 corresponding to the encrypted data 55 are recorded. That is, on the decryption side, when read and received for eachsector 51, thecommon key 29, theinitialization vector 54, theoutput counter 53, thestream encryption algorithm 22, thehash function 23, and the random number generator By sharing 24 with the encryption side, the encrypted data 55 can be decrypted. In addition, when it is desired to read out only thesector 51 including data measured at an arbitrary time, it is possible to search by reading out only thetime stamp 52.
 EEPROM40には、フラッシュメモリ50から次に読み出すセクタの位置を示す読出しセクタポインタ41と、次に書き込むセクタの位置を示す書込みセクタポインタ42が記録される。読出しセクタポインタ41では、セクタのデータを読み出して送信に成功すると、ポインタ値が次のセクタの位置に進められて更新される。また、書込みセクタポインタ42では、セクタにデータを書き込むと、ポインタ値が次のセクタの位置に進められて更新される。また、読出しセクタポインタ41は書込みセクタポインタ42よりは先に進めないようになっている。これにより、書込みセクタポインタ42と読出しセクタポインタ41の間のデータのみを送ることで、重複したデータの送信を防ぐことができる。また、読出しセクタポインタ41と書込みセクタポインタ42は、フラッシュメモリ50で規定された最大値を超えると、最小値に戻って循環する。一般的にフラッシュメモリ50は書き換え回数に制限があるため、使用する領域を循環させることにより、フラッシュメモリ50の寿命を最大化することができる。In theEEPROM 40, aread sector pointer 41 indicating the position of the next sector to be read from theflash memory 50 and awrite sector pointer 42 indicating the position of the next sector to be written are recorded. In theread sector pointer 41, when the sector data is read and transmitted successfully, the pointer value is advanced to the position of the next sector and updated. In thewrite sector pointer 42, when data is written in the sector, the pointer value is advanced to the position of the next sector and updated. Also, theread sector pointer 41 cannot be advanced beyond thewrite sector pointer 42. Thus, by transmitting only data between thewrite sector pointer 42 and theread sector pointer 41, transmission of duplicate data can be prevented. Further, when theread sector pointer 41 and thewrite sector pointer 42 exceed the maximum value defined by theflash memory 50, they return to the minimum value and circulate. In general, since theflash memory 50 has a limit on the number of rewrites, the life of theflash memory 50 can be maximized by circulating the area to be used.
 マイコン10は、シリアル通信部16により、シリアル-USB変換7を介して、USBポート8に接続したUSB端子を有する機器と通信することができる。同様に、無線通信部9を介して、他の無線機器と通信することがきる。Themicrocomputer 10 can communicate with a device having a USB terminal connected to theUSB port 8 via the serial-USB conversion 7 by theserial communication unit 16. Similarly, it is possible to communicate with other wireless devices via thewireless communication unit 9.
 マイコン10、センサ2、RTC3、無線通信部9、EEPROM40、及びフラッシュメモリ50には、レギュレータ4から配線83を介して、電源が供給される。電源は、OR回路70及びレギュレータ4を介して、バッテリ5から、または電源供給可能な機器と接続されていればUSBポート8からそれぞれに供給される。充電回路6は、USBポート8が電源供給可能な機器と接続されている場合にのみ、バッテリ5の充電を開始し、バッテリ5の電圧が十分に高くなると、充電を停止する。Themicrocomputer 10, thesensor 2, theRTC 3, thewireless communication unit 9, theEEPROM 40, and theflash memory 50 are supplied with power from theregulator 4 through thewiring 83. Power is supplied from thebattery 5 via theOR circuit 70 and theregulator 4 or from theUSB port 8 if connected to a device capable of supplying power. The charging circuit 6 starts charging thebattery 5 only when theUSB port 8 is connected to a device capable of supplying power, and stops charging when the voltage of thebattery 5 becomes sufficiently high.
 <電源検出回路の内部構成例>
 図2は、電源検出回路60の構成例を示す図である。当該構成は単なる例であり、本発明を限定するものではないことに注意すべきである。
<Internal configuration example of power supply detection circuit>
FIG. 2 is a diagram illustrating a configuration example of the powersupply detection circuit 60. It should be noted that this configuration is merely an example and does not limit the present invention.
 電源検出回路60は、抵抗601、602、及び603と、トランジスタ604と、グランド605及び606と、を有する。例えば、端子607に、レギュレータ4を介して内部電源(バッテリ5)を接続した場合、端子609にUSBポート8を介して接続された電源の電圧に応じて、端子608の電圧が切り替えられる。つまり、端子607の電圧をレギュレータ4によって、内部電源電圧(バッテリ5の電圧)よりも大きい入力電圧、例えば電源電圧を3ボルトとした場合、例えば5ボルトの外部電源を、USBポート8を介して端子609に接続しても、抵抗601及び603によって分圧してトランジスタ604に適したベース電圧が生成される。そして、端子609にUSB端子を介して外部電源が接続されると、端子608の電圧をグランド606の電圧に、端子609に外部電源が接続されないと端子608を端子607の電圧(内部電源電圧)にする。これにより、USB端子の電源が接続されたことを、内部電源電圧を使用するマイコンにおける0及び1のデジタル入力値として生成することができる。The powersupply detection circuit 60 includesresistors 601, 602, and 603, atransistor 604, andgrounds 605 and 606. For example, when an internal power supply (battery 5) is connected to the terminal 607 via theregulator 4, the voltage of the terminal 608 is switched according to the voltage of the power supply connected to the terminal 609 via theUSB port 8. That is, when the voltage of the terminal 607 is set to a voltage higher than the internal power supply voltage (battery 5 voltage) by theregulator 4, for example, the power supply voltage is 3 volts, for example, an external power supply of 5 volts is connected via theUSB port 8. Even when connected to the terminal 609, the base voltage suitable for thetransistor 604 is generated by dividing by theresistors 601 and 603. When the external power supply is connected to the terminal 609 via the USB terminal, the voltage of the terminal 608 is changed to the voltage of the ground 606, and when the external power supply is not connected to the terminal 609, the voltage of the terminal 608 is changed to the voltage of the terminal 607 (internal power supply voltage). To. Thereby, the fact that the power supply of the USB terminal is connected can be generated as a digital input value of 0 and 1 in the microcomputer using the internal power supply voltage.
 <OR回路の内部構成例>
 図3は、OR回路70の内部構成例を示す図である。当該構成は単なる例であり、本発明を限定するものではないことに注意すべきである。
<Example of internal configuration of OR circuit>
FIG. 3 is a diagram illustrating an internal configuration example of theOR circuit 70. It should be noted that this configuration is merely an example and does not limit the present invention.
 OR回路70は、ダイオード71及び72と、抵抗73と、グランド74と、を有し、端子76及び77に接続された電源電圧の高い方が端子75に出力されるようになっている。The ORcircuit 70 includesdiodes 71 and 72, aresistor 73, and aground 74, and the higher power supply voltage connected to theterminals 76 and 77 is output to the terminal 75.
 <システムの構成>
 図4は、本実施形態による情報管理システム(単に、情報処理システムと称することもできる)の構成例を示す図である。当該情報管理システムは、少なくとも1つのセンサノード1と、少なくとも1つの基地局100と、少なくとも1つのサーバ200と、を有する。各センサノード1と基地局100は無線ネットワークで接続され、基地局100とサーバ200はネットワーク400で接続されている。
<System configuration>
FIG. 4 is a diagram illustrating a configuration example of the information management system (also simply referred to as an information processing system) according to the present embodiment. The information management system includes at least onesensor node 1, at least onebase station 100, and at least oneserver 200. Eachsensor node 1 and thebase station 100 are connected by a wireless network, and thebase station 100 and theserver 200 are connected by anetwork 400.
 当該情報管理システムでは、基地局100は、ユーザ300が身に付けたセンサノード1からセンサで計測したデータを取得して、インターネット等のネットワーク400を介してサーバ200に送信する。そして、サーバ200は、複数のセンサノード1のデータを収集して蓄積し、収集した情報を解析する。In the information management system, thebase station 100 acquires data measured by the sensor from thesensor node 1 worn by theuser 300 and transmits it to theserver 200 via thenetwork 400 such as the Internet. Then, theserver 200 collects and accumulates data of a plurality ofsensor nodes 1 and analyzes the collected information.
 このような構成を採用することにより、センサノード1や基地局100を構成するマイコンやPCが低コストで処理能力が少ない場合においても、ネットワーク400に接続された比較的処理能力が高く、メモリの記録容量も豊富なサーバ200で、大量のセンサデータを扱うことが可能になる。By adopting such a configuration, even when the microcomputer and PC constituting thesensor node 1 and thebase station 100 are low in cost and have little processing capacity, the processing capacity connected to thenetwork 400 is relatively high, Theserver 200 with abundant recording capacity can handle a large amount of sensor data.
 センサノード1と基地局100は、USBなどの有線通信で接続される他、無線通信であれば距離や接続する手間に関わらず、安定してセンサノード1からデータを収集することが可能である。Thesensor node 1 and thebase station 100 are connected by wired communication such as USB, and can collect data from thesensor node 1 stably regardless of the distance and the time and effort of connection if it is wireless communication. .
 <基地局の内部構成>
 図5は、基地局100の内部概略構成例を示す図である。基地局100は、主にPCや携帯電話等の情報機器である制御装置101と、制御装置101に接続される無線通信部130と、入力装置150と、ディスプレイ140と、を有する。
<Internal configuration of base station>
FIG. 5 is a diagram illustrating a schematic internal configuration example of thebase station 100. Thebase station 100 includes acontrol device 101 that is mainly an information device such as a PC or a mobile phone, awireless communication unit 130 connected to thecontrol device 101, aninput device 150, and adisplay 140.
 制御装置101は、不揮発記憶部110と、中央演算部(CPU)102と、RAM103と、ネットワーク400と接続して通信する機能を有するネットワーク接続部104と、ディスプレイ140等を制御してユーザ300が基地局100を操作するために必要な情報等を表示する表示制御部105と、マウスやキーボード及びタッチパネル等の入力装置150からの入力を受け付けてCPU102で実行されるプログラムから参照可能とするU/I制御部106と、外部から供給される電源から基地局100の内部電源電圧を生成する電源装置107と、USBケーブル160で繋がれたセンサノード1や無線通信部130による通信を制御する汎用I/F108と、を有する。Thecontrol device 101 controls thenonvolatile storage unit 110, the central processing unit (CPU) 102, theRAM 103, thenetwork connection unit 104 having a function of communicating with thenetwork 400, thedisplay 140, etc. Adisplay control unit 105 that displays information necessary for operating thebase station 100, and a U / U that can be referred to from a program executed by theCPU 102 by receiving input from aninput device 150 such as a mouse, a keyboard, and a touch panel. General-purpose I that controls communication by theI control unit 106, thepower supply device 107 that generates the internal power supply voltage of thebase station 100 from the power supplied from the outside, and thesensor node 1 and thewireless communication unit 130 connected by theUSB cable 160 / F108.
 不揮発記憶部110には、データ受信プログラム112、時刻同期プログラム113、及び暗号ファイル送信プログラム114等を含む制御プログラム111と、暗号化ファイル120を格納している。制御プログラム111は、CPU102によって実行される。また、暗号化ファイル120は、センサノード1から受信した情報である。Thenonvolatile storage unit 110 stores acontrol program 111 including adata reception program 112, atime synchronization program 113, an encryptionfile transmission program 114, and the like, and anencryption file 120. Thecontrol program 111 is executed by theCPU 102. Theencrypted file 120 is information received from thesensor node 1.
 データ受信プログラム112は、センサノード1から暗号化されたデータを受信して暗号化ファイル120を生成するプログラムである。時刻同期プログラム113は、センサノード1と通信してセンサノード1のRTC3の時刻を同期するためのプログラムである。暗号化ファイル送信プログラム114は、ネットワーク400を介して暗号化ファイル120をサーバ200に送信するためのプログラムである。Thedata reception program 112 is a program that receives the encrypted data from thesensor node 1 and generates theencrypted file 120. Thetime synchronization program 113 is a program for communicating with thesensor node 1 to synchronize the time of theRTC 3 of thesensor node 1. The encryptedfile transmission program 114 is a program for transmitting theencrypted file 120 to theserver 200 via thenetwork 400.
 データ受信プログラム112は、USB通信、有線通信や無線通信によってセンサノード1と基地局100が接続されたか否か定期的に監視し、接続されるとセンサノード1からデータを読み出すためのリクエストコマンドをセンタノード1に送信し、暗号化データの受信を開始する。受信したデータは、制御装置101で扱いやすいファイルサイズの暗号ファイル120に分割されて、不揮発記憶部110に格納される。Thedata reception program 112 periodically monitors whether thesensor node 1 and thebase station 100 are connected by USB communication, wired communication, or wireless communication, and when connected, sends a request command for reading data from thesensor node 1. Transmission to thecenter node 1 starts reception of encrypted data. The received data is divided intoencrypted files 120 having a file size that can be easily handled by thecontrol device 101 and stored in thenonvolatile storage unit 110.
 暗号化ファイル送信プログラム114は、定期的に新しい暗号化ファイル120が生成されたか否か監視し、データ受信プログラム112によって生成された暗号化ファイル120を、ネットワーク通信部104を制御してサーバ200に送信する。The encryptedfile transmission program 114 periodically monitors whether a newencrypted file 120 is generated, and controls thenetwork communication unit 104 to transfer theencrypted file 120 generated by thedata reception program 112 to theserver 200. Send.
 <サーバの内部構成>
 図6は、サーバ200の内部概略構成例を示す図である。サーバ200は、不揮発記憶部220と、CPU201と、RAM210と、インターネット等のネットワーク400に接続されたネットワーク通信部202と、外部電源からサーバ200の内部電源を生成する電源装置202と、を有する。
<Internal configuration of server>
FIG. 6 is a diagram illustrating an internal schematic configuration example of theserver 200. Theserver 200 includes anonvolatile storage unit 220, aCPU 201, aRAM 210, anetwork communication unit 202 connected to anetwork 400 such as the Internet, and apower supply device 202 that generates an internal power source of theserver 200 from an external power source.
 不揮発記憶部220は、サーバ200のCPU201で実行される制御プログラム221と、データベース230を有する。制御プログラム221は、ネットワーク400を介して基地局100から送信される暗号化ファイル120を受信してデータベース230に記録する暗号化ファイル受信プログラム222と、データベース230に記録された暗号化ファイル232を復号化する暗号化ファイル復号化プログラム223と、暗号化ファイル復号化プログラム223から参照されるストリーム暗号アルゴリズム224と、ハッシュ関数225と、データベース230に記録されている復号化されたセンサデータ233から人の行動や健康状態といった有益な情報を抽出するための解析計算プログラム226と、データベース230に記録されているセンサデータ233や解析データ234をユーザ300等からネットワーク400経由で閲覧可能にするWebサーバプログラム227と、を有する。Thenonvolatile storage unit 220 includes acontrol program 221 executed by theCPU 201 of theserver 200 and adatabase 230. Thecontrol program 221 receives theencrypted file 120 transmitted from thebase station 100 via thenetwork 400 and records it in thedatabase 230, and decrypts theencrypted file 232 recorded in thedatabase 230. The encryptedfile decryption program 223 to be converted, thestream encryption algorithm 224 referred to by the encryptedfile decryption program 223, thehash function 225, and the decryptedsensor data 233 recorded in thedatabase 230 Ananalysis calculation program 226 for extracting useful information such as behavior and health status, and a Web server that enablessensor data 233 andanalysis data 234 recorded in thedatabase 230 to be browsed via thenetwork 400 from theuser 300 or the like. It has aserver program 227, a.
 データベース230は、複数のセンサノード1の共通鍵29を記録する共通鍵テーブル231と、センサノード1から受信した暗号化ファイル232と、暗号化ファイル232を復号化した結果であるセンサデータ233と、センサデータ233を解析した結果として得られる解析データ234と、を格納している。Thedatabase 230 includes a common key table 231 that records thecommon keys 29 of the plurality ofsensor nodes 1, anencrypted file 232 received from thesensor node 1,sensor data 233 that is a result of decrypting theencrypted file 232,Analysis data 234 obtained as a result of analyzing thesensor data 233 is stored.
 ストリーム暗号アルゴリズム224は、センサノード1のストリーム暗号アルゴリズム22と共通であり、ハッシュ関数225もセンサノード1のハッシュ関数23と共通である。これにより、それぞれのセンサノード1の共通鍵から、同じ秘密鍵や疑似乱数列の生成が可能である。Thestream encryption algorithm 224 is common to thestream encryption algorithm 22 of thesensor node 1, and thehash function 225 is also common to thehash function 23 of thesensor node 1. Thereby, it is possible to generate the same secret key and pseudo-random number sequence from the common key of eachsensor node 1.
 RAM210は、暗号化ファイル232を復号化した情報を一時的に記憶するセンサデータバッファ領域211と、暗号化ファイル232に含まれる初期化ベクトルを格納する初期ベクトル格納領域218と、共通鍵テーブル231の共通鍵を結合してハッシュ関数235でハッシュ化した値である秘密鍵を格納する秘密鍵格納領域212と、ストリーム暗号アルゴリズム224で疑似乱数列を出力するために使用するメモリの情報である内部状態を格納する内部状態格納領域213(今まさに復号化しようとする暗号化データについての内部状態)と、インデックスiを格納するインデックスi格納領域214と、インデックスjを格納するインデックスj格納領域215と、復号化中のデータの機器IDを格納する機器ID格納領域216と、出力カウンタ値を格納する出力カウンタ値格納領域217と、暗号化ファイル232をストリーム暗号アルゴリズム234で復号化した後の内部状態を記録して保持する内部状態保持データ領域219と、を有する。内部状態保持データ219は、センサデータ(暗号化データ)を受け取るごとに擬似乱数列初期化処理を実行して内部状態を作成しなくてもよいようにするためのデータである。同じセンサノード1からデータを受け取ったときに、以前データを受け取ったときに作成した内部状態の情報が使える可能性があるため、使える内部状態の情報が存在すれば、それを使い、初期化処理の時間を短縮するようにしている。なお、図6では、図1と同様、領域、及び格納領域の文言は省略されている。また、本明細書では、例えば、秘密鍵格納領域212に格納される秘密鍵を、秘密鍵212と称する場合があり、その他のデータについても同様である。TheRAM 210 stores a sensordata buffer area 211 that temporarily stores information obtained by decrypting theencrypted file 232, an initialvector storage area 218 that stores an initialization vector included in theencrypted file 232, and a common key table 231. A secretkey storage area 212 that stores a secret key that is a value obtained by combining the common keys and hashed by the hash function 235, and an internal state that is information of a memory used to output a pseudo-random number sequence by thestream encryption algorithm 224 An internal state storage area 213 (internal state for the encrypted data to be decrypted), an indexi storage area 214 for storing the index i, an indexj storage area 215 for storing the index j, DeviceID storage area 2 for storing the device ID of the data being decrypted 6, an output countervalue storage area 217 for storing the output counter value, and an internal state holdingdata area 219 for recording and holding the internal state after theencrypted file 232 is decrypted by thestream encryption algorithm 234. . The internalstate holding data 219 is data for avoiding the need to create an internal state by executing a pseudo random number sequence initialization process every time sensor data (encrypted data) is received. When data is received from thesame sensor node 1, there is a possibility that the internal state information created when the previous data was received may be used. To shorten the time. In FIG. 6, the words of the area and the storage area are omitted as in FIG. In this specification, for example, a secret key stored in the secretkey storage area 212 may be referred to as asecret key 212, and the same applies to other data.
 <暗号化ファイルの構成例>
 図7は、基地局100の暗号化ファイル120及びサーバ200の暗号化ファイル232の構成例を示す図である。図7には、暗号化ファイル120及び232の共通の構成が示されている。
<Configuration example of encrypted file>
FIG. 7 is a diagram illustrating a configuration example of theencrypted file 120 of thebase station 100 and theencrypted file 232 of theserver 200. FIG. 7 shows a common configuration of theencrypted files 120 and 232.
 暗号化ファイル120及び232は、機器ID121と複数のセクタデータ122を含んでいる。セクタデータ122は、センサノード1のフラッシュメモリ50と同様にタイムスタンプ123と、出力カウンタ124と、初期化ベクトル125と、暗号化データ126と、を有する。Encrypted files 120 and 232 include adevice ID 121 and a plurality ofsector data 122. Thesector data 122 includes atime stamp 123, anoutput counter 124, aninitialization vector 125, andencrypted data 126 as in theflash memory 50 of thesensor node 1.
 サーバ200は、暗号化ファイル120を復号化する場合、機器ID121に対応するセンサノード1の共通鍵を共通鍵テーブル231から読出し、共通鍵と初期化ベクトル125を結合してハッシュ関数225によってハッシュ値を生成する。そして、サーバ200は、生成したハッシュ値を秘密鍵としてストリーム暗号アルゴリズム224を初期化し、出力カウンタ125の値に従って不要な乱数を出力して疑似乱数列を進めた後に、暗号化データ126を暗号化した乱数を出力する。このようにすることにより、暗号化データ126の復号化が可能となる。When decrypting theencrypted file 120, theserver 200 reads the common key of thesensor node 1 corresponding to thedevice ID 121 from the common key table 231, combines the common key and theinitialization vector 125, and uses thehash function 225 to generate a hash value. Is generated. Then, theserver 200 initializes thestream encryption algorithm 224 using the generated hash value as a secret key, outputs an unnecessary random number according to the value of theoutput counter 125, advances the pseudo-random number sequence, and then encrypts theencrypted data 126 Output random numbers. By doing so, theencrypted data 126 can be decrypted.
 出力カウンタ125に従って不要な乱数を出力して疑似乱数列を先に進める処理は、サーバ200にとっては一見無駄な処理のように思われるが、消費電力を抑える点で利点がある。つまり、例えばセクタデータ122ごとに疑似乱数を初期化すると、センサノード1で頻繁に疑似乱数列の初期化処理をしなくてはならないため、消費電力が増大し、電池寿命を大幅に短くする可能性がある。一方で、サーバ200は、小型で電池駆動のセンサノード1と比較して、典型的には十分な電力や処理能力を有するため、疑似乱数列を先に進める処理は無視できる程度に短時間であるため、問題にならない。また、センサノード1とサーバ200の電力コスト、処理時間を最適化するように出力カウンタ125の上限値を定めることが好適である。The process of outputting an unnecessary random number according to theoutput counter 125 to advance the pseudo-random number sequence seems to be a wasteful process for theserver 200, but has an advantage in reducing power consumption. That is, for example, if a pseudo-random number is initialized for eachsector data 122, thesensor node 1 must frequently initialize a pseudo-random number sequence, so that power consumption increases and battery life can be significantly shortened. There is sex. On the other hand, theserver 200 typically has sufficient power and processing capability as compared with the small and battery-poweredsensor node 1, so that the process of proceeding with the pseudo random number sequence can be ignored in a short time. There is no problem because there is. In addition, it is preferable to set the upper limit value of theoutput counter 125 so as to optimize the power cost and processing time of thesensor node 1 and theserver 200.
 <共通鍵テーブル>
 図8は、共通鍵テーブル(テーブル)231の構成例を示す図である。共通鍵テーブル231は、機器ID240と、有効開始日時241と、有効終了日時242と、共通鍵243と、を構成項目として含んでいる。
<Common key table>
FIG. 8 is a diagram illustrating a configuration example of the common key table (table) 231. The common key table 231 includes adevice ID 240, a valid start date /time 241, a valid end date /time 242, and acommon key 243 as configuration items.
 この共通鍵テーブル231からは、機器ID240を基に検索すると、目的のセンサノード1に対応する共通鍵243を取得することができる。検索する際には、例えば、暗号化ファイルのタイムスタンプ122が、有効開始日時241及び有効終了日時242によって規定される有効期間に含まれるものに限定することもできる。これにより、センサノード1の共通鍵29を変更する場合に、変更前の共通鍵243に対応する有効終了日242に変更する直前の日時を入力し、新たな共通鍵243と有効開始日時241を入力して登録することで、共通鍵の変更を容易にできる。From this common key table 231, when searching based on thedevice ID 240, thecommon key 243 corresponding to thetarget sensor node 1 can be acquired. When searching, for example, thetime stamp 122 of the encrypted file can be limited to the one included in the valid period defined by thevalid start date 241 and thevalid end date 242. As a result, when thecommon key 29 of thesensor node 1 is changed, the date and time immediately before the change to thevalid end date 242 corresponding to thecommon key 243 before the change is input, and the newcommon key 243 and the valid start date andtime 241 are set. By entering and registering, the common key can be easily changed.
 <内部状態保持データ>
 図9は、内部状態保持データ219の構成例を示す図である。内部状態保持データ219は、機器ID250と、初期化ベクトル251と、出力カウンタ252と、内部状態253と、インデックスi254と、インデックスj255と、を構成項目として含んでいる。
<Internal state holding data>
FIG. 9 is a diagram illustrating a configuration example of the internalstate holding data 219. The internalstate holding data 219 includes adevice ID 250, aninitialization vector 251, anoutput counter 252, aninternal state 253, an index i254, and an index j255 as configuration items.
 機器ID250、初期化ベクトル251、及び出力カウンタ252を基に内部状態保持データ219を検索することで、対応する内部状態253、インデックスi254及びインデックスj255を取得することができる。つまり、サーバ200でストリーム暗号アルゴリズム234によって疑似乱数列を初期化し、不要な乱数を出力して疑似乱数列を進める処理をすることなく、必要な乱数を即座できるように、出力する内部状態253、インデックスi253、インデックスj254を取得することができるため、大幅に処理時間を短縮することができる。また、出力カウンタ252が同一の内部状態253が存在しない場合は、探したい出力カウンタの値より小さくて最も近い値があれば、その内部状態253を取得することで、疑似乱数列を初期化する処理を省くことができる。By searching the internalstate holding data 219 based on thedevice ID 250, theinitialization vector 251, and theoutput counter 252, the correspondinginternal state 253, index i254, and index j255 can be acquired. That is, theserver 200 initializes the pseudo random number sequence by thestream encryption algorithm 234, and outputs the internalrandom number 253 so that the necessary random number can be immediately output without performing the process of outputting the unnecessary random number and proceeding the pseudo random number sequence. Since the index i253 and the index j254 can be acquired, the processing time can be greatly shortened. Also, if theinternal state 253 having thesame output counter 252 does not exist, if there is a value that is smaller and closest to the value of the output counter to be searched for, theinternal state 253 is acquired to initialize the pseudorandom number sequence. Processing can be omitted.
 <センサノードの処理概要>
 図10は、センサノード1の制御プログラム25による処理概要を説明するためのフローチャートである。制御プログラム25では、所定の間隔で計測したデータを暗号化して記録し、内部電源の電圧が所定値以上ある場合、或いは、USB等によって外部電源が接続された場合に、接続を検出して疑似乱数列を初期化する。
<Sensor node processing overview>
FIG. 10 is a flowchart for explaining an outline of processing by thecontrol program 25 of thesensor node 1. Thecontrol program 25 encrypts and records the data measured at a predetermined interval, detects the connection when the voltage of the internal power supply exceeds a predetermined value, or when an external power supply is connected by USB or the like, and detects the simulation. Initialize the random number sequence.
 処理S100では、制御プログラム25は、マイコン10のリセット、パワーオンリセット時に処理を開始する。In process S100, thecontrol program 25 starts the process when themicrocomputer 10 is reset or power-on reset.
 処理S101では、制御プログラム25は、リセットカウンタの更新や、疑似乱数列の初期化を行う初期化処理を実行する。初期化処理S101の詳細については、図11を用いて後述する。なお、図11に示されるように、S101の処理の中には、擬似乱数列初期化処理(S202)も含まれている。従って、センサノード1が起動された段階での初期化処理(S101)では、時間が掛かったとしても擬似乱数列初期化処理は必ず実行される。In process S101, thecontrol program 25 executes an initialization process for updating a reset counter and initializing a pseudo random number sequence. Details of the initialization process S101 will be described later with reference to FIG. As shown in FIG. 11, the process of S101 includes a pseudo random number sequence initialization process (S202). Therefore, in the initialization process (S101) when thesensor node 1 is activated, the pseudorandom number sequence initialization process is always executed even if it takes time.
 処理S102では、制御プログラム25は、USBや無線で接続された基地局100と通信し、基地局からのリクエストがあれば、フラッシュメモリ40のデータを読み出して基地局100に対して送信する。通信処理S102の詳細については、図18を用いて後述する。In process S102, thecontrol program 25 communicates with thebase station 100 connected via USB or wirelessly, and if there is a request from the base station, reads the data in theflash memory 40 and transmits it to thebase station 100. Details of the communication process S102 will be described later with reference to FIG.
 処理S103では、制御プログラム25は、RTC3が発する所定の周期的な信号を受信するまで待機する。この周期がセンサ2による測定処理実行の周期となる。待機中はマイコン10のクロックを停止したスリープ状態にすることで、消費電力を削減できる。In process S103, thecontrol program 25 waits until a predetermined periodic signal generated by theRTC 3 is received. This period is a period for executing the measurement process by thesensor 2. During standby, power consumption can be reduced by putting themicrocomputer 10 in a sleep state in which the clock is stopped.
 処理S104では、制御プログラム25は、センサ2からデータ(測定データ)を読み出して、RAM30のセンサデータバッファ31に記録する。In process S104, thecontrol program 25 reads data (measurement data) from thesensor 2 and records it in thesensor data buffer 31 of theRAM 30.
 処理S105では、制御プログラム25は、センサデータバッファ領域31に記録されたデータのサイズを監視する。当該領域に所定のサイズが蓄積されている場合(S105でYesの場合)、処理はS106に移行する。満たない場合(S105でNoの場合)、処理はS102に移行する。この所定のサイズとは、圧縮効率やセクタ51の使用効率を最適化するように規定される。例えば、50ミリ秒間隔で3軸加速度を測定する場合には、1秒分、つまり20サンプル分を所定のサイズとすることが望ましい。In process S105, thecontrol program 25 monitors the size of the data recorded in the sensordata buffer area 31. When a predetermined size is accumulated in the area (Yes in S105), the process proceeds to S106. If not satisfied (No in S105), the process proceeds to S102. The predetermined size is defined so as to optimize the compression efficiency and the usage efficiency of thesector 51. For example, when measuring triaxial acceleration at 50 millisecond intervals, it is desirable to set a predetermined size for 1 second, that is, 20 samples.
 処理S106では、制御プログラム25は、センサデータバッファ31のデータを読み出して、公知の圧縮アルゴリズムにて圧縮する。In process S106, thecontrol program 25 reads the data in thesensor data buffer 31 and compresses it with a known compression algorithm.
 処理S107では、制御プログラム25は、ストリーム暗号アルゴリズム22を用いて、センサデータバッファ31の圧縮データを読み出して暗号化し、暗号化データバッファ32に記録する。S107の暗号化処理の詳細については、図13を用いて後述する。In process S107, thecontrol program 25 reads and encrypts the compressed data in thesensor data buffer 31 using thestream encryption algorithm 22, and records the encrypted data in theencrypted data buffer 32. Details of the encryption processing in S107 will be described later with reference to FIG.
 処理S108では、制御プログラム25は、暗号化データバッファ32に記録されたデータのサイズと記録用暗号化データ65に記録されたデータのサイズとの合計サイズを、セクタ51のサイズと比較する。セクタ51が合計サイズよりも小さければ(S108でYesの場合)、処理はS109に移行し、それ以外の場合(S108でNoの場合)、処理はS113に移行する。In process S108, thecontrol program 25 compares the total size of the size of the data recorded in theencrypted data buffer 32 and the size of the data recorded in theencrypted recording data 65 with the size of thesector 51. If thesector 51 is smaller than the total size (Yes in S108), the process proceeds to S109. Otherwise (No in S108), the process proceeds to S113.
 処理S109では、制御プログラム25は、記録用暗号化データ65のデータを暗号化データ55として、RAM30の初期化ベクトル34(の値)をフラッシュメモリ50の初期化ベクトル54(の値)とする。また、制御プログラム25は、記録用出力カウンタ63(の値)を出力カウンタ53(の値)として、記録用タイムスタンプ62に格納されている最初と最後の時刻情報をタイムスタンプ52に格納する。このように、制御プログラム25は、RAM30に格納されたデータをセクタ51のデータとして記録する。フラッシュメモリ50への記録完了後に、制御プログラム25は、記録用タイムスタンプ52及び記録用暗号化データ64を初期化し、記録用出力カウンタ63に出力カウンタ36の値をコピーする。この出力カウンタ36の値は、擬似乱数列の初期化から乱数を出力した回数を示すものである。よって、サーバ200側では、この出力カウンタ値を用いて当該カウンタ値の1つ手前の数に相当する乱数までを不要な乱数として捨て、出力カウンタ値に示された順番の乱数を復号化に用いればすむので、暗号化データを復号化する度に擬似乱数列初期化処理を実行する必要がなくなり、処理時間を短縮することが可能となる。In the process S109, thecontrol program 25 sets the data of the recordingencrypted data 65 as the encrypted data 55, and the initialization vector 34 (value) of theRAM 30 as the initialization vector 54 (value) of theflash memory 50. In addition, thecontrol program 25 stores the first and last time information stored in therecording time stamp 62 in thetime stamp 52 with the recording output counter 63 (value) as the output counter 53 (value). As described above, thecontrol program 25 records the data stored in theRAM 30 as the data of thesector 51. After the recording to theflash memory 50 is completed, thecontrol program 25 initializes therecording time stamp 52 and the recording encrypted data 64 and copies the value of theoutput counter 36 to therecording output counter 63. The value of theoutput counter 36 indicates the number of times the random number has been output since the initialization of the pseudo random number sequence. Therefore, on theserver 200 side, using this output counter value, the random number corresponding to the number immediately before the counter value is discarded as an unnecessary random number, and the random numbers in the order indicated by the output counter value are used for decoding. Therefore, it is not necessary to execute the pseudo random number sequence initialization process every time the encrypted data is decrypted, and the processing time can be shortened.
 処理S110では、制御プログラム25は、EEPROM40の書込みセクタポインタ42を次の位置に更新する。これにより、次に書き込むセクタの正確な位置を確定することができる。In process S110, thecontrol program 25 updates thewrite sector pointer 42 of theEEPROM 40 to the next position. Thereby, the exact position of the sector to be written next can be determined.
 処理S111では、制御プログラム25は、内臓バッテリ5における使用可能な電圧値(バッテリの残量)が所定値(閾値)以上か、或いは、入力検出部14の入力から判断してUSBの外部電源が接続されていて電圧値が所定値(閾値)以上か判断する。つまり、外部電源が接続されていなくてもバッテリ5の電圧値の残量に余裕があるか、或いは、外部電源が接続されて使用可能な電圧値に余裕があるか(バッテリ5への充電処理中であっても良い)が判断される。使用可能電圧値が所定値以上の場合(S111でYesの場合)、処理はS112に移行し、使用可能電圧値が所定値よりも小さい場合(S111でNoの場合)、処理はS113に移行する。In the process S111, thecontrol program 25 determines whether the usable voltage value (remaining battery capacity) in the built-inbattery 5 is equal to or greater than a predetermined value (threshold value), or the USB external power supply is determined based on the input of theinput detection unit 14. It is determined whether the voltage value is greater than or equal to a predetermined value (threshold value). In other words, whether there is a margin in the remaining voltage value of thebattery 5 even if no external power source is connected, or whether there is a margin in the usable voltage value after the external power source is connected (charging process to the battery 5) May be medium). If the usable voltage value is equal to or larger than the predetermined value (Yes in S111), the process proceeds to S112. If the usable voltage value is smaller than the predetermined value (No in S111), the process proceeds to S113. .
 処理S112では、制御プログラム25は、疑似乱数列の初期化処理を実行する。当該擬似欄数列の初期化処理の詳細については、図12を用いて後述する。In process S112, thecontrol program 25 executes a pseudo-random number sequence initialization process. Details of the initialization process of the pseudo column number sequence will be described later with reference to FIG.
 処理S113では、制御プログラム25は、記録用暗号化データ格納領域65に、暗号化データバッファ格納領域32のデータを記録する。In process S113, thecontrol program 25 records the data in the encrypted databuffer storage area 32 in the recording encrypteddata storage area 65.
 <初期化処理の詳細>
 図11は、図10の処理S101の詳細を説明するためのフローチャートである。図11には、基地局100と通信してRTC3を時刻同期し、擬似乱数列を初期化することが示されている。
<Details of initialization processing>
FIG. 11 is a flowchart for explaining details of the processing S101 in FIG. FIG. 11 shows communication with thebase station 100 to time-synchronize theRTC 3 and initialize a pseudo random number sequence.
 処理S200では、制御プログラム25は、初期化処理を開始する。In process S200, thecontrol program 25 starts an initialization process.
 処理S201では、制御プログラム25は、フラッシュメモリ50のデータ記録領域26のリセットカウンタ27をインクリメントする。このリセットカウンタ27の値は、センサノード1の起動回数を示す情報となっている。なお、データ記憶領域26がフラッシュメモリ内にあるため、一般的には最大書き換え回数の制約があるが、一度の充電で1週間以上使用でき、継ぎ足し充電可能なバッテリ5を備えるセンサノード1であれば、典型的にはリセット回数が書き換え回数の上限を上回ることはない。In process S201, thecontrol program 25 increments thereset counter 27 in thedata recording area 26 of theflash memory 50. The value of thereset counter 27 is information indicating the number of activations of thesensor node 1. Since thedata storage area 26 is in the flash memory, the maximum number of rewrites is generally limited. However, thesensor node 1 having abattery 5 that can be used for one week or more and can be recharged once charged. For example, the number of resets typically does not exceed the upper limit of the number of rewrites.
 処理S202では、制御プログラム25は、疑似乱数列の初期化処理を実行する。擬似乱数の列の初期化処理の詳細については、図12を用いて後述する。In process S202, thecontrol program 25 executes a pseudo-random number sequence initialization process. Details of the initialization process of the pseudo random number sequence will be described later with reference to FIG.
 処理S203では、制御プログラム25は、センサノード1のRTC3に時刻情報がセットされているかを判定する。RTC3が時刻同期されていないと、センサで測定しても正しい時刻情報を付加できないからである。従って、時刻同期が完了するまでは測定動作を開始しない。時刻同期が完了していれば(S203でYesの場合)、処理はS204に移行し、初期化処理が終了する。時刻同期が完了していない場合(S203でNo場合)は、処理はS211に移行する。In process S203, thecontrol program 25 determines whether time information is set in theRTC 3 of thesensor node 1. This is because if theRTC 3 is not synchronized in time, correct time information cannot be added even if measurement is performed by a sensor. Therefore, the measurement operation is not started until the time synchronization is completed. If the time synchronization is completed (Yes in S203), the process proceeds to S204, and the initialization process ends. If time synchronization has not been completed (No in S203), the process proceeds to S211.
 処理S211では、制御プログラム25は、基地局100からコマンドが送信されてくるまで待機する。In process S211, thecontrol program 25 waits until a command is transmitted from thebase station 100.
 処理S212では、制御プログラム25は、受信データ列からコマンドを識別し、コマンドに対応する所定の処理を実行する。例えば、時刻情報を受信した場合は、制御プログラム25は、RTC3に時刻情報をセットする。In process S212, thecontrol program 25 identifies a command from the received data string and executes a predetermined process corresponding to the command. For example, when the time information is received, thecontrol program 25 sets the time information in theRTC 3.
 <擬似乱数列初期化処理の詳細>
 図12は、図10の処理S112及び図11の処理S202による擬似乱数列初期化処理の詳細を説明するためのフローチャートである。擬似乱数列初期化処理では、リセットカウンタ28と共通鍵29から、ストリーム暗号アルゴリズムにより、疑似乱数列の出力に必要な内部状態35が生成される。
<Details of pseudo-random number sequence initialization processing>
FIG. 12 is a flowchart for explaining the details of the pseudo-random number sequence initialization process by the process S112 of FIG. 10 and the process S202 of FIG. In the pseudo random number sequence initialization process, theinternal state 35 necessary for outputting the pseudo random number sequence is generated from thereset counter 28 and thecommon key 29 by the stream encryption algorithm.
 処理S300では、制御プログラム25は、疑似乱数列の初期化処理を開始する。In process S300, thecontrol program 25 starts the initialization process of the pseudo random number sequence.
 処理S301では、制御プログラム25は、リセットカウンタ格納領域28からリセットカウンタ値を読み出して、乱数生成器24に記述された処理によって乱数を生成し、当該乱数を初期化ベクトルとして初期化ベクトル格納領域34に記録する。In process S301, thecontrol program 25 reads the reset counter value from the resetcounter storage area 28, generates a random number by the process described in therandom number generator 24, and uses the random number as an initialization vector to initialize thevector storage area 34. To record.
 処理S302では、制御プログラム25は、初期化ベクトル格納領域34に格納されている初期化ベクトルと共通鍵格納領域29に格納されている共通鍵とを結合し、この値を基にハッシュ関数23に記述された処理によってハッシュ値を出力し、当該ハッシュ値を秘密鍵として秘密鍵格納領域33に記録する。In process S302, thecontrol program 25 combines the initialization vector stored in the initializationvector storage area 34 with the common key stored in the commonkey storage area 29, and based on this value, thecontrol program 25 stores it in thehash function 23. A hash value is output by the described process, and the hash value is recorded in the secretkey storage area 33 as a secret key.
 処理S303では、制御プログラム25は、秘密鍵格納領域33に格納されている秘密鍵に基づいて、例えばARCFOURなどの公知のアルゴリズムであるストリーム暗号化アルゴリズム22の初期化処理によって疑似乱数列を初期化し、当該擬似乱数列を乱数出力に必要な内部状態の情報として内部状態格納領域35に出力する。In the process S303, thecontrol program 25 initializes the pseudo-random number sequence by the initialization process of thestream encryption algorithm 22, which is a known algorithm such as ARCFOUR, based on the secret key stored in the secretkey storage area 33. The pseudo random number sequence is output to the internalstate storage area 35 as internal state information necessary for random number output.
 処理S304では、制御プログラム25は、疑似乱数列初期化処理で使用する変数nと、インデックスi37及びインデックスj38を0に初期化する。In process S304, thecontrol program 25 initializes the variable n used in the pseudo-random number sequence initialization process, the index i37, and the index j38 to zero.
 処理S305では、制御プログラム25は、変数nと十分な大きい所定の数(例えば、3000以上)と比較し、nが小さければ(S305でYesの場合)、処理をS306に移行させ、それ以外の場合(S305でNoの場合)、処理をS308に移行させて疑似乱数初期化処理を終了する。本処理で十分な大きい数の分だけ予め疑似乱数列から乱数を出力しておくことで、疑似乱数列の予測や解読を困難にすることができる。つまり、所定回数(例えば、3000回)だけ乱数を出力して初めて暗号化に使える乱数となる。そして、そのときの内部状態、インデックスi及びjをRAMに保持する。なお、当該乱数出力回数は出力カウンタ36には含まれず、暗号化側のセンサノード1と、復号化側のサーバ200とで予め同じ値を疑似乱数初期化処理のプログラムに記述する。In the process S305, thecontrol program 25 compares the variable n with a sufficiently large predetermined number (for example, 3000 or more). If n is small (Yes in S305), thecontrol program 25 shifts the process to S306. In the case (No in S305), the process proceeds to S308, and the pseudorandom number initialization process is terminated. By outputting random numbers from the pseudo-random number sequence in advance by a sufficiently large number in this processing, it is possible to make it difficult to predict and decode the pseudo-random number sequence. That is, a random number that can be used for encryption is not output until a random number is output a predetermined number of times (for example, 3000 times). Then, the internal state at that time, indexes i and j are held in the RAM. The random number output count is not included in theoutput counter 36, and the same value is described in advance in the pseudo random number initialization processing program in thesensor node 1 on the encryption side and theserver 200 on the decryption side.
 処理S306では、制御プログラム25は、ストリーム暗号アルゴリズム22により、内部状態35、インデックスi37、及びインデックスj38を用いて乱数を1バイト出力する。この乱数は不要な乱数となる。In process S306, thecontrol program 25 outputs one byte of random numbers using theinternal state 35, the index i37, and the index j38 by thestream encryption algorithm 22. This random number is an unnecessary random number.
 処理S307では、制御プログラム25は、変数nをインクリメントし、S305からの処理を再度実行する。In process S307, thecontrol program 25 increments the variable n and executes the process from S305 again.
 <暗号化処理の詳細>
 図13は、図10の処理S107による暗号化処理の詳細を説明するためのフローチャートである。図13では、センサデータバッファ31のデータを、ストリーム暗号によって順に暗号化して暗号化データバッファ領域32に記録する処理が実行される。
<Details of encryption processing>
FIG. 13 is a flowchart for explaining details of the encryption processing in step S107 of FIG. In FIG. 13, a process of sequentially encrypting the data in thesensor data buffer 31 by the stream cipher and recording it in the encrypteddata buffer area 32 is executed.
 処理S400では、制御プログラム25は、暗号化処理を開始する。In process S400, thecontrol program 25 starts an encryption process.
 処理S401では、制御プログラム25は、センサデータバッファ領域31から1バイト分のデータを読み出す。In process S401, thecontrol program 25 reads data of 1 byte from the sensordata buffer area 31.
 処理S402では、制御プログラム25は、ストリーム暗号アルゴリズム22によって内部状態35、インデックスi37、及びインデックスj38を用いて、1バイト分の疑似乱数を出力する。In process S402, thecontrol program 25 outputs a pseudo-random number of 1 byte using theinternal state 35, the index i37, and the index j38 by thestream encryption algorithm 22.
 処理S403では、制御プログラム25は、処理S401で読み出したデータと処理S403で出力した乱数とをXOR演算する。In process S403, thecontrol program 25 performs an XOR operation on the data read in process S401 and the random number output in process S403.
 処理S404では、制御プログラム25は、処理S403の結果を暗号化データバッファ格納領域32に記録する。In process S404, thecontrol program 25 records the result of process S403 in the encrypted databuffer storage area 32.
 処理S405では、制御プログラム25は、出力カウンタ36をインクリメントして更新する。In process S405, thecontrol program 25 increments and updates theoutput counter 36.
 処理S406では、制御プログラム25は、S401においてセンサデータバッファ領域31から全てのデータを読み出し終わったかを判定する。読み出しが完了している場合(S406でYesの場合)、処理はS407に移行して暗号化処理は完了する。読み出しが完了していない場合(S406でNoの場合)、処理はS401に戻る。In process S406, thecontrol program 25 determines whether all data has been read from the sensordata buffer area 31 in S401. When the reading is completed (Yes in S406), the process proceeds to S407, and the encryption process is completed. If the reading is not completed (No in S406), the process returns to S401.
 <内部状態のデータ例>
 図14は、内部状態格納領域35に格納される内部状態のデータの好適な例を示す図である。ストリーム暗号アルゴリズム22にARCFOURを用いた場合は、256バイトの内部状態が生成される。
<Example of internal state data>
FIG. 14 is a diagram illustrating a preferred example of internal state data stored in the internalstate storage area 35. When ARCFOUR is used for thestream encryption algorithm 22, an internal state of 256 bytes is generated.
 <秘密鍵の例>
 図15は、秘密鍵格納領域33に格納される秘密鍵の好適な例を示す図である。秘密鍵は、長いほど一般的に暗号強度が高まり、例えば、16バイト以上の長さがあることが望ましい。本実施形態では、16バイトに設定されている。
<Example of secret key>
FIG. 15 is a diagram showing a preferred example of the secret key stored in the secretkey storage area 33. The longer the secret key, the higher the encryption strength in general. For example, it is desirable that the secret key has a length of 16 bytes or more. In this embodiment, it is set to 16 bytes.
 <内部状態生成処理の詳細>
 図16は、図12の処理S303による内部状態生成処理の詳細を説明するためのフローチャートである。図16では、より具体的には、好適な公知のストリーム暗号化アルゴリズムであるARCFOURの初期化処理を実行し、秘密鍵33から内部状態35が生成される。
<Details of internal state generation processing>
FIG. 16 is a flowchart for explaining details of the internal state generation processing in step S303 of FIG. In FIG. 16, more specifically, an initialization process of ARCFOUR, which is a preferable publicly known stream encryption algorithm, is executed, and theinternal state 35 is generated from thesecret key 33.
 処理S500では、制御プログラム25は、ストリーム暗号アルゴリズムの初期化処理を開始する。In process S500, thecontrol program 25 starts the initialization process of the stream encryption algorithm.
 処理S501では、制御プログラム25は、ストリーム暗号アルゴリズムの初期化処理内で使用する変数iを0に初期化する。In process S501, thecontrol program 25 initializes a variable i used in the initialization process of the stream encryption algorithm to 0.
 処理S502では、制御プログラム25は、iが256より小さければ(S502でYesの場合)処理をS503に移行させ、それ以外の場合(S502でNoの場合)、処理をS505に移行させる。In process S502, thecontrol program 25 shifts the process to S503 if i is smaller than 256 (Yes in S502), and shifts the process to S505 in other cases (No in S502).
 処理S503では、制御プログラム25は、内部状態35のi番のバイトにiを代入する。In process S503, thecontrol program 25 substitutes i into the i-th byte of theinternal state 35.
 処理S504でハ、制御プログラム25は、変数iを1インクリメントし、処理をS502に移行させる。In process S504, thecontrol program 25 increments the variable i by 1, and shifts the process to S502.
 処理S505では、制御プログラム25は、ストリーム暗号アルゴリズムの初期化処理内で使用する変数i及びjをそれぞれ0で初期化する。In process S505, thecontrol program 25 initializes variables i and j used in the initialization process of the stream cipher algorithm with 0, respectively.
 処理S506では、制御プログラム25は、変数iが256より小さければ(S506でYesの場合)、処理をS507に移行させ、それ以外の場合(S506でNoの場合)、処理をS510に移行させてストリーム暗号アルゴリズムの初期化処理を完了する。In the process S506, thecontrol program 25 moves the process to S507 if the variable i is smaller than 256 (Yes in S506), and moves the process to S510 in other cases (No in S506). The initialization process of the stream cipher algorithm is completed.
 処理S507では、制御プログラム25は、変数jと、内部状態35のi番のバイト値と、iを16で割った余りをkとした場合の秘密鍵33のk番のバイト値との和を、256で割った余りを、変数jに代入する。In process S507, thecontrol program 25 calculates the sum of the variable j, the i-th byte value of theinternal state 35, and the k-th byte value of the secret key 33 when k is a remainder obtained by dividing i by 16. The remainder divided by 256 is substituted into variable j.
 処理S508では、制御プログラム25は、内部状態35のi番と、内部状態35のj番のバイト値を交換する。In process S508, thecontrol program 25 exchanges the byte value of the i-th number in theinternal state 35 and the j-th byte value in theinternal state 35.
 処理S509では、制御プログラム25は、変数iを1インクリメントし、処理をS506に移行させる。In process S509, thecontrol program 25 increments the variable i by 1, and shifts the process to S506.
 以上の処理により、内部状態のデータが生成される。この内部状態のデータは、擬似乱数列生成処理(S306:詳細は図17参照)に用いられる。Through the above processing, internal state data is generated. This internal state data is used in the pseudo-random number sequence generation process (S306: see FIG. 17 for details).
 <擬似乱数出力処理の詳細>
 図17は、図12のS306及び図13のS402による擬似乱数出力処理の詳細を説明するためのフローチャートである。図17では、好適な公知のストリーム暗号化アルゴリズムであるARCFOURの疑似乱数出力処理が示され、擬似乱数列の初期化処理時と比較して少ない計算量で内部状態35、インデックスi37、及びインデックスj38から1バイト分の疑似乱数が取り出され、内部状態35、インデックスi37、及びインデックスj38が更新される。
<Details of pseudo-random number output processing>
FIG. 17 is a flowchart for explaining the details of the pseudo random number output processing in S306 of FIG. 12 and S402 of FIG. FIG. 17 shows a pseudo random number output process of ARCFOUR which is a preferable known stream encryption algorithm, and theinternal state 35, the index i 37, and theindex j 38 are small in calculation amount compared with the initialization process of the pseudo random number sequence. 1-byte pseudo random numbers are extracted from theinternal state 35, theinternal state 35, the index i37, and the index j38 are updated.
 処理S600では、制御プログラム25は、疑似乱数出力処理を開始する。In process S600, thecontrol program 25 starts a pseudo random number output process.
 処理S601では、制御プログラム25は、インデックスi37の値に1を加えた値を、256で割った余りの数を、インデックスi37に代入する。In process S601, thecontrol program 25 substitutes the remainder of dividing the value obtained by adding 1 to the value of the index i37 by 256 into the index i37.
 処理S602では、制御プログラム25は、インデックスj38の値に、内部状態35のi番のバイト値を加えた値を、256で割った余りを、インデックスj38に代入する。In process S602, thecontrol program 25 substitutes the remainder obtained by dividing the value obtained by adding the i-th byte value of theinternal state 35 by the value of the index j38 into the index j38.
 処理S603では、制御プログラム25は、内部状態35のi番と、内部状態35のj番のバイト値を交換する。In process S603, thecontrol program 25 exchanges the byte value of the i-th number in theinternal state 35 and the j-th byte value in theinternal state 35.
 処理S604では、制御プログラム25は、内部状態35のi番目のバイト値及び内部状態35のj番目のバイト値の和を256で割った余りをkとし、内部状態35のk番のバイト値を、疑似乱数として出力し、処理をS605に移行させて疑似乱数出力処理を完了する。In the process S604, thecontrol program 25 sets k as the remainder obtained by dividing the sum of the i-th byte value of theinternal state 35 and the j-th byte value of theinternal state 35 by 256, and the k-th byte value of theinternal state 35. , Output as a pseudo-random number, shift the process to S605, and complete the pseudo-random number output process.
 <通信処理の詳細>
 図18は、図10のS102による通信処理の詳細を説明するためのフローチャートである。図18では、USBまたは無線接続により通信処理をする例が示されており、基地局100からの所定のコマンドを受信して処理が実行される。例えばセンサノード1が基地局100からデータ送信リクエストコマンドを受信した場合には、フラッシュメモリ50に記録されているデータを重複なく基地局100に送信する。
<Details of communication processing>
FIG. 18 is a flowchart for explaining details of the communication processing in S102 of FIG. FIG. 18 shows an example in which communication processing is performed by USB or wireless connection, and processing is executed upon receiving a predetermined command from thebase station 100. For example, when thesensor node 1 receives a data transmission request command from thebase station 100, the data recorded in theflash memory 50 is transmitted to thebase station 100 without duplication.
 処理S700では、制御プログラム25は、通信処理を開始する。In process S700, thecontrol program 25 starts a communication process.
 処理S701では、制御プログラム25は、電源検出回路60に接続された入力検出部14の入力を監視し、USBや無線で基地局100にセンサノード1が接続されているか否か判断する。基地局が接続されていれば(S701でYesの場合)、処理は、S702に移行する。接続されていなければ(S701でNoの場合)、処理は、S709に移行し、通信処理が終了する。In process S701, thecontrol program 25 monitors the input of theinput detection unit 14 connected to the powersupply detection circuit 60, and determines whether thesensor node 1 is connected to thebase station 100 by USB or wireless. If the base station is connected (Yes in S701), the process proceeds to S702. If not connected (No in S701), the process proceeds to S709, and the communication process ends.
 処理S702では、制御プログラム25は、シリアル通信部16を用いて、基地局100から受信したコマンドがあるか否か判断する。受信したコマンドがあれば(S702でYesの場合)、処理は、S703に移行する。受信したコマンドがなければ(S702でNoの場合)、処理は、S709に移行し、通信処理が終了する。In process S <b> 702, thecontrol program 25 determines whether there is a command received from thebase station 100 using theserial communication unit 16. If there is a received command (Yes in S702), the process proceeds to S703. If there is no received command (No in S702), the process proceeds to S709, and the communication process ends.
 処理S703では、制御プログラム25は、受信したコマンドがデータリクエストであるか否か判断する。受信コマンドがデータリクエストであれば(S703でYesの場合)、処理は、S704に移行する。受信コマンドがデータリクエスト以外であれば(S703でNoの場合)、処理は、S708に移行し、制御プログラム25は、コマンドに対応した所定の処理を実行する。例えば、機器ID27を読み出すリクエストコマンドを受信した場合には、制御プログラム25は、シリアル通信部16を介して、機器ID27を読み出して基地局100に送信する。In process S703, thecontrol program 25 determines whether or not the received command is a data request. If the received command is a data request (Yes in S703), the process proceeds to S704. If the received command is other than a data request (No in S703), the process proceeds to S708, and thecontrol program 25 executes a predetermined process corresponding to the command. For example, when a request command for reading thedevice ID 27 is received, thecontrol program 25 reads thedevice ID 27 via theserial communication unit 16 and transmits it to thebase station 100.
 処理S704では、制御プログラム25は、書込みセクタポインタ42と読出しセクタポインタ41を比較し、同じでなければ(S704でNoの場合)処理をS705に移行させ、同じであれば(S704でYesの場合)処理をS709に移行させ、通信処理を完了する。In the process S704, thecontrol program 25 compares thewrite sector pointer 42 and theread sector pointer 41. If they are not the same (No in S704), the process proceeds to S705, and if they are the same (Yes in S704). ) The process proceeds to S709, and the communication process is completed.
 処理S705では、制御プログラム25は、読出しセクタポインタ41の示すセクタ51のデータをフラッシュメモリ50から読み出す。In process S <b> 705, thecontrol program 25 reads the data of thesector 51 indicated by theread sector pointer 41 from theflash memory 50.
 処理S706では、制御プログラム25は、S705で読み出したセクタのデータを、接続されている基地局100に送信する。In process S706, thecontrol program 25 transmits the sector data read in S705 to the connectedbase station 100.
 処理S707では、制御プログラム25は、読出しセクタポインタ41を進めて更新し、処理をS704に戻す。In process S707, thecontrol program 25 advances and updates theread sector pointer 41, and returns the process to S704.
 <基地局における受信処理の詳細>
 図19は、基地局100のデータ受信プログラム112による受信処理の詳細を説明するためのフローチャートである。基地局100において、受信処理が定期的に実行されることで、センサノード1と基地局100が、USBもしくは無線通信にて接続されるか定期的に監視される。センサノード1と基地局100が接続されていれば、基地局100がデータリクエストコマンドを送信して、センサノード1のセンサ2によって計測したデータを読み出すようにする。
<Details of reception processing at the base station>
FIG. 19 is a flowchart for explaining details of the reception processing by thedata reception program 112 of thebase station 100. In thebase station 100, the reception process is periodically executed, so that thesensor node 1 and thebase station 100 are periodically monitored to be connected by USB or wireless communication. If thesensor node 1 and thebase station 100 are connected, thebase station 100 transmits a data request command to read data measured by thesensor 2 of thesensor node 1.
 処理S800では、データ受信プログラム112は、データ受信処理を開始する。In process S800, thedata reception program 112 starts the data reception process.
 処理S801では、データ受信プログラム112は、センサノード1と基地局100が接続されているかを判定する。両者が接続されていれば(S801でYesの場合)、処理はS802に移行する。両者が接続されていなければ(S801でNoの場合)、処理は、S809に移行し、データ受信処理が終了する。In process S801, thedata reception program 112 determines whether thesensor node 1 and thebase station 100 are connected. If both are connected (Yes in S801), the process proceeds to S802. If the two are not connected (No in S801), the process proceeds to S809, and the data reception process ends.
 処理S802では、データ受信プログラム112は、汎用I/F108を介して、時刻情報を付加したコマンドをセンサノード1に送信する。センサノード1は、当該時刻情報を受信し、RTC3を受信した時刻情報と同期させる処理を実行する。In process S802, thedata reception program 112 transmits a command to which the time information is added to thesensor node 1 via the general-purpose I /F 108. Thesensor node 1 receives the time information and executes a process of synchronizing theRTC 3 with the received time information.
 処理S803では、データ受信プログラム112は、センサノード1の機器ID27を読み出すリクエストコマンドを、該当するセンサノード1に送信する。In process S803, thedata reception program 112 transmits a request command for reading thedevice ID 27 of thesensor node 1 to the correspondingsensor node 1.
 処理S804では、データ受信プログラム112は、汎用I/F(USB)108或いは無線通信部130を介して、機器ID27を受信したか判定する。受信に成功した場合(S804でYesの場合)、処理はS805に移行する。受信に失敗した場合(S804でNoの場合)、処理S809に移行し、データ受信処理は終了する。機器ID27が分からない暗号化データは、復号化に必要な共通鍵が取得できないからである。In process S804, thedata reception program 112 determines whether thedevice ID 27 has been received via the general-purpose I / F (USB) 108 or thewireless communication unit 130. If the reception is successful (Yes in S804), the process proceeds to S805. If the reception has failed (No in S804), the process proceeds to S809, and the data reception process ends. This is because the encrypted data whosedevice ID 27 is not known cannot acquire a common key necessary for decryption.
 処理S805では、データ受信プログラム112は、データリクエストを送信する。In process S805, thedata reception program 112 transmits a data request.
 処理S806では、データ受信プログラム112は、汎用I/F(USB)108或いは無線通信部130によるデータ受信を所定の時間待機する。当該待機時間は、最大でも1秒程度であることが好ましい。In process S806, thedata reception program 112 waits for a predetermined time for data reception by the general-purpose I / F (USB) 108 or thewireless communication unit 130. The waiting time is preferably about 1 second at the maximum.
 処理S807では、データ受信プログラム112は、処理S806でデータ受信があったかを判定する。センサノード1から送信されたセクタデータを受信した場合(S807でYesの場合)、処理は、S808に移行する。セクタデータを受信しなかった場合(S807でNoの場合)、処理はS809に移行し、データ受信処理が終了する。In process S807, thedata reception program 112 determines whether data has been received in process S806. When the sector data transmitted from thesensor node 1 is received (Yes in S807), the process proceeds to S808. If the sector data has not been received (No in S807), the process proceeds to S809, and the data reception process ends.
 処理S808では、データ受信プログラム112は、不揮発記憶部110に暗号化ファイル120を生成、または追記する。In process S808, thedata reception program 112 generates or appends theencrypted file 120 to thenonvolatile storage unit 110.
 <暗号化ファイルの復号化処理の詳細>
 図20は、サーバ200における、暗号化ファイル復号化プログラム223による復号化処理の詳細を説明するためのフローチャートである。当該復号化処理は、定期的に実行され、新しい暗号化ファイルの有無が監視され、新しい暗号化ファイルがあれば復号化してデータベース230に記録される。
<Details of decryption processing of encrypted file>
FIG. 20 is a flowchart for explaining details of the decryption processing by the encryptedfile decryption program 223 in theserver 200. The decryption process is periodically executed, the presence or absence of a new encrypted file is monitored, and if there is a new encrypted file, it is decrypted and recorded in thedatabase 230.
 処理S900では、暗号化ファイル復号化プログラム223は、開始指示に従って、暗号化ファイル復号化処理を開始する。なお、暗号化ファイル復号化プログラム223は、サーバ200のオペレーションシステム、或いは他の制御プログラムによって指示され、定期的に実行されるように設定することが望ましい。In process S900, the encryptedfile decryption program 223 starts the encrypted file decryption process according to the start instruction. The encryptedfile decryption program 223 is preferably set so that it is instructed by the operation system of theserver 200 or another control program and is periodically executed.
 処理S901では、暗号化ファイル復号化プログラム223は、データベース230に新しい暗号化ファイル232が存在するか判定する。新しい暗号化ファイルが存在する場合(S901でYesの場合)、処理は、S902に移行する。新しい暗号化ファイルが存在しない場合(S901でNoの場合)には、処理は、S909に移行し、暗号化ファイル復号化処理は終了する。In process S901, the encryptedfile decryption program 223 determines whether a newencrypted file 232 exists in thedatabase 230. If a new encrypted file exists (Yes in S901), the process proceeds to S902. If a new encrypted file does not exist (No in S901), the process proceeds to S909, and the encrypted file decryption process ends.
 処理S902では、暗号化ファイル復号化プログラム223は、暗号化ファイル232から機器ID121と1セクタ分のデータを読み出す。In process S902, the encryptedfile decryption program 223 reads thedevice ID 121 and data for one sector from theencrypted file 232.
 処理S903では、暗号化ファイル復号化プログラム223は、S902で暗号化ファイル232から読み出したデータを復号化するのに、疑似乱数列が初期化されているかを判定する。これは、復号化対象の暗号化ファイル232に含まれる機器ID121とRAM210に格納された機器ID216が同じで、かつ暗号化ファイル232に含まれる初期化ベクトル125とRAM210に格納された初期化ベクトル218が同じであるかで判定する。同じであれば(S903でYesの場合)、初期化済みであると判断され、処理はS904に移行する。一つでも異なれば(S903でNoの場合)、初期化されていないと判断され、処理はS911に移行する。In process S903, the encryptedfile decryption program 223 determines whether or not the pseudo-random number sequence has been initialized in order to decrypt the data read from theencrypted file 232 in S902. This is because thedevice ID 121 included in theencryption file 232 to be decrypted and thedevice ID 216 stored in theRAM 210 are the same, and theinitialization vector 125 included in theencryption file 232 and theinitialization vector 218 stored in theRAM 210. There is determined by whether it is the same. If they are the same (Yes in S903), it is determined that initialization has been completed, and the process proceeds to S904. If even one is different (No in S903), it is determined that initialization has not been performed, and the process proceeds to S911.
 処理S911では、暗号化ファイル復号化プログラム223は、疑似乱数列の初期化処理を実行する。より具体的には、暗号化ファイル復号化プログラム223は、暗号化ファイル232の機器ID121とRAM210の機器ID216が同じで、かつ初期化ベクトル125と初期化ベクトル218が同じ状態での秘密鍵212を生成し、さらに、内部状態213、インデックスi214、及びインデックスj215を生成する。S911の処理の更なる詳細については、図21を用いて後述する。In process S911, the encryptedfile decryption program 223 executes a pseudo-random number sequence initialization process. More specifically, the encryptedfile decryption program 223 obtains thesecret key 212 when thedevice ID 121 of theencrypted file 232 and thedevice ID 216 of theRAM 210 are the same, and theinitialization vector 125 and theinitialization vector 218 are the same. In addition, aninternal state 213, an index i214, and an index j215 are generated. Further details of the processing of S911 will be described later with reference to FIG.
 処理S904では、暗号化ファイル復号化プログラム223は、暗号化ファイル232のセクタデータ122の出力カウンタ124と、RAM210の出力カウンタ217の差分の回数だけ、ストリーム暗号アルゴリズム234で疑似乱数を出力して出力カウンタ217を出力回数分インクリメントし、出力カウンタ124と出力カウンタ217の値を同じくする。In the process S904, the encryptedfile decryption program 223 outputs a pseudo random number by thestream encryption algorithm 234 and outputs it by the number of differences between theoutput counter 124 of thesector data 122 of theencrypted file 232 and theoutput counter 217 of theRAM 210. Thecounter 217 is incremented by the number of times of output, and the values of theoutput counter 124 and theoutput counter 217 are the same.
 処理S905では、暗号化ファイル復号化プログラム223は、ストリーム暗号アルゴリズム224に従って、セクタデータ122の暗号化データ126を、内部状態213、インデックスi214、及びインデックスj215を用いて復号化し、当該復号化データをセンサデータバッファ領域211に記録する。In process S905, the encryptedfile decryption program 223 decrypts theencrypted data 126 of thesector data 122 using theinternal state 213, the index i 214, and theindex j 215 in accordance with thestream encryption algorithm 224, and the decrypted data is decrypted. recorded in the sensordata buffer area 211.
 処理S906では、暗号化ファイル復号化プログラム223は、センサデータバッファ領域211の復号化データをデータベース230のセンサデータ領域233に記録する。In process S906, the encryptedfile decryption program 223 records the decrypted data in the sensordata buffer area 211 in thesensor data area 233 of thedatabase 230.
 処理S907では、暗号化ファイル復号化プログラム223は、暗号化ファイル232のセクタデータ122が全て処理済みか(S902ですべて読み出したか)判定する。読み出しがファイルの最後まで完了していれば(S907でYesの場合)、処理はS908に移行する。完了していなければ(S907でNoの場合)、処理はS902に戻る。ファイルの読み出しがすべて完了した場合には、読み出した暗号化ファイル232を削除するか、別のバックアップ用記憶領域に処理が移動する。In process S907, the encryptedfile decryption program 223 determines whether all thesector data 122 of theencrypted file 232 has been processed (whether all have been read in S902). If the reading is completed to the end of the file (Yes in S907), the process proceeds to S908. If not completed (No in S907), the process returns to S902. When all the files have been read, the readencrypted file 232 is deleted or the process moves to another backup storage area.
 処理S908では、暗号化ファイル復号化プログラム223は、内部状態213、インデックスi214、インデックスj215、機器ID216、出力カウンタ217、及び初期化ベクトル218を、RAM210の内部状態保持データ219に記録し、処理をS909に移行させ、暗号化ファイル復号化処理を完了する。In the process S908, the encryptedfile decryption program 223 records theinternal state 213, the index i214, the index j215, thedevice ID 216, theoutput counter 217, and theinitialization vector 218 in the internalstate holding data 219 of theRAM 210, and performs the process. The process proceeds to S909 to complete the encrypted file decryption process.
 このように、内部状態を内部状態保持データとして保持することにより、内部状態213の初期化や同期を高速化することができる。なお、内部状態保持データ219(構造については図9参照)の容量に制限を設けるためには、機器当たりに記憶できる最大数を設定し、それを超えた場合には古い情報から削除していくようにしても良い。Thus, by holding the internal state as internal state holding data, the initialization and synchronization of theinternal state 213 can be speeded up. In order to limit the capacity of the internal state holding data 219 (see FIG. 9 for the structure), the maximum number that can be stored per device is set, and if it exceeds that, the old information is deleted. You may do it.
 <サーバにおける擬似乱数列初期化処理(S911)の詳細>
 図21は、図20の処理S911における擬似乱数列初期化処理の詳細を説明するためのフローチャートである。図21では、内部状態保持データ(テーブル)219に機器IDや初期化ベクトルが一致し、出力回数が同じか小さい内部状態のデータが存在する場合には、当該データを内部状態保持データ219から読み出すことにより、擬似乱数列の初期化処理を短縮するようにする。
<Details of Pseudorandom Number Sequence Initialization Processing (S911) in Server>
FIG. 21 is a flowchart for explaining details of the pseudo-random number sequence initialization processing in step S911 in FIG. In FIG. 21, when the internal state holding data (table) 219 has the same device ID and initialization vector, and there is internal state data with the same or smaller number of outputs, the data is read from the internalstate holding data 219. Thus, the initialization process of the pseudo random number sequence is shortened.
 処理S1000では、暗号化ファイル復号化プログラム223は、擬似乱数列の初期化処理を開始する。In process S1000, the encryptedfile decryption program 223 starts the pseudo random number sequence initialization process.
 処理S1001では、暗号化ファイル復号化プログラム223は、内部状態保持データ219(図9)を参照し、機器ID250と暗号化ファイル232の機器ID121が同じで、かつ初期化ベクトル251とセクタデータ122の初期化ベクトル125が同じで、かつ出力カウンタ252がセクタデータ122の出力カウンタ124と同じか小さい内部状態253、インデックスi254、及びインデックスj255が存在するか判断する。存在する場合(S1001でYesの場合)には、暗号化ファイル復号化プログラム223は、該当するデータを内部状態保持データ219から読みだして、処理をS1010に移行させる。存在しない場合(S1001でNoの場合)には、処理はS1002に移行する。In process S1001, the encryptedfile decryption program 223 refers to the internal state holding data 219 (FIG. 9), thedevice ID 250 and thedevice ID 121 of theencrypted file 232 are the same, and theinitialization vector 251 and thesector data 122 It is determined whether theinternal state 253, the index i 254, and theindex j 255 exist that have thesame initialization vector 125 and theoutput counter 252 that is the same as or smaller than theoutput counter 124 of thesector data 122. If it exists (Yes in S1001), the encryptedfile decryption program 223 reads the corresponding data from the internalstate holding data 219, and shifts the processing to S1010. If it does not exist (No in S1001), the process proceeds to S1002.
 処理S1010では、暗号化ファイル復号化プログラム223は、S1001で読みだした内部状態253、インデックスi254、及びインデックスj255を、それぞれRAM210の内部状態213、インデックスi214、及びインデックスj215に記録する。また、暗号化ファイル復号化プログラム223は、暗号化ファイル232の機器ID121と、セクタデータ122の初期化ベクトル125と、出力カウンタ252をそれぞれ、RAM210の機器ID216と、初期化ベクトル218と、出力カウンタ217に記録し、処理をS1008に移行させて、擬似乱数列初期化処理を完了する。In process S1010, the encryptedfile decryption program 223 records theinternal state 253, index i254, and index j255 read in S1001 in theinternal state 213, index i214, and index j215 of theRAM 210, respectively. The encryptedfile decryption program 223 also includes thedevice ID 121 of theencrypted file 232, theinitialization vector 125 of thesector data 122, and theoutput counter 252; thedevice ID 216 of theRAM 210; theinitialization vector 218; In step S1008, the pseudo random number sequence initialization process is completed.
 処理S1002では、暗号化ファイル復号化プログラム223は、暗号化ファイル232の機器ID121に対応する共通鍵を共通鍵テーブル231から読み出する。そして、暗号化ファイル復号化プログラム223は、読み出した共通鍵とセクタデータ122の初期化ベクトル125と結合した値をハッシュ関数225によってハッシュ化し、ハッシュ値を秘密鍵として秘密鍵格納領域212に記録する。In process S1002, the encryptedfile decryption program 223 reads the common key corresponding to thedevice ID 121 of theencrypted file 232 from the common key table 231. Then, the encryptedfile decryption program 223 hashes the value obtained by combining the read common key and theinitialization vector 125 of thesector data 122 with thehash function 225, and records the hash value as a secret key in the secretkey storage area 212. .
 処理S1003では、暗号化ファイル復号化プログラム223は、秘密鍵格納領域212の秘密鍵を基に、ストリーム暗号アルゴリズム224の初期化処理によって内部状態の情報を生成し、内部状態格納領域213に格納する。ストリーム暗号アルゴリズム224はセンサノード1と共通のものが用いられ、例えば、公知のARCFOURを用いられる。暗号化処理の詳細については、図16に示される処理と同様である。In process S1003, the encryptedfile decryption program 223 generates internal state information by the initialization process of thestream encryption algorithm 224 based on the private key in the privatekey storage area 212, and stores it in the internalstate storage area 213. . Thestream encryption algorithm 224 is the same as that of thesensor node 1, and for example, a known ARCFOUR is used. Details of the encryption processing are the same as the processing shown in FIG.
 処理S1004では、暗号化ファイル復号化プログラム223は、疑似乱数列初期化処理で使用する変数n、インデックスi214、及びインデックスj215を0に初期化する。In process S1004, the encryptedfile decryption program 223 initializes the variable n, the index i214, and the index j215 used in the pseudorandom number sequence initialization process to 0.
 処理S1005では、暗号化ファイル復号化プログラム223は、変数nと十分な大きい所定値(例えば、典型的には3000以上)と比較する。nが所定値よりも小さければ(S1005でYesの場合)、処理はS1006に移行する。それ以外の場合(S1005でNoの場合)、処理はS1007に移行し、疑似乱数初期化処理が終了する。本処理で十分な大きい数の分だけ予め疑似乱数列から乱数を出力しておくことで、疑似乱数列の予測や解読を困難にすることができる。この回数は、暗号化側のセンサノード1と、復号化側のサーバ200とで予め同じ値を疑似乱数初期化処理のプログラムに記述する。In process S1005, the encryptedfile decryption program 223 compares the variable n with a sufficiently large predetermined value (for example, typically 3000 or more). If n is smaller than the predetermined value (Yes in S1005), the process proceeds to S1006. In other cases (No in S1005), the process proceeds to S1007, and the pseudorandom number initialization process ends. By outputting random numbers from the pseudo-random number sequence in advance by a sufficiently large number in this processing, it is possible to make it difficult to predict and decode the pseudo-random number sequence. The same number of times is described in advance in the pseudo-random number initialization processing program in thesensor node 1 on the encryption side and theserver 200 on the decryption side.
 処理S1006では、暗号化ファイル復号化プログラム223は、ストリーム暗号アルゴリズム224に従って、内部状態213、インデックスi214、及びインデックスj215を用い、乱数を1バイト出力する。この乱数は不要である。当該処理の詳細は、図17と同様である。In process S1006, the encryptedfile decryption program 223 uses theinternal state 213, the index i214, and the index j215 according to thestream encryption algorithm 224, and outputs a random number of 1 byte. This random number is not required. The details of this processing are the same as in FIG.
 処理S1007では、暗号化ファイル復号化プログラム223は、変数nをインクリメントし、処理をS1005に移行させる。In process S1007, the encryptedfile decryption program 223 increments the variable n and shifts the process to S1005.
 <復号化処理の詳細>
 図22は、図20のS905による復号化処理の詳細を説明するためのフローチャートである。復号化処理では、RAM210の内部状態213、インデックスi214、及びインデックスj215からストリーム暗号アルゴリズム224によって擬似乱数を生成し、暗号化ファイル232のデータを復号化し、復号化データをセンサデータバッファ211に記録するようにしている。
<Details of decryption processing>
FIG. 22 is a flowchart for explaining the details of the decoding processing in S905 of FIG. In the decryption process, a pseudo random number is generated by thestream encryption algorithm 224 from theinternal state 213 of theRAM 210, the index i214, and the index j215, the data of theencrypted file 232 is decrypted, and the decrypted data is recorded in thesensor data buffer 211. I am doing so.
 処理S1100では、暗号化ファイル復号化プログラム223は、復号化処理を開始する。In process S1100, the encryptedfile decryption program 223 starts the decryption process.
 処理S1101では、暗号化ファイル復号化プログラム223は、暗号化ファイル232のセクタデータ122に含まれる暗号化データ126(復号化対象)から1バイト読み出す。In process S1101, the encryptedfile decryption program 223 reads one byte from the encrypted data 126 (decryption target) included in thesector data 122 of theencrypted file 232.
 処理S1102では、暗号化ファイル復号化プログラム223は、ストリーム暗号アルゴリズム224に従って、内部状態213、インデックスi214、及びインデックスj215を用い、疑似乱数を1バイト出力する。処理の詳細は図17と同様である。In process S1102, the encryptedfile decryption program 223 outputs a 1-byte pseudorandom number using theinternal state 213, the index i214, and the index j215 in accordance with thestream encryption algorithm 224. Details of the processing are the same as in FIG.
 処理S1103では、暗号化ファイル復号化プログラム223は、処理S1101で読み出したデータと、処理S1102で出力した乱数をXOR演算する。In process S1103, the encryptedfile decryption program 223 performs an XOR operation on the data read in process S1101 and the random number output in process S1102.
 処理S1104では、暗号化ファイル復号化プログラム223は、処理S1103の結果をセンサデータバッファ領域211に記録する。In process S1104, the encryptedfile decryption program 223 records the result of process S1103 in the sensordata buffer area 211.
 処理S1105では、暗号化ファイル復号化プログラム223は、出力カウンタ217のカウンタ値をインクリメントして更新する。In process S1105, the encryptedfile decryption program 223 increments and updates the counter value of theoutput counter 217.
 処理S1106では、暗号化ファイル復号化プログラム223は、セクタデータ122の暗号化データ126のデータを、S1101で全て読み出し終わったか(全ての対象データの復号が完了したか)を判定する。読み出しが完了している場合(S1106でYesの場合)、処理はS1107に移行し、復号化処理が終了する。読み出しが完了していない場合(S1106でNoの場合)、処理はS1101に移行し、復号化処理が続けられる。In process S1106, the encryptedfile decryption program 223 determines whether all the data of theencrypted data 126 of thesector data 122 has been read in S1101 (whether decryption of all target data has been completed). When the reading is completed (Yes in S1106), the process proceeds to S1107, and the decoding process ends. When the reading is not completed (No in S1106), the process proceeds to S1101, and the decoding process is continued.
 <まとめ>
 図23は、擬似乱数列初期化処理の有無によって電流値がどのように変化するかを示す図である。図23Aは、図1のセンサノード1が512バイトのデータに対し、擬似乱数出力とXOR演算による暗号化のみを行ってフラッシュメモリ50のセクタに記録した電流波形500を示している。図23Bは、擬似乱数列の初期化処理を行ってから、同サイズのデータに対して擬似乱数出力とXOR演算による暗号化のみを行ってフラッシュメモリ50のセクタに記録した電流波形501を比較した例を示している。
<Summary>
FIG. 23 is a diagram illustrating how the current value changes depending on the presence or absence of the pseudo-random number sequence initialization process. FIG. 23A shows acurrent waveform 500 recorded in the sector of theflash memory 50 by performing only pseudo-random number output and encryption by XOR operation on 512-byte data by thesensor node 1 of FIG. FIG. 23B compares thecurrent waveform 501 recorded in the sector of theflash memory 50 by performing pseudo-random number output and encryption only by XOR operation on the same size data after performing initialization processing of the pseudo-random number sequence. An example is shown.
 図23に示されるように、擬似乱数の初期化処理は、擬似乱数出力と暗号化のみの場合と比較して10倍の処理時間を要するため、消費電力を増大させることは明らかである。As shown in FIG. 23, the pseudo random number initialization process requires 10 times the processing time as compared with the case of only the pseudo random number output and encryption, so it is clear that the power consumption is increased.
 従って、擬似乱数列初期化処理は、消費電力量の増大を気にする必要のない環境・状況下で行う必要があることが分かる。このため、本発明では、バッテリ5の残量が充分にある場合、或いは、外部電源がセンサノード1に接続されている場合に、擬似乱数列初期化処理を実行するようにしている。Therefore, it can be seen that the pseudo-random number sequence initialization process needs to be performed in an environment / situation where there is no need to worry about an increase in power consumption. For this reason, in the present invention, when the remaining amount of thebattery 5 is sufficient, or when the external power source is connected to thesensor node 1, the pseudo random number sequence initialization process is executed.
 例えば、通信プロトコルで用いられるARCFOURと呼ばれるストリーム暗号化技術は、秘密鍵とするデータ列を入力として、固有な疑似乱数列を生成する技術である。疑似乱数を発生させる処理量は、一般に比較的少なく、ボタン電池で駆動するマイコンにおいても処理可能である。しかし、ストリーム暗号化では、疑似乱数生成の処理時間は比較的少なくて済むが、秘密鍵から疑似乱数列の生成を始めるまでの初期化処理は桁違いに時間を要する。従って、センサノードで通常の通信プロトコルを用いる場合、データ送信単位であるパケット生成毎に擬似乱数を初期化することになるため、センサノードの処理時間を大幅に増大させる可能性が高く、多くの電力を消費する可能性がある。特に、小型のセンサノードの場合CPUパワーが小さいことが多いので、この擬似乱数列初期化処理の時間が長くなる傾向がある。For example, a stream encryption technique called ARCFOUR used in a communication protocol is a technique for generating a unique pseudo-random number sequence using a data sequence as a secret key as an input. The amount of processing for generating a pseudo-random number is generally relatively small and can be processed by a microcomputer driven by a button battery. However, in the stream encryption, the processing time for generating the pseudo random number is relatively short, but the initialization process until the generation of the pseudo random number sequence from the secret key takes an extremely long time. Therefore, when a normal communication protocol is used in the sensor node, a pseudo-random number is initialized every time a packet is generated as a data transmission unit. Therefore, there is a high possibility that the processing time of the sensor node will be greatly increased. it may consume the power. In particular, in the case of a small sensor node, since the CPU power is often small, the time for this pseudo-random number sequence initialization process tends to be long.
 また、機器内部のメモリに予め定められた複数の疑似乱数列を用いて情報を暗号化し、一定時間ごとに使用する乱数列を切り替えることで、疑似乱数列を内部で生成する処理を避けて消費電力を低減した上で、暗号の解読を困難にする技術がある。この技術では、センサノード内部で疑似乱数列を生成する処理が不要であるため、処理時間の問題はない。しかしながら、記憶できる疑似乱数列はメモリサイズに制約を受けるため、使用する疑似乱数列が循環しやすくなり、暗号化データを大量に収集されると、解読される可能性が高い。In addition, by encrypting information using a plurality of predetermined pseudo-random number sequences in the internal memory of the device and switching the random number sequence to be used at regular intervals, it avoids the process of generating the pseudo-random number sequence internally There is a technology that makes it difficult to decrypt a code while reducing power. In this technique, there is no problem of processing time because the process of generating a pseudo-random number sequence in the sensor node is unnecessary. However, since the pseudo-random number sequence that can be stored is limited by the memory size, the pseudo-random number sequence to be used is likely to circulate, and if a large amount of encrypted data is collected, there is a high possibility of being decrypted.
 一方、本発明では、上述したように、センサノードの起動時、外部電源接続時、或いは内蔵バッテリ残量が十分(所定値以上)の場合のみ、暗号化に用いる擬似乱数列の初期化処理を実行する。従って、使用する擬似乱数列が循環しやすくなるという状態を回避することができる。また、バッテリの残量が少ない状態で擬似乱数列の初期化処理を実行することがなくなるので、擬似乱数列初期化処理による影響(電力低下という状態)を受けなくなる。つまり、ストリーム暗号化の中でも負荷の大きい初期化処理による電池の消費による電池寿命の大幅な低下や、日常的に可能な充電サイクルより早い電池切れを防ぐことができる。従って、CPUパワーが小さいセンサノードであっても、擬似乱数列初期化処理に掛かる時間を気にする必要がなくなる。On the other hand, in the present invention, as described above, the initialization process of the pseudo random number sequence used for encryption is performed only when the sensor node is activated, when an external power source is connected, or when the remaining amount of the built-in battery is sufficient (a predetermined value or more). Execute. Therefore, it is possible to avoid a state in which the pseudo random number sequence to be used is easily circulated. Further, since the pseudo random number sequence initialization process is not executed in a state where the remaining amount of the battery is low, the influence (state of power reduction) due to the pseudo random number sequence initialization process is eliminated. That is, it is possible to prevent a significant decrease in battery life due to battery consumption due to initialization processing with a heavy load even during stream encryption, and battery exhaustion earlier than a charge cycle that can be routinely performed. Therefore, even for a sensor node with low CPU power, there is no need to worry about the time required for the pseudo-random number sequence initialization process.
 また、暗号化データを送信する際には、暗号化データを生成する際に用いた擬似乱数が擬似乱数列の初期化から何回目に出力されたものであるかを示す乱数出力回数情報(出力カウンタ値)を暗号化データに付加する。このようにすることにより、1つの疑似乱数列をある程度の期間に亘って使用する場合で、かつ擬似乱数列が複数パケットにまたがる場合においても、復号化側で暗号化データに付加された出力回数分の擬似乱数列を出力して同期させれば、必要な擬似乱数を出力することができるので、復号化側の処理を軽減することが可能となる。In addition, when sending encrypted data, random number output count information (output) indicating the number of times the pseudorandom number used to generate the encrypted data was output since the initialization of the pseudorandom number sequence (Counter value) is added to the encrypted data. In this way, even when one pseudo-random number sequence is used for a certain period of time and the pseudo-random number sequence spans multiple packets, the number of outputs added to the encrypted data on the decryption side If the pseudo-random number sequence of minutes is output and synchronized, the necessary pseudo-random numbers can be output, so that the processing on the decoding side can be reduced.
 本発明では、センサデバイスの起動回数(リセットカウンタ値)を用いて乱数を生成し、この乱数を初期化ベクトルとして、擬似乱数列の初期化を実行する。このようにすることにより、起動ごとに異なる初期化ベクトルを用いることができ、より秘匿性を強化することが可能となる。In the present invention, a random number is generated using the number of activations (reset counter value) of the sensor device, and a pseudo-random number sequence is initialized using the random number as an initialization vector. By doing so, a different initialization vector can be used for each activation, and it is possible to further enhance the secrecy.
 また、擬似乱数列の出力を所定回数(例えば、3000回)実行して、3000回目の擬似乱数列を暗号化に用いる擬似乱数列とする。このようにすることにより、擬似乱数列の予測や解読を困難にして秘匿性を強化することが可能となる。Further, the pseudo random number sequence is output a predetermined number of times (for example, 3000 times), and the 3000th pseudo random number sequence is used as a pseudo random number sequence for encryption. By doing so, it becomes possible to enhance the secrecy by making it difficult to predict and decode the pseudo-random number sequence.
 本発明は、実施形態の機能を実現するソフトウェアのプログラムコードによっても実現できる。この場合、プログラムコードを記録した記憶媒体をシステム或は装置に提供し、そのシステム或は装置のコンピュータ(又はCPUやMPU)が記憶媒体に格納されたプログラムコードを読み出す。この場合、記憶媒体から読み出されたプログラムコード自体が前述した実施形態の機能を実現することになり、そのプログラムコード自体、及びそれを記憶した記憶媒体は本発明を構成することになる。このようなプログラムコードを供給するための記憶媒体としては、例えば、フレキシブルディスク、CD-ROM、DVD-ROM、ハードディスク、光ディスク、光磁気ディスク、CD-R、磁気テープ、不揮発性のメモリカード、ROMなどが用いられる。The present invention can also be realized by a program code of software that realizes the functions of the embodiment. In this case, a storage medium in which the program code is recorded is provided to the system or apparatus, and the computer (or CPU or MPU) of the system or apparatus reads the program code stored in the storage medium. In this case, the program code itself read from the storage medium realizes the functions of the above-described embodiments, and the program code itself and the storage medium storing the program code constitute the present invention. As a storage medium for supplying such program code, for example, a flexible disk, CD-ROM, DVD-ROM, hard disk, optical disk, magneto-optical disk, CD-R, magnetic tape, nonvolatile memory card, ROM Etc. are used.
 また、プログラムコードの指示に基づき、コンピュータ上で稼動しているOS(オペレーティングシステム)などが実際の処理の一部又は全部を行い、その処理によって前述した実施の形態の機能が実現されるようにしてもよい。さらに、記憶媒体から読み出されたプログラムコードが、コンピュータ上のメモリに書きこまれた後、そのプログラムコードの指示に基づき、コンピュータのCPUなどが実際の処理の一部又は全部を行い、その処理によって前述した実施の形態の機能が実現されるようにしてもよい。Also, based on the instruction of the program code, an OS (operating system) running on the computer performs part or all of the actual processing, and the functions of the above-described embodiments are realized by the processing. May be. Further, after the program code read from the storage medium is written in the memory on the computer, the computer CPU or the like performs part or all of the actual processing based on the instruction of the program code. Thus, the functions of the above-described embodiments may be realized.
 さらに、実施の形態の機能を実現するソフトウェアのプログラムコードを、ネットワークを介して配信することにより、それをシステム又は装置のハードディスクやメモリ等の記憶手段又はCD-RW、CD-R等の記憶媒体に格納し、使用時にそのシステム又は装置のコンピュータ(又はCPUやMPU)が当該記憶手段や当該記憶媒体に格納されたプログラムコードを読み出して実行するようにしても良い。Further, by distributing the program code of the software that realizes the functions of the embodiment via a network, the program code is stored in a storage means such as a hard disk or a memory of a system or apparatus, or a storage medium such as a CD-RW or CD-R And the computer (or CPU or MPU) of the system or apparatus may read and execute the program code stored in the storage means or the storage medium when used.
 最後に、ここで述べたプロセス及び技術は本質的に如何なる特定の装置に関連することはなく、コンポーネントの如何なる相応しい組み合わせによってでも実装できることを理解する必要がある。更に、汎用目的の多様なタイプのデバイスがここで記述した教授に従って使用可能である。ここで述べた方法のステップを実行するのに、専用の装置を構築するのが有益であることが判るかもしれない。また、実施形態に開示されている複数の構成要素の適宜な組み合わせにより、種々の発明を形成できる。例えば、実施形態に示される全構成要素から幾つかの構成要素を削除してもよい。さらに、異なる実施形態にわたる構成要素を適宜組み合わせてもよい。本発明は、具体例に関連して記述したが、これらは、すべての観点に於いて限定の為ではなく説明の為である。本分野にスキルのある者には、本発明を実施するのに相応しいハードウェア、ソフトウェア、及びファームウエアの多数の組み合わせがあることが解るであろう。例えば、記述したソフトウェアは、アセンブラ、C/C++、perl、Shell、PHP、Java(登録商標)等の広範囲のプログラム又はスクリプト言語で実装できる。Finally, it should be understood that the processes and techniques described herein are not inherently related to any particular equipment, and can be implemented by any suitable combination of components. In addition, various types of devices for general purpose can be used in accordance with the teachings described herein. It may prove useful to build a dedicated device to perform the method steps described herein. Various inventions can be formed by appropriately combining a plurality of constituent elements disclosed in the embodiments. For example, some components may be deleted from all the components shown in the embodiment. Furthermore, constituent elements over different embodiments may be appropriately combined. Although the present invention has been described with reference to specific examples, these are in all respects illustrative rather than restrictive. Those skilled in the art will appreciate that there are numerous combinations of hardware, software, and firmware that are suitable for implementing the present invention. For example, the described software can be implemented in a wide range of programs or script languages such as assembler, C / C ++, perl, shell, PHP, Java (registered trademark).
 さらに、上述の実施形態において、制御線や情報線は説明上必要と考えられるものを示しており、製品上必ずしも全ての制御線や情報線を示しているとは限らない。全ての構成が相互に接続されていても良い。Furthermore, in the above-described embodiment, control lines and information lines are those that are considered necessary for the explanation, and not all control lines and information lines on the product are necessarily shown. All the components may be connected to each other.
 加えて、本技術分野の通常の知識を有する者には、本発明のその他の実装がここに開示された本発明の明細書及び実施形態の考察から明らかになるである。記述された実施形態の多様な態様及び/又はコンポーネントは、データを管理する機能を有するコンピュータ化ストレージシステムに於いて、単独又は如何なる組み合わせでも使用することが出来る。明細書と具体例は典型的なものに過ぎず、本発明の範囲と精神は後続する請求範囲で示される。In addition, other implementations of the present invention will become apparent to those skilled in the art from consideration of the specification and embodiments of the present invention disclosed herein. Various aspects and / or components of the described embodiments can be used singly or in any combination in a computerized storage system capable of managing data. The specification and specific examples are merely exemplary, and the scope and spirit of the invention are indicated in the following claims.
 1 センサノード
 3 リアルタイムクロック(RTC)
 10 マイコン
 11 シリアル通信部(SPI)
 12 演算部(MCU)
 16 シリアル通信部(UART)
 30 ランダムアクセスメモリ(RAM)
 60 電源検出回路
 601~603 抵抗
 604 トランジスタ
 605、606 グランド
 607~609 端子
 70 OR回路
 71、72 ダイオード
 73 抵抗
 74 グランド
 75~77 端子
 81~83 配線
 100 基地局
 101 制御装置
 102 中央演算部(CPU)
 103 ランダムアクセスメモリ(RAM)
 106 ユーザインタフェース制御部(U/I制御部)
 108 汎用インタフェース(汎用I/F)
 120 暗号化ファイル
 200 サーバ
 201 中央演算部(CPU)
 210 ランダムアクセスメモリ(RAM)
 219 内部状態保持データ
 231 共通鍵テーブル
 300 ユーザ
 400 ネットワーク
 500、501 電流波形
1Sensor node 3 Real time clock (RTC)
10Microcomputer 11 Serial communication part (SPI)
12 Calculation unit (MCU)
16 Serial communication unit (UART)
30 Random access memory (RAM)
60 powersupply detection circuit 601 to 603resistance 604transistor 605 and 606ground 607 to 609 terminal 70 ORcircuit 71 and 72diode 73resistance 74ground 75 to 77 terminal 81 to 83wiring 100base station 101control device 102 central processing unit (CPU)
103 Random access memory (RAM)
106 User interface control unit (U / I control unit)
108 General-purpose interface (general-purpose I / F)
120Encrypted file 200Server 201 Central processing unit (CPU)
210 Random access memory (RAM)
219 Internalstate holding data 231 Common key table 300User 400Network 500, 501 Current waveform

Claims (10)

  1.  所定の使用状態で測定動作を実行し、測定データを取得するセンサと、
     前記測定データに対して暗号化処理を実行して暗号化データを生成し、当該暗号化データをメモリに格納するプロセッサと、を有し、
     前記プロセッサは、供給電源の電圧値が所定値以上ある場合に、前記暗号化処理に用いる擬似乱数列を初期化する処理を実行することを特徴とするセンサデバイス。
    A sensor that performs a measurement operation in a predetermined use state and acquires measurement data;
    A processor that performs encryption processing on the measurement data to generate encrypted data, and stores the encrypted data in a memory;
    The processor executes a process of initializing a pseudo-random number sequence used for the encryption process when a voltage value of a power supply is a predetermined value or more.
  2.  請求項1において、
     前記プロセッサは、前記センサデバイスの起動回数を前記メモリ上で管理し、前記擬似乱数列初期化処理において、前記起動回数から乱数を生成して初期化ベクトルを取得し、当該初期化ベクトルと前記センサデバイスの共通鍵とを用いて秘密鍵を生成し、当該秘密鍵で内部状態を生成することを特徴とするセンサデバイス。
    In claim 1,
    The processor manages the number of activations of the sensor device on the memory, and in the pseudo random number sequence initialization process, generates a random number from the number of activations to obtain an initialization vector, and the initialization vector and the sensor A sensor device, wherein a secret key is generated using a common key of the device, and an internal state is generated with the secret key.
  3.  所定の使用状態で測定動作を実行し、測定データを出力するセンサデバイスの制御方法であって、
     前記センサデバイスのプロセッサが、供給電源の電圧値が所定値以上ある場合に、暗号化処理に用いる擬似乱数列を初期化する処理を実行するステップと、
     前記プロセッサが、前記初期化された擬似乱数列を用いて、前記測定データに対して暗号化処理を実行して暗号化データを生成し、当該暗号化データをメモリに格納するステップと、
    を有することを特徴とする制御方法。
    A method of controlling a sensor device that executes a measurement operation in a predetermined use state and outputs measurement data,
    The processor of the sensor device, when the voltage value of the power supply is a predetermined value or more, executing a process of initializing a pseudo-random number sequence used for the encryption process;
    The processor performs encryption processing on the measurement data using the initialized pseudorandom number sequence to generate encrypted data, and stores the encrypted data in a memory;
    A control method characterized by comprising:
  4.  請求項6において、
     さらに、前記プロセッサが、擬似乱数を用いて前記暗号化データを生成し、当該暗号化データを生成する際に用いた前記擬似乱数が前記擬似乱数列の初期化から何回目に出力されたものであるかを示す乱数出力回数情報を前記暗号化データに付加して出力するステップを有することを特徴とする制御方法。
    In claim 6,
    Further, the processor generates the encrypted data using a pseudo random number, and the pseudo random number used when generating the encrypted data is output at the number of times since the initialization of the pseudo random number sequence. A control method comprising: adding random number output count information indicating whether or not there is output to the encrypted data.
  5.  請求項6において、
     さらに、前記プロセッサが、前記センサデバイスの起動回数を前記メモリ上で管理ステップを有し、
     前記擬似乱数列を初期化するステップにおいて、前記プロセッサは、前記起動回数から乱数を生成して初期化ベクトルを取得し、当該初期化ベクトルと前記センサデバイスの共通鍵とを用いて秘密鍵を生成し、当該秘密鍵で内部状態を生成することを特徴とする制御方法。
    In claim 6,
    Further, the processor includes a step of managing the number of activations of the sensor device on the memory,
    In the step of initializing the pseudo-random number sequence, the processor generates a random number from the number of activations, obtains an initialization vector, and generates a secret key using the initialization vector and the common key of the sensor device And an internal state is generated with the secret key.
  6.  請求項8において
     前記擬似乱数列を初期化するステップにおいて、前記プロセッサは、前記内部状態と当該内部状態の配列要素を入れ替えるための情報であるインデックス情報とを用いて擬似乱数列を出力し、当該擬似乱数列の出力を所定回数実行して前記擬似乱数列初期化処理を完了することを特徴とする制御方法。
    In the step of initializing the pseudo-random number sequence in claim 8, the processor outputs the pseudo-random number sequence using the internal state and index information that is information for exchanging array elements of the internal state, A control method characterized in that the pseudo random number sequence is output a predetermined number of times to complete the pseudo random number sequence initialization process.
PCT/JP2012/0531192011-02-182012-02-10Sensor device and control method thereofWO2012111559A1 (en)

Applications Claiming Priority (2)

Application NumberPriority DateFiling DateTitle
JP2011-0339452011-02-18
JP2011033945AJP5525467B2 (en)2011-02-182011-02-18 Sensor device and control method thereof

Publications (1)

Publication NumberPublication Date
WO2012111559A1true WO2012111559A1 (en)2012-08-23

Family

ID=46672484

Family Applications (1)

Application NumberTitlePriority DateFiling Date
PCT/JP2012/053119WO2012111559A1 (en)2011-02-182012-02-10Sensor device and control method thereof

Country Status (2)

CountryLink
JP (1)JP5525467B2 (en)
WO (1)WO2012111559A1 (en)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN105447897A (en)*2014-09-192016-03-30卡西欧计算机株式会社 Server device and data integration method
JP2016099987A (en)*2014-11-262016-05-30カシオ計算機株式会社 Server device, information display device, server control program, and computer system
US10042811B2 (en)2014-09-192018-08-07Casio Computer Co., Ltd.Expression processing device, compute server and recording medium having expression processing program recorded thereon
US10192329B2 (en)2014-09-192019-01-29Casio Computer Co., Ltd.Electronic device which displays and outputs function formula data, data output method, and computer readable medium
US10210132B2 (en)2014-09-192019-02-19Casio Computer Co., Ltd.Calculator, recording medium and compute server

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
JP5995075B2 (en)*2012-10-182016-09-21富士電機株式会社 Sensor network system
JP6771902B2 (en)*2016-02-162020-10-21フクダ電子株式会社 Portable medical equipment and its control method
TWI760546B (en)*2017-08-232022-04-11安地卡及巴布達商區塊鏈控股有限公司Computer-implemented system and method for highly secure, high speed encryption and transmission of data
FI129143B (en)*2017-11-032021-08-13Logmore OyData transmission system and use of a data transmission system for monitoring a monitored object
CN116991226A (en)*2018-02-142023-11-03上海寒武纪信息科技有限公司Control device, method and equipment of processor

Citations (5)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
JP2006211439A (en)*2005-01-312006-08-10Hitachi Ltd Sensor node, base station, and sensor network system
JP2008293339A (en)*2007-05-252008-12-04Keihin Corp Random number generator and vehicle control device
JP2009089379A (en)*2007-09-272009-04-23General Electric Co <Ge> System and method for interference mitigation in a wireless sensor network
JP2009535883A (en)*2006-04-292009-10-01コーニンクレッカ フィリップス エレクトロニクス エヌ ヴィ Method and apparatus for controlling energy deployment of sensor network nodes
JP2010166211A (en)*2009-01-142010-07-29Hitachi LtdData management system and method

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
JP2006211439A (en)*2005-01-312006-08-10Hitachi Ltd Sensor node, base station, and sensor network system
JP2009535883A (en)*2006-04-292009-10-01コーニンクレッカ フィリップス エレクトロニクス エヌ ヴィ Method and apparatus for controlling energy deployment of sensor network nodes
JP2008293339A (en)*2007-05-252008-12-04Keihin Corp Random number generator and vehicle control device
JP2009089379A (en)*2007-09-272009-04-23General Electric Co <Ge> System and method for interference mitigation in a wireless sensor network
JP2010166211A (en)*2009-01-142010-07-29Hitachi LtdData management system and method

Cited By (7)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN105447897A (en)*2014-09-192016-03-30卡西欧计算机株式会社 Server device and data integration method
US10042811B2 (en)2014-09-192018-08-07Casio Computer Co., Ltd.Expression processing device, compute server and recording medium having expression processing program recorded thereon
CN105447897B (en)*2014-09-192018-08-17卡西欧计算机株式会社 Server device and data integration method
US10192329B2 (en)2014-09-192019-01-29Casio Computer Co., Ltd.Electronic device which displays and outputs function formula data, data output method, and computer readable medium
US10210132B2 (en)2014-09-192019-02-19Casio Computer Co., Ltd.Calculator, recording medium and compute server
US10372666B2 (en)2014-09-192019-08-06Casio Computer Co., Ltd.Calculator, recording medium and compute server
JP2016099987A (en)*2014-11-262016-05-30カシオ計算機株式会社 Server device, information display device, server control program, and computer system

Also Published As

Publication numberPublication date
JP2012173434A (en)2012-09-10
JP5525467B2 (en)2014-06-18

Similar Documents

PublicationPublication DateTitle
JP5525467B2 (en) Sensor device and control method thereof
JP6925907B2 (en) Data transmitters, data receivers, methods and programs
CN101420428B (en)Cryptographic module management apparatus, method, and program
US9044855B2 (en)Processing context information
Bocu et al.A homomorphic encryption-based system for securely managing personal health metrics data
JP2009111974A (en) HEALTHCARE SYSTEM, KEY MANAGEMENT SERVER AND METHOD THEREOF, ENCRYPTION DEVICE AND METHOD THEREOF
RU2007114063A (en) METHOD FOR DISTRIBUTING INFORMATION FILLING FOR A MOBILE DEVICE WITH DIGITAL AUTHORITY AND A MOBILE DEVICE FOR HIM
KR20110029164A (en) Adaptive Generation of Pseudo Random Number Generator Seeds
US20140215212A1 (en)Electronic data sharing device and method of use
KR102812723B1 (en)Electronic device and method for receiving push message stored in blockchain
WO2010116678A1 (en)Healthcare system
CN103890734A (en)Telemetry file hash and conflict detection
US20140222504A1 (en)Electronic data sharing device and method of use
WO2012121025A1 (en)Random value identification device, random value identification system, and random value identification method
US7634522B1 (en)Random number generation
CN101568929B (en)Information converting technique
KR101619286B1 (en)Cross-platform based security system
JP2004282404A (en) Digital signature generation device, method, computer program, and computer-readable storage medium
JP6903609B2 (en) Sensor system, data collection device and data collection method
JP5565181B2 (en) Prediction device, prediction method, and prediction program
JP2013003667A (en)Information processor, information processing system, method, and program
EP3010178A1 (en)Calculation device, calculation method, and program
JPWO2012017522A1 (en) Verification program and verification device
JP2006120089A (en) Data management system and data management method
CN105303321A (en)Archive management method and apparatus

Legal Events

DateCodeTitleDescription
121Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number:12747622

Country of ref document:EP

Kind code of ref document:A1

NENPNon-entry into the national phase

Ref country code:DE

122Ep: pct application non-entry in european phase

Ref document number:12747622

Country of ref document:EP

Kind code of ref document:A1


[8]ページ先頭

©2009-2025 Movatter.jp