JP2010016526A - Communication device, encryption communication system, communication method, and communication program - Google Patents

Communication device, encryption communication system, communication method, and communication program Download PDF

Info

Publication number
JP2010016526A
JP2010016526A JP2008173307A JP2008173307A JP2010016526A JP 2010016526 A JP2010016526 A JP 2010016526A JP 2008173307 A JP2008173307 A JP 2008173307A JP 2008173307 A JP2008173307 A JP 2008173307A JP 2010016526 A JP2010016526 A JP 2010016526A
Authority
JP
Japan
Prior art keywords
data
communication device
buffer
transmission
encryption
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
JP2008173307A
Other languages
Japanese (ja)
Other versions
JP4906800B2 (en
Inventor
Manabu Misawa
学 三澤
Tsuneo Sato
恒夫 佐藤
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Mitsubishi Electric Corp
Original Assignee
Mitsubishi Electric Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Mitsubishi Electric Corp filed Critical Mitsubishi Electric Corp
Priority to JP2008173307A priority Critical patent/JP4906800B2/en
Publication of JP2010016526A publication Critical patent/JP2010016526A/en
Application granted granted Critical
Publication of JP4906800B2 publication Critical patent/JP4906800B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Communication Control (AREA)

Abstract

<P>PROBLEM TO BE SOLVED: To suppress increase in the capacity of a transmitting/receiving buffer and increase in the frequency of communication, even for a communication device which performs encryption operation a plurality of times due to long data length. <P>SOLUTION: N blocks can be stored in smaller-capacity one of the following buffers: a transmission buffer A of an encryption communication device A and a receiving buffer B of an encryption communication device B. A control portion 202 of the encryption communication device A sequentially inputs data cut out for every N blocks from the beginning of transmission data into the transmit buffer A. When the size of data having not been input is larger than the size for N blocks while being storable in the smaller-capacity buffer, the data are input into the transmission buffer A at one time. A communication portion 201 of the encryption communication device A transmits data from the transmission buffer A to the encryption communication device B, every time the data are input into the transmission buffer A. <P>COPYRIGHT: (C)2010,JPO&INPIT

Description

本発明は、通信装置及び暗号通信システム及び通信方法及び通信プログラムに関するものである。   The present invention relates to a communication device, a cryptographic communication system, a communication method, and a communication program.

従来の装置では、入力チャネルごとに設けられた入力バッファに入力されたデータを格納し、入力データセレクタを介して、入力バッファに格納されているデータを時分割に演算回路にブロック単位で入力する。演算回路はブロック単位で暗号化(又は復号化)を行う。従来の装置では、共通鍵暗号アルゴリズムを使用することを前提としている。共通鍵暗号アルゴリズムでは、上記のように、ブロックと呼ばれる所定のレングス(例えば、8バイト)のデータを1回の演算で暗号化する。長いデータの場合、データをブロック長ごとに分割して、演算回路を分割数分動作させることで、暗号演算が行われる(例えば、特許文献1参照)。
特開2007−114404号公報(図1)
In the conventional apparatus, data input to an input buffer provided for each input channel is stored, and the data stored in the input buffer is input to the arithmetic circuit in units of blocks in a time division manner via an input data selector. . The arithmetic circuit performs encryption (or decryption) in units of blocks. The conventional apparatus is premised on the use of a common key encryption algorithm. In the common key encryption algorithm, as described above, data of a predetermined length called a block (for example, 8 bytes) is encrypted by one operation. In the case of long data, the cryptographic operation is performed by dividing the data into block lengths and operating the arithmetic circuit by the number of divisions (see, for example, Patent Document 1).
JP 2007-114404 A (FIG. 1)

従来の装置では、チャネルから入力される入力データは、ブロック長の整数倍に限定されている。そのため、入力バッファのレングスよりも長い平文データを暗号化する場合は、チャネルを切り替えて異なる入力バッファにデータを入力し、入力データセレクタで入力バッファを切り替えながら演算を行うことになる。この場合、入力バッファのレングスより入力データのレングスは短く、かつ、入力データのレングスはブロック長の整数倍となる。しかし、入力データのレングスで平文データが割り切れることは稀であり、大抵は端数のレングスのデータが入力データとして入力バッファに入力されることになる。つまり、端数のレングスのデータがある場合、そのレングスがどんなに短くても、ブロック長の整数倍のレングスをもつ入力データを入力バッファへ入力する処理と同じ処理が1回分必要となるという課題があった。   In the conventional apparatus, the input data input from the channel is limited to an integral multiple of the block length. Therefore, when encrypting plaintext data longer than the length of the input buffer, the data is input to a different input buffer by switching the channel, and the calculation is performed while switching the input buffer by the input data selector. In this case, the input data length is shorter than the input buffer length, and the input data length is an integral multiple of the block length. However, it is rare that the plaintext data is divisible by the length of the input data, and the fractional length of data is usually input to the input buffer as input data. In other words, if there is fractional length data, no matter how short the length is, there is a problem that the same processing as that for inputting input data having a length that is an integral multiple of the block length to the input buffer is required once. It was.

また、従来の装置では、入力バッファが複数存在するために、一時的に使用するメモリの容量が多くなるという課題もあった。メモリ量を減らすために、入力バッファを1本にすることも考えられるが、この場合、端数のレングスのデータを入力バッファへ入力する処理の影響が相対的に大きくなり、入力バッファの効率的な使用が難しいという課題が生じる。   In addition, the conventional apparatus has a problem that the capacity of the memory to be temporarily used increases because a plurality of input buffers exist. In order to reduce the amount of memory, it is conceivable to use one input buffer, but in this case, the influence of the process of inputting fractional length data to the input buffer becomes relatively large, and the efficiency of the input buffer is reduced. The problem that it is difficult to use arises.

本発明は、例えば、処理するデータのレングスが長く、複数回暗号演算を行わなければならない通信装置においても、送受信バッファの容量を抑え、かつ、通信回数の増大を抑えることを目的とする。   An object of the present invention is, for example, to suppress the capacity of a transmission / reception buffer and suppress an increase in the number of communication even in a communication apparatus in which the length of data to be processed is long and a cryptographic operation must be performed a plurality of times.

本発明の一の態様に係る通信装置は、
データを他の通信装置へ送信して、前記他の通信装置に対し、当該送信データを一定の大きさのブロックごとに分けて行う所定の処理をさせる通信装置であって、
送信バッファAと、
前記送信バッファAと前記他の通信装置が備える受信バッファBとのうち、容量の小さいバッファに格納できるブロックの数をNとし、前記送信データの先頭からN個のブロックごとに切り出したデータを前記送信バッファAへ順次入力し、前記送信データのうち、前記送信バッファAに未入力のデータがブロックN個分の大きさより大きくても前記容量の小さいバッファに格納できる大きさとなった場合、当該データを前記送信バッファAへ一度に入力する制御部と、
前記制御部から前記送信バッファAへデータが入力される度に、当該データを前記送信バッファAから前記他の通信装置へ送信する通信部とを備えることを特徴とする。
A communication apparatus according to one aspect of the present invention is provided.
A communication device that transmits data to another communication device and causes the other communication device to perform a predetermined process for dividing the transmission data into blocks of a certain size,
Send buffer A;
Of the transmission buffer A and the reception buffer B provided in the other communication device, the number of blocks that can be stored in a small-capacity buffer is N, and the data cut out every N blocks from the top of the transmission data is the data When data is sequentially input to the transmission buffer A, and the data that has not been input to the transmission buffer A is larger than the size of N blocks among the transmission data, the data can be stored in the small capacity buffer. A control unit that inputs the data to the transmission buffer A at a time;
And a communication unit that transmits the data from the transmission buffer A to the other communication device each time data is input from the control unit to the transmission buffer A.

本発明の一の態様によれば、通信装置において、制御部が、送信バッファAと他の通信装置が備える受信バッファBとのうち、容量の小さいバッファに格納できるブロックの数をNとし、送信データの先頭からN個のブロックごとに切り出したデータを送信バッファAへ順次入力し、未入力のデータがブロックN個分の大きさより大きくても容量の小さいバッファに格納できる大きさとなった場合、当該データを送信バッファAへ一度に入力することにより、送受信バッファの容量を抑え、かつ、通信回数の増大を抑えることが可能となる。   According to one aspect of the present invention, in the communication apparatus, the control unit sets N as the number of blocks that can be stored in a buffer having a small capacity among the transmission buffer A and the reception buffer B included in another communication apparatus. When data cut out every N blocks from the top of the data is sequentially input to the transmission buffer A, and the size of the uninput data is larger than the size of N blocks, the size can be stored in a small capacity buffer. By inputting the data to the transmission buffer A at a time, it is possible to suppress the capacity of the transmission / reception buffer and suppress the increase in the number of communications.

以下、本発明の実施の形態について、図を用いて説明する。   Hereinafter, embodiments of the present invention will be described with reference to the drawings.

実施の形態1.
本実施の形態について図1を参照し説明する。図1は、本実施の形態における暗号通信システム100が備える通信装置200a,200bの構成図である。以下、通信装置200aを暗号通信装置A、通信装置200bを暗号通信装置Bという。
Embodiment 1 FIG.
This embodiment will be described with reference to FIG. FIG. 1 is a configuration diagram of communication apparatuses 200a and 200b included in the cryptographic communication system 100 according to the present embodiment. Hereinafter, the communication device 200a is referred to as an encryption communication device A, and the communication device 200b is referred to as an encryption communication device B.

図1において、暗号通信装置A及び暗号通信装置Bは、共に、通信部201、制御部202、不揮発メモリ203を備えている。暗号通信装置Bは、さらに、乱数生成器204、暗号処理部205を備えている。暗号通信装置A及び暗号通信装置Bは、それぞれ1つもしくは複数のマイコン(マイクロコンピュータ)などで構成されている。   In FIG. 1, both the encryption communication device A and the encryption communication device B include a communication unit 201, a control unit 202, and a nonvolatile memory 203. The cryptographic communication device B further includes a random number generator 204 and a cryptographic processing unit 205. Each of the encryption communication device A and the encryption communication device B is configured by one or a plurality of microcomputers (microcomputers).

通信部201は、暗号通信装置Aでは送信バッファA及び受信バッファAを用いて、暗号通信装置Bでは送信バッファB及び受信バッファBを用いて、通信データ101の送受信を行う。通信部201は、例えば、スマートカード用の接触式インタフェースや非接触式インタフェース、パラレルインタフェース、シリアルインタフェース、IEEE(Institute・of・Electrical・and・Electronics・Engineers)1394やUSB(Universal・Serial・Bus)などの有線インタフェース、赤外線通信、Bluetooth(登録商標)、無線LAN(ローカルエリアネットワーク)、DSRC(Dedicated・Short・Range・Communication)、携帯電話などの無線インタフェースを実装したものである。制御部202は、通信部201で受信した通信データ101を解読し、又は、送信する通信データ101(送信データ)を生成し、装置全体を制御する。制御部202は、CPU(Central・Processing・Unit)やロジック回路、シーケンスROM(Read・Only・Memory)などで構成される。不揮発メモリ203は、暗号化処理時に使用する鍵などの秘密情報を記憶する。乱数生成器204は、暗号化処理で使用する乱数を生成する。暗号処理部205は、不揮発メモリ203に記憶された鍵などの秘密情報や乱数生成器204で生成された乱数を使用して通信データ101を暗号化又は復号化する。   The communication unit 201 performs transmission / reception of the communication data 101 using the transmission buffer A and the reception buffer A in the encryption communication apparatus A and using the transmission buffer B and the reception buffer B in the encryption communication apparatus B. The communication unit 201 includes, for example, a smart card contact interface, a non-contact interface, a parallel interface, a serial interface, IEEE (Institut of Electrical Engineering and Electronics Engineers) 1394, and USB (Universal Serial Bus). Wireless interfaces such as wired interfaces such as, infrared communication, Bluetooth (registered trademark), wireless LAN (local area network), DSRC (Dedicated Short Range Communication), and mobile phones. The control unit 202 decodes the communication data 101 received by the communication unit 201 or generates communication data 101 (transmission data) to be transmitted, and controls the entire apparatus. The control unit 202 includes a CPU (Central Processing Unit), a logic circuit, a sequence ROM (Read Only Only Memory), and the like. The nonvolatile memory 203 stores secret information such as a key used at the time of encryption processing. The random number generator 204 generates a random number used in the encryption process. The encryption processing unit 205 encrypts or decrypts the communication data 101 using secret information such as a key stored in the nonvolatile memory 203 or a random number generated by the random number generator 204.

以下では、暗号機能のない通信装置200aである暗号通信装置Aが、他の通信装置200bである暗号通信装置Bにブロック暗号によるデータの暗号化を依頼する場合を想定して説明を行う。つまり、以下では、暗号通信装置Aは、データを暗号通信装置Bへ送信して、暗号通信装置Bに対し、当該送信データのブロック暗号による暗号化処理をさせるものとする。ブロック暗号による暗号化処理は、送信データを一定の大きさのブロックごとに分けて行う所定の処理の一例である。   In the following description, it is assumed that the encryption communication device A, which is a communication device 200a having no encryption function, requests encryption encryption device B, which is another communication device 200b, to encrypt data using block encryption. That is, hereinafter, it is assumed that the encryption communication device A transmits data to the encryption communication device B, and causes the encryption communication device B to perform encryption processing of the transmission data by block encryption. The encryption process using the block cipher is an example of a predetermined process in which transmission data is divided into blocks each having a certain size.

図2は、暗号通信装置Aが暗号通信装置Bにデータの暗号化を依頼して、暗号通信装置Bがデータの暗号化を行う際に、暗号通信装置A及び暗号通信装置Bにおいて、データの受け渡しを行う主なHW(ハードウェア)の構成要素を示すブロック図である。   FIG. 2 shows that when the encryption communication device A requests the encryption communication device B to encrypt the data and the encryption communication device B encrypts the data, the encryption communication device A and the encryption communication device B It is a block diagram which shows the component of main HW (hardware) which performs delivery.

図2において、送信データメモリ211、受信データメモリ212は、暗号通信装置Aの不揮発メモリ203又はその一部である。送信バッファA、受信バッファAは、前述したように、それぞれ暗号通信装置Aの通信部201の一部である。ブロック入力部213、暗号演算部214、ブロック出力部215は、それぞれ暗号通信装置Bの暗号処理部205の一部である。受信バッファB、送信バッファBは、前述したように、それぞれ暗号通信装置Bの通信部201の一部である。   In FIG. 2, a transmission data memory 211 and a reception data memory 212 are the nonvolatile memory 203 of the encryption communication apparatus A or a part thereof. The transmission buffer A and the reception buffer A are each part of the communication unit 201 of the encryption communication device A as described above. The block input unit 213, the cryptographic operation unit 214, and the block output unit 215 are each part of the cryptographic processing unit 205 of the cryptographic communication device B. As described above, the reception buffer B and the transmission buffer B are part of the communication unit 201 of the encryption communication device B, respectively.

暗号化(又は復号化)されるデータは、送信データメモリ211に格納されている。暗号化されるデータは大きいので、暗号通信装置Aの制御部202は、送信バッファAに全てのデータを移すことはできず、数回に分けてデータを移すことになる。つまり、暗号通信装置Aの制御部202は、分割したデータを送信バッファAに順番に入力していく。暗号通信装置Aの通信部201は、送信バッファAから受信バッファBにデータを送信する。暗号通信装置Bの暗号処理部205では、共通鍵暗号アルゴリズムを使用するので、ブロックという単位でしかデータを受け付けることができない。ブロック入力部213、ブロック出力部215はブロックのインタフェースである。ブロックのレングスは、受信バッファBのレングスより小さいので、暗号通信装置Bの暗号処理部205には何回かに分けてデータが送られることになる。ブロック入力部213に入力されたデータは、暗号演算部214で暗号化され、ブロック出力部215を介して、送信バッファBに格納される。受信バッファBにあるデータが全て暗号化されると、暗号通信装置Bの通信部201は、送信バッファBに格納されたデータを受信バッファAに送信する。暗号通信装置Aの制御部202は、受信バッファAのデータを受信データメモリ212に格納する。暗号通信装置Aが、データを送信バッファAに入力してから暗号化されたデータを受信バッファAで受け取るまでの処理を、データの分割数分繰り返すことで、全てのデータが暗号化されて、受信データメモリ212に格納されることになる。   Data to be encrypted (or decrypted) is stored in the transmission data memory 211. Since the data to be encrypted is large, the control unit 202 of the encryption communication device A cannot transfer all the data to the transmission buffer A, and transfers the data in several times. That is, the control unit 202 of the encryption communication apparatus A inputs the divided data to the transmission buffer A in order. The communication unit 201 of the encryption communication device A transmits data from the transmission buffer A to the reception buffer B. Since the encryption processing unit 205 of the encryption communication apparatus B uses a common key encryption algorithm, it can accept data only in units of blocks. The block input unit 213 and the block output unit 215 are block interfaces. Since the length of the block is smaller than the length of the reception buffer B, the data is sent to the cryptographic processing unit 205 of the cryptographic communication apparatus B in several times. Data input to the block input unit 213 is encrypted by the cryptographic operation unit 214 and stored in the transmission buffer B via the block output unit 215. When all the data in the reception buffer B is encrypted, the communication unit 201 of the encryption communication device B transmits the data stored in the transmission buffer B to the reception buffer A. The control unit 202 of the encryption communication device A stores the data of the reception buffer A in the reception data memory 212. The encryption communication device A repeats the process from the input of data to the transmission buffer A until the reception of the encrypted data by the reception buffer A, so that all the data is encrypted, It is stored in the reception data memory 212.

図3は、通信装置200a,200b、即ち、暗号通信装置A、暗号通信装置Bそれぞれのハードウェア構成の一例を示す図である。   FIG. 3 is a diagram illustrating an example of a hardware configuration of each of the communication devices 200a and 200b, that is, the encryption communication device A and the encryption communication device B.

図3において、暗号通信装置A、暗号通信装置Bは、主にマイコンなどのコンピュータで構成されており、LCD(液晶ディスプレイ)などの表示画面を有する表示装置901、操作キー902、操作ボタン903などのハードウェアを備え、これらはケーブルや信号線で接続されている。   In FIG. 3, an encryption communication device A and an encryption communication device B are mainly composed of a computer such as a microcomputer, and a display device 901 having a display screen such as an LCD (liquid crystal display), operation keys 902, operation buttons 903, and the like. These are connected by cables and signal lines.

暗号通信装置A、暗号通信装置Bは、プログラムを実行するCPU911を備えている。CPU911は、プロセッサの一例である。CPU911は、バス912を介してROM913、RAM914(Random・Access・Memory)、通信ボード915、表示装置901、操作キー902、操作ボタン903、磁気ディスク装置920と接続され、これらのハードウェアデバイスを制御する。磁気ディスク装置920の代わりに、フラッシュメモリ、メモリカードリーダライタなどの記憶媒体が用いられてもよい。   The encryption communication device A and the encryption communication device B include a CPU 911 that executes a program. The CPU 911 is an example of a processor. The CPU 911 is connected to the ROM 913, the RAM 914 (Random / Access / Memory), the communication board 915, the display device 901, the operation key 902, the operation button 903, and the magnetic disk device 920 via the bus 912, and controls these hardware devices. To do. Instead of the magnetic disk device 920, a storage medium such as a flash memory or a memory card reader / writer may be used.

RAM914は、揮発メモリの一例である。ROM913、磁気ディスク装置920の記憶媒体は、不揮発メモリ203の一例である。これらは、メモリの一例である。通信ボード915、操作キー902、操作ボタン903などは、入力装置の一例である。また、通信ボード915、表示装置901などは、出力装置の一例である。   The RAM 914 is an example of a volatile memory. The storage media of the ROM 913 and the magnetic disk device 920 are an example of the nonvolatile memory 203. These are examples of memories. A communication board 915, operation keys 902, operation buttons 903, and the like are examples of an input device. The communication board 915, the display device 901, and the like are examples of output devices.

通信ボード915は、有線又は無線LAN、移動通信ネットワーク、DSRCネットワークなどに接続される。通信ボード915は、インターネット、あるいは、IP−VPN(Internet・Protocol・Virtual・Private・Network)、広域LAN、ATM(Asynchronous・Transfer・Mode)ネットワークなどのWAN(ワイドエリアネットワーク)などに接続されていても構わない。LAN、移動通信ネットワーク、DSRCネットワーク、インターネット、WANは、いずれもネットワークの一例である。   The communication board 915 is connected to a wired or wireless LAN, a mobile communication network, a DSRC network, or the like. The communication board 915 is connected to the Internet or a WAN (wide area network) such as an IP-VPN (Internet, Protocol, Virtual, Private, Network), a wide area LAN, and an ATM (Asynchronous, Transfer, Mode) network. It doesn't matter. A LAN, a mobile communication network, a DSRC network, the Internet, and a WAN are all examples of networks.

磁気ディスク装置920には、オペレーティングシステム921(OS)、ウィンドウシステム922、プログラム群923、ファイル群924が記憶されている。プログラム群923のプログラムは、CPU911、オペレーティングシステム921、ウィンドウシステム922により実行される。プログラム群923には、本実施の形態の説明において「〜部」として説明する機能を実行するプログラムが記憶されている。プログラムは、CPU911により読み出され実行される。また、ファイル群924には、本実施の形態の説明において、「〜データ」、「〜情報」、「〜ID(識別子)」、「〜フラグ」、「〜結果」として説明するデータや情報や信号値や変数値やパラメータが、「〜ファイル」や「〜データベース」や「〜テーブル」の各項目として記憶されている。「〜ファイル」や「〜データベース」や「〜テーブル」は、ディスクやメモリなどの記憶媒体に記憶される。ディスクやメモリなどの記憶媒体に記憶されたデータや情報や信号値や変数値やパラメータは、読み書き回路を介してCPU911によりメインメモリやキャッシュメモリに読み出され、抽出・検索・参照・比較・演算・計算・制御・出力・印刷・表示などのCPU911の処理(動作)に用いられる。抽出・検索・参照・比較・演算・計算・制御・出力・印刷・表示などのCPU911の処理中、データや情報や信号値や変数値やパラメータは、メインメモリやキャッシュメモリやバッファメモリに一時的に記憶される。   The magnetic disk device 920 stores an operating system 921 (OS), a window system 922, a program group 923, and a file group 924. The programs in the program group 923 are executed by the CPU 911, the operating system 921, and the window system 922. The program group 923 stores a program for executing a function described as “˜unit” in the description of the present embodiment. The program is read and executed by the CPU 911. The file group 924 includes data and information described as “˜data”, “˜information”, “˜ID (identifier)”, “˜flag”, and “˜result” in the description of this embodiment. Signal values, variable values, and parameters are stored as items of “˜file”, “˜database”, and “˜table”. The “˜file”, “˜database”, and “˜table” are stored in a storage medium such as a disk or a memory. Data, information, signal values, variable values, and parameters stored in a storage medium such as a disk or memory are read out to the main memory or cache memory by the CPU 911 via a read / write circuit, and extracted, searched, referenced, compared, and calculated. Used for processing (operation) of the CPU 911 such as calculation / control / output / printing / display. Data, information, signal values, variable values, and parameters are temporarily stored in the main memory, cache memory, and buffer memory during processing of the CPU 911 such as extraction, search, reference, comparison, calculation, control, output, printing, and display. Is remembered.

また、本実施の形態の説明において用いるブロック図やフローチャートの矢印の部分は主としてデータや信号の入出力を示し、データや信号は、RAM914、フラッシュメモリなどのメモリ、磁気ディスク装置920の磁気ディスクなどの記録媒体に記録される。また、データや信号は、バス912や信号線やケーブルその他の伝送媒体により伝送される。   In addition, the arrows in the block diagrams and flowcharts used in the description of the present embodiment mainly indicate input / output of data and signals. The data and signals are RAM 914, memory such as flash memory, magnetic disk of magnetic disk device 920, and the like. Recorded on the recording medium. Data and signals are transmitted by a bus 912, a signal line, a cable, and other transmission media.

また、本実施の形態の説明において「〜部」として説明するものは、「〜回路」、「〜装置」、「〜機器」であってもよく、また、「〜ステップ」、「〜工程」、「〜手順」、「〜処理」であってもよい。即ち、「〜部」として説明するものは、ROM913に記憶されたファームウェアで実現されていても構わない。あるいは、ソフトウェアのみ、あるいは、素子・デバイス・基板・配線などのハードウェアのみ、あるいは、ソフトウェアとハードウェアとの組み合わせ、さらには、ファームウェアとの組み合わせで実現されていても構わない。ファームウェアとソフトウェアは、プログラムとして、磁気ディスク、フラッシュメモリなどの記録媒体に記憶される。このプログラムはCPU911により読み出され、CPU911により実行される。即ち、プログラムは、本実施の形態の説明で述べる「〜部」としてコンピュータを機能させるものである。あるいは、本実施の形態の説明で述べる「〜部」の手順や方法をコンピュータに実行させるものである。   In addition, what is described as “˜unit” in the description of this embodiment may be “˜circuit”, “˜device”, “˜device”, and “˜step”, “˜process”. , “˜procedure”, and “˜processing”. That is, what is described as “˜unit” may be realized by firmware stored in the ROM 913. Alternatively, it may be realized only by software, or only by hardware such as an element, a device, a board, and wiring, or a combination of software and hardware, and further by a combination of firmware. Firmware and software are stored as programs in a recording medium such as a magnetic disk or a flash memory. This program is read by the CPU 911 and executed by the CPU 911. That is, the program causes the computer to function as “to part” described in the description of the present embodiment. Alternatively, it causes the computer to execute the procedures and methods described in the description of the present embodiment.

次に、処理フローについて説明する。   Next, the processing flow will be described.

図4は本実施の形態の処理フロー(本実施の形態に係る通信方法)を示すフローチャートである。   FIG. 4 is a flowchart showing a processing flow (communication method according to the present embodiment) of the present embodiment.

図4において、ステップS101では、後述する送受信パラメータ設定処理が行われる。この処理では、効率よく送受信を行うために、暗号通信装置Aと暗号通信装置Bの送受信パラメータが設定される。ついで、ステップS102では、後述するデータ暗号化処理が行われる。この処理では、送受信パラメータに基づく通信が繰り返され、長大なデータの暗号化が行われる。   4, in step S101, a transmission / reception parameter setting process described later is performed. In this process, the transmission / reception parameters of the encryption communication device A and the encryption communication device B are set in order to perform efficient transmission / reception. In step S102, data encryption processing described later is performed. In this process, communication based on transmission / reception parameters is repeated, and long data is encrypted.

次に、前述したステップS101の送受信パラメータ設定処理の詳細について、図5を参照して説明する。   Next, details of the transmission / reception parameter setting processing in step S101 described above will be described with reference to FIG.

ステップS111で暗号通信装置Aの制御部202は、暗号通信装置Aの通信部201を介して、暗号通信装置A自身の受信バッファAのレングスを暗号通信装置Bに送る。ステップS112で暗号通信装置Bの制御部202は、暗号通信装置Bの通信部201を介して、そのレングスを受け取る。一方、ステップS113で暗号通信装置Bの制御部202は、暗号通信装置Bの通信部201を介して、暗号通信装置B自身の受信バッファBのレングスを暗号通信装置Aに送る。ステップS114で暗号通信装置Aの制御部202は、暗号通信装置Aの通信部201を介して、そのレングスを受け取る。この処理により、暗号通信装置A、暗号通信装置Bは、相互の受信バッファのレングスを不揮発メモリ203にて共有することができる。なお、暗号通信装置A、暗号通信装置Bは、自身の送信バッファ及び受信バッファのレングスを予め不揮発メモリ203に記憶しているものとする。   In step S111, the control unit 202 of the encryption communication device A sends the length of the reception buffer A of the encryption communication device A itself to the encryption communication device B via the communication unit 201 of the encryption communication device A. In step S112, the control unit 202 of the encryption communication device B receives the length via the communication unit 201 of the encryption communication device B. On the other hand, in step S113, the control unit 202 of the encryption communication device B sends the length of the reception buffer B of the encryption communication device B itself to the encryption communication device A via the communication unit 201 of the encryption communication device B. In step S114, the control unit 202 of the encryption communication device A receives the length via the communication unit 201 of the encryption communication device A. Through this process, the encryption communication device A and the encryption communication device B can share the length of the mutual reception buffer in the nonvolatile memory 203. It is assumed that the cryptographic communication device A and the cryptographic communication device B store the lengths of their transmission buffers and reception buffers in the nonvolatile memory 203 in advance.

このように、本実施の形態において、暗号通信装置Aの不揮発メモリ203は、送信バッファA及び受信バッファAの容量を予め記憶する。暗号通信装置Aの制御部202は、暗号通信装置Bから受信バッファBの容量を通知され、受信バッファBの容量も暗号通信装置Aの不揮発メモリ203に記憶される。また、暗号通信装置Bの不揮発メモリ203は、送信バッファB及び受信バッファBの容量を予め記憶する。暗号通信装置Bの制御部202は、暗号通信装置Aから受信バッファAの容量を通知され、受信バッファAの容量も暗号通信装置Bの不揮発メモリ203に記憶される。   As described above, in the present embodiment, the nonvolatile memory 203 of the encryption communication device A stores the capacities of the transmission buffer A and the reception buffer A in advance. The control unit 202 of the encryption communication device A is notified of the capacity of the reception buffer B from the encryption communication device B, and the capacity of the reception buffer B is also stored in the nonvolatile memory 203 of the encryption communication device A. Further, the non-volatile memory 203 of the encryption communication device B stores the capacities of the transmission buffer B and the reception buffer B in advance. The control unit 202 of the encryption communication device B is notified of the capacity of the reception buffer A from the encryption communication device A, and the capacity of the reception buffer A is also stored in the nonvolatile memory 203 of the encryption communication device B.

ステップS115では、暗号通信装置Aの制御部202は、受信バッファBのレングス、送信バッファAのレングスのうち、最小のレングスを選択する。さらに、暗号通信装置Aの制御部202は、この最小のレングスを共通鍵アルゴリズムのブロックのレングスで割った整数部を送信ブロック数Aとする。ここで、最小のレングスは、ブロックのレングスより大きいと仮定する。同様にして、ステップS116でも、暗号通信装置Bの制御部202は、受信バッファAのレングス、送信バッファBのレングスのうち、最小のレングスを選択する。さらに、暗号通信装置Bの制御部202は、この最小のレングスを共通鍵アルゴリズムのブロックのレングスで割った整数部を送信ブロック数Bとする。ついで、ステップS117、S118において、各通信装置の制御部202は、通信部201を介して、送信ブロック数A、送信ブロック数Bを相互に送信して、そのうちの小さい方を送信ブロック数(共通)Nとして各々選択する。ステップS119では、暗号通信装置Aの制御部202は、送信ブロック数(共通)Nとブロックのレングスをかけたレングス値と、受信バッファBのレングス、送信バッファAのレングスのうち、最小のレングスとの差Saを求める。この差Saは、送信ブロック数(共通)Nのデータを暗号通信装置Bに送った際に、受信バッファB、送信バッファAのうち、小さい方で使用されないバッファのレングスに等しい。暗号通信装置Aの制御部202は、送信ブロック数(共通)Nと差Saを送受信パラメータとして設定する。ステップS120では、暗号通信装置Bの制御部202は、送信ブロック数(共通)Nとブロックのレングスをかけたレングス値と、受信バッファAのレングス、送信バッファBのレングスのうち、最小のレングスとの差Sbを求める。この差Sbは、送信ブロック数(共通)Nのデータを暗号通信装置Aに送った際に、受信バッファA、送信バッファBのうち、小さい方で使用されないバッファのレングスに等しい。暗号通信装置Bの制御部202は、送信ブロック数(共通)Nと差Sbを送受信パラメータとして設定する。   In step S115, the control unit 202 of the encryption communication device A selects the minimum length among the length of the reception buffer B and the length of the transmission buffer A. Further, the control unit 202 of the cryptographic communication apparatus A sets the integer part obtained by dividing the minimum length by the block length of the common key algorithm as the transmission block number A. Here, it is assumed that the minimum length is larger than the block length. Similarly, also in step S116, the control unit 202 of the encryption communication device B selects the minimum length among the length of the reception buffer A and the length of the transmission buffer B. Further, the control unit 202 of the cryptographic communication apparatus B sets the integer part obtained by dividing the minimum length by the block length of the common key algorithm as the transmission block number B. Next, in steps S117 and S118, the control unit 202 of each communication apparatus transmits the transmission block number A and the transmission block number B to each other via the communication unit 201, and the smaller one is transmitted as the number of transmission blocks (common). ) Select each as N. In step S119, the control unit 202 of the encryption communication apparatus A determines the minimum length among the number of transmission blocks (common) N and the length value obtained by multiplying the length of the block, the length of the reception buffer B, and the length of the transmission buffer A. Difference Sa is obtained. This difference Sa is equal to the length of the buffer that is not used in the smaller one of the reception buffer B and the transmission buffer A when the transmission block number (common) N data is sent to the encryption communication device B. The control unit 202 of the encryption communication apparatus A sets the number of transmission blocks (common) N and the difference Sa as transmission / reception parameters. In step S120, the control unit 202 of the encryption communication device B determines the minimum length among the number of transmission blocks (common) N and the length value obtained by multiplying the block length, the length of the reception buffer A, and the length of the transmission buffer B. The difference Sb is obtained. This difference Sb is equal to the length of the buffer that is not used in the smaller one of the reception buffer A and the transmission buffer B when the transmission block number (common) N data is sent to the encryption communication device A. The control unit 202 of the encryption communication device B sets the number of transmission blocks (common) N and the difference Sb as transmission / reception parameters.

