JP5526747B2 - Decryption device, encryption device, decryption method, encryption method, and communication system - Google Patents

Decryption device, encryption device, decryption method, encryption method, and communication system Download PDF

Info

Publication number
JP5526747B2
JP5526747B2 JP2009276294A JP2009276294A JP5526747B2 JP 5526747 B2 JP5526747 B2 JP 5526747B2 JP 2009276294 A JP2009276294 A JP 2009276294A JP 2009276294 A JP2009276294 A JP 2009276294A JP 5526747 B2 JP5526747 B2 JP 5526747B2
Authority
JP
Japan
Prior art keywords
packet
data
random number
encryption
encrypted
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.)
Active
Application number
JP2009276294A
Other languages
Japanese (ja)
Other versions
JP2011120051A (en
JP2011120051A5 (en
Inventor
正克 松尾
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.)
Panasonic Corp
Panasonic Holdings Corp
Original Assignee
Panasonic Corp
Matsushita Electric Industrial Co Ltd
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 Panasonic Corp, Matsushita Electric Industrial Co Ltd filed Critical Panasonic Corp
Priority to JP2009276294A priority Critical patent/JP5526747B2/en
Priority to US13/502,081 priority patent/US8731196B2/en
Priority to PCT/JP2010/004712 priority patent/WO2011067876A1/en
Publication of JP2011120051A publication Critical patent/JP2011120051A/en
Publication of JP2011120051A5 publication Critical patent/JP2011120051A5/ja
Application granted granted Critical
Publication of JP5526747B2 publication Critical patent/JP5526747B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/06Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols the encryption apparatus using shift registers or memories for block-wise or stream coding, e.g. DES systems or RC4; Hash functions; Pseudorandom sequence generators
    • H04L9/065Encryption by serially and continuously modifying data stream elements, e.g. stream cipher systems, RC4, SEAL or A5/3
    • H04L9/0656Pseudorandom key sequence combined element-for-element with data sequence, e.g. one-time-pad [OTP] or Vernam's cipher
    • H04L9/0662Pseudorandom key sequence combined element-for-element with data sequence, e.g. one-time-pad [OTP] or Vernam's cipher with particular pseudorandom sequence generator
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/04Network architectures or network communication protocols for network security for providing a confidential data exchange among entities communicating through data packet networks
    • H04L63/0428Network architectures or network communication protocols for network security for providing a confidential data exchange among entities communicating through data packet networks wherein the data content is protected, e.g. by encrypting or encapsulating the payload
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/06Network architectures or network communication protocols for network security for supporting key management in a packet data network
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/12Transmitting and receiving encryption devices synchronised or initially set up in a particular manner

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computer Hardware Design (AREA)
  • Computing Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Description

本発明は、パケットロスやパケットの到着順が逆になることが起こりえる通信方式であっても、送信側と受信側の間の同期ずれを抑制することの出来る、復号化装置、暗号化装置、復号化方法、暗号化方法、および通信システムに関するものである。   The present invention relates to a decryption device and an encryption device capable of suppressing a synchronization shift between a transmission side and a reception side even in a communication scheme in which packet loss and the arrival order of packets may be reversed. The present invention relates to a decryption method, an encryption method, and a communication system.

近年、各種通信において、インターネットを利用するケースが増大している。インターネットが普及した当初は、非リアルタイム通信であるE−mailやWebが主流であった。しかし、インターネット技術の進歩に伴い、最近では、TVや、電話や、監視カメラといった音声・画像系のリアルタイム通信が、インターネットでも多く利用されるようになった。   In recent years, cases of using the Internet in various communications have increased. At the beginning of the spread of the Internet, non-real-time communications such as E-mail and Web were mainstream. However, with the advancement of Internet technology, audio / video real-time communication such as TV, telephone, and surveillance camera has recently been widely used on the Internet.

インターネットは、QoS(Quality of Service)を考慮していないので、リアルタイム通信には適していない。従って、インターネット経由の通信でリアルタイム性を向上するには、通信速度を向上することが望ましい。このような状況下、セキュリティ確保をしつつ、通信速度を向上させるために、ストリーミング暗号などの暗号方式が開示されている(例えば、特許文献1参照)。   The Internet is not suitable for real-time communication because it does not consider QoS (Quality of Service). Therefore, it is desirable to improve the communication speed in order to improve the real-time property in communication via the Internet. Under such circumstances, an encryption method such as streaming encryption has been disclosed in order to improve communication speed while ensuring security (see, for example, Patent Document 1).

一方、利用ユーザ数や転送データ容量の急激な増大(例えば画像通信におけるハイビジョン化など)もあり、インターネットの通信速度向上は、必ずしもリアルタイム性向上にはつながっていない。このような背景から、リアルタイム通信では、通信速度の遅いTCP(Transmission Control Protocol)通信ではなく、より速いUDP(User Datagram Protocol)通信が採用されることが多い。   On the other hand, there is also a rapid increase in the number of users and transfer data capacity (for example, high-definition in image communication, etc.), and the improvement in the Internet communication speed does not necessarily lead to an improvement in real-time performance. From such a background, in real-time communication, faster UDP (User Datagram Protocol) communication is often adopted instead of TCP (Transmission Control Protocol) communication having a low communication speed.

しかし、UDP通信ではパケットロスやパケット到着順が逆になる場合があるので、共通鍵暗号化方式に特別の工夫を施さなくてはならない。例えば、SSL暗号通信(TCP通信)の共通鍵暗号化方式で最もよく利用されているストリーミング暗号のArcfour暗号やブッロク暗号のAES CBCモードでは、パケットロスやパケット到着順が逆になるようなことが起こると、同期ずれが起こり、それ以降、受信側で正しく復号できなくなる不都合がある。   However, since packet loss and packet arrival order may be reversed in UDP communication, special measures must be taken in the common key encryption method. For example, the packet loss and the packet arrival order may be reversed in the ARC CBC mode of the streaming cipher or the block cipher AES CBC mode that is most often used in the common key encryption method of the SSL cipher communication (TCP communication). When this occurs, there is a disadvantage that synchronization is lost, and thereafter the receiving side cannot correctly decode.

特開2007−33649号公報JP 2007-33649 A

解決しようとする問題点は、パケットロスやパケット到着順が逆になることが起こり得る通信方式であっても、同期ずれなく暗号・復号処理を行うことの出来る暗号方式を提供することにある。   The problem to be solved is to provide an encryption method capable of performing encryption / decryption processing without a synchronization error even in a communication method in which packet loss and packet arrival order may be reversed.

本発明の復号化装置は、パケットに含まれる暗号文データを復号化する復号化装置であって、暗号処理を実行する暗号化装置から送信されるパケットを受信する受信手段と、暗号処理に用いられる鍵と同じ鍵を生成する鍵生成手段と、鍵生成手段により生成される鍵に基づいて、受信手段により受信されたパケットに含まれる暗号文データを復号化する復号化手段とを有し、受信手段により受信されたパケットには、鍵の生成に用いられかつパケットを識別するためのパケット情報が含まれており、鍵生成手段は、パケット情報を用いて鍵を生成する構成を備えている。 The decryption device according to the present invention is a decryption device for decrypting ciphertext data included in a packet, and is used for reception processing for receiving a packet transmitted from the encryption device for executing encryption processing, and for encryption processing. A key generation unit that generates the same key as the generated key, and a decryption unit that decrypts the ciphertext data included in the packet received by the reception unit based on the key generated by the key generation unit, The packet received by the receiving means includes packet information used for key generation and for identifying the packet, and the key generating means has a configuration for generating a key using the packet information. .

本発明の暗号化装置は、平文データを暗号化し、暗号文データを復号化装置に送信する暗号化装置であって、パケットに対応しかつパケットを識別するためのパケット情報を用いて、鍵を生成する鍵生成手段と、鍵生成手段により生成される鍵に基づいて平文データを暗号化し、暗号文データを生成する暗号化手段と、暗号文データとパケット情報とを含むパケットを、復号化装置に送信する送信手段とを有する構成を備えている。 An encryption apparatus according to the present invention is an encryption apparatus that encrypts plaintext data and transmits the ciphertext data to the decryption apparatus. The encryption apparatus corresponds to a packet and uses a packet information for identifying the packet, A key generation unit for generating, a ciphertext data based on a key generated by the key generation unit, an encryption unit for generating ciphertext data, and a packet including the ciphertext data and packet information And a transmission means for transmitting to.

本発明の復号化装置は、鍵の生成に用いられたパケット情報と、この鍵を用いて暗号化した平文データを、同一のパケットでまとめて受信するので、鍵の生成に必要な情報を、暗号文データの復号化に使用することが出来る。これにより、パケットが送信される途中で、パケットがロストしたり、パケットの順番が入れ替わったりした場合であっても、暗号化装置と復号化装置の間の同期ずれを抑制することが出来る。   Since the decryption apparatus of the present invention receives packet information used for key generation and plaintext data encrypted using this key together in the same packet, information necessary for key generation is It can be used to decrypt ciphertext data. As a result, even if the packet is lost or the order of the packets is changed during the transmission of the packet, it is possible to suppress the synchronization shift between the encryption device and the decryption device.

本発明の暗号化装置は、暗号化装置は、鍵の生成に用いられたパケット情報と、この鍵を用いて暗号化した平文データを、同一のパケットでまとめて復号化装置に送信するので、パケットが送信される途中で、パケットがロストしたり、パケットの順番が入れ替わったりした場合であっても、復号化装置は、暗号文データの復号化に際して、当該復号化処理の鍵生成に必要な情報を受信することが出来る。   In the encryption device of the present invention, the encryption device transmits the packet information used for generating the key and the plaintext data encrypted using the key together in the same packet to the decryption device. Even if the packet is lost or the order of the packets is changed during the transmission of the packet, the decryption device is required to generate the key for the decryption process when decrypting the ciphertext data. Information can be received.

実施例1における通信システムの機能ブロック図Functional block diagram of a communication system in the first embodiment 実施例1における通信システムの動作を示すタイミングチャートTiming chart showing operation of communication system in embodiment 1 実施例1における送信装置の動作の説明図Explanatory drawing of operation | movement of the transmitter in Example 1. FIG. 実施例1における送信装置の動作を示すフローチャートFlowchart showing the operation of the transmission apparatus in the first embodiment. 実施例1におけるカウンタデータの実装する方法の説明図Explanatory drawing of the method of mounting the counter data in Example 1 実施例1におけるカウンタデータ算出方法のフローチャートFlowchart of counter data calculation method in embodiment 1 実施例1における受信装置の動作を示すフローチャート6 is a flowchart showing the operation of the receiving apparatus according to the first embodiment. 実施例1における処理速度の測定結果を示す図The figure which shows the measurement result of the processing speed in Example 1 実施例1における、MACチェックの説明図Explanatory drawing of MAC check in Example 1. 実施例1におけるMACチェックの説明図Explanatory drawing of MAC check in Example 1 実施例2における通信システムの動作を示すタイミングチャートTiming chart showing operation of communication system in embodiment 2 実施例2における送信装置の動作を示すフローチャートFlowchart showing operation of transmitting apparatus in embodiment 2. 実施例2における受信装置の動作を示すフローチャートFlowchart showing the operation of the receiving apparatus in the second embodiment. 実施例3における監視システムの全体図Overall view of monitoring system in embodiment 3 実施例3における監視システムの機能ブロック図Functional block diagram of a monitoring system in Embodiment 3 実施例4における通信システムの動作を示すタイミングチャートTiming chart showing operation of communication system in embodiment 4 実施例5における通信システムの動作を示すタイミングチャートTiming chart showing operation of communication system in embodiment 5

本発明の復号化装置は、パケットに含まれる暗号文データを復号化する復号化装置であって、暗号処理を実行する暗号化装置から送信されるパケットを受信する受信手段と、暗号処理に用いられる鍵と同じ鍵を生成する鍵生成手段と、鍵生成手段により生成される鍵に基づいて、受信手段により受信されたパケットに含まれる暗号文データを復号化する復号化手段とを有し、受信手段により受信されたパケットには、鍵の生成に用いられかつパケットを識別するためのパケット情報が含まれており、鍵生成手段は、パケット情報を用いて鍵を生成する構成を備えている。これにより、復号化装置は、鍵の生成に用いられたパケット情報と、この鍵を用いて暗号化した平文データを、同一のパケットでまとめて受信するので、鍵の生成に必要な情報を、暗号文データの復号化に使用することが出来る。これにより、パケットが送信される途中で、パケットがロストしたり、パケットの順番が入れ替わったりした場合であっても、暗号化装置と復号化装置の間の同期ずれを抑制することが出来る。 The decryption device according to the present invention is a decryption device for decrypting ciphertext data included in a packet, and is used for reception processing for receiving a packet transmitted from the encryption device for executing encryption processing, and for encryption processing. A key generation unit that generates the same key as the generated key, and a decryption unit that decrypts the ciphertext data included in the packet received by the reception unit based on the key generated by the key generation unit, The packet received by the receiving means includes packet information used for key generation and for identifying the packet, and the key generating means has a configuration for generating a key using the packet information. . Thereby, since the decryption apparatus receives the packet information used for generating the key and the plaintext data encrypted using the key together in the same packet, the information necessary for generating the key is It can be used to decrypt ciphertext data. As a result, even if the packet is lost or the order of the packets is changed during the transmission of the packet, it is possible to suppress the synchronization shift between the encryption device and the decryption device.

さらに、復号化装置は、さらに、鍵生成手段により生成される鍵をシードとして、乱数を生成する乱数生成手段を有し、復号化手段は、乱数生成手段により生成された乱数と、パケットに含まれる暗号文データとを、XOR演算する構成を備えている。これにより、暗号処理に処理速度の速い乱数生成処理を利用するので、復号化処理の高速化を図ることが出来る。   Furthermore, the decryption device further includes a random number generation unit that generates a random number using the key generated by the key generation unit as a seed. The decryption unit includes the random number generated by the random number generation unit and the packet. The ciphertext data is subjected to an XOR operation. Thereby, since the random number generation process with a high processing speed is used for the encryption process, the speed of the decryption process can be increased.

さらに、鍵生成手段は、少なくとも1以上のパケットおきにシードを生成する構成を備えている。これにより、パケットあたりのシード生成の処理回数が少なくなるので、復号化処理をさらに高速化させることが出来る。   Furthermore, the key generation means has a configuration for generating a seed at least every one or more packets. Thereby, since the number of seed generation processes per packet is reduced, the decoding process can be further speeded up.

さらに、暗号化装置から、第1パケット、・・・、第Mパケット、・・・、第Nパケット(1≦M<N、Nは2以上の整数)を当該復号化装置に順次、送信され、復号化装置は、さらに、受信手段により受信された第Mパケットが示す通信データ数の総和に応じて、乱数生成手段が生成した乱数から乱数列を設定する乱数列設定手段を有し、復号化手段は、乱数列設定手段が設定した乱数列と、第Nパケットに含まれる暗号文データとを、XOR演算する構成を備えている。これにより、通信データ数の総和によって、第Nパケットの復号化に必要な乱数列を設定することが出来る。これにより、パケットが送信される途中で、パケットがロストしたり、パケットの順番が入れ替わったりした場合であっても、復号化装置は、必要な分だけ乱数を生成して、同期ずれの抑制を向上させることが出来る。   Further, the first packet,..., The Mth packet,..., The Nth packet (1 ≦ M <N, N is an integer of 2 or more) are sequentially transmitted from the encryption device to the decryption device. The decryption apparatus further includes a random number sequence setting unit that sets a random number sequence from the random numbers generated by the random number generation unit in accordance with the total number of communication data indicated by the Mth packet received by the reception unit. The converting unit has a configuration for performing an XOR operation on the random number sequence set by the random number sequence setting unit and the ciphertext data included in the Nth packet. Accordingly, a random number sequence necessary for decoding the Nth packet can be set based on the total number of communication data. As a result, even when the packet is lost or the order of the packets is changed during the transmission of the packet, the decoding device generates random numbers as much as necessary to suppress the synchronization error. Can be improved.

さらに、第Mパケットには、第1パケットから第M−1パケットまでの通信データ数の総和を示す情報が含まれており、乱数列設定手段は、第Mパケットが示す情報を用いて乱数列を設定する構成を備えている。   Further, the Mth packet includes information indicating the total number of communication data from the first packet to the M−1th packet, and the random number sequence setting means uses the information indicated by the Mth packet to generate a random number sequence. It has a configuration to set.

さらに、鍵生成手段は、逆関数を有する暗号方式に基づいてパケット情報を暗号化することにより、鍵を生成する構成を備えている。これにより、パケット情報から鍵が一意的に定まるので、暗号文データに最適な鍵を用いて復号することが出来る。   Furthermore, the key generation means has a configuration for generating a key by encrypting packet information based on an encryption method having an inverse function. As a result, since the key is uniquely determined from the packet information, the key can be decrypted using the optimum key for the ciphertext data.

さらに、鍵生成手段は、パケット情報をブロック毎に暗号化することにより、鍵を生成する構成を備えている。   Furthermore, the key generation means has a configuration for generating a key by encrypting packet information for each block.

さらに、パケット情報は、パケットを識別自在なカウンタデータである構成を備えている。これにより、パケットのカウンタデータを利用するので、簡易な構成を実現することが出来る。   Furthermore, the packet information has a configuration that is counter data that can identify a packet. Thereby, since the counter data of the packet is used, a simple configuration can be realized.

さらに、カウンタデータは、パケットの通し番号である構成を備えている。これにより、同じカウンタデータが出現しないので、セキュリティレベルを向上させることが出来る。   Further, the counter data has a configuration that is a serial number of the packet. Thereby, since the same counter data does not appear, the security level can be improved.

さらに、パケットは、コネクションレス型のプロトコルに基づく構成を備えている。これにより、コネクションレス型のため、パケットが送信される途中で、パケットがロストしたり、パケットの順番が入れ替わったりした場合があり得るが、このような場合であっても、暗号化装置と復号化装置の間の同期ずれを抑制することが出来る。   Further, the packet has a configuration based on a connectionless protocol. As a result, because of the connectionless type, there is a possibility that the packet is lost or the order of the packets is changed during the transmission of the packet. It is possible to suppress the synchronization error between the digitizing devices.

さらに、コネクションレス型のプロトコルケットは、UDP(User Datagram Protocol)を含む構成を備えている。これにより、UDPでは、パケットが送信される途中で、パケットがロストしたり、パケットの順番が入れ替わったりした場合があり得るが、このような場合であっても、暗号化装置と復号化装置の間の同期ずれを抑制することが出来る。   Furthermore, the connectionless protocol ket has a configuration including UDP (User Datagram Protocol). As a result, in UDP, packets may be lost or the order of the packets may be changed during the transmission of the packets. Even in such a case, the encryption device and the decryption device Can be suppressed.

本発明の復号化装置は、平文データを暗号化し、暗号文データを復号化装置に送信する暗号化装置であって、パケットに対応しかつパケットを識別するためのパケット情報を用いて、鍵を生成する鍵生成手段と、鍵生成手段により生成される鍵に基づいて平文データを暗号化し、暗号文データを生成する暗号化手段と、暗号文データとパケット情報とを含むパケットを、復号化装置に送信する送信手段とを有する構成を備えている。これにより、暗号化装置は、鍵の生成に用いられたパケット情報と、この鍵を用いて暗号化した平文データを、同一のパケットでまとめて復号化装置に送信するので、パケットが送信される途中で、パケットがロストしたり、パケットの順番が入れ替わったりした場合であっても、復号化装置は、暗号文データの復号化に際して、当該復号化処理の鍵生成に必要な情報を受信することが出来る。 The decryption device of the present invention is an encryption device that encrypts plaintext data and transmits the ciphertext data to the decryption device, and uses a packet information for identifying the packet and corresponding to the packet, A key generation unit for generating, a ciphertext data based on a key generated by the key generation unit, an encryption unit for generating ciphertext data, and a packet including the ciphertext data and packet information And a transmission means for transmitting to. As a result, the encryption apparatus transmits the packet information used for generating the key and the plaintext data encrypted using the key together in the same packet to the decryption apparatus, so that the packet is transmitted. Even when the packet is lost or the order of the packets is changed during the process, the decryption device receives the information necessary for generating the key for the decryption process when decrypting the ciphertext data. I can do it.

さらに、暗号化装置は、さらに、鍵生成手段により生成される鍵をシードとして、乱数を生成する乱数生成手段を有し、暗号化手段は、乱数生成手段により生成された乱数と、パケットに含まれる暗号文データとを、XOR演算する構成を備えている。これにより、暗号処理に処理速度の速い乱数生成処理を利用するので、暗号化処理の高速化を図ることが出来る。   Furthermore, the encryption device further includes a random number generation unit that generates a random number using the key generated by the key generation unit as a seed, and the encryption unit includes the random number generated by the random number generation unit and the packet The ciphertext data is subjected to an XOR operation. Thereby, since a random number generation process with a high processing speed is used for the encryption process, the encryption process can be speeded up.

さらに、鍵生成手段は、少なくとも1以上のパケットおきにシードを生成する構成を備えている。これにより、パケットあたりのシード生成の処理回数が少なくなるので、暗号化処理をさらに高速化させることが出来る。   Furthermore, the key generation means has a configuration for generating a seed at least every one or more packets. As a result, the number of seed generation processes per packet is reduced, so that the encryption process can be further accelerated.

さらに、送信手段は、第1パケット、・・・、第Mパケット、・・・、第Nパケット(1≦M<N、Nは2以上の整数)を順次、復号化装置に送信し、第Mパケットには、第1パケットから第M−1パケットまでの通信データ数の総和を示す情報が含まれている構成を備えている。これにより、暗号化装置は、第Nパケットの復号化に必要な情報を、復号化装置に通知することが出来る。   Further, the transmission means sequentially transmits the first packet,..., The Mth packet,..., The Nth packet (1 ≦ M <N, where N is an integer of 2 or more) to the decoding device. The M packet has a configuration in which information indicating the total number of communication data from the first packet to the M-1th packet is included. As a result, the encryption apparatus can notify the decryption apparatus of information necessary for decrypting the Nth packet.

さらに、鍵生成手段は、逆関数を有する暗号方式に基づいてパケット情報を暗号化することにより、鍵を生成する構成を備えている。これにより、パケット情報から鍵が一意的に定まるので、暗号文データに最適な鍵を用いて復号することが出来る。   Furthermore, the key generation means has a configuration for generating a key by encrypting packet information based on an encryption method having an inverse function. As a result, since the key is uniquely determined from the packet information, the key can be decrypted using the optimum key for the ciphertext data.

さらに、鍵生成手段は、パケット情報をブロック毎に暗号化することにより、鍵を生成する構成を備えている。   Furthermore, the key generation means has a configuration for generating a key by encrypting packet information for each block.

さらに、パケット情報は、パケットを識別自在なカウンタデータである構成を備えている。これにより、パケットのカウンタデータを利用するので、簡易な構成を実現することが出来る。   Furthermore, the packet information has a configuration that is counter data that can identify a packet. Thereby, since the counter data of the packet is used, a simple configuration can be realized.

さらに、カウンタデータは、パケットの通し番号である構成を備えている。これにより、同じカウンタデータが出現しないので、セキュリティレベルを向上させることが出来る。   Further, the counter data has a configuration that is a serial number of the packet. Thereby, since the same counter data does not appear, the security level can be improved.

さらに、パケットは、コネクションレス型のプロトコルに基づく構成を備えている。これにより、コネクションレス型のため、パケットが送信される途中で、パケットがロストしたり、パケットの順番が入れ替わったりした場合があり得るが、このような場合であっても、暗号化装置と復号化装置の間の同期ずれを抑制することが出来る。   Further, the packet has a configuration based on a connectionless protocol. As a result, because of the connectionless type, there is a possibility that the packet is lost or the order of the packets is changed during the transmission of the packet. It is possible to suppress the synchronization error between the digitizing devices.

さらに、コネクションレス型のプロトコルケットは、UDP(User Datagram Protocol)を含む構成を備えている。これにより、UDPでは、パケットが送信される途中で、パケットがロストしたり、パケットの順番が入れ替わったりした場合があり得るが、このような場合であっても、暗号化装置と復号化装置の間の同期ずれを抑制することが出来る。   Furthermore, the connectionless protocol ket has a configuration including UDP (User Datagram Protocol). As a result, in UDP, packets may be lost or the order of the packets may be changed during the transmission of the packets. Even in such a case, the encryption device and the decryption device Can be suppressed.

本発明の復号化方法は、パケットに含まれる暗号文データを復号化する復号化方法であって、暗号処理を実行する暗号化装置から送信されるパケットを受信する受信ステップと、暗号処理に用いられる鍵と同じ鍵を生成する鍵生成ステップと、鍵生成ステップで生成される鍵に基づいて、受信ステップで受信されたパケットに含まれる暗号文データを復号化する復号化ステップとを有し、受信ステップで受信されたパケットには、鍵の生成に用いられかつパケットを識別するためのパケット情報が含まれており、鍵生成ステップで、パケット情報を用いて鍵を生成する構成を備えている。これにより、復号化方法は、鍵の生成に用いられたパケット情報と、この鍵を用いて暗号化した平文データを、同一のパケットでまとめて受信するので、鍵の生成に必要な情報を、暗号文データの復号化に使用することが出来る。これにより、パケットが送信される途中で、パケットがロストしたり、パケットの順番が入れ替わったりした場合であっても、暗号化装置と復号化装置の間の同期ずれを抑制することが出来る。 The decryption method of the present invention is a decryption method for decrypting ciphertext data included in a packet, and is used for a reception step of receiving a packet transmitted from an encryption device that performs encryption processing, and for encryption processing A key generation step for generating the same key as the generated key, and a decryption step for decrypting the ciphertext data included in the packet received in the reception step based on the key generated in the key generation step, The packet received in the reception step includes packet information used for key generation and for identifying the packet, and has a configuration for generating a key using the packet information in the key generation step. . As a result, the decryption method receives the packet information used for generating the key and the plaintext data encrypted using the key together in the same packet. It can be used to decrypt ciphertext data. As a result, even if the packet is lost or the order of the packets is changed during the transmission of the packet, it is possible to suppress the synchronization shift between the encryption device and the decryption device.

本発明の暗号化方法は、平文データを暗号化し、暗号文データを復号化装置に送信する暗号化方法であって、パケットに対応しかつパケットを識別するためのパケット情報を用いて、鍵を生成する鍵生成ステップと、鍵生成ステップで生成される鍵に基づいて平文データを暗号化し、暗号文データを生成する暗号化ステップと、暗号文データとパケット情報とを含むパケットを、復号化装置に送信する送信ステップとを有する構成を備えている。これにより、暗号化方法は、鍵の生成に用いられたパケット情報と、この鍵を用いて暗号化した平文データを、同一のパケットでまとめて復号化装置に送信するので、パケットが送信される途中で、パケットがロストしたり、パケットの順番が入れ替わったりした場合であっても、復号化装置は、暗号文データの復号化に際して、当該復号化処理の鍵生成に必要な情報を受信することが出来る。 The encryption method of the present invention is an encryption method for encrypting plaintext data and transmitting the ciphertext data to a decryption device, which uses a packet information corresponding to the packet and for identifying the packet, A key generation step for generating, a plaintext data is encrypted based on the key generated in the key generation step, an encryption step for generating ciphertext data, and a packet including the ciphertext data and packet information is decrypted And a transmission step for transmitting to the network. As a result, the encryption method transmits the packet information used for generating the key and the plain text data encrypted using the key together in the same packet to the decryption device, so that the packet is transmitted. Even when the packet is lost or the order of the packets is changed during the process, the decryption device receives the information necessary for generating the key for the decryption process when decrypting the ciphertext data. I can do it.

本発明の通信方法は、平文データを暗号化し、パケットに含まれる暗号文データを通信回線に送信する暗号化装置と、暗号化装置から通信回線を介してパケットを受信し、パケットに含まれる暗号文データを復号化する復号化装置とを備え、暗号化装置は、パケットに対応するパケット情報を用いて、鍵を生成する第1の鍵生成手段と、第1の鍵生成手段により生成される鍵と同じ鍵に基づいて平文データを暗号化し、暗号文データを生成する暗号化手段と、暗号文データとパケット情報とを含むパケットを、復号化装置に送信する送信手段とを有し、復号化装置は、暗号化装置から送信されるパケットを受信する受信手段と、受信手段により受信されたパケットに含まれかつパケットを識別するためのパケット情報を用いて、鍵を生成する第2の鍵生成手段と、第2の鍵生成手段により生成される鍵に基づいて、受信手段により受信されたパケットに含まれる暗号文データを復号化する復号化手段とを有することを特徴とする構成を備えている。これにより、暗号化装置は、鍵の生成に用いられたパケット情報と、この鍵を用いて暗号化した平文データを、同一のパケットでまとめて復号化装置に送信するので、復号化装置は、暗号文データの復号化に際して、当該復号化処理の鍵生成に必要な情報を受信することが出来る。復号化装置は、鍵の生成に用いられたパケット情報と、この鍵を用いて暗号化した平文データを、同一のパケットでまとめて受信するので、鍵の生成に必要な情報を、暗号文データの復号化に使用することが出来る。これにより、パケットが送信される途中で、パケットがロストしたり、パケットの順番が入れ替わったりした場合であっても、暗号化装置と復号化装置の間の同期ずれを抑制することが出来る。 The communication method of the present invention includes an encryption device that encrypts plaintext data and transmits the ciphertext data included in the packet to the communication line, a packet received from the encryption device via the communication line, and an encryption included in the packet. A decryption device that decrypts the sentence data, and the encryption device is generated by a first key generation unit that generates a key using packet information corresponding to the packet, and a first key generation unit. An encryption unit that encrypts plaintext data based on the same key as the key and generates ciphertext data; and a transmission unit that transmits a packet including the ciphertext data and packet information to the decryption device. apparatus uses a receiving means for receiving a packet transmitted from the encryption apparatus, the packet information for identifying and packets included in the received packet by the receiving means, for generating a key And a decryption unit configured to decrypt ciphertext data included in the packet received by the reception unit based on the key generated by the second key generation unit. It has a configuration. As a result, the encryption device transmits the packet information used for generating the key and the plaintext data encrypted using this key together in the same packet to the decryption device. When decrypting ciphertext data, it is possible to receive information necessary for generating a key for the decryption process. Since the decryption device receives the packet information used for generating the key and the plaintext data encrypted using the key together in the same packet, the information necessary for generating the key is stored in the ciphertext data. Can be used to decrypt As a result, even if the packet is lost or the order of the packets is changed during the transmission of the packet, it is possible to suppress the synchronization shift between the encryption device and the decryption device.

通信システムは、図1に示すように、送信装置10Aおよび受信装置50Aを有している。送信装置10Aおよび受信装置50Aは、それぞれ暗号化装置および復号化装置の一例である。送信装置10Aおよび受信装置50Aは、インターネットなどの通信経路で接続自在である。なお、通信経路は、有線、無線いずれでも良い。また、本実施例では、通信プロトコルとして、UDP(User Datagram Protocol)などのコネクションレス型のプロトコルを使用している。なお、TCP(Transmission Control Transmission)などのコネクション型のプロトコルを使用することも可能である。   As shown in FIG. 1, the communication system includes a transmission device 10A and a reception device 50A. The transmission device 10A and the reception device 50A are examples of an encryption device and a decryption device, respectively. The transmitting device 10A and the receiving device 50A can be freely connected via a communication path such as the Internet. Note that the communication path may be either wired or wireless. In this embodiment, a connectionless protocol such as UDP (User Datagram Protocol) is used as a communication protocol. It is also possible to use a connection type protocol such as TCP (Transmission Control Transmission).

送信装置10Aは、通信データ生成部11、暗号器12、鍵交換部13、CTR記憶部15、乱数生成器16、XOR処理部17、データ合成部19、カウンタアップ部20、UDPデータ送受信部21、およびネットワーク制御部22を有している。送信装置10Aは、図示しないCPUやASICなどの集積回路を有しており、図1に示す機能ブロックは、例えばCPUによって実現される。   The transmission device 10A includes a communication data generation unit 11, an encryption unit 12, a key exchange unit 13, a CTR storage unit 15, a random number generator 16, an XOR processing unit 17, a data synthesis unit 19, a counter increase unit 20, and a UDP data transmission / reception unit 21. And a network control unit 22. The transmitting apparatus 10A has an integrated circuit such as a CPU and an ASIC (not shown), and the functional blocks shown in FIG. 1 are realized by a CPU, for example.

受信装置50Aは、データ分解部51、暗号器52、鍵交換部53、乱数生成器55、乱数生成器55、XOR処理部56、通信データ解釈部57、UDPデータ送受信部60、およびネットワーク制御部59を有している。受信装置50Aは、送信装置10Aと同様に、図示しないCPUやASICなどの集積回路を有しており、図1に示す機能ブロックは、例えばCPUによって実現される。   The receiving device 50A includes a data decomposition unit 51, an encryptor 52, a key exchange unit 53, a random number generator 55, a random number generator 55, an XOR processing unit 56, a communication data interpretation unit 57, a UDP data transmission / reception unit 60, and a network control unit. 59. Similarly to the transmission device 10A, the reception device 50A has an integrated circuit such as a CPU and an ASIC (not shown), and the functional blocks shown in FIG. 1 are realized by a CPU, for example.

乱数生成器16は、共通鍵を用いて乱数を生成し、XOR処理部17は、平文データをビット毎に暗号化する。すなわち、乱数生成器16およびXOR処理部17は、ストリーミング暗号を実行する機能ブロックを構成する。乱数生成器55は、乱数生成器16と同様に、共通鍵を用いて乱数を生成し、XOR処理部56は、暗号文データをビット毎に復号化する。すなわち、乱数生成器55およびXOR処理部56は、ストリーミング暗号を実行する機能ブロックを構成する。   The random number generator 16 generates a random number using the common key, and the XOR processing unit 17 encrypts the plaintext data bit by bit. That is, the random number generator 16 and the XOR processing unit 17 constitute a functional block that executes streaming encryption. Similarly to the random number generator 16, the random number generator 55 generates a random number using the common key, and the XOR processing unit 56 decrypts the ciphertext data bit by bit. That is, the random number generator 55 and the XOR processing unit 56 constitute a functional block that executes streaming encryption.

ストリーミング暗号は、共通鍵暗号方式の一種で、平文をビット単位、若しくはバイト単位で逐次、暗号化する暗号方式である。ストリーミング暗号は、共通鍵暗号化方式の一種なので、暗号側(乱数生成器16およびXOR処理部17)と復号側(乱数生成器55およびXOR処理部56)は、等価な計算手段である。ここでは同一の計算手段を用いている。ストリーミング暗号としては、例えばArcfourがあるが、これに限られるものではない。例えば、CBC(Cipher Block Chaining)モードなどのように、ブロック暗号をストリーミング暗号として利用する方法でも良い。なお、Arcfourのような専用のストリーミング暗号は、ブロック暗号の代表格であるAES(Advanced Encryption Standard)暗号よりも、ソフト処理では処理速度が速いことから、高速なUDP通信に適している。先に説明したように、リアルタイム性を要求される音声・画像通信では、音飛びや映像飛びを防ぐために、Arcfourのような専用のストリーミング暗号が望ましい。本実施例では、ストリーミング暗号として、Arcfourを利用している。   Streaming encryption is a kind of common key encryption method, and is an encryption method that sequentially encrypts plain text in bit units or byte units. Since the streaming cipher is a kind of common key encryption method, the encryption side (random number generator 16 and XOR processing unit 17) and the decryption side (random number generator 55 and XOR processing unit 56) are equivalent calculation means. Here, the same calculation means is used. Examples of the streaming cipher include Arcfour, but are not limited thereto. For example, a method using a block cipher as a streaming cipher such as CBC (Cipher Block Chaining) mode may be used. Note that a dedicated streaming cipher such as Arcfour is suitable for high-speed UDP communication because the processing speed is higher in software processing than AES (Advanced Encryption Standard) cipher, which is a typical block cipher. As described above, in audio / image communication that requires real-time performance, a dedicated streaming cipher such as Arcfour is desirable in order to prevent sound skipping and video skipping. In this embodiment, Arcfour is used as the streaming cipher.

暗号器12は、カウンタモードが適用可能なブロック暗号器である。本実施例では、AES暗号を利用している。ブロック暗号は、共通鍵暗号方式の一種で、平文をブロック単位で処理する暗号方式である。ブロック単位は、固定長であっても、可変長であってもよい。ブロック暗号としては、例えば、AESや3DES(Data Encryption Standard)がある。このように、ブロック暗号は共通鍵暗号化方式の一種なので、暗号器12と暗号器52と同様、等価な計算手段である。ここでは同一の計算手段を用いている。従って、暗号器12、52に入力される、共通鍵の鍵KY1は、同じ値である。また、ブロック暗号は、逆関数を有する暗号方式の一種であって、逆関数を有する暗号方式とは、異なる平文を同じ暗号文に変換しない方式をいう。   The encryption device 12 is a block encryption device to which a counter mode can be applied. In this embodiment, AES encryption is used. Block cipher is a kind of common key cryptosystem, and is an encryption scheme that processes plaintext in units of blocks. The block unit may be a fixed length or a variable length. Examples of the block cipher include AES and 3DES (Data Encryption Standard). As described above, the block cipher is a kind of common key encryption method, and thus is an equivalent calculation means like the encryptor 12 and the encryptor 52. Here, the same calculation means is used. Accordingly, the common key KY1 input to the encryptors 12 and 52 has the same value. The block cipher is a kind of encryption method having an inverse function, and the encryption method having an inverse function refers to a method in which different plaintexts are not converted into the same ciphertext.

カウンタモードは、カウンタデータを暗号化し、その数値を乱数として使用する処理である。また、カウンタデータは、パケットを識別自在な番号である。ここでは、カウンタデータは、パケットの通し番号である。通し番号の場合、同じカウンタデータが出現しないので、セキュリティレベルを向上させることが出来る。   The counter mode is a process of encrypting counter data and using the numerical value as a random number. The counter data is a number that can identify the packet. Here, the counter data is a packet serial number. In the case of serial numbers, the same counter data does not appear, so the security level can be improved.

カウンタデータは、パケット情報の一例である。パケット情報とは、送信装置が、第1パケットPK1、・・・、第N−1パケットPKn−1、第NパケットPKn(N、nは2以上)を、受信装置に送信する場合に、パケットPK1、・・・、PKn−1、PKnのそれぞれに対応する情報であって、パケットPK1、・・・、PKn−1、PKnのそれぞれを識別自在な情報である。従って、パケット情報は、カウンタデータに限る必要はない。例えば、UDPパケット内にカウンタデータとして利用可能なものがあれば、それをカウンタデータとして代用しても構わない。例えば、音声データの通信を行っている際に、音声データのデータフォーマットに通し番号があれば、これをカウンタデータとして扱っても良い。   The counter data is an example of packet information. The packet information is a packet when the transmitting device transmits the first packet PK1,..., The N-1th packet PKn-1, and the Nth packet PKn (N, n is 2 or more) to the receiving device. Information corresponding to each of PK1,..., PKn-1, and PKn, and information that can identify each of packets PK1,..., PKn-1, and PKn. Therefore, the packet information need not be limited to the counter data. For example, if there is a UDP packet that can be used as counter data, it may be used as counter data. For example, when audio data is communicated, if there is a serial number in the data format of the audio data, it may be handled as counter data.

以下、送信装置10Aの動作を説明する。はじめに、送信装置10Aが、鍵KY1を鍵交換部13で生成し、これを暗号器12にセットする。暗号器12は、この鍵KY1を公開鍵暗号化方式の公開鍵として用いて暗号化を行い、この暗号化された鍵をUDPデータ送受信部21に送る。UDPデータ送受信部21は、ネットワーク制御部22を介して、この暗号化された鍵KY1を受信装置50Aに送信する。受信装置50Aでは、UDPデータ送受信部60が、ネットワーク制御部59を介して、暗号化された鍵KY1を受信する。   Hereinafter, the operation of the transmitting apparatus 10A will be described. First, the transmitting apparatus 10A generates the key KY1 in the key exchange unit 13 and sets it in the encryptor 12. The encryptor 12 performs encryption using the key KY1 as a public key of the public key encryption method, and sends the encrypted key to the UDP data transmitting / receiving unit 21. The UDP data transmitting / receiving unit 21 transmits the encrypted key KY1 to the receiving device 50A via the network control unit 22. In the receiving device 50A, the UDP data transmitting / receiving unit 60 receives the encrypted key KY1 via the network control unit 59.

鍵交換部53は、この暗号化された鍵を、UDPデータ送受信部60から受け取る。鍵交換部53は、公開鍵と対となる公開鍵暗号化方式の秘密鍵を用いて、この暗号化された鍵KY1を復号化する。鍵交換部53は、送信装置10Aが生成した鍵KY1を取得し、この鍵KY1を暗号器52にセットする。ここでは、単純な公開鍵暗号化方式を用いて鍵の受け渡しを行っているが、実際は、SSL(Secure Sockets Layer)通信のように、暗号化においては、攻撃を受けないために、いくつもの注意事項がある。しかし、本発明の説明を簡単にするために、この鍵の交換は、このような簡単な説明に留める。また、UDPパケットで鍵の交換を行っているが、これはSSL通信のようにTCP通信で行っても良い。あるいは、手作業で共通鍵をセットしても良い。共通鍵の交換方法は、この他どのような手段を用いても良い。   The key exchange unit 53 receives the encrypted key from the UDP data transmission / reception unit 60. The key exchange unit 53 decrypts the encrypted key KY1 using a secret key of a public key encryption method that is paired with the public key. The key exchange unit 53 acquires the key KY1 generated by the transmission device 10A and sets the key KY1 in the encryptor 52. Here, a simple public key encryption method is used to pass the key, but in fact, as with SSL (Secure Sockets Layer) communication, encryption is not subject to attacks, so there are several cautions. There are matters. However, in order to simplify the description of the present invention, this key exchange is limited to such a simple description. Moreover, although the key exchange is performed by the UDP packet, this may be performed by the TCP communication like the SSL communication. Alternatively, the common key may be set manually. Any other means may be used as the common key exchange method.

鍵KY1をセットすると、通信データ生成部11は、平文データの一例である通信データCDを生成し、XOR処理部17に送る。これと同時に、通信データ生成部11は、暗号器12に、暗号処理開始を通知する。なお、この暗号処理開始の通知は、XOR処理部17が行っても良い。   When the key KY1 is set, the communication data generation unit 11 generates communication data CD, which is an example of plaintext data, and sends it to the XOR processing unit 17. At the same time, the communication data generation unit 11 notifies the encryption unit 12 of the start of encryption processing. Note that the notification of the start of encryption processing may be performed by the XOR processing unit 17.

暗号器12は、カウンタデータCTRを記憶しているCTR記憶部15から、現在のカウンタデータCTRを読み出す。暗号器12は、このカウンタデータCTRを暗号化して、暗号カウンタデータE(CTR)を生成する。暗号器12は、この暗号カウンタデータE(CTR)を、乱数生成器16のシードSDとして、つまりストリーミング暗号の共通鍵として設定する。これにより、乱数生成器16は、暗号学的に安全な乱数(つまり予測不可能な乱数)を発生させることができる。なお、カウンタデータCTRの初期値は、どんな値であっても良い。   The encryptor 12 reads the current counter data CTR from the CTR storage unit 15 that stores the counter data CTR. The encryptor 12 encrypts the counter data CTR to generate encrypted counter data E (CTR). The encryption device 12 sets the encryption counter data E (CTR) as the seed SD of the random number generator 16, that is, as a common key for streaming encryption. Thereby, the random number generator 16 can generate a cryptographically secure random number (that is, an unpredictable random number). Note that the initial value of the counter data CTR may be any value.

次に、暗号器12は、乱数生成器16に乱数の生成を要求する。この要求は、通信データ生成部11、またはXOR処理部17が行ってもよい。乱数生成器16は、通信データCDのデータ長と同じ、あるいは大きい乱数RNを生成し、乱数RNをXOR処理部17に送る。   Next, the encryptor 12 requests the random number generator 16 to generate a random number. This request may be made by the communication data generation unit 11 or the XOR processing unit 17. The random number generator 16 generates a random number RN that is the same as or larger than the data length of the communication data CD, and sends the random number RN to the XOR processing unit 17.

XOR処理部17は、乱数RN1を受けて、通信データCDと乱数RNのXOR(排他的論理和)を計算(つまり、通信データCDを暗号化)し、暗号通信データECDを生成する。以下の説明では、排他的論理輪を単に「XOR演算」と称す。XOR処理部17は、暗号通信データECDを、データ合成部19に送る。ここでは、通信データCDと乱数RNのXOR演算を一度に計算しているが、逐次行っても良い。   The XOR processing unit 17 receives the random number RN1, calculates XOR (exclusive OR) of the communication data CD and the random number RN (that is, encrypts the communication data CD), and generates encrypted communication data ECD. In the following description, the exclusive logical ring is simply referred to as “XOR operation”. The XOR processing unit 17 sends the encrypted communication data ECD to the data synthesis unit 19. Here, the XOR operation of the communication data CD and the random number RN is calculated at once, but may be performed sequentially.

データ合成部19は、CTR記憶部15から読み出したカウンタデータCTRを暗号通信データECDに付加して、カウンタデータCTR付きの暗号通信データECDを生成する。そして、データ合成部19は、これをUDPデータ送受信部21に送る。   The data synthesizing unit 19 adds the counter data CTR read from the CTR storage unit 15 to the encrypted communication data ECD to generate encrypted communication data ECD with the counter data CTR. Then, the data synthesis unit 19 sends this to the UDP data transmission / reception unit 21.

また、データ合成部19は、カウンタアップ部20に、カウンタデータCTRの更新を要求する。カウンタアップ部20は、CTR記憶部15からカウンタデータCTRを読み出し、この値を更新する。最も簡単な更新方法は、現在のカウンタデータCTRに1を加えたデータを次のカウンタデータCTRにする方法である。現在のカウンタデータのハッシュ値を次のカウンタデータCTRにするなど、この更新はどのようなものであっても良い。   Further, the data composition unit 19 requests the counter up unit 20 to update the counter data CTR. The counter up unit 20 reads the counter data CTR from the CTR storage unit 15 and updates this value. The simplest updating method is a method in which data obtained by adding 1 to the current counter data CTR is used as the next counter data CTR. This update may be anything such as changing the hash value of the current counter data to the next counter data CTR.

UDPデータ送受信部21は、カウンタデータCTR付きの暗号通信データECDにUDPヘッダを付加して、ネットワーク制御部22を介して、カウンタデータCTR付きの暗号通信データECDを、つまりUDPパケットを受信装置50Aに送信する。   The UDP data transmitting / receiving unit 21 adds a UDP header to the encrypted communication data ECD with the counter data CTR, and receives the encrypted communication data ECD with the counter data CTR, that is, the UDP packet, via the network control unit 22, by the receiving device 50A. Send to.

ついで、受信装置50Aの動作を説明する。UDPデータ送受信部60は、送信装置10Aが送信したUDPパケットを、ネットワーク制御部59を介して受信する。UDPデータ送受信部60は、UDPパケットのUDPヘッダを削除し、カウンタデータCTR付きの暗号通信データECDを、データ分解部51に送信する。   Next, the operation of the receiving device 50A will be described. The UDP data transmitting / receiving unit 60 receives the UDP packet transmitted by the transmitting device 10 </ b> A via the network control unit 59. The UDP data transmitting / receiving unit 60 deletes the UDP header of the UDP packet, and transmits the encrypted communication data ECD with the counter data CTR to the data decomposing unit 51.

データ分解部51は、カウンタデータCTR付きの暗号通信データECDから、カウンタデータCTRを読み取り、カウンタデータCTRを暗号器12に送る。またデータ分解部51は、カウンタデータCTR付きの暗号通信データECDから暗号通信データECDを読み取り、XOR処理部56に送る。   The data decomposing unit 51 reads the counter data CTR from the encrypted communication data ECD with the counter data CTR, and sends the counter data CTR to the encryptor 12. The data decomposing unit 51 reads the encrypted communication data ECD from the encrypted communication data ECD with the counter data CTR and sends it to the XOR processing unit 56.

一方、暗号器52は、読み取ったカウンタデータCTRを暗号化して、暗号カウンタデータE(CTR)を生成する。そして暗号器52は、この暗号カウンタデータE(CTR)を、乱数生成器55のシードSDとして、つまりストリーミング暗号の共通鍵として設定する。このように、乱数生成器16、55に入力するシードSDを、異なる乱数生成器で生成させるのではなく、カウンタデータを利用した同一の暗号方式で生成させている。   On the other hand, the encryptor 52 encrypts the read counter data CTR to generate encrypted counter data E (CTR). Then, the encryption device 52 sets the encryption counter data E (CTR) as the seed SD of the random number generator 55, that is, as a common key for streaming encryption. As described above, the seed SD input to the random number generators 16 and 55 is not generated by different random number generators but by the same encryption method using the counter data.

暗号器52は、乱数生成器55に乱数の生成を要求する。この要求は、データ分解部51、またはXOR処理部56が行ってもよい。乱数生成器55は、暗号通信データECDのデータ長と同じ、あるいは大きい乱数RNを発生する。そして乱数生成器55は、乱数RN1をXOR処理部56に送る。   The encryptor 52 requests the random number generator 55 to generate a random number. This request may be made by the data decomposing unit 51 or the XOR processing unit 56. The random number generator 55 generates a random number RN that is the same as or larger than the data length of the encrypted communication data ECD. Then, the random number generator 55 sends the random number RN1 to the XOR processing unit 56.

XOR処理部56は、乱数RNを受けて、暗号通信データECDと乱数RNのXOR演算を行う。ある値Xに対して、同じ値YでXOR演算を2回行うと元の値Xに戻る。つまり、暗号・復号で、同じ乱数を2回用いて、XOR演算を行えば、正しく復号できる。従って、XOR処理部56は、暗号通信データECDを通信データCDに復号化する。XOR処理部56は、通信データCDを、通信データ解釈部57に送り、通信データ解釈部57は、送信装置10Aが送信した通信データCDの内容の解釈を行う。   The XOR processing unit 56 receives the random number RN and performs an XOR operation on the encrypted communication data ECD and the random number RN. When an XOR operation is performed twice on a certain value X with the same value Y, the original value X is restored. In other words, the encryption / decryption can be correctly decrypted by performing the XOR operation using the same random number twice. Therefore, the XOR processing unit 56 decrypts the encrypted communication data ECD into the communication data CD. The XOR processing unit 56 sends the communication data CD to the communication data interpreting unit 57, and the communication data interpreting unit 57 interprets the contents of the communication data CD transmitted by the transmitting device 10A.

UDPパケットPKに付加されたカウンタデータCTRは、暗号化されていないので、第三者はカウンタデータを知り得る。しかし、暗号カウンタデータE(CTR)は、暗号化されたカウンタデータCTRなので、第三者には復号化できない。このことは、この方法で発生させたシードSDもまた第三者には予想されないということと等価である。つまり、ブロック暗号の共通鍵さえ秘密にできれば、カウンタデータCTRは公開されていても、暗号化カウンタデータE(CTR)、つまりシードSDを第三者に知られることはない。   Since the counter data CTR added to the UDP packet PK is not encrypted, a third party can know the counter data. However, since the encrypted counter data E (CTR) is encrypted counter data CTR, it cannot be decrypted by a third party. This is equivalent to the fact that the seed SD generated by this method is also not expected by a third party. That is, as long as the common key of the block cipher can be kept secret, even if the counter data CTR is made public, the encrypted counter data E (CTR), that is, the seed SD is not known to a third party.

なお、カウンタデータCTRは、ブロック暗号で暗号化するので、暗号化カウンタデータE(CTR)のデータサイズは、ブロック暗号のブロック長になる。乱数生成器に必要なシードが、このブロック長サイズより小さければ、暗号化されたカウンタデータの一部分を利用するか、若しくはこの暗号化されたカウンタデータに何らかの計算処理を施し、シードのデータサイズに縮小すれば良い。もし逆に、乱数生成器に必要なシードが、このブロック長より大きければ、この暗号化されたカウンタデータに何らかの計算処理を施し、シードのデータサイズに拡張すれば良い。このような方法は種々あり、どのような方法を使っても良い。   Since the counter data CTR is encrypted with block cipher, the data size of the encrypted counter data E (CTR) is the block length of the block cipher. If the seed required for the random number generator is smaller than the block length size, use a part of the encrypted counter data, or apply some calculation processing to the encrypted counter data to obtain the seed data size. You can reduce it. On the contrary, if the seed required for the random number generator is larger than the block length, the encrypted counter data may be subjected to some calculation processing and expanded to the seed data size. There are various such methods, and any method may be used.

図2に沿って、パケットロスした場合の同期ずれ抑制について説明する。図2では、第1パケットPK1、・・・、第N−1パケットPKn−1、第NパケットPKnの送受信を図示している(N、nは3以上)。図2では、カウンタデータCTR1、・・・、CTRn−1、CTRnは1から始まるケースで説明しており、CTR1、CTR2、CTR3・・・はそれぞれ、1、2、3、・・・である。暗号器12、52で暗号化したものは、それぞれE(CTR1)、・・・、E(CTRn−1)、E(CTRn)である。暗号器12、52が、カウンタデータCTRを暗号化することで、パケット毎に、シードSDを設定している。   With reference to FIG. 2, the suppression of synchronization deviation in the case of packet loss will be described. FIG. 2 illustrates transmission / reception of the first packet PK1,..., The N−1th packet PKn−1, and the Nth packet PKn (N and n are 3 or more). In FIG. 2, the counter data CTR1,..., CTRn-1, CTRn are described starting from 1, and CTR1, CTR2, CTR3,... Are 1, 2, 3,. . Those encrypted by the encryptors 12 and 52 are E (CTR1),..., E (CTRn-1), and E (CTRn), respectively. The encryptors 12 and 52 encrypt the counter data CTR, thereby setting a seed SD for each packet.

UDP通信は、TCP通信とは異なり、コネクションレス通信なので、通信経路上でパケットロスしたり、パケットの到着順が逆になったり、することが起こり得る。例えば、通信経路上のルータの処理が混雑した場合などで、UDPパケットのロストが発生しやすい。   Since UDP communication is connectionless communication unlike TCP communication, packet loss may occur on the communication path or the arrival order of packets may be reversed. For example, the UDP packet is likely to be lost when the processing of the router on the communication path is congested.

まず、送信装置10Aが、パケットPK1を受信装置50Aに送信する。パケットPK1には、カウンタデータCTR1が含まれている。受信装置50Aは、受信したパケットPK1からカウンタデータCTR1を読み出し、暗号器52がこれを暗号化して、暗号カウンタデータE(CTR1)を取得する。乱数生成器55は、暗号カウンタデータE(CTR1)をシードSD1として乱数RN1を生成し、XOR処理部56は、生成された乱数RN1を用いて、パケットPK1に含まれる暗号通信データを復号化する。   First, the transmitting device 10A transmits the packet PK1 to the receiving device 50A. The packet PK1 includes counter data CTR1. The receiving device 50A reads the counter data CTR1 from the received packet PK1, and the encryptor 52 encrypts it to obtain the encrypted counter data E (CTR1). The random number generator 55 generates the random number RN1 using the cryptographic counter data E (CTR1) as the seed SD1, and the XOR processing unit 56 decrypts the encrypted communication data included in the packet PK1 using the generated random number RN1. .

この処理を繰り返し、送信装置10Aは、パケット毎に、シードSDを設定して、パケットPK1、PK2、PK3、・・・を順次、受信装置50Aに送信していく。こうして、送信装置10Aが、乱数RNn−1を発生させ、暗号カウンタデータE(CTRn−1)を付与したパケットPKn−1を、受信装置50Aに送信した場合に、パケットPKn−1が、通信経路上のどこかでロストしたとする。この場合、受信装置50Aは、ロストしたパケットPKn−1を受信しない。   Repeating this process, the transmitting apparatus 10A sets a seed SD for each packet, and sequentially transmits the packets PK1, PK2, PK3,... To the receiving apparatus 50A. Thus, when the transmitting device 10A generates the random number RNn-1 and transmits the packet PKn-1 with the encrypted counter data E (CTRn-1) to the receiving device 50A, the packet PKn-1 Suppose you lost somewhere above. In this case, the receiving device 50A does not receive the lost packet PKn-1.

この状態で、送信装置10Aが、乱数RNnを発生させ、暗号カウンタデータE(CTRn)を付与したパケットPKnを、受信装置50Aに送信する。パケットPKnはロストすることなく、受信装置50Aに受信されたとする。シードはパケット毎に設定されているので、パケットPKnには、暗号通信データと、その暗号通信データを復号するための情報としてカウンタデーCTRnとが含まれている。   In this state, the transmitting device 10A generates a random number RNn and transmits the packet PKn to which the cryptographic counter data E (CTRn) is added to the receiving device 50A. Assume that the packet PKn is received by the receiving device 50A without being lost. Since the seed is set for each packet, the packet PKn includes encrypted communication data and counter data CTRn as information for decrypting the encrypted communication data.

暗号器52は、受信したパケットPKnから、カウンタデータCTRnを暗号化して暗号カウンタデータE(CTRn)を生成し、乱数生成器55のシードSDnとして入力する。乱数生成器55は、パケットPKnのデータ部のデータサイズ分の乱数RNnを発生する。受信装置50Aは、パケットPKn−1を受信していないが、パケットPKnに含まれる暗号通信データを、パケットPKnからカウンタデータCTRnが読み出せるので、カウンタデータCTRnを暗号化することで、暗号文データを復号化することが出来る。これにより、パケットPKnの暗号と復号では問題なく同期が取れる。これは、通常のストリーミング暗号とは異なり、パケット毎に、カウンタデータを元にシードを生成し、これを元に乱数を生成しているからである。   The encryptor 52 encrypts the counter data CTRn from the received packet PKn to generate encrypted counter data E (CTRn), and inputs it as the seed SDn of the random number generator 55. The random number generator 55 generates a random number RNn for the data size of the data part of the packet PKn. The receiving device 50A has not received the packet PKn-1, but can read the encrypted communication data included in the packet PKn from the packet PKn, so that the counter data CTRn can be read out. Can be decrypted. As a result, synchronization can be achieved without any problem in encryption and decryption of the packet PKn. This is because, unlike ordinary streaming encryption, a seed is generated for each packet based on the counter data, and a random number is generated based on the seed.

このように、送信装置は、鍵の生成に用いられたパケット情報と、この鍵を用いて暗号化した平文データを、同一のパケットでまとめて復号化装置に送信するので、受信装置は、暗号文データの復号化に際して、復号化処理の鍵生成に必要な情報を受信することが出来る。これにより、パケットが送信される途中で、パケットロスしたり、パケットの順番が入れ替わったりした場合であっても、送信側と受信側の間の同期ずれを抑制することが出来る。特に、パケットロスや到着順が入れ替わることが起き得る、UDP通信において、良好に、暗号化、および復号化処理を行える。また、ストリーミング暗号による暗号・復号とは異なり、かなり先のカウンタデータを付与された不正なパケットを送信されても、サービス不能状態に陥ることを抑制することが出来る。   In this way, the transmitting device transmits the packet information used for generating the key and the plaintext data encrypted using the key together in the same packet to the decrypting device. When decrypting sentence data, it is possible to receive information necessary for generating a key for decryption processing. Thereby, even if the packet is lost or the order of the packets is changed during the transmission of the packet, the synchronization shift between the transmission side and the reception side can be suppressed. In particular, encryption and decryption processing can be performed satisfactorily in UDP communication where packet loss and arrival order can be switched. Also, unlike encryption / decryption using streaming encryption, it is possible to prevent a service from becoming inoperable even if an illegal packet to which counter data is added is transmitted.

一般に、ブロック暗号は、ストリーミング暗号に比較して処理速度が遅いが、本実施例では、ブロック暗号をストリーミング暗号のシード生成に利用しているので、平文を直接ブロック暗号で暗号化する場合に比べて、パケットあたりのブロック暗号の処理回数を少なくすることが出来る。これにより、トータルの処理速度が速くすることが出来る。   In general, block ciphers are slower in processing speed than streaming ciphers, but in this embodiment, block ciphers are used to generate seeds for streaming ciphers, so plain text is directly encrypted with block ciphers. Thus, the number of block cipher processes per packet can be reduced. Thereby, the total processing speed can be increased.

ここで、本実施例(XOR処理部と乱数生成器にストリーミング暗号を適用し、暗号器にブロック暗号を適用する場合)と、単なるブロック暗号の処理速度との対比について、具体的に説明する。リアルタイム性を要求される音声・画像通信のUDP通信では、128バイトや256バイト程度のUDP通信を行う。AES暗号のブロック暗号方式で暗号・復号を行うとすると、1パケットが128バイトで、ブロック暗号の処理単位が16バイトの場合、1パケット処理するのに、8回の暗号・復号処理が必要となる。しかしこの方法を用いれば、1パケット処理するのに、1回の128ビットのAES暗号は必要となるが、その後は、128バイトのArcfourで暗号・復号処理を行える。もしも、Arcfourが、128ビットのAES暗号より処理速度で倍のスピードがあれば、1パケットが128バイトの場合、約5回の128ビットのAES暗号処理をしたのと同じ速度になる。つまり約1.6倍の速度で処理できることになる。実際は、Arcfourのシードのセット時間に余計な処理時間がかかるので、これよりも速度は落ちるが、1パケットのデータサイズが増加すれば、この処理速度はさらに向上する。   Here, the comparison between the present embodiment (when the streaming cipher is applied to the XOR processing unit and the random number generator and the block cipher is applied to the encryptor) and the processing speed of the mere block cipher will be specifically described. In voice / image communication UDP communication that requires real-time performance, UDP communication of about 128 bytes or 256 bytes is performed. If encryption / decryption is performed using the block encryption method of AES encryption, if one packet is 128 bytes and the block cipher processing unit is 16 bytes, eight encryption / decryption processes are required to process one packet. Become. However, if this method is used, one 128-bit AES cipher is required to process one packet, but thereafter, encryption / decryption processing can be performed with 128-byte Arcfour. If Arcfour is twice as fast as the processing speed of 128-bit AES cipher, if one packet is 128 bytes, it will be the same speed as about five 128-bit AES ciphers. That is, processing can be performed at a speed about 1.6 times. Actually, an extra processing time is required for the setting time of the Arcfour seed, so the speed is lower than this. However, if the data size of one packet is increased, the processing speed is further improved.

このように、リアルタイム性を要求される音声・画像通信のUDP通信において、高速な暗号・復号処理を行うことが可能となり、暗号通信と高速通信とを両立できるようになる。なお、暗号器12、52の暗号・復号処理には、ブロック暗号ではなく、ストリーミング暗号を利用することが可能である。ストリーミング暗号として、Arcfourのような、ソフト処理ではブロック暗号より、処理速度が速いストリーミング暗号を用いれば、高速な暗号・復号処理が可能となる。   In this way, high-speed encryption / decryption processing can be performed in voice / image communication UDP communication that requires real-time performance, and both encryption communication and high-speed communication can be achieved. Note that the encryption / decryption processing of the encryptors 12 and 52 can use streaming encryption instead of block encryption. As a streaming cipher, a high-speed encryption / decryption process can be performed by using a streaming cipher such as Arcfour that has a higher processing speed than a block cipher in software processing.

図3では、送信装置10Aの主要要素の詳細を説明している。主要要素は、図3上方に示す破線枠内の、暗号器12、乱数生成器16、およびXOR処理部17である。図3下方は、この主要要素の詳細を示している。ここでは、カウンタデータCTR1の処理のみを示している。   FIG. 3 illustrates details of main elements of the transmission device 10A. The main elements are the encryptor 12, the random number generator 16, and the XOR processing unit 17 in the broken line frame shown in the upper part of FIG. The lower part of FIG. 3 shows details of this main element. Here, only the processing of the counter data CTR1 is shown.

暗号器12により暗号化されたカウンタデータCTR、つまり暗号カウンタデータE(CTR)が、乱数生成器16に入力されると、乱数RN1を生成する。乱数RN1は、乱数列RN11、RN12、RN13、・・・から構成される。一方、平文データは、平文PT1、PT2、PT3、・・・から構成される。平文PT1、PT2、PT3のデータ長は、乱数列RN11、RN12、RN13、・・・の乱数長とそれぞれ一致している。従って、XOR処理部17は、平文PT1と乱数列RN11、平文PT2と乱数列RN12、平文PT3と乱数列RN13、・・を順次、XOR演算する。これらの計算結果が暗号文データとなる。この時点で、「暗号化されたUDPパケット」を生成したことになる。なお、UDPパケットを暗号化するというのは、UDPパケット全体を暗号化するという意味ではない。通常は、UDPパケットのUDPデータ領域の一部、またはすべてを暗号化する。これ以降の説明も同じである。   When the counter data CTR encrypted by the encryptor 12, that is, the encrypted counter data E (CTR) is input to the random number generator 16, a random number RN1 is generated. The random number RN1 is composed of a random number sequence RN11, RN12, RN13,. On the other hand, the plain text data is composed of plain text PT1, PT2, PT3,. The data lengths of the plain texts PT1, PT2, and PT3 are the same as the random number lengths of the random number sequences RN11, RN12, RN13,. Therefore, the XOR processing unit 17 sequentially performs an XOR operation on the plaintext PT1 and the random number sequence RN11, the plaintext PT2 and the random number sequence RN12, the plaintext PT3 and the random number sequence RN13,. These calculation results become ciphertext data. At this point, an “encrypted UDP packet” has been generated. Note that encrypting a UDP packet does not mean encrypting the entire UDP packet. Usually, a part or all of the UDP data area of the UDP packet is encrypted. The description below is the same.

送信装置10Aの動作を、図4のフローチャートに沿って再度説明する。S101では、カウンタデータCTRの初期値を設定する。カウンタデータCTRは第三者に知られても問題ないので、暗号化しない。カウンタデータCTRの初期値は0でもその他の値でも良い。実際の実装では、送信装置10A、および受信装置50Aの間で、所定のIV(イニシャルベクタ)値を交換しておき、これをカウンタデータと混合するのが、セキュリティレベルが向上し、望ましい。   The operation of the transmitting apparatus 10A will be described again along the flowchart of FIG. In S101, an initial value of the counter data CTR is set. The counter data CTR is not encrypted because there is no problem even if it is known to a third party. The initial value of the counter data CTR may be 0 or another value. In actual implementation, it is desirable to exchange a predetermined IV (initial vector) value between the transmission device 10A and the reception device 50A and mix it with the counter data because the security level is improved.

S102では、カウンタデータCTRを暗号器12で暗号し、暗号カウンタデータE(CTR)を求める。例えば、暗号器12がAES暗号を実行する場合は、AESの暗号化関数であるAES_Encryptに、カウンタデータCTRを代入する。   In S102, the counter data CTR is encrypted by the encryptor 12, and the encrypted counter data E (CTR) is obtained. For example, when the encryptor 12 executes AES encryption, the counter data CTR is substituted into AES_Encrypt which is an AES encryption function.

S103では、暗号カウンタデータE(CTR)を乱数生成器16のシードとして入力する。例えば、乱数生成器16が、ストリーミング暗号としてArcfourを実行する場合は、Arcfourの初期化関数であるArcfour_Initに、この暗号カウンタデータE(CTR)を代入する。   In S103, the encryption counter data E (CTR) is input as a seed for the random number generator 16. For example, when the random number generator 16 executes Arcfour as a streaming cipher, the cipher counter data E (CTR) is substituted into Arcfour_Init which is an initialization function of Arcfour.

S104では、1パケット分の平文データと、乱数生成器16が発生した1パケット分のデータサイズの乱数とをXOR演算して、1パケット分の暗号文データを生成する。例えば、乱数生成器、つまりストリーミング暗号がArcfourであれば、Arcfourの暗号化関数であるArcfour_Encryptに、平文データを代入する。   In S104, the plaintext data for one packet and the random number of the data size for one packet generated by the random number generator 16 are XORed to generate ciphertext data for one packet. For example, if the random number generator, that is, the streaming cipher is Arcfour, plaintext data is substituted into Arcfour_Encrypt, which is the Arcfour encryption function.

S105では、カウンタデータCTRをUDPパケットPKに付加し、暗号文データをUDPパケットとして受信装置50Aに送信する。   In S105, the counter data CTR is added to the UDP packet PK, and the ciphertext data is transmitted to the receiving device 50A as a UDP packet.

S106では、送信データの準備ができていない場合は(S106のNo)、送信データの準備ができるまで待つ。なお、これ以上の送信データがなければ、ここで終了しても良い。   In S106, if the transmission data is not ready (No in S106), the process waits until the transmission data is ready. If there is no more transmission data, the process may be terminated here.

送信データの準備ができた場合は(S106のYes)、S107で、カウンタデータCTRを更新する。以下、S102〜S107を繰り返す。ここでは、カウンタデータCTRを1ずつアップさせているが、次に利用するカウンタデータCTRが、以前利用したカウンタデータCTRと同じものにならないように工夫を行えば、その方法はどのようなものであっても良い。カウンタデータCTRのハッシュ値を、新たなカウンタデータCTRとすることも可能である。   When the transmission data is ready (Yes in S106), the counter data CTR is updated in S107. Thereafter, S102 to S107 are repeated. Here, the counter data CTR is incremented by one. However, if the device is devised so that the counter data CTR to be used next is not the same as the counter data CTR that has been used before, what kind of method is available? There may be. The hash value of the counter data CTR can be used as new counter data CTR.

UDPパケットPKは、図5に示すように、ヘッダ領域と、UDPデータ領域UDFを有している。ヘッダ領域は、MACヘッダHD1、IPヘッダHD2、およびUDPヘッダHD3を含む。UDPデータ領域UDFは、カウンタデータCTR、および暗号UDPデータEUDを含む。UDPデータ領域UDFには、実データの他、改ざんチェックやデータ誤り検知のために、MACやCRCが付加されていても良い。   As shown in FIG. 5, the UDP packet PK has a header area and a UDP data area UDF. The header area includes a MAC header HD1, an IP header HD2, and a UDP header HD3. The UDP data area UDF includes counter data CTR and encrypted UDP data EUD. In addition to actual data, a MAC or CRC may be added to the UDP data area UDF for falsification check and data error detection.

カウンタデータCTRのデータ長を固定にしておけば、受信装置50Aは、暗号UDPデータEUDがどこからスタートするかは簡単に分かる。またカウンタデータCTRにデータ長を付与すれば、カウンタデータCTRが可変長であっても、受信装置50Aはこのデータ長を読み取ることで、カウンタデータCTRのサイズを求めることが可能なので、同じく、暗号UDPデータEUDがどこからスタートするかが簡単に分かる。   If the data length of the counter data CTR is fixed, the receiving device 50A can easily know where the encrypted UDP data EUD starts. If the data length is given to the counter data CTR, even if the counter data CTR has a variable length, the receiving device 50A can obtain the size of the counter data CTR by reading this data length. You can easily see where the UDP data EUD starts.

カウンタデータCTRは、図5に示すように、UDPデータ領域UDFの先頭にセットされている。カウンタデータCTRは、UDPパケットPKに関連付けられていれば、カウンタデータCTRを付加する箇所は、UDPデータ領域UDFである必要はなく、UDPパケットPKのどこにセットしても良い。   As shown in FIG. 5, the counter data CTR is set at the head of the UDP data area UDF. If the counter data CTR is associated with the UDP packet PK, the location to which the counter data CTR is added need not be the UDP data area UDF, and may be set anywhere in the UDP packet PK.

また、UDPパケットに付与されているいずれかのヘッダ(例えば音声データであれば、この音声パケットのヘッダなど)より、カウンタデータCTRが導くことが出来れば、カウンタデータCTRをUDPパケットPKに付加する必要はない。例えば、カウンタデータCTRを、既存のEthernet(登録商標)ヘッダ、IPヘッダ、UDPヘッダの中から導くことの出来る値にすることも可能である。   Further, if the counter data CTR can be derived from any header (for example, the header of this voice packet if it is voice data) attached to the UDP packet, the counter data CTR is added to the UDP packet PK. There is no need. For example, the counter data CTR can be set to a value that can be derived from an existing Ethernet (registered trademark) header, IP header, or UDP header.

また、カウンタデータCTRを導く元データをUDPパケットPKに付加しても良い。例えば、図6に示すように、S301で、元データODをハッシュ計算ルーチンで処理する、つまり元データODのハッシュ値を計算することで、カウンタデータCTRを生成する。   Further, original data for deriving the counter data CTR may be added to the UDP packet PK. For example, as shown in FIG. 6, the counter data CTR is generated by processing the original data OD with a hash calculation routine in S301, that is, by calculating the hash value of the original data OD.

受信装置50Aの動作を、図7のフローチャートに沿って再度説明する。はじめに、S201で、図4の要領で生成されたUDPパケットPKを受信する。   The operation of the receiving device 50A will be described again along the flowchart of FIG. First, in S201, the UDP packet PK generated in the manner shown in FIG. 4 is received.

S202で、データ分解部51が、UDPパケットPKに付加されたカウンタデータCTRを読み取る。送信装置10Aおよび受信装置50A間で、所定のIV(イニシャルベクタ)値を交換しておき、これをカウンタデータと混合することになっていれば、ここで、カウンタデータCTRとIVの混合を行い、新たなカウンタデータCTRを計算する
S203で、暗号器52が、カウンタデータCTRを暗号化し、暗号カウンタデータE(CTR)を求める。例えば、送信側の暗号器12がAES暗号であれば、AESの暗号化関数であるAES_Encryptに、カウンタデータCTRを、暗号器52に代入する。
In S202, the data decomposition unit 51 reads the counter data CTR added to the UDP packet PK. If a predetermined IV (initial vector) value is exchanged between the transmitting device 10A and the receiving device 50A and this is to be mixed with the counter data, the counter data CTR and IV are mixed here. The new counter data CTR is calculated. In S203, the encryptor 52 encrypts the counter data CTR to obtain the encrypted counter data E (CTR). For example, if the transmitting side encryption device 12 is AES encryption, the counter data CTR is substituted into the encryption device 52 for AES_Encrypt, which is an AES encryption function.

S204で、暗号器52は、暗号カウンタデータE(CTR)をシードSDとして、乱数生成器55に入力する。例えば、送信側の乱数生成器16が実行するストリーミング暗号がArcfourであれば、Arcfourの初期化関数であるArcfour_initに、暗号カウンタデータE(CTR)を、乱数生成器55に代入する。   In S204, the encryption device 52 inputs the encryption counter data E (CTR) to the random number generator 55 as the seed SD. For example, if the streaming cipher executed by the random number generator 16 on the transmission side is Arcfour, the cipher counter data E (CTR) is substituted into the random number generator 55 for Arcfour_init, which is an initialization function of Arcfour.

乱数発生器55は、暗号カウンタデータE(CTR)を用いて乱数を発生し、S205で、1パケット分の暗号文データと、発生した1パケット分のデータサイズの乱数をXOR演算して、1パケット分の平文データを生成する。例えば、乱数生成器55が実行するストリーミング暗号がArcfourであれば、Arcfourの暗号化関数であるArcfour_Encryptに、暗号文データを代入する。送信装置10AからまたUDPパケットが送信されてきたら、S201〜S206を繰り返す。   The random number generator 55 generates a random number using the cipher counter data E (CTR), and in S205, performs XOR operation on the ciphertext data for one packet and the generated random number of data size for one packet to obtain 1 Generate plaintext data for packets. For example, if the streaming cipher executed by the random number generator 55 is Arcfour, the ciphertext data is substituted into Arcfour_Encrypt which is an encryption function of Arcfour. When a UDP packet is transmitted again from the transmitting apparatus 10A, S201 to S206 are repeated.

ついで、本実施例の効果を、図8に沿って説明する。図8は、UDPの1パケットのデータサイズが256バイトの場合における、ブロック暗号のCTRモード、実施例1、ストリーミング暗号でのそれぞれの処理速度を示している。   Next, the effect of the present embodiment will be described with reference to FIG. FIG. 8 shows processing speeds in the block cipher CTR mode, the first embodiment, and the streaming cipher when the data size of one UDP packet is 256 bytes.

図8左方は、CTRモードの処理速度:約15Mbpsを示している。CTRモードとは、256バイトすべてを128ビットのAESカウンタモードで暗号処理する場合である。128ビットのAESの1ブロックのデータサイズは16バイトなので、256バイトのブロック数は、256バイト / 16バイト = 16ブロックである。従って、16回のAES暗号(+256バイト分の排他的論理和の計算)が必要となる。UDPの1パケットに対して1回しかカウンタデータをAES暗号せず、この暗号化されたカウンタデータを256バイトすべての排他的論理和の計算に用いるとすることも可能であるが、これでは、同じ平文が同じ暗号文となるため、著しくセキュリティレベルを下げてしまう。   The left side of FIG. 8 shows the processing speed in the CTR mode: about 15 Mbps. The CTR mode is a case where all 256 bytes are encrypted in the 128-bit AES counter mode. Since the data size of one block of 128-bit AES is 16 bytes, the number of blocks of 256 bytes is 256 bytes / 16 bytes = 16 blocks. Therefore, 16 AES ciphers (calculation of +256 bytes exclusive OR) are required. Although it is possible that the counter data is AES-encrypted only once for one UDP packet and this encrypted counter data is used to calculate the exclusive OR of all 256 bytes, Since the same plaintext becomes the same ciphertext, the security level is significantly lowered.

図8右方は、ストリーミング暗号の処理速度:31Mbpsである。ここでは、ストリーミング暗号として、Arcfourを使用している。   The right side of FIG. 8 shows the processing speed of streaming encryption: 31 Mbps. Here, Arcfour is used as the streaming cipher.

図8中央は、本実施例の処理速度:約27Mbpsを示している。ここでは、暗号器12、52にAESカウンタモードを適用し、乱数生成器16、55およびXOR処理部17、56にArcfour暗号を適用した場合である。   The center of FIG. 8 shows the processing speed of this embodiment: about 27 Mbps. In this case, the AES counter mode is applied to the encryptors 12 and 52, and the Arcfour encryption is applied to the random number generators 16 and 55 and the XOR processing units 17 and 56.

本実施例では、UDP1パケットに1回だけカウンタデータをAES暗号化し、この暗号化されたカウンタデータをArcfour暗号の共通鍵(シード)として、256バイトすべてをArcfour暗号で暗号化する。通常のArcfour暗号に比べると、1回のAES暗号と、共通鍵のセット時間が余計な処理時間となる。通常、ソフト処理では、ArcfourはAES暗号の半分以下の時間で暗号・復号処理を行えるので、本方式をAES暗号処理で換算すると、1回のAES暗号(カウンタデータの暗号化)+16回のAES暗号/2(図8左方に示したCTRモードの場合の半分)+α(共通鍵のセット時間)により、おおよそ、9〜10回程度のAES暗号・復号処理となる。測定環境は、CPU:MIPS 32ビット、200MHzである。測定方法としては、UDPヘッダ作成時間+暗号処理時間を測定した。また、1パケットあたりの平分データサイズは1024バイト、データ中身は“0×00〜0×FF”を4回セット、10Mバイト分繰り返した時間を計測し、bpsを算出、CTRモードには高速なAESを利用、ストリーミング暗号にはArcfourを利用した。以上の測定結果から、ブロック暗号を基準にすれば、本実施例の処理速度は、ストリーミング暗号の処理速度:31Mbpsに接近している。   In the present embodiment, the counter data is AES encrypted only once in the UDP1 packet, and the encrypted counter data is used as a common key (seed) of the Arcfour encryption, and all 256 bytes are encrypted using the Arcfour encryption. Compared with the normal Arcfour cipher, the time required for one AES cipher and the common key is extra processing time. Normally, in software processing, Arcfour can perform encryption / decryption processing in less than half the time of AES encryption, so when this method is converted by AES encryption processing, one AES encryption (encryption of counter data) + 16 times AES By cipher / 2 (half of the case of the CTR mode shown on the left in FIG. 8) + α (common key set time), the AES encryption / decryption process is approximately 9 to 10 times. The measurement environment is CPU: MIPS 32 bits, 200 MHz. As a measuring method, UDP header creation time + cryptographic processing time was measured. Also, the average data size per packet is 1024 bytes, the data content is set to "0x00-0xFF" 4 times, the time repeated 10M bytes is measured, bps is calculated, and the CTR mode is fast AES was used, and Arcfour was used for streaming encryption. From the above measurement results, if the block cipher is used as a reference, the processing speed of this embodiment is close to the processing speed of streaming cipher: 31 Mbps.

このように、本実施例では、ブロック暗号で暗号化したカウンタデータを、通信データの暗号・復号処理に直接用いるのではなく、暗号化したカウンタデータを、通信データを暗号化する共通鍵暗号の共通鍵として用いている。なお、図1のストリーミング暗号を実行する要素(乱数生成器16、55およびXOR処理部17、56)は、Arcfourのようなストリーミング暗号に限られるものではなく、AESや3DESのようなブロック暗号であっても良い。なお、全体の処理速度を上げる点で、暗号・復号を実行する要素(乱数生成器16、55およびXOR処理部17、56)の暗号方式は、鍵を生成する要素(暗号器12、52)の暗号方式より処理速度が速いことが望ましい。   As described above, in this embodiment, the counter data encrypted with the block cipher is not directly used for the encryption / decryption processing of the communication data, but the encrypted counter data is used for the common key encryption for encrypting the communication data. Used as a common key. The elements (random number generators 16 and 55 and XOR processing units 17 and 56) that execute the streaming cipher of FIG. 1 are not limited to the streaming cipher such as Arcfour, but are block ciphers such as AES and 3DES. There may be. Note that the encryption method of the elements (random number generators 16 and 55 and the XOR processing units 17 and 56) that execute encryption / decryption is the element that generates the key (encryptors 12 and 52) in order to increase the overall processing speed. It is desirable that the processing speed is faster than the encryption method.

なお、悪意のある攻撃者が送信装置10Aのふりをして、意図的に、かなり先のカウンタデータが付与された不正なUDPパケットを送信するかもしれないので、受信装置50Aは、MACチェックを行うようにして、これが正しい場合のみ、最大のカウンタデータを更新するようにしてもよい。一般に、正規のUDP通信であれば、極端なパケットロスがない限り、カウンタデータが極端に飛ぶことはない。従って、極端なカウンタデータの飛びがあれば、それはかなりパケットロスが発生していることになるので、受信装置50Aは飛んだカウンタデータをいつまでも受信できるものとして、受信装置50Aに記憶しておく必要はない。   Note that since a malicious attacker may pretend to be the transmitting device 10A and intentionally transmit an illegal UDP packet to which counter data is considerably added, the receiving device 50A performs the MAC check. Only when this is correct, the maximum counter data may be updated. In general, in the case of regular UDP communication, the counter data does not fly extremely unless there is an extreme packet loss. Therefore, if there is an extreme jump in counter data, it means that a packet loss has occurred. Therefore, the receiving device 50A needs to store the skipped counter data in the receiving device 50A as being able to receive it forever. There is no.

この仕組みを図9、および図10を用いて、詳細を説明する。図9は、MACチェックを行う際のUDPパケットPKのフォーマットの一例を示している。送信装置10Aは、UDPデータ領域UDFに、カウンタデータCTR、実際のUDPデータ(平文UDPデータPUD)、MACデータMDをセットしておく。XOR処理部17が、乱数RN1と平文UDPデータPUDのXOR演算を行い、暗号UDPデータEUDを生成する。送信装置10Aは、UDPデータ領域UDFに、カウンタデータCTR、暗号UDPデータEUD、MACデータMDをセットして、UDPパケットPKを受信装置50Aに送る。受信装置50Aでは、UDPパケットPKを受信し、XOR処理部56で、この乱数RN1と暗号UDPデータEUDとのXOR演算を行い、平文UDPデータPUDを取得する。   This mechanism will be described in detail with reference to FIG. 9 and FIG. FIG. 9 shows an example of the format of the UDP packet PK when performing the MAC check. The transmitting apparatus 10A sets counter data CTR, actual UDP data (plain text UDP data PUD), and MAC data MD in the UDP data area UDF. The XOR processing unit 17 performs an XOR operation on the random number RN1 and the plain text UDP data PUD, and generates encrypted UDP data EUD. The transmitting apparatus 10A sets the counter data CTR, the encrypted UDP data EUD, and the MAC data MD in the UDP data area UDF, and sends the UDP packet PK to the receiving apparatus 50A. The receiving device 50A receives the UDP packet PK, and the XOR processing unit 56 performs an XOR operation between the random number RN1 and the encrypted UDP data EUD to obtain plaintext UDP data PUD.

図10は、図9のUDPパケットPKのフォーマットで通信している際の、MACチェック方法の一例を示すものである。送信装置10Aは、平文UDPデータPUD、つまり通信データを用意する。MAC計算器23は、平文UDPデータPUDからMACデータMD1を計算する。MAC計算手法には、MD5、SHA1、SHA2など、様々な手法があるが、送信装置10A・受信装置50Aで同じ計算手法を用いるものとする。   FIG. 10 shows an example of the MAC check method when communicating in the format of the UDP packet PK of FIG. The transmitting apparatus 10A prepares plain text UDP data PUD, that is, communication data. The MAC calculator 23 calculates the MAC data MD1 from the plain text UDP data PUD. There are various MAC calculation methods such as MD5, SHA1, and SHA2, and the same calculation method is used in the transmission device 10A and the reception device 50A.

図10では、カウンタデータCTRは通し番号で、カウンタデータCTRは1ずつカウントアップするものとする。送信装置10Aは、送信するUDPパケットPKに付与するカウンタデータCTR1を用意する。実際は、暗号器12が、現在のカウンタデータCTR1を、CTR記憶部15より読み出す。暗号器12、および乱数生成器16は、図2と同様の暗号を行い、平文UDPデータPUDから暗号UDPデータEUDを生成する。暗号化が終了したら、次回のパケット送信に備えて、カウンタデータを1アップする。実際は、暗号器12がカウンタアップ部20に指示して、カウンタデータCTRのアップを行わせ、このアップしたカウンタデータをCTR記憶部15に保存させる。   In FIG. 10, the counter data CTR is a serial number, and the counter data CTR is counted up by one. The transmitting apparatus 10A prepares counter data CTR1 to be given to the UDP packet PK to be transmitted. Actually, the encryptor 12 reads the current counter data CTR1 from the CTR storage unit 15. The encryptor 12 and the random number generator 16 perform encryption similar to that shown in FIG. 2, and generate encrypted UDP data EUD from the plaintext UDP data PUD. When the encryption is completed, the counter data is incremented by 1 in preparation for the next packet transmission. Actually, the encryptor 12 instructs the counter-up unit 20 to increase the counter data CTR, and stores the increased counter data in the CTR storage unit 15.

送信装置10Aは、カウンタデータCTRと暗号UDPデータEUDとMACデータMD1を受信装置50Aに送信する。受信装置50Aは、これらのデータを受信する。受信装置50Aでは、現在までに取得したカウンタデータCTRの最大値CTRmaxをCTR記憶部61に記憶している。また、CTR記憶部61は、最大値未満でまだ受信していないカウンタデータCTRnyも記憶している。   The transmitting device 10A transmits the counter data CTR, the encrypted UDP data EUD, and the MAC data MD1 to the receiving device 50A. The receiving device 50A receives these data. In the receiving device 50A, the maximum value CTRmax of the counter data CTR acquired so far is stored in the CTR storage unit 61. The CTR storage unit 61 also stores counter data CTRny that is less than the maximum value and has not been received yet.

受信装置50Aは、受信したカウンタデータCTR1をカウンタチェック部62でチェックする。具体的には、次のような方法でチェックする。まず、CTR記憶部61から、2つのカウンタデータCTRmax、CTRnyを読み出す。受信したカウンタデータCTR1が、カウンタデータCTRmaxより大きいか、またはカウンタデータCTRnyに該当するか否かをチェックする。受信したカウンタデータCTR1が、カウンタデータCTRmaxより小さく、かつ、カウンタデータCTRnyに該当しない場合は、このUDPパケットPKを、カウンタチェック部62が破棄する。これによりリトライ攻撃が防御できるようになる。   The receiving device 50A checks the received counter data CTR1 with the counter check unit 62. Specifically, the following method is used for checking. First, two counter data CTRmax and CTRny are read from the CTR storage unit 61. It is checked whether the received counter data CTR1 is larger than the counter data CTRmax or corresponds to the counter data CTRny. If the received counter data CTR1 is smaller than the counter data CTRmax and does not correspond to the counter data CTRny, the counter check unit 62 discards the UDP packet PK. This makes it possible to defend against retry attacks.

一方、受信したカウンタデータCTR1が、カウンタデータCTRmaxより大きい、または、カウンタデータCTRnyに該当する場合は、UDPパケットPKは破棄されない。暗号器52および乱数生成器55は、図2と同様の復号を行い、暗号UDPデータEUDから平文UDPデータPUDを取得する。   On the other hand, when the received counter data CTR1 is larger than the counter data CTRmax or corresponds to the counter data CTRny, the UDP packet PK is not discarded. The encryptor 52 and the random number generator 55 perform the same decryption as in FIG. 2, and obtain the plain text UDP data PUD from the encrypted UDP data EUD.

MAC計算器63は、平文UDPデータPUDからMACデータMD2を計算する。MACデータ比較器65は、この計算で求めたMACデータMD2と、受信したUDPパケットに付与されていたMACデータMD1とを比較する。一致しない場合は、何もしないか、またはMACデータ比較器65が、このUDPパケットを破棄する。一致した場合は、MACデータ比較器65は、カウンタアップ部66に指示して、カウンタデータのアップを行わせ、このアップしたカウンタデータCTRをCTR記憶部61に保存させる。なお、受信したカウンタデータCTRが現在の最大値より大きい場合は、このカウンタデータCTRを新たな最大値として記憶する。またその際、受信したカウンタデータCTRが現在の最大値より2以上飛んでいた場合には、この飛んだカウンタデータCTRはまだ未受信のカウンタデータCTRとして記憶する。受信したカウンタデータCTRが未受信のカウンタデータCTRであった場合には、その未受信で記憶しているカウンタデータCTRを消去する。   The MAC calculator 63 calculates the MAC data MD2 from the plain text UDP data PUD. The MAC data comparator 65 compares the MAC data MD2 obtained by this calculation with the MAC data MD1 added to the received UDP packet. If they do not match, do nothing or the MAC data comparator 65 discards this UDP packet. If they match, the MAC data comparator 65 instructs the counter up unit 66 to increase the counter data, and stores the increased counter data CTR in the CTR storage unit 61. When the received counter data CTR is larger than the current maximum value, the counter data CTR is stored as a new maximum value. At this time, if the received counter data CTR has jumped by two or more from the current maximum value, the skipped counter data CTR is stored as unreceived counter data CTR. When the received counter data CTR is unreceived counter data CTR, the counter data CTR stored without being received is erased.

図11に沿って実施例2における、通信システムの動作を説明する。実施例2の通信システムは、図1に示す実施例1の通信システムと同一である。後述する動作方法が異なる。   The operation of the communication system in the second embodiment will be described with reference to FIG. The communication system of the second embodiment is the same as the communication system of the first embodiment shown in FIG. The operation method described later is different.

図11の動作方法は、図2の動作方法と比較して、2つの相違点がある。1つ目の相違点は、乱数生成器が、一定のパケット毎にシードを変更する点である。例えば、カウンタデータが所定値を超えた場合に、若しくは受信側へ送信したパケットの全ての通信データ数が所定値を超えた場合に、シードを変更する。   The operation method of FIG. 11 has two differences compared to the operation method of FIG. The first difference is that the random number generator changes the seed every fixed packet. For example, the seed is changed when the counter data exceeds a predetermined value or when the number of all communication data of the packet transmitted to the receiving side exceeds the predetermined value.

2つ目の相違点は、送信装置が、所定パケットから、いずれかのパケットまでの送信した、全ての通信データ数を、受信装置が把握できるようにする。例えば、パケットPKn+xやパケットPKn+x+1などに、パケットPKnからの通信データ数の総和(つまり、パケットPKnを起点として、パケットPKn+xやパケットPKn+x+1までの全パケットのデータサイズの総和)をUDPパケットのUDPデータ領域に記載する。なお、xは、x=1、2、・・・である。   The second difference is that the receiving apparatus can grasp the total number of communication data transmitted from the predetermined packet to any one of the packets. For example, the packet data PKn + x, the packet PKn + x + 1, and the like add the total number of communication data from the packet PKn (that is, the total data size of all packets from the packet PKn to the packet PKn + x and the packet PKn + x + 1). It describes. Note that x is x = 1, 2,.

また、実施例2におけるストリーミング暗号は、通信データに依存しない乱数を用いたものである。乱数生成器が、通信データとは独立に存在するストリーミング暗号で、例えば、Arcfourなどである。CBCモードなど、通信データに依存するストリーミング暗号(ブロック暗号の操作モードを利用したストリーミング暗号)は該当しない。   In addition, the streaming encryption in the second embodiment uses a random number that does not depend on communication data. A random number generator is a streaming cipher that exists independently of communication data, such as Arcfour. This does not apply to streaming ciphers that depend on communication data, such as CBC mode (streaming ciphers using block cipher operation mode).

受信装置50Bは、この通信データ数を取得することで、各UDPパケット(UDPデータ部)が送信される前に、送信装置10Bがどれくらいのデータサイズの通信データを送信したかを知ることができる。これにより、各UDPパケットの復号処理を行う前に、乱数生成器に、この通信データ数分の乱数を発生させれば、たとえ、いくつかのUDPパケットがロストしても、同期をとることができる。   The receiving device 50B can know how much communication data the transmitting device 10B has transmitted before each UDP packet (UDP data portion) is transmitted by acquiring the number of communication data. . As a result, if the random number generator generates random numbers for the number of communication data before decoding each UDP packet, synchronization can be achieved even if several UDP packets are lost. it can.

図12に沿って、実施例2における送信装置の動作について説明する。はじめに、S111で、カウンタデータCTRの初期値を設定する。カウンタデータCTRは第三者に知られても問題ないので、初期値は0でもその他の値でも良い。実際の実装では、送信装置10Bと受信装置50Bの間で所定のIV(イニシャルベクタ)値を交換しておき、これをカウンタデータCTRと混合するのが、セキュリティレベルが向上し、望ましい。   The operation of the transmission apparatus according to the second embodiment will be described with reference to FIG. First, in S111, an initial value of the counter data CTR is set. Even if the counter data CTR is known to a third party, there is no problem, so the initial value may be 0 or any other value. In actual implementation, it is desirable to exchange a predetermined IV (initial vector) value between the transmission device 10B and the reception device 50B and mix it with the counter data CTR because the security level is improved.

S112で、カウンタデータCTRが一定の値Nを超えたか否かを調べる。具体的には、CTR Mod N=0の方程式が成り立つか否かを判断する。CTR Mod N≠0であれば(S112のNo)、すなわち、NをカウンタデータCTRで割った剰余が0でない場合、S116に進む。例えば、Nが5の場合、カウンタデータCTRが、1、2、3、4、6、7、8・・・の場合に、S116に進む。一方、CTR Mod N=0であれば(S112のYes)、すなわち、NをカウンタデータCTRで割った剰余が0である場合、S113で、通信データ数TNを0に設定する。   In S112, it is checked whether or not the counter data CTR exceeds a certain value N. Specifically, it is determined whether an equation of CTR Mod N = 0 holds. If CTR Mod N ≠ 0 (No in S112), that is, if the remainder obtained by dividing N by the counter data CTR is not 0, the process proceeds to S116. For example, when N is 5, when the counter data CTR is 1, 2, 3, 4, 6, 7, 8,. On the other hand, if CTR Mod N = 0 (Yes in S112), that is, if the remainder obtained by dividing N by the counter data CTR is 0, the number of communication data TN is set to 0 in S113.

S114で、カウンタデータCTRを暗号器12で暗号し、暗号カウンタデータE(CTR)を求める。例えば、AESの暗号化関数であるAES_Encryptに、カウンタデータCTRを代入する。   In S114, the counter data CTR is encrypted by the encryptor 12, and the encrypted counter data E (CTR) is obtained. For example, the counter data CTR is substituted into AES_Encrypt which is an AES encryption function.

なお、カウンタデータCTRが一定の値Nを超える場合に限らず(つまり、複数のカウンタデータを超えた場合に限らず)、一定のカウンタデータのみを超えた場合に、本発明を適用することも可能です。または、ある決められたステップ数を越えるたびに実行してもよい。例えば、ステップ数を10とすれば、カウンタデータが10、20、30、・・・というように、10刻みのタイミングとすることができる。   The present invention may be applied not only when the counter data CTR exceeds a certain value N (that is, not only when the counter data exceeds a plurality of counter data) but also when only a certain counter data is exceeded. Is possible. Alternatively, it may be executed every time a predetermined number of steps is exceeded. For example, if the number of steps is 10, the counter data can be set in increments of 10, such as 10, 20, 30,.

S115で、暗号カウンタデータE(CTR)を乱数生成器16のシードSDとして入力する。例えば、Arcfourの初期化関数であるArcfour_Initに、この暗号カウンタデータE(CTR)を代入する。   In S115, the encryption counter data E (CTR) is input as the seed SD of the random number generator 16. For example, the encryption counter data E (CTR) is substituted into Arcfour_Init, which is an initialization function of Arcfour.

S116で、パケット分の平文データと、乱数生成器16が発生した1パケット分のデータサイズの乱数とをXOR演算して、1パケット分の暗号文データを生成する。例えば、Arcfourの暗号化関数であるArcfour_Encryptに、平文データを代入する。   In S116, the plaintext data for the packet and the random number having the data size for one packet generated by the random number generator 16 are XORed to generate the ciphertext data for one packet. For example, plain text data is substituted into Arcfour_Encrypt which is an encryption function of Arcfour.

S117で、カウンタデータCTRと通信データ数TN(n)をUDPパケットPKに付加し、このUDPパケットを受信装置50Bに送信する。   In S117, the counter data CTR and the number of communication data TN (n) are added to the UDP packet PK, and this UDP packet is transmitted to the receiving device 50B.

S118で、通信データ数TN(n)を更新する。前の通信データ数TN(n)に、このUDPパケットPKのデータサイズを加算し、通信データ数TN(n+1)を求め、通信データ数TN(n+1)を所定のメモリ(図示せず)に記憶する。   In S118, the number of communication data TN (n) is updated. The data size of this UDP packet PK is added to the previous communication data number TN (n) to obtain the communication data number TN (n + 1), and the communication data number TN (n + 1) is stored in a predetermined memory (not shown). To do.

S119で、送信データの準備ができていない場合は(S119のNo)、送信データの準備ができるまで待つ。なお、これ以上の送信データがなければ、ここで終了しても良い。一方、送信データの準備ができた場合は(S119のYes)、S120で、カウンタデータCTRを更新する。これ以降、S112からS120を繰り返す。   If the transmission data is not ready in S119 (No in S119), the process waits until the transmission data is ready. If there is no more transmission data, the process may be terminated here. On the other hand, when the transmission data is ready (Yes in S119), the counter data CTR is updated in S120. Thereafter, S112 to S120 are repeated.

ついで、図13に沿って、実施例2における受信装置の動作を説明する。受信装置50Bでは、図示しないメモリが、次の通信データ数RDを記憶している。次の通信データ数とは、送信装置が所定のパケットから任意のパケットまでを順次送信し、かつパケットロスやパケットの到着順の入れ違いがない場合に、受信装置が受信すべく、所定のパケットから任意のパケットまでの通信データ数の総和をいう。次の通信データ数RDは、初期値は0である。はじめに、S211では、図12の要領で生成されたUDPパケットPKを受信する。   Next, the operation of the receiving apparatus according to the second embodiment will be described with reference to FIG. In the receiving device 50B, a memory (not shown) stores the next communication data number RD. The next number of communication data means that when the transmitting device transmits from a predetermined packet to an arbitrary packet sequentially, and there is no mistake in packet loss or packet arrival order, the receiving device receives from the predetermined packet. This is the total number of communication data up to an arbitrary packet. The initial value of the next communication data number RD is 0. First, in S211, the UDP packet PK generated as shown in FIG. 12 is received.

S212で、UDPパケットPKに付加されたカウンタデータCTRと通信データ数TD(n)を読み取る。   In S212, the counter data CTR added to the UDP packet PK and the number of communication data TD (n) are read.

S213で、カウンタデータCTRが一定の値Nを超えたか否かを調べる。具体的には、CTR Mod N=0の方程式が成り立つか否かを判断する。この処理は、図12のS112と同様である。   In S213, it is checked whether or not the counter data CTR exceeds a certain value N. Specifically, it is determined whether an equation of CTR Mod N = 0 holds. This process is the same as S112 in FIG.

CTR Mod N≠0であれば(S213のNo)、S217に進む。CTR Mod N=0であれば(S213のYes)、S214で、次の通信データ数RDを0として所定のメモリ(図示せず)に記憶する。なお、図示していないが、ここで、読み取った通信データ数TD(n)が0以外の値であれば、エラーとしてこのUDPパケットPKを破棄する。   If CTR Mod N ≠ 0 (No in S213), the process proceeds to S217. If CTR Mod N = 0 (Yes in S213), the next communication data number RD is set to 0 and stored in a predetermined memory (not shown) in S214. Although not shown, if the read communication data number TD (n) is a value other than 0, the UDP packet PK is discarded as an error.

S215で、カウンタデータCTRを暗号器52で暗号し、暗号カウンタデータE(CTR)を求める。例えば、AESの暗号化関数であるAES_Encryptに、カウンタデータCTRを代入する。   In S215, the counter data CTR is encrypted by the encryptor 52 to obtain the encrypted counter data E (CTR). For example, the counter data CTR is substituted into AES_Encrypt which is an AES encryption function.

S216で、暗号カウンタデータE(CTR)を乱数生成器55のシードSDとして入力する。例えば、Arcfourの初期化関数であるArcfour_Initに、この暗号カウンタデータE(CTR)を代入する。   In S216, the encryption counter data E (CTR) is input as the seed SD of the random number generator 55. For example, the encryption counter data E (CTR) is substituted into Arcfour_Init, which is an initialization function of Arcfour.

次にS217で、読み取った通信データ数TD(n)と次の通信データ数RD(n)を比較する。読み取った通信データ数TD(n)が、次の通信データ数RD(n)より小さければ(S217のYes)、パケットの到着順が逆になったため、受信したUDPパケットPKが、処理済みのパケットよりカウンタデータの値が若い未処理のパケットがあるということなので、S214に進む。なお、処理済みのパケットよりカウンタデータの値が若い未処理のパケットがなければ(S217のNo)、読み取った通信データ数TD(n)<次の通信データ数RD(n)となるのは不正なので、このUDPパケットPKを破棄する。   In step S217, the read communication data number TD (n) is compared with the next communication data number RD (n). If the read communication data number TD (n) is smaller than the next communication data number RD (n) (Yes in S217), the arrival order of the packets is reversed, so that the received UDP packet PK is a processed packet. Since there is an unprocessed packet with a smaller counter data value, the process proceeds to S214. If there is no unprocessed packet whose counter data value is smaller than that of the processed packet (No in S217), it is illegal that the read communication data number TD (n) <the next communication data number RD (n). Therefore, the UDP packet PK is discarded.

S218で、通信データ数TD(n)と次の通信データ数RD(n)が等しければ(S218のYes)、S220に進む。通信データ数TD(n)と次の通信データ数RD(n)が等しくない場合(S218のNo)、パケットロス、若しくはパケット到着順が入れ替わっているので、S219で、乱数列を飛ばす処理を行う。具体的には、通信データ数TD(n)から次の通信データ数RD(n)を差し引いた通信データ数と同一の乱数列分、乱数を発生させる。この乱数列は直ちに利用せず、後で、これに対応したUDPパケットPKが受信した場合に備えて、この乱数列を所定のメモリ(図示せず)に記憶しておく。これにより、次に再び乱数を発生させなくて済み、S217でS214に戻る処理を行わなくて済むようになる。このように、通信データ数TD(n)に応じて、パケットに対応した乱数列を設定する。この設定処理は、図示しないCPUが実行する。   If the communication data number TD (n) is equal to the next communication data number RD (n) in S218 (Yes in S218), the process proceeds to S220. If the number of communication data TD (n) is not equal to the next number of communication data RD (n) (No in S218), the packet loss or the packet arrival order is switched. Therefore, in S219, the random number sequence is skipped. . Specifically, random numbers are generated for the same random number sequence as the number of communication data obtained by subtracting the next communication data number RD (n) from the communication data number TD (n). This random number sequence is not used immediately, but is stored in a predetermined memory (not shown) in case the UDP packet PK corresponding to the random number sequence is received later. This eliminates the need to generate a random number again and eliminates the process of returning to S214 in S217. Thus, a random number sequence corresponding to the packet is set according to the communication data number TD (n). This setting process is executed by a CPU (not shown).

S220で、1パケット分の暗号文データと、乱数生成器52が発生した1パケット分のデータサイズの乱数とをXOR演算して、1パケット分の平文データを生成する。例えば、Arcfourの暗号化関数であるArcfour_Encryptに、暗号文データを代入する。   In S220, the ciphertext data for one packet and the random number having the data size for one packet generated by the random number generator 52 are XORed to generate plaintext data for one packet. For example, ciphertext data is substituted into Arcfour_Encrypt, which is an Arcfour encryption function.

S221で、次の通信データ数RD(n)を更新し、所定のメモリ(図示せず)に記憶する。具体的には、通信データ数RD(n)に1パケット分のデータサイズを加算した値を、次の通信データ数RD(n+1)として、その値を所定メモリに記憶する。送信装置10BからまたUDPパケットが送信されてきたら、S211〜S221を繰り返す。   In S221, the next communication data number RD (n) is updated and stored in a predetermined memory (not shown). Specifically, the value obtained by adding the data size for one packet to the communication data number RD (n) is stored as a next communication data number RD (n + 1) in a predetermined memory. When a UDP packet is transmitted again from the transmission apparatus 10B, S211 to S221 are repeated.

このように、受信装置50Bは、パケットPKn+x+1の前に送信された通信データ数を知ることで、パケットPKn+xがロストしたか、または順番が前後しているかを知ることができる。そして、パケットPKn+x+1を復号化するために、パケットPKn+x+1の前に送信された通信データ数から、パケットPKn+x−1の前に送信された通信データ数を差し引いた通信データ数を計算して、この差の分、乱数生成器55に乱数を生成させる。なお、1パケットのデータ部のデータサイズが固定されている場合には、送信装置10Bは送信した通信データ数をUDPのデータ部に記載する必要はない。受信装置50BはUDPパケットからカウンタデータを読み取ることで、送信装置10Bが送信した通信データ数を知ることができる。   In this way, the receiving device 50B can know whether the packet PKn + x has been lost or whether the order has been changed by knowing the number of communication data transmitted before the packet PKn + x + 1. Then, in order to decode the packet PKn + x + 1, the number of communication data obtained by subtracting the number of communication data transmitted before the packet PKn + x−1 from the number of communication data transmitted before the packet PKn + x + 1 is calculated. Therefore, the random number generator 55 is caused to generate random numbers. When the data size of the data portion of one packet is fixed, the transmitting apparatus 10B does not need to describe the number of transmitted communication data in the UDP data portion. The receiving device 50B can know the number of communication data transmitted by the transmitting device 10B by reading the counter data from the UDP packet.

こうすれば、パケットPKn+x+1に用いられる乱数は、送信装置10Bが暗号に利用した乱数RNn+x+1と同じものとなり、同期が取れるので、正しく復号化できる。   In this way, the random number used for the packet PKn + x + 1 is the same as the random number RNn + x + 1 used for encryption by the transmitting apparatus 10B and can be correctly decrypted because it is synchronized.

しかも、ストリーミング暗号による暗号・復号処理とは異なり、悪意のある攻撃者が、送信装置10Bのふりをして、かなり先のカウンタデータが付与されたUDPパケットを受信装置50Bに送ったとしても、図2に比べて、対応に多少時間を要するだけでサービス不能状態に陥ることがない。かなり先のカウンタデータが付与されたUDPパケットが送られたとしても、受信装置50BはN、N+1、N+2、・・・を基準に乱数列を生成するだけなので、短い時間で対応できる。なお、パケットの暗号・復号処理のほとんどを、Arcfourなど処理の速いストリーミング暗号で行えるので、通信データ数を付加することによる処理時間のロスはあるものの、図2よりさらに高速に暗号・復号処理を行うことが可能となる。   Moreover, unlike encryption / decryption processing using streaming encryption, even if a malicious attacker pretends to be the transmitting device 10B and sends a UDP packet to which the counter data is considerably added to the receiving device 50B, Compared to FIG. 2, it takes a little time for the response and does not fall into a service-disabled state. Even if the UDP packet to which the counter data is considerably added is sent, the receiving device 50B only generates a random number sequence based on N, N + 1, N + 2,. Note that most encryption / decryption processing of packets can be performed with fast-streaming encryption such as Arcfour, so there is a loss of processing time due to the addition of the number of communication data, but encryption / decryption processing is performed at a higher speed than in FIG. Can be done.

なお、ここでは、送信装置10Bがシードを設定後に送信した通信データ数を、受信装置50Bが把握できるようにするために、送信装置10BがUDPパケットに通信データ数の情報を付加する、つまり通信データ数をUDPパケットに記載するとして説明したが、送信装置10Bと受信装置50Bで送受信するUDPパケットのデータ部のデータサイズを固定にするなど、1回のUDPパケットで送信する前記通信データ数を事前に取り決めておけば、通信データ数をUDPパケットに記載する必要はなく、さらに高速なUDP通信が実現できる。   Here, in order for the receiving device 50B to be able to grasp the number of communication data transmitted by the transmitting device 10B after setting the seed, the transmitting device 10B adds information on the number of communication data to the UDP packet, that is, communication. Although the number of data is described as being described in the UDP packet, the number of communication data to be transmitted in one UDP packet is fixed, for example, the data size of the data part of the UDP packet transmitted / received between the transmitting device 10B and the receiving device 50B is fixed. If the arrangement is made in advance, it is not necessary to describe the number of communication data in the UDP packet, and higher-speed UDP communication can be realized.

このように、実施例2を用いれば、リアルタイム性を要求される音声・画像通信のUDP通信で、さらに高速な暗号・復号処理を行うことが可能となり、暗号通信と高速通信とを両立できるようになる。   As described above, when the second embodiment is used, it is possible to perform encryption / decryption processing at higher speed in the UDP communication for voice / image communication that requires real-time performance, so that both encryption communication and high-speed communication can be achieved. become.

このように、パケットロスやパケットの到着順に入れ替わりがなければ、毎回、シードSDを入力することも、乱数を余計に発生させることもなくなるので、高速な復号処理が行えるようになる。   In this way, if there is no change in the packet loss or the arrival order of the packets, the seed SD is not input every time and no extra random number is generated, so that a high-speed decoding process can be performed.

また、UDP通信で、高速な暗号通信を行うことが可能となるだけでなく、AESカウンタモードなど、処理速度の遅い暗号処理を減らせるので、より高速な暗号・復号処理が可能となる。   Further, not only high-speed encryption communication can be performed with UDP communication, but also encryption processing with a low processing speed such as the AES counter mode can be reduced, so that higher-speed encryption / decryption processing can be performed.

図14は、実施例3における監視システムを示す構成図である。図14において、通信システムの一例である、監視システム1を示す。監視システム1は、PC(パーソナルコンピュータ)50Cと、ネットワークカメラ10Cを有している。PC50Cとネットワークカメラ10Cは、ネットワークケーブル205で接続されている。PC50Cは、受信装置の一例であり、映像を受信する。モニタ203は、受信した映像を表示する。PC50Cは、ネットワーク制御部59と鍵設定部53を、外部から接続自在に構成されている。ネットワーク制御部59は、ネットワークケーブルが接続自在であり、ネットワーク通信を制御する。鍵設定部53は、USB(Universal Serial Bus)インタフェースなど、外部メモリと鍵データの受け渡しを行い、鍵の設定を行う。   FIG. 14 is a configuration diagram illustrating a monitoring system according to the third embodiment. In FIG. 14, the monitoring system 1 which is an example of a communication system is shown. The monitoring system 1 includes a PC (personal computer) 50C and a network camera 10C. The PC 50C and the network camera 10C are connected by a network cable 205. The PC 50C is an example of a receiving device, and receives video. The monitor 203 displays the received video. The PC 50C is configured such that the network control unit 59 and the key setting unit 53 can be connected from the outside. The network control unit 59 is connectable with a network cable and controls network communication. The key setting unit 53 exchanges key data with an external memory such as a USB (Universal Serial Bus) interface, and sets a key.

ネットワークカメラ10Cは、送信装置の一例であり、監視を行う。ネットワークカメラ10Cは、カメラ部101を有しており、ネットワーク制御部22と鍵設定部13を、外部から接続自在に構成されている。カメラ部101は、映像データを撮影し、映像データの生成を行う。ネットワーク制御部22は、ネットワークケーブルが接続自在であり、ネットワーク通信を制御する。鍵設定部13は、鍵設定部53と同様、USBインタフェースなど、外部メモリと鍵データの受け渡しを行い、鍵の設定を行う。ネットワークケーブル205は、例えばイーサネット(登録商標)ケーブルやシリアルケーブルなど、各種のケーブルが適用可能である。なお、無線通信の場合は、ケーブルは不要である。   The network camera 10C is an example of a transmission device and performs monitoring. The network camera 10C includes a camera unit 101, and is configured to be able to connect the network control unit 22 and the key setting unit 13 from the outside. The camera unit 101 captures video data and generates video data. The network control unit 22 is connectable with a network cable and controls network communication. Similarly to the key setting unit 53, the key setting unit 13 exchanges key data with an external memory such as a USB interface, and sets a key. As the network cable 205, various types of cables such as an Ethernet (registered trademark) cable and a serial cable can be applied. In the case of wireless communication, no cable is necessary.

図15は、図14の監視システムの機能ブロック図である。図1と共通する要素は、同一の符号を付している。映像通信を開始する前に、事前設定を行う。暗号器12と暗号器52は、カウンタモードを実行するブロック暗号器であり、両者で同じ鍵KY1を設定する。   FIG. 15 is a functional block diagram of the monitoring system of FIG. Elements common to FIG. 1 are assigned the same reference numerals. Perform pre-configuration before starting video communication. The encryption device 12 and the encryption device 52 are block encryption devices that execute the counter mode, and both set the same key KY1.

はじめに、設定者が、USBメモリ内に鍵KY1を用意する。設定者は、このUSBメモリを、USBインタフェース機能を持つ鍵設定部70に挿入する。鍵設定部70は、USBメモリから鍵KY1を読み込み、これを暗号器12にセットする。   First, the setter prepares the key KY1 in the USB memory. The setter inserts the USB memory into the key setting unit 70 having a USB interface function. The key setting unit 70 reads the key KY1 from the USB memory and sets it in the encryptor 12.

また設定者は、このUSBメモリを、USBインタフェース機能を持つ鍵設定部71にも挿入する。鍵設定部71は、USBメモリから鍵KY1を読み込み、これを暗号器52にセットする。ここでは、設定者はUSBメモリを鍵設定部70に先に挿入したが、鍵設定部71に先に挿入しても構わない。また、USBメモリを利用して鍵の設定を行っているが、図1と同様に、公開鍵暗号方式を用いて、設定者を介さずに自動に設定させることも可能である。   The setter also inserts the USB memory into the key setting unit 71 having a USB interface function. The key setting unit 71 reads the key KY1 from the USB memory and sets it in the encryptor 52. Here, the setter has inserted the USB memory into the key setting unit 70 first, but it may be inserted into the key setting unit 71 first. Further, although the key is set using the USB memory, it is also possible to automatically set the key without using the setter by using the public key cryptosystem as in FIG.

次に、カメラ部101が、映像撮影を行い、映像データ生成部72が、映像データIDを生成し、この映像データIDをXOR処理部17に送る。これと同時にカメラ部101は暗号器12に、暗号処理開始を通知する。なお、この暗号処理開始の通知は、XOR処理部17が行っても良い。   Next, the camera unit 101 captures a video, the video data generation unit 72 generates a video data ID, and sends this video data ID to the XOR processing unit 17. At the same time, the camera unit 101 notifies the encryption unit 12 of the start of encryption processing. Note that the notification of the start of encryption processing may be performed by the XOR processing unit 17.

暗号器12は、CTR記憶部15から現在のカウンタデータCTRを読み出し、このカウンタデータCTRを暗号化して、暗号カウンタデータE(CTR)を生成する。そして、この暗号カウンタデータE(CTR)を、乱数生成器16のシードSDとして設定する。なお、カウンタデータの初期値はどんな値であっても良い。   The encryptor 12 reads the current counter data CTR from the CTR storage unit 15, encrypts the counter data CTR, and generates encrypted counter data E (CTR). Then, this encryption counter data E (CTR) is set as the seed SD of the random number generator 16. The initial value of the counter data may be any value.

次に暗号器12は、乱数生成器16に乱数の生成を要求する。この要求は、カメラ部101、またはXOR処理部17が行ってよい。乱数生成器16は、映像データIDのデータ長と同じ、あるいは大きい乱数を発生する。そして、乱数RNをXOR処理部17に送る。   Next, the encryptor 12 requests the random number generator 16 to generate a random number. This request may be made by the camera unit 101 or the XOR processing unit 17. The random number generator 16 generates a random number that is the same as or larger than the data length of the video data ID. Then, the random number RN is sent to the XOR processing unit 17.

XOR処理部17は、乱数RNを受けて、映像データIDと乱数のXOR演算を行い、暗号映像データEIDを生成し、この暗号通信データEIDを、データ合成部19に送る。ここでは、一度に映像データIDと乱数のXOR演算を行っているが、逐次行っても良い。   The XOR processing unit 17 receives the random number RN, performs an XOR operation between the video data ID and the random number, generates encrypted video data EID, and sends the encrypted communication data EID to the data synthesis unit 19. Here, the XOR operation of the video data ID and the random number is performed at one time, but may be performed sequentially.

データ合成部19は、CTR記憶部15から、現在のカウンタデータCTRを読み出し、このカウンタデータCTRを暗号映像データEIDに付加する。カウンタデータCTR付きの暗号映像データEIDを生成し、これをUDPデータ送受信部21に送る。   The data synthesis unit 19 reads the current counter data CTR from the CTR storage unit 15 and adds the counter data CTR to the encrypted video data EID. The encrypted video data EID with the counter data CTR is generated and sent to the UDP data transmitting / receiving unit 21.

また、データ合成部19は、カウンタアップ部20に、カウンタデータCTRの更新を要求する。カウンタアップ部20は、カウンタデータCTRをCTR記憶部15から読み出し、この値を更新する。最も簡単な更新方法は、現在のカウンタデータに1を加えたデータを次のカウンタデータにする方法であるが、現在のカウンタデータのハッシュ値を次のカウンタデータにするなど、この更新はどのようなものであっても良い。但し、同じカウンタデータが出現しない方法を採用するのが望ましい。   Further, the data composition unit 19 requests the counter up unit 20 to update the counter data CTR. The counter up unit 20 reads the counter data CTR from the CTR storage unit 15 and updates this value. The simplest update method is to add 1 to the current counter data to make the next counter data, but how to do this update, such as changing the hash value of the current counter data to the next counter data? It may be anything. However, it is desirable to adopt a method in which the same counter data does not appear.

UDPデータ送受信部21は、カウンタデータCTR付きの暗号映像データEIDにUDPヘッダを付加して、ネットワーク制御部22を介して、カウンタデータCTR付きの暗号映像データEIDを、PC50Cに送信する。   The UDP data transmitting / receiving unit 21 adds a UDP header to the encrypted video data EID with the counter data CTR, and transmits the encrypted video data EID with the counter data CTR to the PC 50C via the network control unit 22.

PC50Cでは、UDPデータ送受信部60が、ネットワーク制御部59を介して、カウンタデータCTR付きの暗号映像データEIDを含むUDPパケットを受信する。   In the PC 50C, the UDP data transmitting / receiving unit 60 receives the UDP packet including the encrypted video data EID with the counter data CTR via the network control unit 59.

データ分解部51は、カウンタデータCTR付きの暗号映像データEIDを、UDPデータ送受信部60から受け取る。このカウンタデータCTR付きの暗号映像データEIDから、カウンタデータCTRを抜き出し、このカウンタデータCTRを暗号器52に送る。また、カウンタデータCTR付きの暗号映像データEIDから、暗号映像データEIDを抜き出し、この暗号映像データEIDをXOR処理部56に送る。   The data decomposing unit 51 receives the encrypted video data EID with the counter data CTR from the UDP data transmitting / receiving unit 60. The counter data CTR is extracted from the encrypted video data EID with the counter data CTR, and the counter data CTR is sent to the encryptor 52. Further, the encrypted video data EID is extracted from the encrypted video data EID with the counter data CTR, and this encrypted video data EID is sent to the XOR processing unit 56.

暗号器52は、カウンタデータCTRを暗号化して暗号カウンタデータE(CTR)を生成する。そして、この暗号カウンタデータE(CTR)を、乱数生成器55のシードSDとして設定する。   The encryptor 52 encrypts the counter data CTR to generate encrypted counter data E (CTR). The encryption counter data E (CTR) is set as the seed SD of the random number generator 55.

また、暗号器52は、乱数生成器55に乱数RNの生成を要求する。この要求は、データ分解部51、またはXOR処理部56が行うものとすることもできる。乱数生成器55は、暗号映像データEIDのデータ長と同じ、あるいは大きい乱数RNを発生する。そして、乱数RNをXOR処理部56に送る。   Further, the encryptor 52 requests the random number generator 55 to generate a random number RN. This request may be made by the data decomposing unit 51 or the XOR processing unit 56. The random number generator 55 generates a random number RN that is the same as or larger than the data length of the encrypted video data EID. Then, the random number RN is sent to the XOR processing unit 56.

XOR処理部56は、乱数RNを受けて、暗号映像データEIDと乱数RNのXOR演算を行い、映像データIDを取得する。そして、この映像データIDを、映像データ生成部73に送る。映像データ生成部73は、ネットワークカメラ10Cが送信した映像データIDをモニタ203に表示させる。   The XOR processing unit 56 receives the random number RN, performs an XOR operation on the encrypted video data EID and the random number RN, and acquires the video data ID. Then, this video data ID is sent to the video data generation unit 73. The video data generation unit 73 causes the monitor 203 to display the video data ID transmitted by the network camera 10C.

このように、本実施例の監視システムは、実施例1と同様に、同期ずれを抑制することが出来るので、リアルタイム通信が要求される映像通信で、UDP通信が適用された場合であっても、セキュリティを確保しながら、映像通信を円滑に行うことが出来る。   As described above, the monitoring system of the present embodiment can suppress the synchronization shift as in the first embodiment. Therefore, even when UDP communication is applied in video communication that requires real-time communication. Video communication can be performed smoothly while ensuring security.

図16は、実施例4におけるUDP通信に利用できるように、ストリーミング暗号の利用方法を改良した手段を説明するブロック図である。本実施例では、通信データ数を用いて同期ずれを抑制する点で、実施例2と同様であるが、シード生成を行う暗号器12、52を備えていない。   FIG. 16 is a block diagram for explaining means for improving the method of using the streaming cipher so that it can be used for UDP communication in the fourth embodiment. The present embodiment is similar to the second embodiment in that the synchronization shift is suppressed by using the number of communication data, but the encryptors 12 and 52 that perform seed generation are not provided.

図16の暗号化・復号化手段の特徴は、パケットPKn−1やパケットPKnなどに、送信装置10Dがそれ以前に送信した通信データ数の情報を記載するところである。この通信データ数の情報は、送信装置10Dが、UDPパケットのデータ部に記載し、これを受信装置50Dが読み取るようになっている。   A feature of the encryption / decryption means in FIG. 16 is that information on the number of communication data transmitted by the transmission device 10D before that is described in the packet PKn-1, the packet PKn, and the like. The information on the number of communication data is described by the transmitting device 10D in the data portion of the UDP packet, and this is read by the receiving device 50D.

受信装置50Dは、この通信データ数を取得することで、各UDPパケット(UDPデータ部)が送信される前に、送信装置10Dがどれくらいのデータサイズの通信データを送信したかを知ることができる。これにより、各UDPパケットの復号化の前に、この通信データ数分の乱数を発生させれば、たとえ、いくつかのUDPパケットがロストしても、同期をとることができるようになる。   The receiving device 50D can know how much communication data the transmitting device 10D has transmitted before each UDP packet (UDP data portion) is transmitted by acquiring the number of communication data. . Thus, if random numbers corresponding to the number of communication data are generated before decoding each UDP packet, synchronization can be achieved even if several UDP packets are lost.

図16では、受信装置50Dは、パケットPKnの前に送信された通信データ数を知ることで、パケットPKn−1がロストしたか、または順番が前後しているかを知ることができる。そして、パケットPKnを復号化するために、パケットPKnの前に送信された通信データ数から、パケットPKn−2の前に送信された通信データ数を差し引いた、通信データ数を計算して、この差分、乱数生成器55に乱数を生成させる。なお、パケットPKn−1は後で到着するかもしれないので、この際に発生させた乱数は、受信装置50Dに記憶しておき、パケットPKn−1が到着したら利用する。   In FIG. 16, the receiving device 50D can know whether the packet PKn-1 has been lost or whether the order has been changed by knowing the number of communication data transmitted before the packet PKn. In order to decode the packet PKn, the number of communication data obtained by subtracting the number of communication data transmitted before the packet PKn-2 from the number of communication data transmitted before the packet PKn-2 is calculated. The difference and random number generator 55 is caused to generate a random number. Note that since the packet PKn-1 may arrive later, the random number generated at this time is stored in the receiving device 50D and used when the packet PKn-1 arrives.

こうすれば、パケットPKnに用いられる乱数は、送信装置10Dが暗号に利用した乱数RNnと同じになり、同期が取れるので、正しく復号化できる。   In this way, the random number used for the packet PKn becomes the same as the random number RNn used for encryption by the transmitting device 10D and can be correctly decrypted because it is synchronized.

図17は、UDP通信に利用できるように、ストリーミング暗号の利用方法を図2からさらに改良した手段を説明するブロック図である。本実施例は、実施例4の構成に、第2乱数生成器162、552を付加したものである。なお、第1乱数生成器161、551、実施例4の乱数生成器16、55と同様である。   FIG. 17 is a block diagram for explaining means obtained by further improving the method of using the streaming cipher from FIG. 2 so that it can be used for UDP communication. In this embodiment, second random number generators 162 and 552 are added to the configuration of the fourth embodiment. The first random number generators 161 and 551 are the same as the random number generators 16 and 55 of the fourth embodiment.

図17の暗号化・復号化手段の特徴は、シードSD1を、送信装置10E、受信装置50Eで交換するのではなく、それぞれ第2乱数生成器162、および第2乱数生成器552によって生成するものとしたところである。従って、シードSD2は事前に交換されて設定されていなければならない。また、パケットPKn+xやパケットPKn+x+1に記載されている通信データ数は、図16とは異なり、1番目のパケットからの通信データ数ではなく、パケットPKnからの通信データ数、つまりパケットPKnを起点として、パケットPKn+xやパケットPKn+x+1を受け取る前までに、送信装置10Eが送信した通信データのデータサイズとなっている。これにより、通信データ数を小さくできるので、パケットロスがあった場合に、転送速度を上げることができるようになっている。   The encryption / decryption means in FIG. 17 is characterized in that the seed SD1 is generated by the second random number generator 162 and the second random number generator 552 instead of being exchanged between the transmission device 10E and the reception device 50E. That's right. Therefore, the seed SD2 must be exchanged and set in advance. Further, the number of communication data described in the packet PKn + x and the packet PKn + x + 1 is different from that in FIG. 16, not the number of communication data from the first packet, but the number of communication data from the packet PKn, that is, the packet PKn Before receiving the packet PKn + x or the packet PKn + x + 1, the data size of the communication data transmitted by the transmission device 10E is set. As a result, the number of communication data can be reduced, so that if there is a packet loss, the transfer rate can be increased.

なお、第2乱数生成器162、および第2乱数生成器552は、「N,2N,3N,・・・」というようにカウンタデータがNステップするたびに、シード(乱数)を発生させるものとする。従って、受信装置50EはカウンタデータをUDPパケットから読み出せるものとする。受信装置50EがUDPパケットからカウンタデータを読み出せるようにするためには、送信装置10EがカウンタデータをUDPパケットに付与するか、若しくはUDPの各ヘッダからカウンタデータを読み出すものとすれば良い。   The second random number generator 162 and the second random number generator 552 generate seeds (random numbers) every time the counter data is N steps, such as “N, 2N, 3N,. To do. Therefore, it is assumed that the receiving device 50E can read the counter data from the UDP packet. In order to enable the receiving device 50E to read the counter data from the UDP packet, the transmitting device 10E may add the counter data to the UDP packet or read the counter data from each UDP header.

このような工夫を施せば、図16で説明したような、かなり先のカウンタデータが付与された不正なUDPパケット、あるいはかなり先の通信データ数が付与されたUDPパケットを送信されても、Nの値を大きくしておけば、乱数発生時間を低下させることができる。具体的には、受信装置50Eは、カウンタデータをNで割った商の数の乱数を、第2乱数生成器552に発生させ、この最後の乱数のシードSD1を第1乱数生成器551に設定し、カウンタデータをNで割った余りの数の乱数を、第1乱数生成器551に発生させることになるので、乱数発生時間を短縮できる。   If such a contrivance is applied, even if an illegal UDP packet to which a considerably earlier counter data is added or a UDP packet to which a considerably earlier number of communication data is sent as described in FIG. If the value of is increased, the random number generation time can be reduced. Specifically, the receiving device 50E causes the second random number generator 552 to generate a random number corresponding to the quotient obtained by dividing the counter data by N, and sets the last random number seed SD1 in the first random number generator 551. Since the first random number generator 551 generates the remainder of the random number obtained by dividing the counter data by N, the random number generation time can be shortened.

ここでは、乱数発生器を2段にしているが、3段以上で構成し、さらに効率の良い乱数発生方法を得ることも可能である。   Here, although the random number generator has two stages, it is possible to obtain a more efficient random number generation method by using three or more stages.

但し、図16で説明したような不正なUDPパケットを送信されると、第2乱数生成器162が発生した乱数の中に、利用しなかった乱数が出てくる。この乱数は取っておかないと、送信装置10Eが正規のUDPパケットを送信してきた場合に復号化できなくなる。しかしどれくらいのデータサイズ、覚えておけば良いかを決められないので問題となる。   However, when an illegal UDP packet as described with reference to FIG. 16 is transmitted, random numbers that are not used appear among the random numbers generated by the second random number generator 162. If this random number is not saved, the transmitting device 10E cannot be decrypted when it transmits a regular UDP packet. However, it is a problem because it is impossible to decide how much data size should be remembered.

そこで、第2乱数生成器552で、シードSD1を発生させる場合に、第2乱数生成器552の内部情報を受信装置50Eに記憶しておけば良い。そしてMACを利用して、UDPパケットが正しいか否かを判定し、正しくないと判定された場合は、受信装置50Eに記憶しておいた第2乱数生成器552の内部情報を、第2乱数生成器552に戻せば良い。   Therefore, when the second random number generator 552 generates the seed SD1, the internal information of the second random number generator 552 may be stored in the receiving device 50E. Then, using the MAC, it is determined whether or not the UDP packet is correct. If it is determined that the UDP packet is not correct, the internal information of the second random number generator 552 stored in the receiving device 50E is used as the second random number. Return to the generator 552.

本発明に係る復号化装置、暗号化装置、復号化方法、暗号化方法、および通信システムは、パケットのロスや到着順の入れ替わりがあった場合であっても、送信側と受信側の間の同期ずれを抑制することの出来るので、セキュリティと円滑な通信を要求される通信方式に有用である。   The decryption device, the encryption device, the decryption method, the encryption method, and the communication system according to the present invention are provided between the transmission side and the reception side even when there is a packet loss or a change in arrival order. Since synchronization loss can be suppressed, it is useful for communication systems that require security and smooth communication.

1 監視システム
10A、10B、10D、10E 送信装置
10C ネットワークカメラ
11 通信データ生成部
12 暗号器
13 鍵交換部
15 CTR記憶部
16 乱数生成器
17 XOR処理部
19 データ合成部
20 カウンタアップ部
21 UDPデータ送受信部
22 ネットワーク制御部
23 MAC計算器
50A、50B、50D、50E 受信装置
50C PC
51 データ分解部
52 暗号器
53 鍵交換部
55 乱数生成器
56 XOR処理部
57 通信データ解釈部
59 ネットワーク制御部
60 UDPデータ送受信部
61 CTR記憶部
62 カウンタチェック部
63 MAC計算器
65 MACデータ比較器
66 カウンタアップ部
70、71 鍵生成部
72、73 映像データ生成部
101 カメラ部
161 第1乱数生成器
162 第2乱数生成器
203 モニタ
205 ネットワークケーブル
551 第1乱数生成器
552 第2乱数生成器
CD 通信データ
CP 暗号文
CTR カウンタデータ
ECD 暗号通信データ
E(CTR) 暗号カウンタデータ
EID 暗号映像データ
EUD 暗号UDPデータ
HD1 MACヘッダ
HD2 IPヘッダ
HD3 UDPヘッダ
ID 映像データ
KY1 鍵
MD MACデータ
OD 元データ
PK UDPパケット
PT 平文
PUD 平文UDPデータ
RN 乱数
SD シード
UDF UDPデータ領域
DESCRIPTION OF SYMBOLS 1 Monitoring system 10A, 10B, 10D, 10E Transmission apparatus 10C Network camera 11 Communication data generation part 12 Encryption machine 13 Key exchange part 15 CTR memory | storage part 16 Random number generator 17 XOR process part 19 Data composition part 20 Counter up part 21 UDP data Transmission / reception unit 22 Network control unit 23 MAC calculator 50A, 50B, 50D, 50E Receiver 50C PC
51 Data Decomposing Unit 52 Cryptographic Unit 53 Key Exchange Unit 55 Random Number Generator 56 XOR Processing Unit 57 Communication Data Interpreting Unit 59 Network Control Unit 60 UDP Data Transmitting / Receiving Unit 61 CTR Storage Unit 62 Counter Checking Unit 63 MAC Calculator 65 MAC Data Comparator 66 Counter up unit 70, 71 Key generation unit 72, 73 Video data generation unit 101 Camera unit 161 First random number generator 162 Second random number generator 203 Monitor 205 Network cable 551 First random number generator 552 Second random number generator CD Communication data CP Ciphertext CTR Counter data ECD Encryption communication data E (CTR) Encryption counter data EID Encryption video data EUD Encryption UDP data HD1 MAC header HD2 IP header HD3 UDP header ID Video data KY1 Key MD AC data OD based on data PK UDP packet PT plaintext PUD plaintext UDP data RN random number SD seed UDF UDP data area

Claims (24)

パケットに含まれる暗号文データを復号化する復号化装置であって、
暗号処理を実行する暗号化装置から送信されるパケットを受信する受信手段と、
前記パケットに対応しかつ前記パケットを識別するためのパケット情報を、共通鍵を用いて暗号化し、暗号化されたパケット情報を生成する鍵生成手段と、
前記鍵生成手段により生成される暗号化されたパケット情報をシードとして、乱数を生成する乱数生成手段と、
前記乱数生成手段により生成される乱数に基づいて、前記受信手段により受信されたパケットに含まれる暗号文データを復号化する復号化手段とを有することを特徴とする復号化装置。
A decryption device for decrypting ciphertext data contained in a packet,
Receiving means for receiving a packet transmitted from an encryption device that performs encryption processing;
Key generation means for encrypting packet information corresponding to the packet and identifying the packet using a common key, and generating encrypted packet information ;
Random number generating means for generating random numbers using the encrypted packet information generated by the key generating means as a seed;
On the basis of the random numbers generated by the random number generating means, decoding apparatus for decoding means for decoding the encrypted data included in the received packet, wherein Rukoto which have a by the receiving means.
記復号化手段は、前記乱数生成手段により生成された乱数と、前記パケットに含まれる暗号文データとを、XOR演算することを特徴とする請求項1記載の復号化装置。 Before Symbol decoding means includes a random number generated by the random number generating unit, and a ciphertext data included in the packet, the decoding apparatus according to claim 1, characterized in that the XOR operation. 前記鍵生成手段は、少なくとも1以上のパケットおきにシードを生成することを特徴とする請求項2記載の復号化装置。 The decryption apparatus according to claim 2, wherein the key generation unit generates a seed every at least one packet. 前記暗号化装置から、第1パケット、・・・、第Mパケット、・・・、第Nパケット(1≦M<N、Nは2以上の整数)を当該復号化装置に順次、送信され、
前記復号化装置は、さらに、前記第1パケットから前記第M−1パケットまでの通信データ数の総和に応じて、前記乱数生成手段が生成した乱数から乱数列を設定する乱数列設定手段を有し、
前記復号化手段は、前記乱数列設定手段が設定した乱数列と、前記第Nパケットに含まれる暗号文データとを、XOR演算することを特徴とする請求項2記載の復号化装置。
From the encryption device, the first packet,..., The Mth packet,..., The Nth packet (1 ≦ M <N, where N is an integer of 2 or more) are sequentially transmitted to the decryption device.
The decryption device further includes random number sequence setting means for setting a random number sequence from the random numbers generated by the random number generation means in accordance with the total number of communication data from the first packet to the M-1th packet. And
The decryption apparatus according to claim 2, wherein the decryption unit performs an XOR operation on the random number sequence set by the random number sequence setting unit and ciphertext data included in the Nth packet.
前記第Mパケットには、前記第1パケットから前記第M−1パケットまでの通信データ数の総和を示す情報が含まれており、前記乱数列設定手段は、前記第Mパケットが示す情報を用いて乱数列を設定することを特徴とする請求項4記載の復号化装置。 The Mth packet includes information indicating the total number of communication data from the first packet to the M-1th packet, and the random number sequence setting means uses information indicated by the Mth packet. 5. The decoding apparatus according to claim 4, wherein a random number sequence is set. 前記鍵生成手段は、逆関数を有する暗号方式に基づいてパケット情報を暗号化することにより、前記暗号化されたパケット情報を生成することを特徴とする請求項1記載の復号化装置。 The key generation means, by encrypting the packet information based on encryption scheme that having a reverse function, decoding apparatus according to claim 1, wherein the generating the encrypted packet information . 前記鍵生成手段は、前記パケット情報をブロック毎に暗号化することにより、前記暗号化されたパケット情報を生成することを特徴とする請求項6記載の復号化装置。 The key generation means, by encrypting the packet information for each block, the decoding apparatus according to claim 6, wherein the generating the encrypted packet information. 前記パケット情報は、前記パケットを識別自在なカウンタデータであることを特徴とする請求項1記載の復号化装置。 2. The decoding apparatus according to claim 1, wherein the packet information is counter data capable of identifying the packet. 前記カウンタデータは、前記パケットの通し番号であることを特徴とする請求項8記載の復号化装置。 The decoding apparatus according to claim 8, wherein the counter data is a serial number of the packet. 前記パケットは、コネクションレス型のプロトコルに基づくことを特徴とする請求項1記載の復号化装置。 The decoding apparatus according to claim 1, wherein the packet is based on a connectionless protocol. 前記コネクションレス型のプロトコルケットは、UDP(User Datagram Protocol)を含むことを特徴とする請求項10記載の復号化装置。 11. The decoding apparatus according to claim 10, wherein the connectionless protocol ket includes UDP (User Datagram Protocol). 平文データを暗号化し、暗号文データを復号化装置に送信する暗号化装置であって、
パケットに対応しかつ前記パケットを識別するためのパケット情報を、共通鍵を用いて暗号化し暗号化されたパケット情報を生成する鍵生成手段と、
前記鍵生成手段により生成される暗号化されたパケット情報をシードとして、乱数を生成する乱数生成手段と、
前記乱数生成手段により生成される乱数に基づいて平文データを暗号化し、暗号文データを生成する暗号化手段と、
前記暗号文データと前記パケット情報とを含むパケットを、前記復号化装置に送信する送信手段とを有することを特徴とする暗号化装置。
An encryption device that encrypts plaintext data and transmits the ciphertext data to a decryption device,
Key generation means for encrypting packet information corresponding to a packet and identifying the packet using a common key, and generating encrypted packet information ;
Random number generating means for generating random numbers using the encrypted packet information generated by the key generating means as a seed;
Encrypting plaintext data based on a random number generated by the random number generating means, and generating encrypted text data;
An encryption apparatus comprising: a transmission unit configured to transmit a packet including the ciphertext data and the packet information to the decryption apparatus.
記暗号化手段は、前記乱数生成手段により生成された乱数と、前記平文データとを、XOR演算することを特徴とする請求項12記載の暗号化装置。 Before Symbol encryption means includes a random number generated by the random number generating means and the plaintext data, the encryption device according to claim 12, characterized in that the XOR operation. 前記鍵生成手段は、少なくとも1以上のパケットおきにシードを生成することを特徴とする請求項13記載の暗号化装置。 14. The encryption apparatus according to claim 13, wherein the key generation unit generates a seed every at least one packet. 前記送信手段は、第1パケット、・・・、第Mパケット、・・・、第Nパケット(1≦M<N、Nは2以上の整数)を順次、前記復号化装置に送信し、
前記第Mパケットには、前記第1パケットから前記第M−1パケットまでの通信データ数の総和を示す情報が含まれていることを特徴とする請求項13記載の暗号化装置。
The transmission means sequentially transmits the first packet,..., The Mth packet,..., The Nth packet (1 ≦ M <N, where N is an integer of 2 or more) to the decoding device.
14. The encryption apparatus according to claim 13, wherein the Mth packet includes information indicating a total number of communication data from the first packet to the M-1 packet.
前記鍵生成手段は、逆関数を有する暗号方式に基づいてパケット情報を暗号化することにより、前記暗号化されたパケット情報を生成することを特徴とする請求項12記載の暗号化装置。 The key generation means, by encrypting the packet information based on the encryption scheme having an inverse function, the encryption apparatus according to claim 12, wherein the generating the encrypted packet information. 前記鍵生成手段は、前記パケット情報をブロック毎に暗号化することにより、前記暗号化されたパケット情報を生成することを特徴とする請求項16記載の暗号化装置。 The key generation means, by encrypting the packet information for each block, encryption device according to claim 16, wherein the generating the encrypted packet information. 前記パケット情報は、前記パケットを識別自在なカウンタデータであることを特徴とする請求項12記載の暗号化装置。 13. The encryption apparatus according to claim 12, wherein the packet information is counter data capable of identifying the packet. 前記カウンタデータは、前記パケットの通し番号であることを特徴とする請求項18記載の暗号化装置。 19. The encryption apparatus according to claim 18, wherein the counter data is a serial number of the packet. 前記パケットは、コネクションレス型のプロトコルに基づくことを特徴とする請求項12記載の暗号化装置。 13. The encryption apparatus according to claim 12, wherein the packet is based on a connectionless protocol. 前記コネクションレス型のプロトコルケットは、UDP(User Datagram Protocol)を含むことを特徴とする請求項20記載の暗号化装置。 21. The encryption apparatus according to claim 20, wherein the connectionless protocol ket includes UDP (User Datagram Protocol). パケットに含まれる暗号文データを復号化する復号化方法であって、
暗号処理を実行する暗号化装置から送信されるパケットを受信する受信ステップと、
前記パケットに対応しかつ前記パケットを識別するためのパケット情報を、共通鍵を用いて暗号化し、暗号化されたパケット情報を生成する鍵生成ステップと、
前記鍵生成ステップで生成される暗号化されたパケット情報をシードとして、乱数を生成する乱数生成ステップと、
前記乱数生成ステップで生成される乱数に基づいて、前記受信ステップで受信されたパケットに含まれる暗号文データを復号化する復号化ステップとを有することを特徴とする復号化方法。
A decryption method for decrypting ciphertext data contained in a packet,
A receiving step of receiving a packet transmitted from an encryption device that performs cryptographic processing;
A key generation step of encrypting packet information corresponding to the packet and identifying the packet using a common key, and generating encrypted packet information ;
A random number generation step for generating a random number using the encrypted packet information generated in the key generation step as a seed;
On the basis of the random numbers generated by the random number generation step, the decoding method comprising Rukoto which have a a decoding step of decoding the encrypted data included in the received packet by the reception step.
平文データを暗号化し、暗号文データを復号化装置に送信する暗号化方法であって、
パケットに対応しかつ前記パケットを識別するためのパケット情報を、共通鍵を用いて暗号化し暗号化されたパケット情報を生成する鍵生成ステップと、
前記鍵生成ステップで生成される暗号化されたパケット情報をシードとして、乱数を生成する乱数生成ステップと、
前記乱数生成ステップで生成される乱数に基づいて平文データを暗号化し、暗号文データを生成する暗号化ステップと、
前記暗号文データと前記パケット情報とを含むパケットを、前記復号化装置に送信する送信ステップとを有することを特徴とする暗号化方法。
An encryption method for encrypting plaintext data and transmitting the ciphertext data to a decryption device,
A key generation step of encrypting packet information corresponding to a packet and identifying the packet using a common key, and generating encrypted packet information ;
A random number generation step for generating a random number using the encrypted packet information generated in the key generation step as a seed;
Encrypting plaintext data based on the random number generated in the random number generation step, and generating encrypted text data;
An encryption method comprising: a transmission step of transmitting a packet including the ciphertext data and the packet information to the decryption device.
通信システムであって、
前記通信システムは、
平文データを暗号化し、パケットに含まれる暗号文データを通信回線に送信する暗号化装置と、
前記暗号化装置から通信回線を介してパケットを受信し、前記パケットに含まれる暗号文データを復号化する復号化装置とを備え、
前記暗号化装置は、
前記パケットに対応しかつ前記パケットを識別するためのパケット情報を、共通鍵を用いて暗号化し暗号化されたパケット情報を生成する第1の鍵生成手段と、
前記第1の鍵生成手段により生成される暗号化されたパケット情報をシードとして、乱数を生成する第1の乱数生成ステップと、
前記第1の乱数生成手段により生成される乱数に基づいて平文データを暗号化し、暗号文データを生成する暗号化手段と、
前記暗号文データと前記パケット情報とを含むパケットを、前記復号化装置に送信する送信手段とを有し、
前記復号化装置は、
前記暗号化装置から送信されるパケットを受信する受信手段と、
前記パケット情報を、前記共通鍵を用いて暗号化し、前記暗号化されたパケット情報を生成する第2の鍵生成手段と、
前記第2の鍵生成手段により生成される暗号化されたパケット情報をシードとして、乱数を生成する第2の乱数生成手段と、
前記第2の乱数生成手段により生成される乱数に基づいて、前記受信手段により受信されたパケットに含まれる暗号文データを復号化する復号化手段とを有することを特徴とする通信システム。
A communication system,
The communication system is:
An encryption device that encrypts plaintext data and transmits the ciphertext data included in the packet to a communication line;
A decryption device that receives a packet from the encryption device via a communication line and decrypts ciphertext data included in the packet;
The encryption device is:
First key generation means for encrypting packet information corresponding to the packet and for identifying the packet using a common key, and generating encrypted packet information ;
A first random number generation step of generating a random number using the encrypted packet information generated by the first key generation means as a seed;
Encryption means for encrypting plaintext data based on a random number generated by the first random number generation means and generating ciphertext data;
A transmission means for transmitting a packet including the ciphertext data and the packet information to the decryption device;
The decoding device
Receiving means for receiving a packet transmitted from the encryption device;
Second key generation means for encrypting the packet information using the common key and generating the encrypted packet information ;
Second random number generation means for generating a random number using the encrypted packet information generated by the second key generation means as a seed;
A communication system comprising: decrypting means for decrypting ciphertext data contained in a packet received by the receiving means based on a random number generated by the second random number generating means.
JP2009276294A 2009-12-04 2009-12-04 Decryption device, encryption device, decryption method, encryption method, and communication system Active JP5526747B2 (en)

Priority Applications (3)

Application Number Priority Date Filing Date Title
JP2009276294A JP5526747B2 (en) 2009-12-04 2009-12-04 Decryption device, encryption device, decryption method, encryption method, and communication system
US13/502,081 US8731196B2 (en) 2009-12-04 2010-07-23 Decrypting apparatus, encrypting apparatus, decrypting method, encrypting method, and communication system
PCT/JP2010/004712 WO2011067876A1 (en) 2009-12-04 2010-07-23 Decrypting apparatus, encrypting apparatus, decrypting method, encrypting method, and communication system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2009276294A JP5526747B2 (en) 2009-12-04 2009-12-04 Decryption device, encryption device, decryption method, encryption method, and communication system

Publications (3)

Publication Number Publication Date
JP2011120051A JP2011120051A (en) 2011-06-16
JP2011120051A5 JP2011120051A5 (en) 2013-01-10
JP5526747B2 true JP5526747B2 (en) 2014-06-18

Family

ID=42828458

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2009276294A Active JP5526747B2 (en) 2009-12-04 2009-12-04 Decryption device, encryption device, decryption method, encryption method, and communication system

Country Status (3)

Country Link
US (1) US8731196B2 (en)
JP (1) JP5526747B2 (en)
WO (1) WO2011067876A1 (en)

Families Citing this family (18)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
DE102011118367B4 (en) * 2011-08-24 2017-02-09 Deutsche Telekom Ag Method for authenticating a telecommunication terminal comprising an identity module at a server device of a telecommunication network, use of an identity module, identity module and computer program
US9449183B2 (en) * 2012-01-28 2016-09-20 Jianqing Wu Secure file drawer and safe
US10419907B2 (en) 2012-02-22 2019-09-17 Qualcomm Incorporated Proximity application discovery and provisioning
US9544075B2 (en) 2012-02-22 2017-01-10 Qualcomm Incorporated Platform for wireless identity transmitter and system using short range wireless broadcast
US10360593B2 (en) 2012-04-24 2019-07-23 Qualcomm Incorporated Retail proximity marketing
JP2013251609A (en) * 2012-05-30 2013-12-12 Sony Corp Information processing device, ic chip, and information processing method
US8990556B1 (en) 2014-08-13 2015-03-24 Gimbal, Inc. Sharing beacons
US9107152B1 (en) 2015-03-11 2015-08-11 Gimbal, Inc. Beacon protocol advertising bi-directional communication availability window
CN113923052A (en) * 2015-07-03 2022-01-11 阿费罗有限公司 Apparatus and method for establishing a secure communication channel in an internet of things (IoT) system
US9729310B2 (en) * 2015-10-08 2017-08-08 The Boeing Company Scrambled counter mode for differential power analysis resistant encryption
WO2017205770A1 (en) * 2016-05-27 2017-11-30 Afero, Inc. System and method for establishing secure communication channels with internet things (iot) devices
JP6925907B2 (en) 2017-08-09 2021-08-25 オムロンヘルスケア株式会社 Data transmitters, data receivers, methods and programs
US10902144B2 (en) * 2017-08-25 2021-01-26 Electronics And Telecommunications Research Institute Method and apparatus for securing data
CN110582082B (en) * 2018-06-08 2022-06-10 阿里巴巴集团控股有限公司 Method and device for accessing network to be configured to network hotspot equipment
FR3093363B1 (en) * 2019-02-28 2021-12-03 Psa Automobiles Sa Method and device for symmetric cryptography for a vehicle computer
US10681547B1 (en) * 2019-05-22 2020-06-09 Frank Yang Access verification network device and method
US11588798B1 (en) * 2020-03-12 2023-02-21 Government Of The United States, As Represented By The National Security Agency Protocol free encrypting device
US11451526B2 (en) * 2020-04-10 2022-09-20 Crestron Electronics Inc. Encrypted 1-bit audio distribution system

Family Cites Families (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH08335040A (en) * 1995-06-02 1996-12-17 Fujitsu Ltd Enciphering processing system
JPH10301492A (en) 1997-04-23 1998-11-13 Sony Corp Enciphering device and method therefor, decoding device and method therefor, and information processing device and method therefor
US6052466A (en) * 1997-08-28 2000-04-18 Telefonaktiebolaget L M Ericsson (Publ) Encryption of data packets using a sequence of private keys generated from a public key exchange
WO2001086860A1 (en) * 2000-05-09 2001-11-15 Verizon Laboratories Inc. Stream-cipher method and apparatus
US20020025045A1 (en) * 2000-07-26 2002-02-28 Raike William Michael Encryption processing for streaming media
AU2001284870A1 (en) * 2000-08-23 2002-03-04 Motorola, Inc. Method and apparatus for generating an unique encryption key stream for each data block in a frame
US7684565B2 (en) * 2001-01-16 2010-03-23 General Instrument Corporation System for securely communicating information packets
JP4254758B2 (en) 2005-07-25 2009-04-15 ソニー株式会社 Stream encryption device, stream encryption method, stream decryption device, and stream decryption method
JP2008060817A (en) * 2006-08-30 2008-03-13 Ttt Kk Communication system, web server device, client device, communication program for performing communication, and recording medium recording the program
JP5101965B2 (en) * 2007-09-25 2012-12-19 京セラ株式会社 Receiver
JP2009188751A (en) * 2008-02-06 2009-08-20 Fujitsu Ltd Encryption and decryption method, transmission device, and reception device in radio communication system
US20100303229A1 (en) * 2009-05-27 2010-12-02 Unruh Gregory Modified counter mode encryption

Also Published As

Publication number Publication date
JP2011120051A (en) 2011-06-16
US20120201383A1 (en) 2012-08-09
WO2011067876A1 (en) 2011-06-09
US8731196B2 (en) 2014-05-20

Similar Documents

Publication Publication Date Title
JP5526747B2 (en) Decryption device, encryption device, decryption method, encryption method, and communication system
JP7008725B2 (en) Methods and systems for improved authenticated encryption in counter-based cryptosystems
US7200232B2 (en) Method and apparatus for symmetric-key decryption
CN112398651B (en) Quantum secret communication method and device, electronic equipment and storage medium
US8121284B2 (en) Information processing system, information processing method, and information processing program
JP2007522764A (en) Method and apparatus for cryptographically processing data
JP2011120051A5 (en)
CN102625995A (en) Galois/counter mode encryption in a wireless network
JP2005525047A (en) Secure wireless local area network or wireless metropolitan area network and related methods
JP2007140566A (en) Efficient packet encryption method
WO2007059558A1 (en) Wireless protocol for privacy and authentication
US7039190B1 (en) Wireless LAN WEP initialization vector partitioning scheme
JPWO2004086672A1 (en) Apparatus, method, program and recording medium for encryption and decryption
JP2010028747A (en) Transmission device and reception device for ciphering process
US20080165953A1 (en) Processing method for message integrity with tolerance for non-sequential arrival of message data
US8793505B2 (en) Encryption processing apparatus
Caneill et al. Attacks against the WiFi protocols WEP and WPA
JP4664692B2 (en) ENCRYPTION METHOD, DECRYPTION METHOD, ENCRYPTION DEVICE, DECRYPTION DEVICE, ENCRYPTION DEVICE, AND PROGRAM
WO2003049363A1 (en) System and method for symmetrical cryptography
Došek et al. Secure high level communication protocol for CAN bus
KR20200028782A (en) Method and apparatus for encrypting data based on patterned cipher block for real-time data communication
JP5423308B2 (en) COMMUNICATION TERMINAL DEVICE, COMMUNICATION PROCESSING METHOD, AND PROGRAM
CN101237461A (en) Stream encryption and decryption method and device
KR100864092B1 (en) Packet encryption method using block chaining mode of block cipher
Ahmad et al. Attack Robustness and Security Enhancement with Improved Wired Equivalent Protocol

Legal Events

Date Code Title Description
A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20121120

A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20121120

RD01 Notification of change of attorney

Free format text: JAPANESE INTERMEDIATE CODE: A7421

Effective date: 20121217

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20131217

RD01 Notification of change of attorney

Free format text: JAPANESE INTERMEDIATE CODE: A7421

Effective date: 20140107

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20140129

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: 20140318

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20140331

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250