このように、本実施の形態において、暗号通信装置Aの制御部202、及び、暗号通信装置Bの制御部202は、送信バッファAと受信バッファAと受信バッファBと送信バッファBとのうち、容量の最も小さいバッファに格納できるブロックの最大数をNとする(格納できるブロックの最大数より小さい数をNとしても本実施の形態は適用可能であるが、格納できるブロックの最大数をNとすることが望ましい)。例えば、送信バッファA、受信バッファA、受信バッファB、送信バッファBの容量が、順番に20バイト、40バイト、30バイト、30バイトであるとき、ブロック1個分の大きさを8バイトとすると、N=2となる(N=1としても本実施の形態は適用可能であるが、N=2とすることが望ましい)。Nを求めるために、暗号通信装置Aの制御部202は、不揮発メモリ203に記憶された送信バッファAの容量と暗号通信装置Bから通知された受信バッファBの容量とのうち、最小値をブロック1個分の大きさで除算する。このとき、商は、送信バッファAと受信バッファBとのうち、容量の小さいバッファに格納できるブロックの最大数Aに相当する。上記の例では、A=2となる(このとき、Sa=4バイトとなる)。また、暗号通信装置Bの制御部202は、不揮発メモリ203に記憶された送信バッファBの容量と暗号通信装置Aから通知された受信バッファAの容量とのうち、最小値をブロック1個分の大きさで除算する。このとき、商は、送信バッファBと受信バッファAとのうち、容量の小さいバッファに格納できるブロックの最大数Bに相当する。上記の例では、B=3となる(このとき、Sb=6バイトとなる)。本実施の形態では、このような場合、AとBとの最小値をとって、N=2としている。つまり、暗号通信装置Aが暗号通信装置Bへデータを送信する場合と暗号通信装置Aが暗号通信装置Bからデータを受信する場合とで、Nは共通する。しかしながら、2つの場合でNを別々に設定してもよい。つまり、暗号通信装置Aが暗号通信装置Bへデータを送信する場合は、N=Aとし(NをAより小さい値にしてもよいが、N=Aとすることが望ましい)、暗号通信装置Aが暗号通信装置Bからデータを受信する場合は、N=Bとしてもよい(NをBより小さい値にしてもよいが、N=Bとすることが望ましい)。このようにすることで、例えば暗号通信装置Bの暗号処理部205に入力されるデータのブロック数と当該データが暗号化されたデータのブロック数とが異なる場合に、メモリ容量をより効率的に利用することが可能となる。   Thus, in the present embodiment, the control unit 202 of the encryption communication device A and the control unit 202 of the encryption communication device B include the transmission buffer A, the reception buffer A, the reception buffer B, and the transmission buffer B. The maximum number of blocks that can be stored in the buffer having the smallest capacity is N (this embodiment can be applied even if the number smaller than the maximum number of blocks that can be stored is N, but the maximum number of blocks that can be stored is N. Preferably). For example, when the capacity of the transmission buffer A, the reception buffer A, the reception buffer B, and the transmission buffer B is 20 bytes, 40 bytes, 30 bytes, and 30 bytes in order, the size of one block is 8 bytes. N = 2 (this embodiment can be applied even if N = 1, but N = 2 is desirable). In order to obtain N, the control unit 202 of the encryption communication device A blocks the minimum value of the capacity of the transmission buffer A stored in the nonvolatile memory 203 and the capacity of the reception buffer B notified from the encryption communication device B. Divide by one size. At this time, the quotient corresponds to the maximum number A of blocks that can be stored in a buffer having a small capacity among the transmission buffer A and the reception buffer B. In the above example, A = 2 (At this time, Sa = 4 bytes). In addition, the control unit 202 of the encryption communication device B sets the minimum value for one block between the capacity of the transmission buffer B stored in the nonvolatile memory 203 and the capacity of the reception buffer A notified from the encryption communication device A. Divide by size. At this time, the quotient corresponds to the maximum number B of blocks that can be stored in a buffer having a small capacity among the transmission buffer B and the reception buffer A. In the above example, B = 3 (At this time, Sb = 6 bytes). In this embodiment, in such a case, the minimum value of A and B is taken and N = 2. That is, N is common in the case where the encryption communication device A transmits data to the encryption communication device B and the case where the encryption communication device A receives data from the encryption communication device B. However, N may be set separately in the two cases. That is, when the encryption communication device A transmits data to the encryption communication device B, N = A (N may be a value smaller than A, but N = A is desirable), and the encryption communication device A May receive data from the encryption communication device B, N = B (N may be smaller than B, but N = B is desirable). In this way, for example, when the number of blocks of data input to the encryption processing unit 205 of the encryption communication device B is different from the number of blocks of data obtained by encrypting the data, the memory capacity is more efficiently increased. It can be used.

図5の送受信パラメータ設定処理を行うことにより、暗号通信装置Aには、送信ブロック数(共通)Nと差Saが設定され、暗号通信装置Bには、送信ブロック数(共通)Nと差Sbが設定されることになる。   By performing the transmission / reception parameter setting process of FIG. 5, the number of transmission blocks (common) N and the difference Sa are set in the encryption communication device A, and the number of transmission blocks (common) N and the difference Sb are set in the encryption communication device B. Will be set.

次に、前述したステップS102のデータ暗号化処理の詳細について、図6を参照して説明する。データ暗号化処理は、主にデータの送受信と暗号演算(暗号化又は復号化)の処理からなるもので、前述した送受信パラメータ設定処理以後に行われる。   Next, details of the data encryption processing in step S102 described above will be described with reference to FIG. The data encryption processing mainly includes data transmission / reception and cryptographic computation (encryption or decryption) processing, and is performed after the above-described transmission / reception parameter setting processing.

ステップS151で、暗号通信装置Aの制御部202は、暗号通信装置Aの通信部201を介して、暗号通信装置Bに向けて暗号演算コマンドを送信する。暗号演算コマンドは、暗号演算を開始する旨の通知で、その他、使用する鍵番号や暗号アルゴリズムを指定する番号、これから送るデータのレングスなどが必要に応じて付加されている。ステップS152で暗号演算コマンドは、暗号通信装置Bの通信部201を介して、暗号通信装置Bの制御部202によって受信され、暗号通信装置Bの制御部202では、そのコマンドが指示する設定が行われる。例えば、鍵番号に対応する鍵を設定する、使用する暗号アルゴリズムを選択するなどである。   In step S151, the control unit 202 of the cryptographic communication apparatus A transmits a cryptographic operation command to the cryptographic communication apparatus B via the communication unit 201 of the cryptographic communication apparatus A. The cipher operation command is a notification that the cipher operation is started, and a key number to be used, a number for specifying an encryption algorithm, a length of data to be transmitted, and the like are added as necessary. In step S152, the cryptographic operation command is received by the control unit 202 of the cryptographic communication device B via the communication unit 201 of the cryptographic communication device B, and the control unit 202 of the cryptographic communication device B performs the setting indicated by the command. Is called. For example, a key corresponding to the key number is set, and an encryption algorithm to be used is selected.

ついで、暗号通信装置Aでは、ステップS153で制御部202がデータ送信を開始する。ステップS154で、暗号通信装置Aの制御部202は、図2で示した送信データメモリ211から送信バッファAにデータを分割して移す。このとき、暗号通信装置Aの制御部202は、設定されている送信ブロック数(共通)Nと差Saと未送信データレングスDの関係に従って下記(ア)〜(エ)のいずれかの手順を実行し、データを送信データメモリ211から送信バッファAに移す。なお、未送信データレングスとは、送るべきデータのレングスから、送信したデータのレングスを引いたものをいう。ステップS155では、暗号通信装置Aの通信部201は、送信バッファAの分割データを暗号通信装置Bに送る。   Next, in the encryption communication device A, the control unit 202 starts data transmission in step S153. In step S154, the control unit 202 of the encryption communication device A divides the data from the transmission data memory 211 shown in FIG. At this time, the control unit 202 of the encryption communication apparatus A performs any of the following procedures (A) to (D) according to the relationship between the set number of transmission blocks (common) N, the difference Sa, and the untransmitted data length D. The data is transferred from the transmission data memory 211 to the transmission buffer A. The untransmitted data length is a length obtained by subtracting the length of transmitted data from the length of data to be transmitted. In step S155, the communication unit 201 of the encryption communication device A sends the divided data in the transmission buffer A to the encryption communication device B.

以下では、ブロック数をM、ブロックレングス(1ブロックのレングス)をL、端数をHとする。前述したように、Nは送信ブロック数(共通)、Saは差、Dは未送信データレングスである。   In the following, the number of blocks is M, the block length (length of one block) is L, and the fraction is H. As described above, N is the number of transmission blocks (common), Sa is a difference, and D is an untransmitted data length.

(ア)D≧N・L+Saの場合
M=N、H=0とする。即ち、暗号通信装置Aの制御部202は、送信ブロック数(共通)NだけデータをステップS154で分割し、送信バッファAに移す。そして、暗号通信装置Aの通信部201は、送信バッファAに移された分割データをステップS155で送信する。
(A) When D ≧ N · L + Sa M = N and H = 0. That is, the control unit 202 of the encryption communication apparatus A divides the data by the number of transmission blocks (common) N in step S154 and moves the data to the transmission buffer A. Then, the communication unit 201 of the encryption communication apparatus A transmits the divided data transferred to the transmission buffer A in step S155.

(イ)N・L+Sa>D≧N・Lの場合
M=N+FLOOR(Sa/L)、H=D−M・Lとする。ここで、FLOOR(X)というとき、これはXを超えない最大の整数を示す。この場合は、送信バッファAと暗号通信装置Bの受信バッファBとのうち、レングスが短いバッファの余裕(N個のブロックを格納したときの空き容量、即ち、Sa)の範囲内の未送信データであれば、暗号通信装置Aの制御部202は、送信ブロック数(共通)Nを超えても、未送信データ全てをステップS154で分割し(取り出し)、送信バッファAに移す。そして、暗号通信装置Aの通信部201は、送信バッファAに移された分割データをステップS155で送信する。
(A) When N · L + Sa> D ≧ N · L, M = N + FLOOR (Sa / L), and H = D−M · L. Here, when it is referred to as FLOOR (X), this indicates a maximum integer not exceeding X. In this case, of the transmission buffer A and the reception buffer B of the encryption communication device B, untransmitted data within the range of a short buffer (free capacity when N blocks are stored, that is, Sa) Then, even if the number of transmission blocks (common) N is exceeded, the control unit 202 of the encryption communication apparatus A divides (extracts) all untransmitted data in step S154 and moves it to the transmission buffer A. Then, the communication unit 201 of the encryption communication apparatus A transmits the divided data transferred to the transmission buffer A in step S155.

(ウ)N・L>D>0の場合
M=FLOOR(D/L)、H=D−M・Lとする。この場合、暗号通信装置Aの制御部202は、未送信データ全てをステップS154で分割し(取り出し)、送信バッファAに移す。そして、暗号通信装置Aの通信部201は、送信バッファAに移された分割データをステップS155で送信する。
(C) When N · L>D> 0: M = FLOOR (D / L) and H = D−M · L. In this case, the control unit 202 of the encryption communication device A divides (unloads) all untransmitted data in step S154 and moves it to the transmission buffer A. Then, the communication unit 201 of the encryption communication apparatus A transmits the divided data transferred to the transmission buffer A in step S155.

(エ)D=0の場合
暗号通信装置Aの制御部202は、送信をやめる。
(D) When D = 0 The control unit 202 of the encryption communication device A stops transmission.

暗号通信装置Bでは、通信部201がステップS156で分割データを受信すると、制御部202がステップS157で当該分割データ(受信データ)を1ブロックずつ分割する。そして、暗号処理部205がステップS158で暗号演算を行う。ステップS159の暗号演算結果は、ブロックのレングスの結果になる。即ち、1ブロックの暗号化データとなる。暗号通信装置Bの制御部202は、この暗号化データを受け取り、ステップS160で送信バッファBに格納する。暗号通信装置Bでは、ステップS157からステップS160の処理が、受信データが全て暗号演算されるまで繰り返される。図6では、この繰り返しの範囲を「繰り返し単位1」で示した。   In the encryption communication device B, when the communication unit 201 receives the divided data in step S156, the control unit 202 divides the divided data (received data) block by block in step S157. In step S158, the cryptographic processing unit 205 performs cryptographic computation. The result of the cryptographic operation in step S159 is the result of the block length. That is, one block of encrypted data is obtained. The control unit 202 of the encryption communication device B receives this encrypted data and stores it in the transmission buffer B in step S160. In the cryptographic communication device B, the processing from step S157 to step S160 is repeated until all received data is cryptographically computed. In FIG. 6, this repeating range is indicated by “repeating unit 1”.

ここで、「繰り返し単位1」の繰り返し数について述べる前に、図7に示す本実施の形態におけるデータ送信のフォーマットについて説明する。   Here, before describing the number of repetitions of “repetition unit 1”, the format of data transmission in the present embodiment shown in FIG. 7 will be described.

図7において、ヘッダ301には、暗号演算用のデータであることを示す識別子、最初に送られるデータであることを示す識別子、最後のデータであることを示す識別子が含まれる。ブロック数302には、通常は、送信ブロック数(共通)Nが設定されるが、最後のデータでは、送信ブロック数(共通)Nより小さい値となる場合がある。端数303は、ブロックレングスに満たないデータのレングスを示す。データ304には、ブロック数302と端数303を合わせたレングスをもつデータが格納される。   In FIG. 7, a header 301 includes an identifier indicating that the data is for cryptographic operation, an identifier indicating that the data is transmitted first, and an identifier indicating that it is the last data. Normally, the number of blocks 302 is set to the number of transmission blocks (common) N, but the last data may be smaller than the number of transmission blocks (common) N. The fraction 303 indicates the length of data that is less than the block length. The data 304 stores data having a length combining the block number 302 and the fractional number 303.

このように、本実施の形態において、暗号通信装置Aの制御部202は、送信バッファAへ入力するデータ(図7のデータ304)のフォーマットに、当該データに含まれるブロックの数(図7のブロック数302)と当該データの大きさをブロック1個分の大きさで除算した場合の端数(図7の端数303)とを示す制御情報を含める。同様に、暗号通信装置Bの制御部202は、送信バッファBへ入力するデータ(図7のデータ304)のフォーマットに、当該データに含まれるブロックの数(図7のブロック数302)と当該データの大きさをブロック1個分の大きさで除算した場合の端数(図7の端数303)とを示す制御情報を含める。   As described above, in the present embodiment, the control unit 202 of the encryption communication apparatus A includes the number of blocks included in the data (data 304 in FIG. 7) in the format of the data (data 304 in FIG. 7) input to the transmission buffer A. The control information indicating the number of blocks 302) and the fraction when the data size is divided by the size of one block (fraction 303 in FIG. 7) is included. Similarly, the control unit 202 of the encryption communication apparatus B includes the number of blocks (the number of blocks 302 in FIG. 7) included in the data in the format of the data input to the transmission buffer B (data 304 in FIG. 7) and the data. Control information indicating the fraction (fraction 303 in FIG. 7) when the size of is divided by the size of one block is included.

上記のようなフォーマットをデータ送信用に決めているため、「繰り返し単位1」は、端数H=0の場合はブロック数M、H>0の場合はM+1となる。なお、端数Hが存在する場合、即ち、H>0の場合、「繰り返し単位1」の最後の1回は、暗号通信装置Bの暗号処理部205がブロックのレングスより小さいレングスのデータを暗号演算することになる。そのため、暗号通信装置Bの制御部202は、ブロックレングスに満たないビットにはパディング処理をステップS157で行う。   Since the format as described above is determined for data transmission, “repetition unit 1” is the number of blocks M when the fraction H = 0, and M + 1 when H> 0. When the fraction H exists, that is, when H> 0, the encryption processing unit 205 of the encryption communication device B performs cryptographic operation on data having a length smaller than the block length for the last time of “repetition unit 1”. Will do. For this reason, the control unit 202 of the encryption communication device B performs padding processing for bits that are less than the block length in step S157.

このように、本実施の形態において、暗号通信装置Aの制御部202は、送信データの先頭からN個のブロックごとに切り出したデータを送信バッファAへ順次入力する(図6のステップS154)。そして、送信データのうち、送信バッファAに未入力のデータがブロックN個分の大きさより大きくても上記容量の小さいバッファに格納できる大きさとなった場合、暗号通信装置Aの制御部202は、当該データを送信バッファAへ一度に入力する(図6のステップS154)。暗号通信装置Aの通信部201は、暗号通信装置Aの制御部202から送信バッファAへデータが入力される度に、当該データを送信バッファAから暗号通信装置Bへ送信する(図6のステップS155)。   As described above, in the present embodiment, the control unit 202 of the encryption communication device A sequentially inputs the data cut out every N blocks from the top of the transmission data to the transmission buffer A (step S154 in FIG. 6). When the data not input to the transmission buffer A among the transmission data is larger than the size of the N blocks, the control unit 202 of the encryption communication apparatus A The data is input to the transmission buffer A at a time (step S154 in FIG. 6). Each time data is input from the control unit 202 of the cryptographic communication device A to the transmission buffer A, the communication unit 201 of the cryptographic communication device A transmits the data from the transmission buffer A to the cryptographic communication device B (step of FIG. 6). S155).

「繰り返し単位1」が全て終了すれば、暗号通信装置Bの送信バッファBには暗号演算が終わったデータが格納されていることになる。暗号通信装置Bの通信部201は、この送信データをステップS161で暗号通信装置Aに送り、暗号通信装置Aの通信部201は、ステップS162でデータを受信する。暗号通信装置Aの制御部202は、受信したデータをステップS163で受信データメモリ212に格納する。   When “repetition unit 1” is completed, the transmission buffer B of the encryption communication apparatus B stores the data for which the cryptographic operation has been completed. The communication unit 201 of the encryption communication device B sends this transmission data to the encryption communication device A in step S161, and the communication unit 201 of the encryption communication device A receives the data in step S162. The control unit 202 of the encryption communication device A stores the received data in the reception data memory 212 in step S163.

暗号通信システム100では、ステップS154からステップS163までの処理が、送信データメモリ211のデータがなくなるまで繰り返される。図6では、この繰り返しの範囲を「繰り返し単位2」で示した。   In the cryptographic communication system 100, the processing from step S154 to step S163 is repeated until there is no more data in the transmission data memory 211. In FIG. 6, this repeating range is indicated by “repeating unit 2”.

ステップS164で暗号通信装置Aの制御部202は、「繰り返し単位2」の終了を、データ送信のフォーマットのヘッダ301で知ることができる。   In step S164, the control unit 202 of the encryption communication apparatus A can know the end of “repetition unit 2” from the header 301 of the data transmission format.

このように、本実施の形態において、暗号通信装置Bの通信部201は、暗号通信装置Aからデータが送信される度に、当該データを受信バッファBで受信する(図6のステップS156)。暗号通信装置Bの制御部202は、当該データを受信バッファBから出力する(図6のステップS157)。暗号通信装置Bの暗号処理部205は、暗号通信装置Bの制御部202により受信バッファBからデータが出力される度に、当該データをブロック暗号により順次暗号化する(図6のステップS158、S159)。暗号通信装置Bの制御部202は、暗号通信装置Bの暗号処理部205で暗号化されたデータを送信バッファBへ順次入力する(図6のステップS160)。暗号通信装置Bの通信部201は、暗号通信装置Bの制御部202から送信バッファBへデータが入力される度に、当該データを送信バッファBから暗号通信装置Aへ送信する(図6のステップS161)。暗号通信装置Aの通信部201は、暗号通信装置Bへ送信したデータが暗号通信装置Bで暗号化され、暗号通信装置Bから当該データが送信される度に、当該データを受信バッファAで受信する(図6のステップS162)。暗号通信装置Aの制御部202は、受信バッファAでデータが受信される度に、当該データを受信バッファAから出力し、当該データを連結して送信データの暗号化データを生成する(図6のステップS163)。   Thus, in the present embodiment, the communication unit 201 of the encryption communication device B receives the data by the reception buffer B every time data is transmitted from the encryption communication device A (step S156 in FIG. 6). The control unit 202 of the encryption communication device B outputs the data from the reception buffer B (step S157 in FIG. 6). Each time the data is output from the reception buffer B by the control unit 202 of the encryption communication device B, the encryption processing unit 205 of the encryption communication device B sequentially encrypts the data by block encryption (steps S158 and S159 in FIG. 6). ). The control unit 202 of the encryption communication device B sequentially inputs the data encrypted by the encryption processing unit 205 of the encryption communication device B to the transmission buffer B (step S160 in FIG. 6). Each time data is input from the control unit 202 of the cryptographic communication device B to the transmission buffer B, the communication unit 201 of the cryptographic communication device B transmits the data from the transmission buffer B to the cryptographic communication device A (step of FIG. 6). S161). The communication unit 201 of the encryption communication device A receives the data by the reception buffer A every time the data transmitted to the encryption communication device B is encrypted by the encryption communication device B and the data is transmitted from the encryption communication device B. (Step S162 in FIG. 6). Each time data is received by the reception buffer A, the control unit 202 of the encryption communication apparatus A outputs the data from the reception buffer A and concatenates the data to generate encrypted data of the transmission data (FIG. 6). Step S163).

次に、本実施の形態の効果について説明をする。   Next, the effect of this embodiment will be described.

本実施の形態では、暗号演算を行う前に、暗号通信装置A及びB双方の受信バッファの大きさを通知し、暗号演算の単位であるブロックが最も大きくとれるように、送信ブロック数(共通)Nを設定する。このことにより、受信バッファのうち通信に使用されない領域をシステムで最小にすることができるようになる。このことは、データのレングスが長く、複数回暗号演算を行わなければならない暗号通信装置であっても、通信回数を最も小さく設定できることを示している。   In the present embodiment, before performing the cryptographic operation, the size of the reception buffer of both the cryptographic communication devices A and B is notified, and the number of transmission blocks (common) so that the block that is the unit of the cryptographic operation can be maximized. N is set. This allows the system to minimize the area of the reception buffer that is not used for communication. This indicates that the number of communication times can be set to the smallest even in the case of a cryptographic communication device having a long data length and having to perform cryptographic operations a plurality of times.

本実施の形態では、さらに、通信データのフォーマットをブロック数と端数を記述するようにし、かつ、未送信データのレングスと受信バッファ(又は送信バッファ)のうち通信に使用されない領域(前述した差Saや差Sbに相当)とを比較し、未送信データが全受信バッファを使用すれば送信可能である場合、未送信データを全て送信し、そのデータを受信先で暗号演算処理するようにしたので、通信回数をさらに1回減らすことができる。この効果を図で示したものが、図8である。図8では送信データを、送信ブロック数(共通)N=4で3回送信する例を示している。3回目のクロスハッチの送信データは、ブロック数が4でさらに端数のデータも合わせて送信しているものである。このように、受信バッファに余裕がある場合には、最後はその分データを多めに送信できるので、送信回数を1回減らすことができる。これに合わせて暗号演算の回数は、3回目のデータ送信時には、1回目、2回目と比べて、1回多くなっている。また、図8に示したように、端数のデータについてはパディングが行われる。これに対し、図9は従来の例を図8と同じデータで行った場合を示している。図9では、3回の送信では全ての送信データを送れないので、4回目の送信を行っており、本実施の形態と比べて、送信回数が増えてしまうことがわかる。   In the present embodiment, the format of communication data further describes the number of blocks and fractions, and the length of untransmitted data and the area not used for communication in the reception buffer (or transmission buffer) (the difference Sa described above) If the unsent data can be transmitted if all the receive buffers are used, all the unsent data is transmitted, and the data is subjected to cryptographic calculation processing at the receiving destination. The number of communications can be further reduced by one. This effect is illustrated in FIG. FIG. 8 shows an example in which transmission data is transmitted three times with the number of transmission blocks (common) N = 4. The transmission data of the third cross hatch is one in which the number of blocks is four and fractional data is also transmitted. As described above, when there is a margin in the reception buffer, a larger amount of data can be transmitted at the end, so the number of transmissions can be reduced by one. In accordance with this, the number of cryptographic computations is one more at the time of the third data transmission than at the first time and the second time. Also, as shown in FIG. 8, the fractional data is padded. On the other hand, FIG. 9 shows a case where the conventional example is performed with the same data as FIG. In FIG. 9, since all transmission data cannot be transmitted in three transmissions, the fourth transmission is performed, and it can be seen that the number of transmissions is increased as compared with the present embodiment.

本実施の形態では、さらに、送受信パラメータ設定処理により最大の送受信パラメータが設定されるので、送受信バッファを各々1本としても、通信回数の増大を最小限に抑えることができる。   In the present embodiment, since the maximum transmission / reception parameter is set by the transmission / reception parameter setting process, an increase in the number of communication can be minimized even if one transmission / reception buffer is used.

本実施の形態では、送受信パラメータ設定処理を行ってから、データ暗号化処理を行うとしたが、暗号通信装置の組み合わせが決まっている場合、両者の受信バッファの大きさは予めわかっているので、事前に送受信パラメータを決めておき、データ処理時は、送受信パラメータ設定処理は行わず、データ暗号化処理だけにしてもよい。   In the present embodiment, the data encryption process is performed after the transmission / reception parameter setting process is performed, but when the combination of the encryption communication devices is determined, the sizes of both reception buffers are known in advance, Transmission / reception parameters may be determined in advance, and during data processing, transmission / reception parameter setting processing may not be performed, and only data encryption processing may be performed.

また、本実施の形態では、送信データ分割を未送信データのレングスと受信バッファのうち通信に使用されない領域とを逐次考慮して決めていたが、固定長のデータを扱う場合は、送信データの分割パターンは決まっているので、事前に分割パターンを決めておき、逐次判断を行わず分割パターンに従って、データ分割を行うようにしてもよい。   In this embodiment, the transmission data division is determined by sequentially considering the length of untransmitted data and the area of the reception buffer that is not used for communication. However, when handling fixed-length data, Since the division pattern is determined, the division pattern may be determined in advance, and data division may be performed according to the division pattern without performing sequential determination.

また、本実施の形態の説明では暗号通信装置という個別の装置を例にとったが、1チップマイコンチップと暗号演算が可能なセキュアなマイコンチップとの間の通信でも構わない。   In the description of the present embodiment, an individual device called a cryptographic communication device has been taken as an example, but communication between a one-chip microcomputer chip and a secure microcomputer chip capable of cryptographic operation may be used.

以上のように、本実施の形態では、少なくとも一方の装置内で共通鍵暗号アルゴリズムを用いて暗号演算を行う暗号通信システム100が、
相互の受信バッファのレングスと送信バッファのレングスから、ブロック単位で最大の送信ブロック数(共通)と他方の受信バッファと送信ブロック数(共通)に対応するレングスとの差を送受信パラメータとして設定する送受信パラメータ設定処理と、
送信ブロック数(共通)、上記の差、未送信データのレングスから、受信先の全受信バッファを使用すれば送信できる場合は、送信ブロック数(共通)以上の未送信データを送信し、送信されたブロック数、端数に基づき暗号演算を行うデータ暗号化処理とを実行することを特徴とする。
As described above, in the present embodiment, the cryptographic communication system 100 that performs cryptographic computation using the common key cryptographic algorithm in at least one of the devices includes:
Transmission / reception that sets the difference between the maximum number of transmission blocks (common) and the length corresponding to the other reception buffer and the number of transmission blocks (common) as transmission / reception parameters based on the mutual reception buffer length and transmission buffer length Parameter setting process,
From the number of transmission blocks (common), the above difference, and the length of untransmitted data, if transmission is possible using all receiving buffers at the receiver, untransmitted data equal to or greater than the number of transmission blocks (common) is transmitted and transmitted. And a data encryption process for performing a cryptographic operation based on the number of blocks and a fraction.

また、本実施の形態の変形例では、少なくとも一方の装置内で共通鍵暗号アルゴリズムを用いて暗号演算を行う暗号通信システム100が、
相互の受信バッファのレングスと送信バッファのレングスから、ブロック単位で最大の送信ブロック数(共通)と他方の受信バッファと送信ブロック数(共通)に対応するレングスとの差を送受信パラメータとして事前に設定する送受信パラメータ設定処理と、
データ暗号化処理時は上記送受信パラメータ設定処理を行わず、送信ブロック数(共通)、上記の差、未送信データのレングスから、受信先の全受信バッファを使用すれば送信できる場合は、送信ブロック数(共通)以上の未送信データを送信し、送信されたブロック数、端数に基づき暗号演算を行うデータ暗号化処理とを実行することを特徴とする。
Further, in a modification of the present embodiment, the cryptographic communication system 100 that performs cryptographic computation using a common key cryptographic algorithm in at least one of the devices,
Based on the length of the mutual reception buffer and the length of the transmission buffer, the difference between the maximum number of transmission blocks (common) and the length corresponding to the other reception buffer and the number of transmission blocks (common) is set in advance as transmission / reception parameters. Send / receive parameter setting processing,
If the transmission / reception parameter setting process is not performed during the data encryption process, and transmission is possible using all the reception buffers of the reception destination based on the number of transmission blocks (common), the above difference, and the length of untransmitted data, the transmission block The number of (uncommon) or more untransmitted data is transmitted, and a data encryption process for performing a cryptographic operation based on the number of transmitted blocks and a fraction is executed.

また、本実施の形態の変形例では、少なくとも一方の装置内で共通鍵暗号アルゴリズムを用いて暗号演算を行う暗号通信システム100が、
相互の受信バッファのレングスと送信バッファのレングスから、ブロック単位で最大の送信ブロック数(共通)と他方の受信バッファと送信ブロック数(共通)に対応するレングスとの差を送受信パラメータとして事前に設定する送受信パラメータ設定処理と、
データ暗号化処理時は上記送受信パラメータ設定処理を行わず、暗号化処理以前に上記送受信パラメータを考慮して送信パターンを設定し、暗号化処理時は前記送信パターンに基づいてデータを送信し、送信されたブロック数、端数に基づき暗号演算を行うデータ暗号化処理とを実行することを特徴とする。
Further, in a modification of the present embodiment, the cryptographic communication system 100 that performs cryptographic computation using a common key cryptographic algorithm in at least one of the devices,
Based on the lengths of the reception buffer and the transmission buffer, the difference between the maximum number of transmission blocks (common) and the length corresponding to the other reception buffer and the number of transmission blocks (common) is set in advance as transmission / reception parameters. Send / receive parameter setting processing,
The transmission / reception parameter setting process is not performed during the data encryption process, the transmission pattern is set in consideration of the transmission / reception parameter before the encryption process, and the data is transmitted based on the transmission pattern during the encryption process. And a data encryption process for performing a cryptographic operation based on the number of blocks and a fraction.

また、本実施の形態では、暗号通信データフォーマットが、データのレングスを示す数値として、少なくともブロック数と端数を含んでいることを特徴とする。   In the present embodiment, the encrypted communication data format includes at least a block number and a fraction as a numerical value indicating the data length.

実施の形態2.
本実施の形態について、主に実施の形態1との差異を説明する。
Embodiment 2. FIG.
In the present embodiment, differences from the first embodiment will be mainly described.

本実施の形態は、図1の暗号通信装置Aが、暗号通信装置Bに対して、送信データの真偽を判定させるケースを想定したものである。例えば、暗号通信装置Aに外部からある暗号データが送られてきて、そのデータの真偽の判定を暗号通信装置Bに依頼する場合である。暗号通信装置Bには暗号データの真偽を判定するための情報が予め格納されているものとする。以下では、暗号通信装置Aは、データを暗号通信装置Bへ送信して、暗号通信装置Bに対し、当該送信データのブロック暗号による暗号化処理(復号化処理)を伴うデータ真偽判定処理(例えば、データの復号化に成功した場合、あるいは、復号化したデータの値が所定の値であった場合に、そのデータが真正なものであると判定する処理)をさせる。データ真偽判定処理は、送信データを一定の大きさのブロックごとに分けて行う所定の処理の一例である。   This embodiment assumes a case where the encryption communication device A in FIG. 1 causes the encryption communication device B to determine the authenticity of transmission data. For example, there is a case where some encrypted data is sent from the outside to the encryption communication device A and the encryption communication device B is requested to determine the authenticity of the data. It is assumed that information for determining the authenticity of the encryption data is stored in advance in the encryption communication device B. In the following, the encryption communication device A transmits data to the encryption communication device B, and the data authenticity determination processing (encryption processing (decryption processing) with block encryption of the transmission data is transmitted to the encryption communication device B ( For example, when data is successfully decrypted, or when the value of the decrypted data is a predetermined value, a process of determining that the data is authentic is performed. The data authenticity determination process is an example of a predetermined process that is performed by dividing transmission data into blocks of a certain size.

図10は、暗号通信装置Aが暗号通信装置Bにデータの真偽判定を依頼して、暗号通信装置Bがデータの真偽判定を行う際に、暗号通信装置A及び暗号通信装置Bにおいて、データの受け渡しを行う主なHW(ハードウェア)の構成要素を示すブロック図である。   FIG. 10 shows that when the encryption communication device A requests the encryption communication device B to determine the authenticity of the data, and the encryption communication device B performs the data authenticity determination, the encryption communication device A and the encryption communication device B It is a block diagram which shows the component of main HW (hardware) which delivers and receives data.

図10において、暗号通信装置Aの送信データメモリ211、送信バッファA、受信バッファAについては、実施の形態1と同様である。また、暗号通信装置Bのブロック入力部213、暗号演算部214、ブロック出力部215、受信バッファB、送信バッファBについては、実施の形態1と同様である。結果格納メモリ216、真偽レジスタ217、バッファ空レジスタ218は、それぞれ暗号通信装置Bの不揮発メモリ203又はその一部である。   In FIG. 10, the transmission data memory 211, transmission buffer A, and reception buffer A of the encryption communication device A are the same as those in the first embodiment. Further, the block input unit 213, the cryptographic operation unit 214, the block output unit 215, the reception buffer B, and the transmission buffer B of the cryptographic communication device B are the same as those in the first embodiment. The result storage memory 216, the true / false register 217, and the buffer empty register 218 are the nonvolatile memory 203 of the encryption communication apparatus B or a part thereof, respectively.

真偽判定されるデータは、送信データメモリ211に格納されている。真偽判定されるデータは大きいので、暗号通信装置Aの制御部202は、送信バッファAに全てのデータを移すことはできず、数回に分けてデータを移すことになる。つまり、暗号通信装置Aの制御部202は、分割したデータを送信バッファAに順番に入力していく。暗号通信装置Aの通信部201は、送信バッファAから受信バッファBにデータを通信する。暗号通信装置Bの暗号処理部205では、共通鍵暗号アルゴリズムを使用するので、ブロックという単位でしかデータを受け付けることができない。ブロック入力部213、ブロック出力部215はブロックのインタフェースである。ブロックのレングスは、受信バッファBのレングスより小さいので、暗号通信装置Bの暗号処理部205には何回かに分けてデータが送られることになる。ブロック入力部213に入力されたデータは、暗号演算部214で暗号化され、ブロック出力部215を介して、結果格納メモリ216に格納される。受信バッファBにあるデータが全て暗号化(復号化)されると、バッファ空レジスタ218にフラグがたち、暗号通信装置Bの制御部202は、暗号通信装置Bの通信部201(送信バッファB)を介して、受信バッファBが空になったことを暗号通信装置Aに知らせる。暗号通信装置Aでは、未送信データがあれば、制御部202が再度送信データメモリ211からデータを送信バッファAに移し、通信部201を介してそのデータを送信して暗号通信装置Bに真偽判定を依頼する。送信データメモリ211の全てのデータが送信され、暗号演算が全て終われば、結果格納メモリ216には全ての結果が格納される。暗号通信装置Bの制御部202は、その内容を判定して、真偽レジスタ217に格納される真偽フラグを設定する。その真偽フラグは、通信部201(送信バッファB)を介して、暗号通信装置Aに送られる。   Data for which the authenticity is determined is stored in the transmission data memory 211. Since the data for which the authenticity is determined is large, the control unit 202 of the encryption communication device A cannot transfer all the data to the transmission buffer A, and transfers the data in several times. That is, the control unit 202 of the encryption communication apparatus A inputs the divided data to the transmission buffer A in order. The communication unit 201 of the encryption communication device A communicates data from the transmission buffer A to the reception buffer B. Since the encryption processing unit 205 of the encryption communication apparatus B uses a common key encryption algorithm, it can accept data only in units of blocks. The block input unit 213 and the block output unit 215 are block interfaces. Since the length of the block is smaller than the length of the reception buffer B, the data is sent to the cryptographic processing unit 205 of the cryptographic communication apparatus B in several times. Data input to the block input unit 213 is encrypted by the cryptographic operation unit 214 and stored in the result storage memory 216 via the block output unit 215. When all the data in the reception buffer B is encrypted (decrypted), the buffer empty register 218 is flagged, and the control unit 202 of the encryption communication device B communicates with the communication unit 201 (transmission buffer B) of the encryption communication device B. Through this, the encryption communication apparatus A is notified that the reception buffer B has become empty. In the encryption communication device A, if there is untransmitted data, the control unit 202 again moves the data from the transmission data memory 211 to the transmission buffer A, transmits the data via the communication unit 201, and authenticates the encryption communication device B. Request a decision. When all the data in the transmission data memory 211 is transmitted and all the cryptographic operations are completed, all the results are stored in the result storage memory 216. The control unit 202 of the encryption communication device B determines the contents and sets a true / false flag stored in the true / false register 217. The true / false flag is sent to the encryption communication device A via the communication unit 201 (transmission buffer B).

次に、処理フローについて説明する。   Next, the processing flow will be described.

図11は本実施の形態の処理フロー(本実施の形態に係る通信方法)を示すフローチャートである。   FIG. 11 is a flowchart showing a processing flow (communication method according to the present embodiment) of the present embodiment.

図11において、ステップS201では、後述する送信パラメータ設定処理が行われる。この処理では、効率よく送信を行うために、暗号通信装置Aの送信パラメータが設定される。ついで、ステップS202では、後述するデータ真偽判定処理が行われる。この処理では、送信パラメータに基づく通信が繰り返され、長大なデータが暗号通信装置Bに送られ、暗号通信装置B内でその真偽判定が行われる。   In FIG. 11, in step S201, a transmission parameter setting process to be described later is performed. In this process, the transmission parameters of the encryption communication device A are set in order to perform transmission efficiently. In step S202, a data authenticity determination process, which will be described later, is performed. In this process, communication based on the transmission parameter is repeated, long data is sent to the encryption communication device B, and the authenticity determination is performed in the encryption communication device B.

次に、前述したステップS201の送信パラメータ設定処理の詳細について、図12を参照して説明する。   Next, details of the transmission parameter setting process in step S201 described above will be described with reference to FIG.

ステップS211で暗号通信装置Aの制御部202は、暗号通信装置Aの通信部201を介して、バッファ長送信依頼を暗号通信装置Bに送る。ステップS112で暗号通信装置Bの制御部202は、暗号通信装置Bの通信部201を介して、その依頼を受け取る。その後、ステップS213で暗号通信装置Bの制御部202は、暗号通信装置Bの通信部201を介して、暗号通信装置B自身の受信バッファBのレングスを暗号通信装置Aに送る。ステップS214で暗号通信装置Aの制御部202は、暗号通信装置Aの通信部201を介して、そのレングスを受け取る。   In step S211, the control unit 202 of the encryption communication device A sends a buffer length transmission request to the encryption communication device B via the communication unit 201 of the encryption communication device A. In step S112, the control unit 202 of the cryptographic communication device B receives the request via the communication unit 201 of the cryptographic communication device B. Thereafter, the control unit 202 of the encryption communication device B sends the length of the reception buffer B of the encryption communication device B itself to the encryption communication device A via the communication unit 201 of the encryption communication device B in step S213. In step S214, the control unit 202 of the encryption communication device A receives the length via the communication unit 201 of the encryption communication device A.

ステップS215では、暗号通信装置Aの制御部202は、受信バッファBのレングス、送信バッファAのレングスのうち、最小のレングスを選択する。さらに、暗号通信装置Aの制御部202は、この最小のレングスを共通鍵アルゴリズムのブロックのレングスで割った整数部を送信ブロック数Nとする。ここで、最小のレングスは、ブロックのレングスより大きいと仮定する。ステップS216では、暗号通信装置Aの制御部202は、送信ブロック数Nとブロックのレングスをかけたレングス値と、受信バッファBのレングス、送信バッファAのレングスのうち、最小のレングスとの差Sを求める。この差Sは、送信ブロック数Nのデータを暗号通信装置Bに送った際に、受信バッファB、送信バッファAのうち、小さい方で使用されないバッファのレングスに等しい。暗号通信装置Aの制御部202は、送信ブロック数Nと差Sを送信パラメータとして設定する。   In step S215, the control unit 202 of the encryption communication device A selects the minimum length among the length of the reception buffer B and the length of the transmission buffer A. Further, the control unit 202 of the cryptographic communication apparatus A sets the integer part obtained by dividing the minimum length by the block length of the common key algorithm as the transmission block number N. Here, it is assumed that the minimum length is larger than the block length. In step S216, the control unit 202 of the encryption communication device A determines the difference S between the number of transmission blocks N and the length value obtained by multiplying the length of the block with the minimum length among the length of the reception buffer B and the length of the transmission buffer A. Ask for. This difference S is equal to the length of the buffer that is not used in the smaller one of the reception buffer B and the transmission buffer A when the transmission block number N of data is sent to the encryption communication device B. The control unit 202 of the encryption communication device A sets the transmission block number N and the difference S as transmission parameters.

次に、前述したステップS202のデータ真偽判定処理の詳細について、図13を参照して説明する。データ真偽判定処理は、前述した送信パラメータ設定処理以後に行われる。   Next, details of the data authenticity determination process in step S202 described above will be described with reference to FIG. The data authenticity determination process is performed after the transmission parameter setting process described above.

ステップS251で、暗号通信装置Aの制御部202は、暗号通信装置Aの通信部201を介して、暗号通信装置Bに向けて真偽判定コマンドを送信する。真偽判定コマンドは、真偽判定を開始する旨の通知で、その他、使用する鍵番号や暗号アルゴリズムを指定する番号、これから送るデータのレングスなどが必要に応じて付加されている。ステップS252で真偽判定コマンドは、暗号通信装置Bの通信部201を介して、暗号通信装置Bの制御部202によって受信され、暗号通信装置Bの制御部202では、そのコマンドが指示する設定が行われる。例えば、鍵番号に対応する鍵を設定する、使用する暗号アルゴリズムを選択するなどである。   In step S <b> 251, the control unit 202 of the encryption communication device A transmits a true / false determination command to the encryption communication device B via the communication unit 201 of the encryption communication device A. The authenticity determination command is a notification to start authenticity determination, and additionally includes a key number to be used, a number for specifying an encryption algorithm, a length of data to be transmitted, and the like as necessary. In step S252, the authenticity determination command is received by the control unit 202 of the encryption communication device B via the communication unit 201 of the encryption communication device B, and the control unit 202 of the encryption communication device B has a setting indicated by the command. Done. For example, a key corresponding to the key number is set, and an encryption algorithm to be used is selected.

ついで、暗号通信装置Aでは、ステップS253で制御部202がデータ送信を開始する。ステップS254で、暗号通信装置Aの制御部202は、図10で示した送信データメモリ211から送信バッファAにデータを分割して移す。このとき、暗号通信装置Aの制御部202は、設定されている送信ブロック数Nと差Sと未送信データレングスDの関係に従って下記(カ)〜(ケ)のいずれかの手順を実行し、データを送信データメモリ211から送信バッファAに移す。ステップS255では、暗号通信装置Aの通信部201は、送信バッファAの分割データを暗号通信装置Bに送る。   Next, in the encryption communication device A, the control unit 202 starts data transmission in step S253. In step S254, the control unit 202 of the encryption communication device A divides the data from the transmission data memory 211 shown in FIG. At this time, the control unit 202 of the encryption communication apparatus A executes one of the following procedures (f) to (k) in accordance with the relationship between the set number of transmission blocks N, the difference S, and the untransmitted data length D, Data is transferred from the transmission data memory 211 to the transmission buffer A. In step S <b> 255, the communication unit 201 of the encryption communication device A sends the divided data in the transmission buffer A to the encryption communication device B.

以下では、ブロック数をM、ブロックレングス(1ブロックのレングス)をL、端数をHとする。前述したように、Nは送信ブロック数、Sは差、Dは未送信データレングスである。   In the following, the number of blocks is M, the block length (length of one block) is L, and the fraction is H. As described above, N is the number of transmission blocks, S is a difference, and D is an untransmitted data length.

(カ)D≧N・L+Saの場合
M=N、H=0とする。即ち、暗号通信装置Aの制御部202は、送信ブロック数NだけデータをステップS254で分割し、送信バッファAに移す。そして、暗号通信装置Aの通信部201は、送信バッファAに移された分割データをステップS255で送信する。
(F) When D ≧ N · L + Sa M = N and H = 0. That is, the control unit 202 of the encryption communication device A divides the data by the number of transmission blocks N in step S254 and moves it to the transmission buffer A. Then, the communication unit 201 of the encryption communication device A transmits the divided data transferred to the transmission buffer A in step S255.

(キ)N・L+Sa>D≧N・Lの場合
M=N+FLOOR(S/L)、H=D−M・Lとする。この場合は、送信バッファAと暗号通信装置Bの受信バッファBとのうち、レングスが短いバッファの余裕(N個のブロックを格納したときの空き容量、即ち、Sa)の範囲内の未送信データであれば、暗号通信装置Aの制御部202は、送信ブロック数Nを超えても、未送信データ全てをステップS254で分割し(取り出し)、送信バッファAに移す。そして、暗号通信装置Aの通信部201は、送信バッファAに移された分割データをステップS255で送信する。
(G) When N · L + Sa> D ≧ N · L, M = N + FLOOR (S / L), and H = D−M · L. In this case, of the transmission buffer A and the reception buffer B of the encryption communication device B, untransmitted data within the range of a short buffer (free capacity when N blocks are stored, that is, Sa) If so, the control unit 202 of the encryption communication device A divides (extracts) all untransmitted data in step S254 even if the number of transmission blocks N is exceeded, and moves it to the transmission buffer A. Then, the communication unit 201 of the encryption communication device A transmits the divided data transferred to the transmission buffer A in step S255.

(ク)N・L>D>0の場合
M=FLOOR(D/L)、H=D−M・Lとする。この場合、暗号通信装置Aの制御部202は、未送信データ全てをステップS254で分割し(取り出し)、送信バッファAに移す。そして、暗号通信装置Aの通信部201は、送信バッファAに移された分割データをステップS255で送信する。
(H) When N · L>D> 0, M = FLOOR (D / L) and H = D−M · L. In this case, the control unit 202 of the encryption communication device A divides (unloads) all untransmitted data in step S254 and moves it to the transmission buffer A. Then, the communication unit 201 of the encryption communication device A transmits the divided data transferred to the transmission buffer A in step S255.

(ケ)D=0の場合
暗号通信装置Aの制御部202は、送信をやめる。
(G) When D = 0 The control unit 202 of the encryption communication apparatus A stops transmission.

暗号通信装置Bでは、通信部201がステップS256で分割データを受信すると、制御部202がステップS257で受信データを1ブロックずつ分割する。そして、暗号処理部205がステップS258で暗号演算を行う。ステップS259の暗号演算結果は、ブロックのレングスの結果になる。即ち、1ブロックの暗号化(復号化)データとなる。暗号通信装置Bの制御部202は、この暗号化データを受け取り、ステップS260で結果格納メモリ216に格納する。暗号通信装置Bでは、ステップS257からステップS260の処理が、受信データが全て暗号演算されるまで繰り返される。図13では、この繰り返しの範囲を「繰り返し単位1」で示した。   In the encryption communication device B, when the communication unit 201 receives the divided data in step S256, the control unit 202 divides the received data block by block in step S257. Then, the cryptographic processing unit 205 performs cryptographic computation in step S258. The result of the cryptographic operation in step S259 is the result of the block length. That is, one block of encrypted (decrypted) data is obtained. The control unit 202 of the encryption communication device B receives this encrypted data and stores it in the result storage memory 216 in step S260. In the cryptographic communication device B, the processing from step S257 to step S260 is repeated until all the received data is cryptographically computed. In FIG. 13, the repetition range is indicated by “repetition unit 1”.

ここで、「繰り返し単位1」の繰り返し数について述べる前に、本実施の形態におけるデータ送信のフォーマットについて説明する。本実施の形態におけるデータ送信のフォーマットは、図7に示した実施の形態1のものと同様である。   Here, before describing the number of repetitions of “repetition unit 1”, the format of data transmission in the present embodiment will be described. The format of data transmission in the present embodiment is the same as that of the first embodiment shown in FIG.

前述したようなフォーマットをデータ送信用に決めているため、「繰り返し単位1」は、端数H=0の場合はブロック数M、H>0の場合はM+1となる。なお、端数Hが存在する場合、即ち、H>0の場合、「繰り返し単位1」の最後の1回は、暗号通信装置Bの暗号処理部205がブロックのレングスより小さいレングスのデータを暗号演算することになる。そのため、暗号通信装置Bの制御部202は、実施の形態1と同様に、ブロックレングスに満たないビットにはパディング処理をステップS257で行う。   Since the format as described above is determined for data transmission, “repetition unit 1” is the number of blocks M when the fraction H = 0, and M + 1 when H> 0. When the fraction H exists, that is, when H> 0, the encryption processing unit 205 of the encryption communication device B performs cryptographic operation on data having a length smaller than the block length for the last time of “repetition unit 1”. Will do. Therefore, as in Embodiment 1, the control unit 202 of the encryption communication device B performs padding processing for bits that are less than the block length in step S257.

このように、本実施の形態において、暗号通信装置Aの制御部202は、送信データの先頭からN個のブロックごとに切り出したデータを送信バッファAへ順次入力する(図13のステップS254)。そして、送信データのうち、送信バッファAに未入力のデータがブロックN個分の大きさより大きくても上記容量の小さいバッファに格納できる大きさとなった場合、暗号通信装置Aの制御部202は、当該データを送信バッファAへ一度に入力する(図13のステップS254)。暗号通信装置Aの通信部201は、暗号通信装置Aの制御部202から送信バッファAへデータが入力される度に、当該データを送信バッファAから暗号通信装置Bへ送信する(図13のステップS255)。   As described above, in the present embodiment, the control unit 202 of the encryption communication device A sequentially inputs the data cut out every N blocks from the head of the transmission data to the transmission buffer A (step S254 in FIG. 13). When the data not input to the transmission buffer A among the transmission data is larger than the size of the N blocks, the control unit 202 of the encryption communication apparatus A The data is input to the transmission buffer A at a time (step S254 in FIG. 13). Each time data is input to the transmission buffer A from the control unit 202 of the cryptographic communication device A, the communication unit 201 of the cryptographic communication device A transmits the data from the transmission buffer A to the cryptographic communication device B (step of FIG. 13). S255).

「繰り返し単位1」が全て終了すれば、暗号通信装置Bの結果格納メモリ216には暗号演算が終わったデータが格納されていることになる。また、受信バッファBは空になったので、バッファ空レジスタ218のバッファ空フラグがたつ。暗号通信装置Bの通信部201は、このバッファ空フラグ(バッファ空通知)をステップS261で暗号通信装置Aに送り、暗号通信装置Aの通信部201は、ステップS262でバッファ空フラグを受信する。   When “repetition unit 1” is all completed, the result storage memory 216 of the encryption communication device B stores the data for which the cryptographic operation has been completed. Since the reception buffer B is empty, the buffer empty flag in the buffer empty register 218 is counted. The communication unit 201 of the encryption communication device B sends this buffer empty flag (buffer empty notification) to the encryption communication device A in step S261, and the communication unit 201 of the encryption communication device A receives the buffer empty flag in step S262.

暗号通信システム100では、ステップS254からステップS262までの処理が、送信データメモリ211のデータがなくなるまで繰り返される。図13では、この繰り返しの範囲を「繰り返し単位2」で示した。   In the cryptographic communication system 100, the processing from step S254 to step S262 is repeated until there is no more data in the transmission data memory 211. In FIG. 13, the repetition range is indicated by “repetition unit 2”.

「繰り返し単位2」が全て終了すれば、暗号通信装置Bの結果格納メモリ216には暗号演算が終わった全てのデータが格納されていることになる。暗号通信装置Bの制御部202は、ステップS263で、その内容が真正なものか否かを判定して、真偽レジスタ217の真偽フラグを設定する。暗号通信装置Bの通信部201は、この真偽フラグ(真偽判定通知)をステップS264で暗号通信装置Aに送り、暗号通信装置Aの通信部201は、ステップS265で真偽フラグを受信する。   When the “repetition unit 2” is all completed, the result storage memory 216 of the encryption communication device B stores all the data for which the cryptographic operation has been completed. In step S263, the control unit 202 of the encryption communication device B determines whether or not the content is authentic, and sets the true / false flag of the true / false register 217. The communication unit 201 of the encryption communication device B sends this authenticity flag (true / false determination notification) to the encryption communication device A in step S264, and the communication unit 201 of the encryption communication device A receives the authenticity flag in step S265. .

このように、本実施の形態において、暗号通信装置Bの通信部201は、暗号通信装置Aからデータが送信される度に、当該データを受信バッファBで受信する(図13のステップS256)。暗号通信装置Bの制御部202は、当該データを受信バッファBから出力する(図13のステップS257)。暗号通信装置Bの暗号処理部205は、暗号通信装置Bの制御部202により受信バッファBからデータが出力される度に、当該データをブロック暗号により順次暗号化(復号化)する(図13のステップS258、S259)。暗号通信装置Bの制御部202は、暗号通信装置Bの暗号処理部205により暗号化されたデータを検証して、送信データの真偽を判定する(図13のステップS263)。そして、暗号通信装置Bの制御部202は、当該判定結果を、暗号通信装置Bの通信部201を介して暗号通信装置Aに通知する(図13のステップS264)。   As described above, in this embodiment, the communication unit 201 of the encryption communication device B receives the data by the reception buffer B every time data is transmitted from the encryption communication device A (step S256 in FIG. 13). The control unit 202 of the encryption communication device B outputs the data from the reception buffer B (step S257 in FIG. 13). Each time the data is output from the reception buffer B by the control unit 202 of the encryption communication device B, the encryption processing unit 205 of the encryption communication device B sequentially encrypts (decrypts) the data by block encryption (FIG. 13). Steps S258 and S259). The control unit 202 of the encryption communication device B verifies the data encrypted by the encryption processing unit 205 of the encryption communication device B and determines the authenticity of the transmission data (step S263 in FIG. 13). And the control part 202 of the encryption communication apparatus B notifies the said determination result to the encryption communication apparatus A via the communication part 201 of the encryption communication apparatus B (step S264 of FIG. 13).

次に、本実施の形態の効果について説明をする。   Next, the effect of this embodiment will be described.

本実施の形態では、暗号演算を行う前に、データを受け取る側である暗号通信装置Bの受信バッファBの大きさを通知し、暗号演算の単位であるブロックが最も大きくとれるように、送信ブロック数Nを設定する。このことにより、受信バッファBのうち通信に使用されない領域をシステムで最小にすることができるようになる。このことは、データのレングスが長く、複数回暗号演算を行わなければならない暗号通信装置であっても、通信回数を最も小さく設定できることを示している。   In this embodiment, before performing the cryptographic operation, the size of the reception buffer B of the cryptographic communication device B that is the data receiving side is notified, and the transmission block is set so that the block that is the unit of the cryptographic operation is the largest. Set the number N. As a result, the area of the reception buffer B that is not used for communication can be minimized by the system. This indicates that the number of communication times can be set to the smallest even in the case of a cryptographic communication device having a long data length and having to perform cryptographic operations a plurality of times.

本実施の形態では、さらに、通信データのフォーマットをブロック数と端数を記述するようにし、かつ、未送信データのレングスと受信バッファB(又は送信バッファA)のうち通信に使用されない領域(前述した差Sに相当)とを比較し、未送信データが全受信バッファBを使用すれば送信可能である場合、未送信データを全て送信し、そのデータを受信先で真偽判定処理するようにしたので、通信回数をさらに1回減らすことができる。   In the present embodiment, the communication data format further describes the number of blocks and the fraction, and the length of untransmitted data and the reception buffer B (or transmission buffer A) are not used for communication (described above). Compared with the difference S), if unsent data can be transmitted if all the reception buffers B are used, all unsent data is transmitted, and the data is subjected to true / false judgment processing at the receiving destination. Therefore, the number of communications can be further reduced by one.

本実施の形態では、送信パラメータ設定処理を行ってから、データ真偽判定処理を行うとしたが、暗号通信装置の組み合わせが決まっている場合、受信バッファBの大きさは予めわかっているので、事前に送信パラメータを決めておき、データ処理時は、送信パラメータ設定処理は行わず、データ真偽判定処理だけにしてもよい。   In this embodiment, the data authenticity determination process is performed after performing the transmission parameter setting process. However, when the combination of the encryption communication devices is determined, the size of the reception buffer B is known in advance. Transmission parameters may be determined in advance, and during data processing, transmission parameter setting processing may not be performed, and only data authenticity determination processing may be performed.

また、本実施の形態では、送信データ分割を未送信データのレングスと受信バッファBのうち通信に使用されない領域とを逐次考慮して決めていたが、固定長のデータを扱う場合は、送信データの分割パターンは決まっているので、事前に分割パターンを決めておき、逐次判断を行わず分割パターンに従って、データ分割を行うようにしてもよい。   In this embodiment, the transmission data division is determined by sequentially considering the length of untransmitted data and the area of the reception buffer B that is not used for communication. However, when handling fixed-length data, Therefore, the division pattern may be determined in advance, and data division may be performed according to the division pattern without performing sequential determination.

また、本実施の形態の説明では暗号通信装置という個別の装置を例にとったが、1チップマイコンチップと暗号演算が可能なセキュアなマイコンチップとの間の通信でも構わない。   In the description of the present embodiment, an individual device called a cryptographic communication device has been taken as an example, but communication between a one-chip microcomputer chip and a secure microcomputer chip capable of cryptographic operation may be used.

以上のように、本実施の形態では、一方の装置内で共通鍵暗号アルゴリズムを用いて暗号演算を行う暗号通信システム100が、
暗号演算を行う暗号通信装置Bの受信バッファBのレングスから、ブロック単位で最大の送信ブロックと送信ブロック数に対応するレングスとの差を送信パラメータとして設定する送信パラメータ設定処理と、
送信ブロック数、上記の差、未送信データのレングスから、受信先の全受信バッファBを使用すれば送信できる場合は、送信ブロック数以上の未送信データを送信し、送信されたブロック数、端数に基づき暗号演算を行うデータ暗号化処理(データ真偽判定処理)とを実行することを特徴とする。
As described above, in the present embodiment, the cryptographic communication system 100 that performs cryptographic computation using the common key cryptographic algorithm in one apparatus is
A transmission parameter setting process for setting, as a transmission parameter, a difference between the length of the reception buffer B of the encryption communication device B that performs the cryptographic operation and the length corresponding to the maximum transmission block in block units and the number of transmission blocks;
From the number of transmission blocks, the above difference, and the length of untransmitted data, if transmission is possible using all receiving buffers B at the receiving destination, untransmitted data equal to or greater than the number of transmitted blocks is transmitted. And performing data encryption processing (data authenticity determination processing) for performing cryptographic operations based on the above.

また、本実施の形態の変形例では、一方の装置内で共通鍵暗号アルゴリズムを用いて暗号演算を行う暗号通信システム100が、
暗号演算を行う暗号通信装置Bの受信バッファBのレングスから、ブロック単位で最大の送信ブロックと送信ブロック数に対応するレングスとの差を送信パラメータとして事前に設定する送信パラメータ設定処理と、
データ暗号化処理時は上記送受信パラメータ設定処理を行わず、送信ブロック数、上記の差、未送信データのレングスから、受信先の全受信バッファBを使用すれば送信できる場合は、送信ブロック数以上の未送信データを送信し、送信されたブロック数、端数に基づき暗号演算を行うデータ暗号化処理(データ真偽判定処理)とを実行することを特徴とする。
Further, in a modification of the present embodiment, the cryptographic communication system 100 that performs a cryptographic operation using a common key cryptographic algorithm in one apparatus includes:
A transmission parameter setting process for setting in advance, as a transmission parameter, a difference between the length of the reception buffer B of the encryption communication device B that performs the cryptographic operation and the length corresponding to the maximum transmission block in block units and the length corresponding to the number of transmission blocks;
If the transmission / reception parameter setting process is not performed at the time of data encryption processing, and transmission is possible using the total reception buffer B of the reception destination from the number of transmission blocks, the above difference, and the length of untransmitted data, the number of transmission blocks or more The data encryption processing (data authenticity determination processing) for performing cryptographic operation based on the number of transmitted blocks and the fraction is executed.

また、本実施の形態の変形例では、一方の装置内で共通鍵暗号アルゴリズムを用いて暗号演算を行う暗号通信システム100が、
暗号演算を行う暗号通信装置Bの受信バッファBのレングスから、ブロック単位で最大の送信ブロックと送信ブロック数に対応するレングスとの差を送信パラメータとして事前に設定する送信パラメータ設定処理と、
データ暗号化処理時は上記送受信パラメータ設定処理を行わず、暗号化処理以前に上記送受信パラメータを考慮して送信パターンを設定し、暗号化処理時は前記送信パターンに基づいてデータを送信し、送信されたブロック数、端数に基づき暗号演算を行うデータ暗号化処理(データ真偽判定処理)とを実行することを特徴とする。
Further, in a modification of the present embodiment, the cryptographic communication system 100 that performs a cryptographic operation using a common key cryptographic algorithm in one apparatus includes:
A transmission parameter setting process for setting in advance, as a transmission parameter, a difference between the length of the reception buffer B of the encryption communication device B that performs the cryptographic operation and the length corresponding to the maximum transmission block in block units and the length corresponding to the number of transmission blocks;
The transmission / reception parameter setting process is not performed during the data encryption process, the transmission pattern is set in consideration of the transmission / reception parameter before the encryption process, and the data is transmitted based on the transmission pattern during the encryption process. A data encryption process (data authenticity determination process) for performing a cryptographic operation on the basis of the number of blocks and a fraction is performed.

また、本実施の形態では、暗号通信データフォーマットが、データのレングスを示す数値として、少なくともブロック数と端数を含んでいることを特徴とする。   In the present embodiment, the encrypted communication data format includes at least a block number and a fraction as a numerical value indicating the data length.

以上、本発明の実施の形態について説明したが、これらのうち、2つ以上の実施の形態を組み合わせて実施しても構わない。あるいは、これらのうち、1つの実施の形態を部分的に実施しても構わない。あるいは、これらのうち、2つ以上の実施の形態を部分的に組み合わせて実施しても構わない。   As mentioned above, although embodiment of this invention was described, you may implement combining 2 or more embodiment among these. Alternatively, one of these embodiments may be partially implemented. Or you may implement combining two or more embodiment among these partially.

実施の形態1に係る暗号通信システムの構成を示すブロック図である。1 is a block diagram showing a configuration of a cryptographic communication system according to Embodiment 1. FIG. 実施の形態1に係る通信装置が他の通信装置にデータの暗号化を行わせる際に、各通信装置においてデータの受け渡しを行う主な構成要素を示すブロック図である。FIG. 3 is a block diagram illustrating main components that perform data transfer in each communication device when the communication device according to Embodiment 1 causes another communication device to perform data encryption. 実施の形態1に係る通信装置のハードウェア構成の一例を示す図である。2 is a diagram illustrating an example of a hardware configuration of a communication apparatus according to Embodiment 1. FIG. 実施の形態1に係る通信方法を示すフローチャートである。3 is a flowchart showing a communication method according to the first embodiment. 実施の形態1に係る通信方法を示すフローチャートである。3 is a flowchart showing a communication method according to the first embodiment. 実施の形態1に係る通信方法を示すフローチャートである。3 is a flowchart showing a communication method according to the first embodiment. 実施の形態1に係る送信データのフォーマットを示す図である。6 is a diagram showing a format of transmission data according to Embodiment 1. FIG. 実施の形態1に係る通信方法を用いた例を示す図である。6 is a diagram illustrating an example using the communication method according to Embodiment 1. FIG. 従来例を示す図である。It is a figure which shows a prior art example. 実施の形態2に係る通信装置が他の通信装置にデータの暗号化を行わせる際に、各通信装置においてデータの受け渡しを行う主な構成要素を示すブロック図である。FIG. 10 is a block diagram illustrating main components that exchange data in each communication device when the communication device according to the second embodiment causes another communication device to perform data encryption. 実施の形態2に係る通信方法を示すフローチャートである。6 is a flowchart illustrating a communication method according to Embodiment 2. 実施の形態2に係る通信方法を示すフローチャートである。6 is a flowchart illustrating a communication method according to Embodiment 2. 実施の形態2に係る通信方法を示すフローチャートである。6 is a flowchart illustrating a communication method according to Embodiment 2.

符号の説明Explanation of symbols

100 暗号通信システム、101 通信データ、200a,200b 通信装置、201 通信部、202 制御部、203 不揮発メモリ、204 乱数生成器、205 暗号処理部、211 送信データメモリ、212 受信データメモリ、213 ブロック入力部、214 暗号演算部、215 ブロック出力部、216 結果格納メモリ、217 真偽レジスタ、218 バッファ空レジスタ、301 ヘッダ、302 ブロック数、303 端数、304 データ、901 表示装置、902 操作キー、903 操作ボタン、911 CPU、912 バス、913 ROM、914 RAM、915 通信ボード、920 磁気ディスク装置、921 オペレーティングシステム、922 ウィンドウシステム、923 プログラム群、924 ファイル群。   DESCRIPTION OF SYMBOLS 100 Encryption communication system, 101 Communication data, 200a, 200b Communication apparatus, 201 Communication part, 202 Control part, 203 Non-volatile memory, 204 Random number generator, 205 Encryption processing part, 211 Transmission data memory, 212 Reception data memory, 213 Block input , 214 Cryptographic operation unit, 215 block output unit, 216 result storage memory, 217 true / false register, 218 buffer empty register, 301 header, 302 blocks, 303 fraction, 304 data, 901 display device, 902 operation key, 903 operation Button, 911 CPU, 912 bus, 913 ROM, 914 RAM, 915 communication board, 920 magnetic disk unit, 921 operating system, 922 window system, 923 program group, 924 file Yl group.

Claims (9)

データを他の通信装置へ送信して、前記他の通信装置に対し、当該送信データを一定の大きさのブロックごとに分けて行う所定の処理をさせる通信装置であって、
送信バッファAと、
前記送信バッファAと前記他の通信装置が備える受信バッファBとのうち、容量の小さいバッファに格納できるブロックの数をNとし、前記送信データの先頭からN個のブロックごとに切り出したデータを前記送信バッファAへ順次入力し、前記送信データのうち、前記送信バッファAに未入力のデータがブロックN個分の大きさより大きくても前記容量の小さいバッファに格納できる大きさとなった場合、当該データを前記送信バッファAへ一度に入力する制御部と、
前記制御部から前記送信バッファAへデータが入力される度に、当該データを前記送信バッファAから前記他の通信装置へ送信する通信部とを備えることを特徴とする通信装置。
A communication device that transmits data to another communication device and causes the other communication device to perform a predetermined process for dividing the transmission data into blocks of a certain size,
Send buffer A;
Of the transmission buffer A and the reception buffer B provided in the other communication device, the number of blocks that can be stored in a small-capacity buffer is N, and the data cut out every N blocks from the top of the transmission data is the data When data is sequentially input to the transmission buffer A, and the data that has not been input to the transmission buffer A is larger than the size of N blocks among the transmission data, the data can be stored in the small capacity buffer. A control unit that inputs the data to the transmission buffer A at a time;
And a communication unit that transmits the data from the transmission buffer A to the other communication device each time data is input from the control unit to the transmission buffer A.
前記制御部は、前記容量の小さいバッファに格納できるブロックの最大数をNとすることを特徴とする請求項1に記載の通信装置。   The communication apparatus according to claim 1, wherein the control unit sets N as a maximum number of blocks that can be stored in the small-capacity buffer. 前記通信装置は、さらに、
前記送信バッファAの容量を予め記憶するメモリを備え、
前記制御部は、前記他の通信装置から前記受信バッファBの容量を通知され、前記メモリに記憶された送信バッファAの容量と前記他の通信装置から通知された受信バッファBの容量とのうち、最小値をブロック1個分の大きさで除算してNを求めることを特徴とする請求項1又は2に記載の通信装置。
The communication device further includes:
A memory for storing in advance the capacity of the transmission buffer A;
The control unit is notified of the capacity of the reception buffer B from the other communication device, and the capacity of the transmission buffer A stored in the memory and the capacity of the reception buffer B notified from the other communication device The communication apparatus according to claim 1, wherein N is obtained by dividing the minimum value by the size of one block.
前記制御部は、前記送信バッファAへ入力するデータのフォーマットに、当該データに含まれるブロックの数と当該データの大きさをブロック1個分の大きさで除算した場合の端数とを示す制御情報を含めることを特徴とする請求項1から3までのいずれかに記載の通信装置。   The control unit is a control information indicating the number of blocks included in the data and the fraction when the size of the data is divided by the size of one block in the format of data input to the transmission buffer A The communication apparatus according to claim 1, further comprising: 前記所定の処理は、ブロック暗号による暗号化処理であり、
前記通信装置は、さらに、
受信バッファAを備え、
前記制御部は、前記送信バッファAと前記受信バッファAと前記受信バッファBと前記他の通信装置が備える送信バッファBとのうち、容量の最も小さいバッファに格納できるブロックの最大数をNとし、
前記通信部は、前記他の通信装置へ送信したデータが前記他の通信装置で暗号化され、前記他の通信装置から当該データが送信される度に、当該データを前記受信バッファAで受信し、
前記制御部は、前記受信バッファAでデータが受信される度に、当該データを前記受信バッファAから出力し、当該データを連結して前記送信データの暗号化データを生成することを特徴とする請求項1から4までのいずれかに記載の通信装置。
The predetermined process is an encryption process using a block cipher,
The communication device further includes:
A receive buffer A;
The control unit, N is the maximum number of blocks that can be stored in the buffer having the smallest capacity among the transmission buffer A, the reception buffer A, the reception buffer B, and the transmission buffer B provided in the other communication device,
The communication unit receives the data by the reception buffer A every time the data transmitted to the other communication device is encrypted by the other communication device and the data is transmitted from the other communication device. ,
The control unit outputs the data from the reception buffer A each time data is received by the reception buffer A, and generates encrypted data of the transmission data by concatenating the data. The communication apparatus according to any one of claims 1 to 4.
請求項1から5までのいずれかに記載の通信装置と前記他の通信装置とを有する暗号通信システムであって、
前記他の通信装置は、前記通信装置からデータが送信される度に、当該データを前記受信バッファBで受信し、当該データを前記受信バッファBから出力し、当該データをブロック暗号により順次暗号化し、当該データを前記通信装置へ送信することを特徴とする暗号通信システム。
An encryption communication system comprising the communication device according to any one of claims 1 to 5 and the other communication device,
Each time data is transmitted from the communication device, the other communication device receives the data by the reception buffer B, outputs the data from the reception buffer B, and sequentially encrypts the data by block cipher. And transmitting the data to the communication device.
請求項1から4までのいずれかに記載の通信装置と前記他の通信装置とを有する暗号通信システムであって、
前記他の通信装置は、前記通信装置からデータが送信される度に、当該データを前記受信バッファBで受信し、当該データを前記受信バッファBから出力し、当該データをブロック暗号により検証して、前記送信データの真偽を判定し、当該判定結果を前記通信装置へ通知することを特徴とする暗号通信システム。
An encryption communication system comprising the communication device according to any one of claims 1 to 4 and the other communication device,
Each time data is transmitted from the communication device, the other communication device receives the data by the reception buffer B, outputs the data from the reception buffer B, and verifies the data by block cipher. An encryption communication system, wherein authenticity of the transmission data is determined and the determination result is notified to the communication device.
データを他の通信装置へ送信して、前記他の通信装置に対し、当該送信データを一定の大きさのブロックごとに分けて行う所定の処理をさせる通信装置を用いた通信方法であって、
前記通信装置が備える制御部が、前記通信装置が備える送信バッファAと前記他の通信装置が備える受信バッファBとのうち、容量の小さいバッファに格納できるブロックの数をNとし、前記送信データの先頭からN個のブロックごとに切り出したデータを前記送信バッファAへ順次入力し、前記送信データのうち、前記送信バッファAに未入力のデータがブロックN個分の大きさより大きくても前記容量の小さいバッファに格納できる大きさとなった場合、当該データを前記送信バッファAへ一度に入力する第1ステップと、
前記通信装置が備える通信部が、前記第1ステップで前記送信バッファAへデータが入力される度に、当該データを前記送信バッファAから前記他の通信装置へ送信する第2ステップとを備えることを特徴とする通信方法。
A communication method using a communication device that transmits data to another communication device and causes the other communication device to perform a predetermined process for dividing the transmission data into blocks of a certain size,
The control unit included in the communication device has N as the number of blocks that can be stored in a small-capacity buffer among the transmission buffer A included in the communication device and the reception buffer B included in the other communication device, and the transmission data Data cut out every N blocks from the beginning is sequentially input to the transmission buffer A, and the capacity of the capacity is not affected even if the data not input to the transmission buffer A is larger than the size of N blocks among the transmission data. A first step of inputting the data to the transmission buffer A at a time when the data can be stored in a small buffer;
A communication unit included in the communication device includes a second step of transmitting the data from the transmission buffer A to the other communication device each time data is input to the transmission buffer A in the first step. A communication method characterized by the above.
データを他の通信装置へ送信して、前記他の通信装置に対し、当該送信データを一定の大きさのブロックごとに分けて行う所定の処理をさせる通信装置で実行される通信プログラムであって、
前記通信装置が備える送信バッファAと前記他の通信装置が備える受信バッファBとのうち、容量の小さいバッファに格納できるブロックの数をNとし、前記送信データの先頭からN個のブロックごとに切り出したデータを前記送信バッファAへ順次入力し、前記送信データのうち、前記送信バッファAに未入力のデータがブロックN個分の大きさより大きくても前記容量の小さいバッファに格納できる大きさとなった場合、当該データを前記送信バッファAへ一度に入力する制御処理と、
前記制御処理から前記送信バッファAへデータが入力される度に、当該データを前記送信バッファAから前記他の通信装置へ送信する通信処理とをコンピュータに実行させることを特徴とする通信プログラム。
A communication program executed by a communication device that transmits data to another communication device and causes the other communication device to perform a predetermined process in which the transmission data is divided into blocks of a certain size. ,
Of the transmission buffer A provided in the communication device and the reception buffer B provided in the other communication device, N is the number of blocks that can be stored in a buffer having a small capacity, and is cut out every N blocks from the head of the transmission data. The received data is sequentially input to the transmission buffer A, and the size of the transmission data that can be stored in the small buffer even if the data not yet input to the transmission buffer A is larger than the size of N blocks. A control process for inputting the data to the transmission buffer A at a time;
A communication program for causing a computer to execute a communication process for transmitting the data from the transmission buffer A to the other communication device each time data is input from the control process to the transmission buffer A.
JP2008173307A 2008-07-02 2008-07-02 COMMUNICATION DEVICE, ENCRYPTED COMMUNICATION SYSTEM, COMMUNICATION METHOD, AND COMMUNICATION PROGRAM Active JP4906800B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2008173307A JP4906800B2 (en) 2008-07-02 2008-07-02 COMMUNICATION DEVICE, ENCRYPTED COMMUNICATION SYSTEM, COMMUNICATION METHOD, AND COMMUNICATION PROGRAM

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2008173307A JP4906800B2 (en) 2008-07-02 2008-07-02 COMMUNICATION DEVICE, ENCRYPTED COMMUNICATION SYSTEM, COMMUNICATION METHOD, AND COMMUNICATION PROGRAM

Publications (2)

Publication Number Publication Date
JP2010016526A true JP2010016526A (en) 2010-01-21
JP4906800B2 JP4906800B2 (en) 2012-03-28

Family

ID=41702228

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2008173307A Active JP4906800B2 (en) 2008-07-02 2008-07-02 COMMUNICATION DEVICE, ENCRYPTED COMMUNICATION SYSTEM, COMMUNICATION METHOD, AND COMMUNICATION PROGRAM

Country Status (1)

Country Link
JP (1) JP4906800B2 (en)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2013025374A (en) * 2011-07-15 2013-02-04 Fujitsu Semiconductor Ltd Security device and security system
JP2013141137A (en) * 2012-01-05 2013-07-18 Ricoh Co Ltd Composite system
JP2013143653A (en) * 2012-01-10 2013-07-22 Canon Inc Information processing apparatus and information processing method
JP2015511434A (en) * 2012-02-21 2015-04-16 インターナショナル・ビジネス・マシーンズ・コーポレーションInternational Business Machines Corporation Network node with network-attached stateless security offload device
JP2020009022A (en) * 2018-07-04 2020-01-16 キヤノン株式会社 Communication device and control method thereof and communication system

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO1992006430A1 (en) * 1990-09-28 1992-04-16 Fujitsu Limited Message control system in a data communication system
JP2004126323A (en) * 2002-10-04 2004-04-22 Sony Corp Method and circuit for block ciphering, ciphering device, method and circuit for block deciphering, and deciphering device
JP2004364022A (en) * 2003-06-05 2004-12-24 Nec Corp Encrypted communication control system
JP2006041684A (en) * 2004-07-23 2006-02-09 Sony Corp Encryption processing apparatus and encryption processing method

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO1992006430A1 (en) * 1990-09-28 1992-04-16 Fujitsu Limited Message control system in a data communication system
JP2004126323A (en) * 2002-10-04 2004-04-22 Sony Corp Method and circuit for block ciphering, ciphering device, method and circuit for block deciphering, and deciphering device
JP2004364022A (en) * 2003-06-05 2004-12-24 Nec Corp Encrypted communication control system
JP2006041684A (en) * 2004-07-23 2006-02-09 Sony Corp Encryption processing apparatus and encryption processing method

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2013025374A (en) * 2011-07-15 2013-02-04 Fujitsu Semiconductor Ltd Security device and security system
US9152805B2 (en) 2011-07-15 2015-10-06 Socionext Inc. Security device
JP2013141137A (en) * 2012-01-05 2013-07-18 Ricoh Co Ltd Composite system
JP2013143653A (en) * 2012-01-10 2013-07-22 Canon Inc Information processing apparatus and information processing method
JP2015511434A (en) * 2012-02-21 2015-04-16 インターナショナル・ビジネス・マシーンズ・コーポレーションInternational Business Machines Corporation Network node with network-attached stateless security offload device
JP2020009022A (en) * 2018-07-04 2020-01-16 キヤノン株式会社 Communication device and control method thereof and communication system

Also Published As

Publication number Publication date
JP4906800B2 (en) 2012-03-28

Similar Documents

Publication Publication Date Title
US11784801B2 (en) Key management method and related device
US9003202B2 (en) Memory control device, semiconductor memory device, memory system, and memory control method
US8077867B2 (en) Confidential information processing apparatus, confidential information processing device, and confidential information processing method
US9344278B2 (en) Secure data transfer using random ordering and random block sizing
EP0482371A2 (en) Method and apparatus for controlling the use of a public key, based on the level of integrity for the key
CN108959978A (en) The generation of key and acquisition methods and device in equipment
JP4906800B2 (en) COMMUNICATION DEVICE, ENCRYPTED COMMUNICATION SYSTEM, COMMUNICATION METHOD, AND COMMUNICATION PROGRAM
US8571206B2 (en) Information transmitting apparatus, information transmitting method, and computer product
KR101305627B1 (en) Cryptographic apparatus and memory system
CN110912920A (en) Data processing method, apparatus and medium
US7167559B2 (en) Information security device, exponentiation device, modular exponentiation device, and elliptic curve exponentiation device
JP5080908B2 (en) Confidential information processing apparatus, confidential information processing apparatus, and confidential information processing method
CN115208701A (en) Data packet selective encryption method and device
US6501840B1 (en) Cryptographic processing apparatus cryptographic processing method and recording medium for recording a cryptographic processing program
CN115208570A (en) Encryption method and device based on dynamic replacement of secret key
JP4912797B2 (en) ENCRYPTION DEVICE, DECRYPTION DEVICE, ENCRYPTION METHOD, DECRYPTION METHOD, AND PROGRAM
CN115208569B (en) Encryption and decryption method and device for dynamic key distribution
Jamaluddin et al. Securing RF communication using AES-256 symmetric encryption: A performance evaluation
JP2009044677A (en) Secret information processor, processing apparatus, and processing method
CN113381854B (en) Data transmission method, device, equipment and storage medium
CN115955306B (en) Data encryption transmission method and device, electronic equipment and storage medium
KR102117758B1 (en) Lightweight Cryptographic Accelerated Operation Processing Method In Power Platform Server EnvironmentEnvironment
JP6162556B2 (en) Storage device and information processing system
JP6786455B2 (en) Communication system, public key cryptosystem and its method
JP2004184516A (en) Digital data transmitting terminal

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20110511

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20111202

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

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20111213

A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20120110

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

Free format text: PAYMENT UNTIL: 20150120

Year of fee payment: 3

R150 Certificate of patent or registration of utility model

Ref document number: 4906800

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150

Free format text: JAPANESE INTERMEDIATE CODE: R150

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250