WO2011114373A1 - 通信装置、プログラムおよび方法 - Google Patents

通信装置、プログラムおよび方法 Download PDF

Info

Publication number
WO2011114373A1
WO2011114373A1 PCT/JP2010/001912 JP2010001912W WO2011114373A1 WO 2011114373 A1 WO2011114373 A1 WO 2011114373A1 JP 2010001912 W JP2010001912 W JP 2010001912W WO 2011114373 A1 WO2011114373 A1 WO 2011114373A1
Authority
WO
WIPO (PCT)
Prior art keywords
key
data
unit
encryption
communication device
Prior art date
Application number
PCT/JP2010/001912
Other languages
English (en)
French (fr)
Inventor
山田健二
岩尾忠重
高岡秀文
古賀俊介
伊豆哲也
武仲正彦
Original Assignee
富士通株式会社
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 富士通株式会社 filed Critical 富士通株式会社
Priority to JP2012505306A priority Critical patent/JP5454673B2/ja
Priority to PCT/JP2010/001912 priority patent/WO2011114373A1/ja
Priority to CN201080065354.4A priority patent/CN103109493B/zh
Publication of WO2011114373A1 publication Critical patent/WO2011114373A1/ja
Priority to US13/613,633 priority patent/US20130070925A1/en

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/08Key distribution or management, e.g. generation, sharing or updating, of cryptographic keys or passwords
    • 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
    • H04L63/068Network architectures or network communication protocols for network security for supporting key management in a packet data network using time-dependent keys, e.g. periodically changing keys
    • 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/08Key distribution or management, e.g. generation, sharing or updating, of cryptographic keys or passwords
    • H04L9/0891Revocation or update of secret information, e.g. encryption key update or rekeying
    • 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
    • H04L63/0435Network 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 wherein the sending and receiving network entities apply symmetric encryption, i.e. same key used for encryption and decryption
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/12Applying verification of the received information
    • H04L63/126Applying verification of the received information the source of the received data

Definitions

  • the present invention relates to encrypted communication.
  • One topic regarding encrypted communication by symmetric cryptography is key establishment between a sender and a receiver.
  • the access key generation unit obtains a first access key, which is an encryption key unique to the first node device, for a first time. Change every time.
  • the common key generation unit changes the common key common to the plurality of node devices every second time.
  • the first node device encrypts and transmits the generated first access key with the generated common key, and transmits the second access of the second node device transmitted from the second node device.
  • An access key notification frame including data obtained by encrypting a key with a common key is received.
  • the decrypting unit obtains the second access key by decrypting the received access key notification frame using the generated common key.
  • the plaintext frame with the signature data obtained by encrypting the data including the hash value calculated from the plaintext frame with the common key is encrypted with the second access key.
  • An encrypted frame is transmitted.
  • IPsec Internet Protocol
  • IPsec gateway an IPsec gateway to which a single or a plurality of terminals are connected.
  • VLAN Virtual Local Network
  • the monitoring control server includes means for managing and distributing VLAN-compatible encryption keys distributed to the IPsec gateway.
  • the IPsec gateway includes a new key memory that holds the currently distributed encryption key from the monitoring control server as a new key, and an old key memory that holds the previously distributed encryption key as an old key.
  • the IPsec gateway further includes means for switching to encryption communication using the old key held in the old key memory due to unsuccessful encryption communication using the new key.
  • LAN Local Area Network
  • the transmitting device encrypts the data using the encryption key before the update, and the ciphertext data And the generated ciphertext data may be transmitted.
  • the receiving device may update the encryption key slightly before receiving the ciphertext data. Then, the receiving apparatus cannot correctly decrypt the received ciphertext data with the updated encryption key currently recognized as the encryption key used for decryption.
  • the receiving device performs some processing to obtain correct plaintext data.
  • the receiving apparatus may hold not only the latest encryption key but also an old encryption key, and when decryption using the latest encryption key fails, the receiving apparatus may decrypt the ciphertext data again using the old encryption key. Then, the receiving device can obtain correct plaintext data even when it receives ciphertext data encrypted with the old encryption key before being updated.
  • the receiving device may operate as follows, for example. That is, the receiving apparatus first performs decryption using the latest encryption key, and continues to hold the ciphertext data in preparation for re-decryption using the old encryption key even after the decryption is completed. Then, the receiving apparatus verifies the decrypted data, and when correct plaintext data is not obtained by decryption, decrypts the ciphertext data using the old encryption key.
  • the above-described receiving apparatus holds the received ciphertext data in addition to the storage area holding the data obtained as a result of the decryption using the latest encryption key. Requires storage space.
  • the storage capacity of the receiving device may be very limited. And, according to the knowledge obtained by the inventors as a result of research, for a receiving device with a small storage capacity, both the data obtained as a result of decryption with the latest encryption key and the received ciphertext data are retained. However, it may directly lead to performance degradation or errors due to insufficient memory.
  • an object of the present invention is to provide a technique for easily performing decryption using an old encryption key even in a communication apparatus having a small storage capacity in an encrypted communication system in which the encryption key is updated.
  • a communication device includes a data storage unit that stores encrypted data or decrypted data, a decryption unit that decrypts encrypted data, and an encryption unit that encrypts decrypted data.
  • the communication apparatus further reads out, from the data storage unit, first decrypted data, which is decrypted by the decryption unit based on an encryption key, from the data storage unit.
  • a determination unit that issues an instruction so as to write back the second encrypted data obtained by encrypting the decrypted data based on the encryption key to the data storage unit.
  • the above communication device has an effect of saving the storage area by writing back to the data storage unit. That is, since the second encrypted data having the same content as the first encrypted data is written back to the data storage unit, according to the communication device, the first encrypted data is separated from the first decrypted data. Need not be kept in the data storage unit. That is, the communication device has an effect of suppressing consumption of the storage area.
  • the encryption key in the communication device may be an updated encryption key
  • the first encrypted data may be data received by the communication device from another device.
  • the communication device can prepare for decryption using the old encryption key without having to keep the received data itself separately from the decrypted data obtained by decrypting the received data.
  • FIG. 1 is a timing chart showing an example of communication in the first embodiment.
  • FIG. 1 illustrates an example in which the communication device 100B transmits encrypted data to the communication device 100A.
  • Both the communication devices 100A and 100B recognize a current cryptographic key used for decryption by the communication device 100A according to some key establishment method. Since symmetric key encryption is used, the decryption key for the communication device 100A and the encryption key for the communication device 100B are the same encryption key.
  • the communication devices 100A and 100B may generate encryption keys according to the same algorithm.
  • the communication device 100A may generate an encryption key and deliver the generated encryption key to the communication device 100B.
  • the communication device 100A may encrypt the generated encryption key using another encryption key for key distribution and deliver it to the communication device 100B.
  • the encryption key for key distribution used by the communication device 100A to encrypt the encryption key to be delivered may be a symmetric key encryption key or a public key of the communication device 100B in public key encryption.
  • the first embodiment can be applied to various encrypted communication systems regardless of the specific method of key establishment between the communication devices 100A and 100B.
  • the encryption key is updated at appropriate intervals between the communication devices 100A and 100B.
  • the renewed encryption key is distinguished by generation such as “first generation, second generation,...”,
  • the a-th generation encryption key used for decryption by the communication device 100A is “K”.
  • the communication device 100B on the transmission side stores the current encryption key used for decryption by the communication device 100A in association with information for identifying the communication device 100A as the transmission destination.
  • the address Adr A of the communication device 100A is used as information for identifying the communication device 100A.
  • identification information other than the address Adr A such as an identification number can also be used.
  • the encrypted communication of the first embodiment can be realized on various layers of protocols.
  • the Protocol Data Unit (PDU) in the first embodiment is not limited to a PDU of a specific protocol in a specific layer. Therefore, the address Adr A of the communication device 100A may be an address corresponding to the protocol layer.
  • MAC Media Access Control
  • IP Internet Protocol
  • the encrypted communication in the first embodiment may be any of wireless communication, wired communication, or a combination thereof.
  • the number of hops between the communication devices 100A and 100B may be 1 or 2 or more.
  • the communication device 100B for example, in the time TB101 the latest encryption key K A communication devices 100A, recognizes a. Then, the communication device 100B replaces the previous generation encryption key KA , a-1 stored in association with the address Adr A of the communication device 100A with the new encryption key KA , a .
  • the communication device 100A also generates the latest encryption key K A, a at the time TA101, and uses the encryption key (hereinafter referred to as “current key”) that the communication device 100A itself uses for the current decryption of the previous generation.
  • the encryption key KA , a-1 is updated to a new encryption key KA , a .
  • the communication device 100A according to the first embodiment also stores an encryption key of the previous generation of the current key (hereinafter referred to as “old key”). Therefore, at time TA101, communication apparatus 100A also performs processing for updating the old key from KA , a-2 to KA , a-1 .
  • the time TB101 and TA101 are almost the same, the time TB101 may be earlier than the time TA101 and vice versa.
  • the encryption key KA , a is established between the communication devices 100A and 100B at the later time of the time TB101 and the time TA101.
  • the communication device 100B creates plaintext data P101 to be transmitted to the communication device 100A, for example, at time TB102. Then, the communication device 100B encrypts the plaintext data P101 using the encryption key K A, a stored in association with the address Adr A of the communication device 100A that is the transmission destination at time TB103, and the ciphertext data Obtain C101.
  • a PDU includes a header and a payload.
  • the plaintext data P101 and the ciphertext data C101 are data corresponding to the payload.
  • the type of the plaintext data P101 is arbitrary.
  • the plaintext data P101 may be, for example, text data, image data, or binary data in a specific application software format.
  • the communication device 100B When the communication device 100B obtains the ciphertext data C101 as described above, the communication device 100B transmits the ciphertext data C101 to the communication device 100A at time TB104. To be exact, the communication device 100B transmits a PDU including the ciphertext data C101 as a payload, but since the header is unrelated to the encryption, the description regarding the header will be omitted below for the sake of simplicity. .
  • the ciphertext data C101 transmitted from the communication device 100B as described above is received by the communication device 100A at time TA102. Then, the communication device 100A is currently stored as the key at time TA102 is an encryption key K A, a generated at time TA101. Therefore, the communication device 100A at time TA103 subsequent to time TA102, decrypts the encrypted data C101 by using the encryption key K A, a.
  • the encrypted data C101 is data obtained by encrypting the encryption key K A, by a. Therefore, the encryption key K A at time TA103, by decoding by a, the same plaintext data P101 is obtained as the communication device 100B is generated at time TA102.
  • the plaintext data P101 includes two parts, and the second part indicates the characteristics of the first part.
  • a value indicating the feature of the first part is referred to as a “feature value”.
  • the feature value itself or a value obtained by performing a predetermined operation on the feature value is set.
  • the communication device 100A can check the integrity of the plaintext data P101 by using the feature value, and can confirm that the plaintext data P101 obtained by decryption is correct plaintext data.
  • the communication device 100B further generates another plaintext data P102 to be transmitted to the communication device 100A at time TB105. Then, the communication device 100B, the plaintext data P102 is encrypted using time TB103 similarly to the encryption key K A, the a at time TB106, to obtain the encrypted data C102. Then, the communication device 100B transmits the ciphertext data C102 at time TB107 in the same manner as at time TB104.
  • the communication device 100A a little before receiving the encrypted data C102 from the communication device 100B, at time TA104, the old key update K A, from a-1 K A, the a, currently a key K A, From a to KA , a + 1 may be updated. That is, the communication device 100A may receive the ciphertext data C102 at time TA105 after the encryption key is updated at time TA104.
  • the communication device 100B also, at the time TB108 close to the time TA104 the communication apparatus 100A performs the updating of the encryption key, updates the encryption key corresponding to the address Adr A communication device 100A K A, from a K A, in a + 1 . Therefore, a new encryption key K A, a + 1 is established between communication apparatuses 100A and 100B at time TB108, which is the later of time TA104 and time TB108.
  • the communication device 100B may encrypt the plaintext data P102 at the time TB106 just before the update at the time TB108. Also, the communication device 100A may update the current key and the old key at time TA104 immediately before receiving the ciphertext data C102 at time TA105.
  • the ciphertext data C102 is transmitted immediately before the key delivery. It may be.
  • a key establishment method when communication devices 100A and 100B each generate a cryptographic key according to the same algorithm with reference to time, a built-in clock of communication device 100B is used rather than a built-in clock of communication device 100A. May be late. Further, even if the internal clocks of the communication devices 100A and 100B are accurately synchronized, the current key may be updated during the time taken from transmission to reception of the ciphertext data C102.
  • the ciphertext data C102 has already been used more than the cipher key KA , a.
  • a new encryption key K A, a + 1 may be stored as the current key.
  • the communication device 100A that has received the ciphertext data C102 decrypts the ciphertext data C102 using the current key KA , a + 1 at time TA106.
  • decrypted data D102 is obtained as a result of decryption, but the decrypted data D102 is different from the original plaintext data P102.
  • the communication device 100A can determine that the decrypted data D102 is not correct plaintext data by checking the feature value.
  • the communication device 100A determines that the decrypted data D102 is not correct plaintext data, the communication device 100A recognizes that “the ciphertext data C102 may be data encrypted with the old key KA , a ”. Therefore, the communication device 100A attempts to decrypt the ciphertext data C102 using the old key KA , a .
  • the communication device 100A stores the ciphertext data C102 at the time TA106 in order to save memory, instead of creating the decrypted data D102 in a storage area different from the ciphertext data C102.
  • the decrypted data D102 is overwritten on the storage area. Therefore, the communication device 100A does not hold the ciphertext data C102 at the stage of attempting to decrypt the ciphertext data C102 with the old key KA , a .
  • the communication device 100A restores the ciphertext data C102 by re-encrypting the decrypted data D102 using the current key KA , a + 1 at time TA107. Even in the re-encryption at time TA107, the communication device 100A overwrites the ciphertext data C102 on the storage area storing the decrypted data D102 in order to save memory.
  • the communication device 100A thus after restoring the encrypted data C102 by re-encryption, at time TA108, decrypts the encrypted data C102 Kyukagi K A, by a.
  • the communication device 100A Even in the decryption at time TA108, the communication device 100A overwrites the plaintext data P102 on the storage area storing the restored ciphertext data C102 in order to save memory. Then, the communication device 100A can confirm that the plaintext data P102 is correct plaintext data by checking the feature value.
  • the communication device 100A performs the re-encryption and the decryption with the old key as described above, so that even if the plaintext data cannot be obtained by the decryption with the current key due to the timing difference, the communication device 100A The correct plaintext data can be obtained from the decryption with the old key. Therefore, retransmission of data is not necessary. That is, there is no need for the communication device 100A to request the communication device 100B to retransmit the data, and in response to the request, the communication device 100B re-encrypts the plaintext data P102 with the new encryption key K A, a + 1 , There is no need to transmit data to the communication device 100A. Further, it is not necessary for the communication device 100B to hold the plaintext data P102 for a while in preparation for retransmission.
  • the first embodiment has the following effects (a1) to (a3).
  • A1 The amount of traffic between the communication devices 100A and 100B can be small.
  • A2) The communication device 100B does not consume an extra storage area in preparation for retransmission.
  • A3) Since the time required for re-encryption and re-decryption in the communication device 100A is generally shorter than the time required for the retransmission request and data retransmission, the communication device 100A can quickly obtain the correct plaintext data P102. Can do.
  • the communication device 100A sequentially stores the received ciphertext data C102, decrypted data D102, ciphertext data C102 restored by re-encryption, and plaintext data P102 in the same storage area. And overwriting. Therefore, even if the capacity of the memory mounted on the communication device 100A is limited for some reason, the effects (a1) to (a3) can be obtained according to the first embodiment.
  • each communication device 100A may of course transmit data to the communication device 100B.
  • each communication device has both a function of receiving data and a function of transmitting data.
  • the communication device 100A further associates with the address Adr B of the communication device 100B for identifying the communication device 100B, and the latest encryption key of the communication device 100B.
  • the communication device 100B stores KB, b .
  • the communication device 100B stores the latest encryption key KB , b used for decryption by the communication device 100B itself as a current key, and the previous generation encryption key KB , b-1 before the current key.
  • a key the latest encryption key KB , b used for decryption by the communication device 100B itself as a current key, and the previous generation encryption key KB , b-1 before the current key.
  • the communication device 100B can re-encrypt and re-decrypt with the old key as necessary for the data transmitted from the communication device 100A to the communication device 100B. . Therefore, the effects (a1) to (a3) can be obtained even when both the communication devices 100A and 100B are equipped with only a small-capacity memory.
  • a specific example of a communication device whose memory capacity is limited includes a communication device in a sensor network.
  • the sensor network is a network for collecting various information from a large number of sensors arranged at appropriate locations, and each node in the sensor network is a communication device connected to the sensor or incorporating the sensor.
  • the sensor may be any type of sensor such as an image sensor, a temperature sensor, a humidity sensor, a pressure sensor, or an acceleration sensor.
  • a sensor network including a large number of communication devices on the order of thousands to hundreds of thousands may be designed.
  • individual communication devices are expensive, it is unrealistic to construct and operate a sensor network including a large number of communication devices. Therefore, it is preferable that the manufacturing cost of the communication device for the sensor network is low.
  • the built-in memory in order to reduce the manufacturing cost, it is effective to limit the capacity of the built-in memory, for example. This is because by limiting the capacity of the built-in memory, the area of the integrated circuit (IC) used in the communication device can be reduced, and more ICs can be manufactured from one semiconductor wafer. This is because the unit price of IC decreases.
  • IC integrated circuit
  • the communication devices 100A and 100B of the first embodiment are suitable as communication devices when the capacity of the built-in memory is limited for some reason, such as communication devices in a sensor network.
  • the memory saving effect according to the first embodiment and the effects (a1) to (a3) can be obtained.
  • the communication devices 100A and 100B can be used in various environments.
  • an example of the environment will be described more specifically with reference to FIG.
  • FIG. 2 is a system configuration diagram showing an example of an environment to which the first embodiment is applied.
  • the first embodiment is not limited to application to a wireless communication network, in the example of FIG. 2, the communication devices 100A and 100B perform wireless communication.
  • FIG. 2 also shows other communication devices 100C to 100L similar to the communication devices 100A and 100B.
  • FIG. 2 also shows the gateway device 120 and the server 130.
  • the ad hoc network 140 in FIG. 2 is a network that is autonomously constructed by the communication devices 100A to 100L and the gateway device 120 described above.
  • the communication devices 100A can communicate directly with the communication devices 100B to 100I. That is, the number of hops from the communication device 100A is 1 for the communication devices 100B to 100I, and the number of hops from the communication device 100A to the communication devices 100J to 100L is 2 or more.
  • the ad hoc network 140 may be used as a sensor network. That is, each of the communication devices 100A to 100L may be connected to a sensor or may incorporate a sensor. In that case, each of the communication devices 100A to 100L transmits the PDU including the data sensed by the sensor to the gateway device 120 through the ad hoc network 140.
  • the communication devices 100D, 100F, and 100I can directly communicate with the gateway device 120. Therefore, the PDU transmitted by the communication device 100A may reach the gateway device 120 with two hops via the communication device 100D, for example. PDUs transmitted by the other communication devices 100B to 100L also reach the gateway device 120 via an appropriate route in the ad hoc network 140.
  • the gateway device 120 Since the gateway device 120 is connected to the server 130, the PDUs transmitted by the communication devices 100A to 100L are further transferred from the gateway device 120 to the server 130.
  • the gateway device 120 may be directly connected to the server 130 or indirectly connected via a network.
  • the connection between the gateway device 120 and the server 130 is wired, wireless, or a combination thereof.
  • the server 130 can collect and analyze data sensed by the sensors from the communication devices 100A to 100L in the ad hoc network 140. For example, when each sensor is a temperature sensor, the server 130 may perform a process for examining a temperature distribution or a temperature change, or may perform a temperature prediction process.
  • the communication in the ad hoc network 140 is encrypted, and the encryption key is updated at an appropriate interval.
  • the encryption key is updated at an appropriate interval by some method, thereby realizing key establishment.
  • the mutual encryption keys are shared between the communication devices 100A and 100D that can communicate in one hop.
  • the mutual encryption key is shared between the communication device 100D and the gateway device 120 that can communicate in one hop. Therefore, data sensed by a sensor connected to or incorporated in the communication device 100A reaches the gateway device 120 from the communication device 100A via the communication device 100D in an encrypted state as follows.
  • the algorithm for determining the data transfer path in the ad hoc network 140 is arbitrary, but for the sake of convenience of explanation, it is assumed as follows. That is, it is assumed that communication apparatus 100A decides to transmit a PDU to communication apparatus 100D among adjacent communication apparatuses 100B to 100I when the final transmission destination in ad hoc network 140 is gateway apparatus 120.
  • the communication device 100A encrypts the data sensed by the sensor using the encryption key of the communication device 100D stored in association with the address of the communication device 100D. Then, the communication device 100A generates a PDU including the ciphertext data obtained by the encryption as a payload, and transmits the generated PDU.
  • the communication device 100D receives the PDU. Similar to the example of FIG. 1, the communication device 100D may obtain correct plaintext data from the PDU by decryption using the current key. Alternatively, in some cases, due to a difference in timing between key establishment and PDU transmission / reception, the communication device 100D may not obtain correct plaintext data in the first decryption using the current key. However, also in this case, the communication device 100D can eventually obtain correct plaintext data by performing re-encryption using the current key and re-decryption using the old key.
  • the communication device 100D encrypts the plaintext data obtained by the decryption with the encryption key of the gateway device 120. Then, the communication device 100D generates a PDU including the ciphertext data obtained by the encryption as a payload, and transmits the generated PDU to the gateway device 120.
  • the gateway device 120 receives the PDU. Similar to the example of FIG. 1, the gateway device 120 may obtain correct plaintext data from the PDU by decryption using the current key. Alternatively, depending on the case, the gateway device 120 may not be able to obtain correct plaintext data in the first decryption using the current key due to a difference in timing between key establishment and PDU transmission / reception. However, even in that case, the gateway device 120 can eventually obtain correct plaintext data by re-encryption using the current key and re-decryption using the old key.
  • the gateway device 120 appropriately encrypts the plaintext data obtained by the decryption, generates a PDU including the ciphertext data obtained by the encryption as a payload, and transmits the generated PDU to the server 130.
  • the encryption algorithm used in the ad hoc network 140 and the encryption algorithm used between the gateway device 120 and the server 130 may be the same or different.
  • the server 130 receives the PDU from the gateway device 120 and decodes the payload of the received PDU, so that plaintext data that is data sensed by a sensor connected to the communication device 100A (or built in the communication device 100A) is obtained. Can be obtained. Similarly, the server 130 can collect data sensed by the sensors from the other communication devices 100B to 100L.
  • the ad hoc network 140 may not be a sensor network.
  • FIG. 3 is a block diagram of the communication apparatus according to the first embodiment.
  • all of the communication devices 100A to 100L are the communication device 100 in FIG. 3, and the gateway device 120 also has each unit shown in FIG.
  • FIG. 3 and FIG. 14 to be described later there are portions where the arrow lines intersect, but it should be noted that the intersection of the lines does not mean connection between the lines.
  • the delivery unit 110 includes an encryption unit 111, and the encryption unit 111 includes a key recognition unit 112. Details of these units in the communication device 100 are as follows.
  • the key management unit 101 repeatedly generates an encryption key used by the communication device 100 for decryption.
  • the key storage unit 102 is an example of a first storage unit that stores a plurality of encryption keys generated by the key management unit 101.
  • the key storage unit 102 of the first embodiment stores two encryption keys, a current key and an old key, as shown in FIG.
  • the key storage unit 102 may store three or more encryption keys including encryption keys of two generations or older.
  • the key management unit 101 not only operates as a key generation unit by repeatedly generating an encryption key as described above, but also performs other management related to the encryption key, such as updating the old key accompanying the generation of the encryption key. .
  • the instruction unit 103 selects one of a plurality of encryption keys stored in the key storage unit 102 as a selected encryption key. That is, the instruction unit 103 selects an encryption key used for decryption or re-encryption as a selected encryption key.
  • the selected encryption key varies depending on the situation, but will be described in detail later.
  • the memory 104 is an example of a second storage unit.
  • FIG. 3 also shows reception data 114 and transmission data 115 stored on the memory 104.
  • the entire data of the PDU including the header and the payload is illustrated as reception data 114 and transmission data 115.
  • the payload of the received data 114 may be in the state of the received ciphertext, or may be in the state of being decrypted with an encryption key different from that when it was encrypted. sell. Furthermore, the payload of the received data 114 may be in a re-encrypted state or may be in a correct plaintext state that is decrypted with the same encryption key as when it was encrypted. Further, as will be described later, the payload of the transmission data 115 may be in a plaintext state or a ciphertext state.
  • the memory 104 is an example of a data storage unit that stores encrypted data or decrypted data.
  • the encrypted data is ciphertext data in other words.
  • the decrypted data may be plaintext data that has been correctly decrypted, or data that has been decrypted with an encryption key that is different from the encrypted data.
  • the receiving unit 105 receives the ciphertext data and stores the received ciphertext data in the memory 104. That is, the payload of the received data 114 in FIG. 3 is initially in a ciphertext state when the receiving unit 105 stores the received data 114 in the memory 104.
  • the decryption unit 106 reads out the selected encryption key instructed by the instruction unit 103 from the key storage unit 102, and decrypts the ciphertext data stored in the memory 104 as the payload of the received data 114 using the selected encryption key. .
  • the decryption unit 106 overwrites the ciphertext data on the memory 104 with decrypted data obtained by decryption. As a result, the payload of the received data 114 is decrypted with the selected encryption key.
  • the memory 104 can be efficiently used by overwriting.
  • the determining unit 107 calculates a feature value indicating the feature of the first part from the first part included in the decoded data stored on the memory 104 as the payload of the received data 114. If the calculated feature value matches the second portion included in the decrypted data, the determination unit 107 determines that the decrypted data is normal plaintext data. Conversely, if the calculated feature value does not match the second part included in the decoded data, the determination unit 107 determines that the decoded data is abnormal.
  • the re-encryption unit 108 When the determination unit 107 determines that the decrypted data is abnormal, the re-encryption unit 108 reads the selected encryption key indicated by the instruction unit 103 from the key storage unit 102 and uses the selected encryption key on the memory 104. Encrypt the decrypted data.
  • the re-encryption unit 108 is a specific example of an encryption unit that encrypts decrypted data.
  • the re-encryption unit 108 overwrites the decrypted data on the memory 104 with the ciphertext data obtained again by the encryption. As a result, the payload of the received data 114 returns to the original ciphertext. As described with reference to FIG. 1, the memory 104 can be efficiently used by overwriting.
  • the selected encryption key varies depending on the situation.
  • the instruction unit 103 selects the current key, which is the latest encryption key generated by the key management unit 101, as the selected encryption key.
  • the receiving unit 105 instructs the decoding unit 106 to decode the payload of the received data 114. Therefore, in this case, the decryption unit 106 decrypts the ciphertext data stored as the payload of the reception data 114 using the current key.
  • the instruction unit 103 reselects an encryption key different from the currently selected encryption key as the selected encryption key.
  • the encryption key that the instruction unit 103 reselects as the selected encryption key is specifically the old key.
  • the determination unit 107 determines that the decrypted data is abnormal, the timing at which the instruction unit 103 reselects the selected encryption key is more accurately determined by the re-encryption unit 108 according to the determination of the determination unit 107. This is after the decrypted data is overwritten with the ciphertext data.
  • the instruction unit 103 instructs the decryption unit 106 to decrypt the payload of the received data 114. Therefore, in this case, the decryption unit 106 decrypts the ciphertext data stored as the payload of the reception data 114 with the old key.
  • the key management unit 101 of the communication device 100A generates encryption keys K A, a ⁇ 1 , K A, a , K A, a + 1 and the like.
  • the key storage unit 102 stores the current key KA , a and the old key KA , a-1 from time TA101 to immediately before time TA104. Further, after time TA104, until the key management unit 101 next updates the encryption key, the key storage unit 102 stores the current key KA , a + 1 and the old key KA , a .
  • the instruction unit 103 selects the current key K A, a that is the latest encryption key as the selected encryption key. Therefore, the ciphertext data C101 stored as the payload of the reception data 114 on the memory 104 is decrypted by the decryption unit 106 at time TA103 and overwritten with the plaintext data P101.
  • the determination unit 107 determines that the plaintext data P101 is normal from the feature value of the plaintext data P101.
  • the plaintext processing unit 109 of the communication device 100A performs appropriate processing according to the embodiment on normal plaintext data P101.
  • the instruction unit 103 selects the current key KA , a + 1 as the selected encryption key. Therefore, the ciphertext data C102 stored as the payload of the received data 114 on the memory 104 is decrypted by the decryption unit 106 at time TA106 and overwritten with the decrypted data D102.
  • the determination unit 107 determines from the feature value of the decrypted data D102 that the decrypted data D102 is not normal plaintext data (that is, the decrypted data D102 is abnormal). Therefore, according to the determination by the determination unit 107, at time TA107, the re-encryption unit 108 encrypts the decrypted data D102 using the current key K A, a + 1 selected as the selected encryption key. As a result, the decrypted data D102 stored as the payload of the received data 114 on the memory 104 is overwritten with the ciphertext data C102.
  • the instruction unit 103 reselects the old key K A, a different from the currently selected key K A, a + 1 currently selected as the selected encryption key as the selected encryption key.
  • the decryption unit 106 is instructed to decrypt the sentence data C102.
  • the ciphertext data C102 stored as the payload of the reception data 114 on the memory 104 is decrypted by the decryption unit 106 and overwritten with the plaintext data P102.
  • the determination unit 107 determines that the plaintext data P102 is normal from the feature value of the plaintext data P102. Then, the plaintext processing unit 109 performs appropriate processing on the plaintext data P102.
  • the communication device 100 uses the data Can also be sent.
  • the detail of each part regarding transmission is demonstrated concretely, referring the example of the communication apparatus 100B of FIG.
  • the plaintext processing unit 109 not only processes the received data 114 whose payload has been decrypted into correct plaintext data as described above, but also transmits plaintext transmission data 115 as data to be transmitted to another communication device 100 in the memory 104. May be generated.
  • the plaintext processing unit 109 of the communication device 100B of FIG. 1 generates plaintext data P101 and a header at time TB102, stores the plaintext data P101 and the PDU including the header in the memory 104 as transmission data 115, and encrypts the PDU.
  • the encryption unit 111 is instructed to be
  • the encryption unit 111 encrypts the plaintext data P101 stored as the payload of the transmission data 115 on the memory 104. Specifically, since the key recognition unit 112 in the encryption unit 111 can recognize the encryption key KA , a used for encryption, the encryption unit 111 recognizes the encryption key recognized by the key recognition unit 112. K a, encrypts the plaintext data P101 using a.
  • the plaintext processing unit 109 explicitly notifies the encryption unit 111 of the address Adr A of the communication device 100A that is the destination of the plaintext data P101, so that the encryption unit 111 recognizes the destination address Adr A.
  • the encryption unit 111 may read the address Adr A of the destination communication device 100A from the header on the memory 104.
  • the key recognition unit 112 in the encryption unit 111 uses the encryption key used to encrypt the payload of the transmission data 115 to be transmitted to the address Adr A from the address Adr A recognized by the encryption unit 111 as the destination address. Can be recognized.
  • the key recognition unit 112, at time TB103, recognized as "encryption key used to encrypt the payload of the transmission data 115 to be sent to the address Adr A destined is an encryption key K A, a" To do. Therefore, the encryption unit 111, the plaintext data P101 stored as the payload of the transmission data 115 is encrypted using the encryption key K A, a.
  • the encryption unit 111 similarly to the decryption by the decryption unit 106 and the re-encryption by the re-encryption unit 108, the encryption unit 111 also overwrites the same storage area on the memory 104. That is, the encryption unit 111 encrypts the plaintext data P101 stored on the memory 104 as the payload of the transmission data 115, and overwrites the plaintext data P101 with the ciphertext data C101 obtained by the encryption. By such overwriting, the memory 104 can be used efficiently even during transmission.
  • the encryption unit 111 instructs the transmission unit 113 to transmit the transmission data 115.
  • the transmission unit 113 reads transmission data 115 (that is, PDU data including the ciphertext data C101) from the memory 104 in accordance with an instruction from the encryption unit 111. Then, the transmission unit 113 transmits the PDU to the communication device 100A.
  • the transmission data 115 stored on the memory 104 by the encryption unit 111 and the transmission unit 113 in the distribution unit 110 operating as described above is transmitted to the other communication device 100 of the transmission destination with the payload encrypted. And delivered.
  • FIG. 4 is a diagram illustrating an example of a hardware configuration of the communication apparatus according to the first embodiment.
  • the communication device 100 includes a MicroProcessing Unit (MPU) 201.
  • the communication device 100 includes at least one of the wired physical layer processing unit 202 and the wireless processing unit 203.
  • the communication apparatus 100 may further include a timer IC 204 and a tamper resistant peripheral interface controller microcomputer (PIC microcomputer) 205.
  • PIC microcomputer peripheral interface controller microcomputer
  • the communication apparatus 100 includes a dynamic random access memory (DRAM) 206 and a flash memory 207.
  • DRAM dynamic random access memory
  • connection interface between the MPU 201 and the wired processing unit 202 is, for example, Media Independent Interface (MII) or Management Data Input / Output (MDIO) (hereinafter referred to as “MII / MDIO208”). Both MII and MDIO are interfaces between the physical layer and the MAC sublayer.
  • MII Media Independent Interface
  • MDIO Management Data Input / Output
  • the timer IC 204 and the tamper resistant PIC microcomputer 205 are connected to the MPU 201 by an inter-integrated circuit (I 2 C) bus or a parallel input / output (PIO) bus (hereinafter referred to as “I 2 C / PIO bus 209”). It is connected.
  • the wireless processing unit 203, the DRAM 206, and the flash memory 207 are connected to the MPU 201 through a peripheral component interconnect (PCI) bus 210.
  • PCI peripheral component interconnect
  • the MPU 201 performs various processes by loading various programs such as firmware stored in the flash memory 207, which is one type of nonvolatile storage device, onto the DRAM 206 and executing them.
  • programs executed by the MPU 201 are, for example, a driver for the tamper-resistant PIC microcomputer 205, a program for processing shown in FIG. 7 described later, a program for processing shown in FIG. 10 or FIG.
  • the wired processing unit 202 is hardware including a physical port for connecting a cable and a circuit for processing a physical layer in the wired connection.
  • the wireless processing unit 203 is hardware that performs processing of a physical layer and a MAC sublayer in wireless connection, and includes, for example, an antenna, an analog / digital converter, a digital / analog converter, a modulator, and a demodulator. .
  • the timer IC 204 is a circuit that performs a count-up operation until a set time elapses, and outputs an interrupt signal when the set time elapses.
  • the tamper resistant PIC microcomputer 205 is a microcomputer in which a predetermined algorithm is incorporated. The predetermined algorithm cannot be analyzed from the outside because the tamper resistant PIC microcomputer 205 has tamper resistance.
  • the DRAM 206 stores various data
  • the flash memory 207 stores a firmware program and the like as described above.
  • the flash memory 207 may further store information unique to the communication device 100 itself, such as an identification (ID) and a MAC address of the communication device 100 itself.
  • the communication device 100 may include another nonvolatile storage device such as a read-only memory (ROM) or a hard disk device instead of or together with the flash memory 207.
  • ROM read-only memory
  • the program may be installed in advance in the flash memory 207 or other nonvolatile storage device.
  • the program may be downloaded from a network such as the ad hoc network 140 and stored in the flash memory 207 or other nonvolatile storage device.
  • the communication device 100 may further include a computer-readable storage medium driving device.
  • the program may be copied from the storage medium to the flash memory 207 or other non-volatile storage device.
  • a storage medium a semiconductor memory card, an optical disc such as a Compact Disc (CD) or a Digital Versatile Disk (DVD), a magneto-optical disc, a magnetic disc, or the like can be used.
  • the key management unit 101 in FIG. 3 generates a cryptographic key used by the communication device 100 for decryption, and includes a tamper-resistant PIC microcomputer 205 in which an algorithm for updating the storage content of the key storage unit 102 is incorporated, May be realized by a timer IC 204 in which an interval for updating is set.
  • the key management unit 101 generates an encryption key used for decryption by the communication device 100 itself, and sets an MPU 201 that executes a program for updating the storage content of the key storage unit 102 and an interval for updating the encryption key.
  • the timer IC 204 may be realized.
  • the MPU 201 may recognize the time by the internal clock instead of the signal from the timer IC 204 and the timing for updating the encryption key.
  • the encryption key used for decryption by the communication device 100 itself may be a unique encryption key for each communication device 100 depending on the content of data transmitted by the communication device 100 and the application field. In some cases, the encryption key is shared by a plurality of communication devices 100. The first embodiment can be applied to either case.
  • the key storage unit 102 may be realized by a RAM in the tamper resistant PIC microcomputer 205 or may be realized by a DRAM 206.
  • the communication device 100 may further include another tamper-resistant memory (not shown), and the key storage unit 102 may be realized by the tamper-resistant memory.
  • the instruction unit 103, the decryption unit 106, the determination unit 107, the re-encryption unit 108, and the plaintext processing unit 109 are realized by the MPU 201 that executes a program.
  • a dedicated hardware circuit for realizing each unit may be used instead of the MPU 201.
  • the decryption unit 106 may be realized by a dedicated decryption circuit
  • the re-encryption unit 108 may be realized by a dedicated encryption circuit.
  • the memory 104 is realized by the DRAM 206.
  • the reception unit 105 and the transmission unit 113 are realized by at least one of the wired processing unit 202 or the wireless processing unit 203 and the MPU 201 that executes a program.
  • the encryption unit 111 includes, for example, an MPU 201 that executes a program for encrypting the payload of the transmission data 115 or a dedicated encryption circuit.
  • the key recognition unit 112 in the encryption unit 111 may be realized by the following hardware.
  • the key recognizing unit 112 has an interval for updating an MPU 201 that executes a program for generating and managing an encryption key used by another communication device 100 for decryption, and an encryption key used by another communication device 100 for decryption.
  • a set timer IC 204 may be included.
  • the hardware that generates and manages the encryption key used for the decryption by the other communication device 100 may be the tamper resistant PIC microcomputer 205 instead of the MPU 201.
  • the key recognition unit 112 may include a wired processing unit 202 or a wireless processing unit 203 that receives a notification of an encryption key from another communication device 100. In that case, the key recognizing unit 112 recognizes an encryption key used for decryption by the other communication device 100 from the received notification, and updates a storage content regarding the encryption key used by the other communication device 100 for decryption.
  • the MPU 201 to be executed is included.
  • an encryption key used for decryption by another communication apparatus 100 may be an encryption key unique to the other communication apparatus 100 or may be a common encryption key among a plurality of communication apparatuses 100.
  • the first embodiment can be applied to either case.
  • the key recognition unit 112 includes a DRAM 206 or a RAM in the tamper resistant PIC microcomputer 205 as hardware for storing an encryption key used for decryption by another communication apparatus 100.
  • the communication device 100 may further include another tamper-resistant memory (not shown), and the tamper-resistant memory may be used as hardware that stores an encryption key used by the other communication device 100 for decryption.
  • the communication apparatus 100 can be realized by appropriate hardware according to the embodiment. Subsequently, data used by the communication device 100 will be described with reference to FIGS. 5 to 6, and then processing performed by the communication device 100 will be described with reference to FIGS.
  • FIG. 5 is a diagram illustrating an example of data stored in the communication device according to the first embodiment. Specifically, FIG. 5 illustrates data stored in the key storage unit 102 and the key recognition unit 112 of the communication device 100A in FIG.
  • the key storage unit 102 illustrated in FIG. 5 stores the latest a-th generation encryption key K A, a generated by the key management unit 101 as a current key, and the (a-1) th (a-1) previously generated by the key management unit 101 ) Store the generation encryption key KA , a-1 as the old key. That is, FIG. 5 shows the state of the key storage unit 102 in the period from time TA101 in FIG. 1 to immediately before time TA104. As described above, the key management unit 101 repeatedly generates an encryption key and updates the stored content of the key storage unit 102.
  • the key recognition unit 112 shown in FIG. 5 stores the encryption key of the other communication device 100 with which the key is established with the communication device 100A in association with the address.
  • the example of FIG. 5 is an example in which the key recognition unit 112 of the communication device 100A recognizes the encryption key used for the decryption by the communication devices 100B, 100C, 100D, and the like of FIG.
  • the key recognition unit 112 of the communication device 100A stores the latest encryption key KB , b of the communication device 100B in association with the address Adr B of the communication device 100B.
  • the key recognition unit 112 stores the latest encryption key K C, c of the communication device 100C in association with the address Adr C of the communication device 100C, and associates it with the address Adr D of the communication device 100D.
  • the latest encryption key K D, d is stored.
  • the key recognition unit 112 of the communication device 100A may store a pair of an address and an encryption key for another communication device 100 as well.
  • a method for the key recognition unit 112 of the communication device 100A to recognize the latest encryption key such as the other communication devices 100B, 100C, and 100D is arbitrary.
  • the communication device 100B may notify the communication device 100A of the new encryption key KB , b + 1 .
  • the key recognition unit 112 of the communication device 100A recognizes the update of the encryption key of the communication device 100B based on the notification from the communication device 100B, and sets the encryption key corresponding to the address Adr B to the current b-th generation encryption key K.
  • the new (b + 1) generation encryption key KB , B + 1 is updated from B, b .
  • the key recognition unit 112 of the communication device 100A may recognize the update timing of the encryption key KB , b of the communication device 100B, for example, with the passage of time without communicating with the communication device 100B. In that case, when the key recognition unit 112 of the communication device 100A recognizes the update timing of the encryption key KB , b of the communication device 100B, the key recognition unit 112 generates a new encryption key KB , b + 1, and the encryption corresponding to the address Adr B. The key is updated from the current encryption key KB , b to a new encryption key KB , b + 1 .
  • the key recognition unit 112 stores the encryption key of the other communication device 100 in association with the address of the other communication device 100 of the transmission destination, and updates the encryption key at an appropriate timing. If each communication device 100 uses a different encryption key for decryption, the key recognition unit 112 stores the encryption key in association with an address for identifying each communication device 100, as shown in FIG. However, in some embodiments, a plurality of communication devices 100 may use a common encryption key for decryption. For example, an embodiment in which all communication devices 100 in the ad hoc network 140 use a common encryption key is possible. In this case, the key recognition unit 112 simply recognizes the current key stored in the key storage unit 102 as an encryption key for encrypting the transmission data 115, and stores the encryption key for each address as shown in FIG. do not have to.
  • FIG. 6 is a diagram for explaining the format of data transmitted and received in the first embodiment.
  • FIG. 6 will be described with a specific example of the case where the communication device 100B transmits data to the communication device 100A, as in the example of FIG.
  • the plaintext processing unit 109 of the communication device 100B generates a plaintext body 301, generates a header 302 corresponding to the communication protocol, and calculates a feature value 303 from the body 301.
  • the plaintext processing unit 109 stores the plaintext PDU 304 including the header 302, the body 301, and the feature value 303 in the memory 104.
  • the payload of the plaintext PDU 304 is a body 301 and a feature value 303 part.
  • the feature value 303 may be a value indicating the feature of the body 301. Further, in FIG. 6, the feature value 303 data is added to the end of the body 301 for the sake of simplification. However, the feature value 303 data is inserted in a plurality of locations in the body 301. Also good.
  • the plaintext processing unit 109 may calculate the feature value 303 from all or part of the body 301 by using a hash function. That is, the feature value 303 may be a hash value.
  • a hash function for calculating the feature value 303 for example, an arbitrary hash function used for generating a message digest or a message integrity code (MIC) can be used.
  • the feature value 303 may be a value obtained by encrypting a hash value with a fixed encryption key.
  • the plaintext processing unit 109 may calculate an error detection code for all or part of the body 301 as the feature value 303.
  • error detection codes such as parity, checksum, and Cyclic Redundancy Check (CRC) can be used as the feature value 303.
  • the error detection code includes an error correction code.
  • an error correction code such as a Hamming code or a Reed-Solomon code can be used.
  • the body 301 corresponds to an information bit
  • the feature value 303 corresponds to a code bit calculated from the information bit.
  • the plaintext processing unit 109 When the plaintext processing unit 109 stores the plaintext PDU 304 including the feature value 303 in the memory 104, the plaintext processing unit 109 instructs the encryption unit 111 to encrypt the payload with respect to the plaintext PDU 304 corresponding to the transmission data 115 in FIG. As a result, the plaintext body 301 is replaced with the encrypted body 305, and the plaintext feature value 303 is replaced with the encrypted feature value 306. That is, the ciphertext PDU 307 including the header 302, the encrypted body 305, and the encrypted feature value 306 is stored as transmission data 115 on the memory 104.
  • the transmission unit 113 of the communication device 100B transmits the ciphertext PDU 307 to the communication device 100A.
  • the ciphertext data C101 in FIG. 1 is an example of a payload of the ciphertext PDU 307, and includes an encrypted body 305 and an encrypted feature value 306.
  • the ciphertext PDU 307 transmitted from the communication device 100B is received by the receiving unit 105 of the communication device 100A and stored in the memory 104. Then, the decryption unit 106 decrypts the payload of the ciphertext PDU 307 (that is, the encrypted body 305 and the encrypted feature value 306) using the current key.
  • the memory 104 stores the decoded PDU 310 including the header 302, the decoded body 308, and the decoded feature value 309. Therefore, the determination unit 107 reads the decoded body 308 from the memory 104 and calculates a feature value 311 from the decoded body 308. Note that the algorithm by which the determination unit 107 calculates the feature value 311 from the decrypted body 308 is the same as the algorithm by which the plaintext processing unit 109 calculates the feature value 303 from the body 301.
  • the determination unit 107 compares the calculated feature value 311 with the decoded feature value 309. If the calculated feature value 311 matches the decrypted feature value 309, the determination unit 107 determines that “the payload of the decrypted PDU 310 is normal plaintext data”.
  • the determination unit 107 determines that “the payload of the decoded PDU 310 is abnormal”. In other words, the determination unit 107 estimates that “the ciphertext PDU 307 was used to encrypt the old key, not the current key”.
  • the determination unit 107 instructs the re-encryption unit 108 to encrypt the payload of the decryption PDU 310. Then, the re-encryption unit 108 encrypts the payload of the decryption PDU 310 with the current key, and restores the ciphertext PDU 307 on the memory 104. The re-encryption unit 108 notifies the instruction unit 103 of the end of encryption when the encryption process is completed.
  • the instruction unit 103 switches the selected encryption key from the current key to the old key triggered by the notification from the re-encryption unit 108 and instructs the decryption unit 106 to decrypt the payload of the ciphertext PDU 307.
  • the determination by the determination unit 107 is performed again in the same manner as described above. If normal plaintext data is obtained, the plaintext processing unit 109 processes the normal plaintext data.
  • FIG. 7 is a flowchart of a reception process that is performed when the communication apparatus according to the first embodiment receives data.
  • receiving unit PDU When receiving unit PDU is received, receiving unit 105 stores the received PDU data as received data 114 in memory 104. Therefore, received data 114 is stored in memory 104 when the reception process in FIG. Has been.
  • a PDU addressed to another communication apparatus 100 may be physically received.
  • the reception unit 105 receives the received PDU before starting the reception process of FIG. It is determined from the header whether the destination is the communication device 100 itself.
  • the receiving unit 105 discards the received data 114 when the destination is not the communication device 100 itself, and starts the reception process of FIG. 7 when the destination is the communication device 100 itself.
  • step S101 the reception unit 105 determines from the header whether or not the PDU stored as the reception data 114 is a type of PDU that is encrypted with an unfixed encryption key.
  • the receiving unit 105 instructs the decrypting unit 106 to decrypt the payload of the received data 114, and the process proceeds to step S102. To do. If the received PDU is another type of PDU, the process proceeds to step S113.
  • the first embodiment is an example in which there is a field indicating the type of PDU in the header.
  • step S101 and step S113 described later can be omitted.
  • step S102 the decoding unit 106 decodes the payload of the reception data 114 in accordance with the instruction from the reception unit 105. Specifically, the decryption unit 106 obtains information indicating which encryption key is the selected encryption key from the instruction unit 103, reads the selected encryption key from the key storage unit 102, and receives the received data 114 using the selected encryption key. Decrypt the payload.
  • the instruction unit 103 selects the current key as the selected encryption key in the initial state when the communication device 100 is powered on. 7 is performed every time a PDU is received. As will be described later with respect to steps S105 and S111, the instruction unit 103 determines that the current key that is the default selected encryption key at the time of ending the process of FIG. Is selected as the selected encryption key. Therefore, at the time of step S102, the selected encryption key is the current key.
  • step S102 the decryption unit 106 first obtains the information that “the selected encryption key is the current key” from the instruction unit 103, reads the current key from the key storage unit 102, and uses the current key to read the received data 114. Decrypt the payload. Note that the decryption unit 106 overwrites the ciphertext of the payload of the received data 114 with the decrypted data as described above at the time of decryption in step S102. By such overwriting, consumption of an extra storage area is suppressed.
  • step S ⁇ b> 103 the determination unit 107 that has received the notification from the decoding unit 106 extracts a feature value from the data decoded by the decoding unit 106. That is, the determination unit 107 reads the decoded feature value 309 of FIG.
  • step S104 the determination unit 107 calculates a feature value from the body of the data decoded by the decoding unit 106. That is, the determination unit 107 reads the decoded body 308 of FIG. 6 from the memory 104, and calculates the feature value 311 from the decoded body 308 according to a predetermined algorithm. Note that step S103 and step S104 may be performed in reverse order or in parallel.
  • step S105 the determination unit 107 determines whether or not the extracted feature value matches the calculated feature value. If the two feature values match, the determination unit 107 determines that “the payload of the reception data 114 decoded in step S102 and stored in the memory 104 is normal plaintext data”. In this case, the determination unit 107 instructs the plaintext processing unit 109 to process the received data 114 on the memory 104.
  • the determination unit 107 may further instruct the instruction unit 103 to reset the selected encryption key in preparation for reception of the next PDU. Then, the instruction unit 103 may reselect the current key that is the default selected encryption key as the selected encryption key. Of course, since the selected encryption key at the time of step S105 is the current key, such explicit resetting of the selected encryption key can be omitted. If the two feature values match, the process proceeds to step S106.
  • the determination unit 107 determines that “the payload of the reception data 114 decoded in step S102 and stored in the memory 104 is abnormal”. In this case, the determination unit 107 instructs the re-encryption unit 108 to re-encrypt the payload of the reception data 114 on the memory 104 to return the reception data 114 to the original state. That is, the determination unit 107 reads out the decrypted data decrypted by the decryption unit 106 based on the selected encryption key from the memory 104 to the re-encryption unit 108 and encrypts the decrypted data based on the selected encryption key. An instruction is issued to overwrite the memory data in the memory 104. Then, the process proceeds to step S107.
  • step S106 the plaintext processing unit 109 processes the PDU decrypted by the decryption unit 106. That is, the plaintext processing unit 109 reads data stored in the memory 104 as received data 114 after the payload is decrypted into normal plaintext, and performs appropriate processing. Then, the process of FIG. 7 ends.
  • step S106 The type of processing in step S106 is arbitrary depending on the embodiment. For example, when the communication device 100 is used as a node in the ad hoc network 140 used as a sensor network, the plaintext processing unit 109 Such processing may be performed.
  • the communication device 100A in FIG. 2 receives a PDU from the communication device 100E. Further, it is assumed that the communication device 100A recognizes the route as follows using an appropriate algorithm according to the embodiment. That is, the communication device 100A recognizes that “when receiving a PDU whose final destination in the ad hoc network 140 is the gateway device 120, it is appropriate to transfer the received PDU to the communication device 100D”. And
  • the plaintext processing unit 109 of the communication device 100A determines to use the payload of the reception data 114 including the data obtained from the sensor by the communication device 100E or another communication device 100 (not shown) as the payload of the transmission data 115. To do.
  • the plaintext processing unit 109 may generate the transmission data 115 by overwriting the storage area of the reception data 114 by overwriting the address Adr D of the transfer destination communication device 100D in the header of the reception data 114.
  • the plaintext processing unit 109 instructs the encryption unit 111 to encrypt the transmission data 115.
  • the encryption unit 111 encrypts the transmission data 115 using the encryption key K D, d recognized by the key recognition unit 112 in association with the address Adr D of the transfer destination communication device 100D, and the transmission unit 113. Transmits the transmission data 115.
  • the PDU including data obtained from the sensor by the communication device 100E or another communication device 100 is transferred from the communication device 100A to the communication device 100D.
  • processing other than the transfer processing as described above may be performed in step S106.
  • the plaintext processing unit 109 may perform data processing according to a protocol in a layer higher than the network layer.
  • the plaintext processing unit 109 may perform data processing according to a protocol in a layer higher than the transport layer.
  • step S107 the re-encryption unit 108 re-encrypts the data decrypted by the decryption unit 106 with the current key. Specifically, the re-encryption unit 108 first obtains information from the instruction unit 103 that “the selected encryption key is the current key”. Then, the re-encryption unit 108 reads the current key from the key storage unit 102 and encrypts the payload of the reception data 114 using the current key.
  • the re-encryption unit 108 overwrites the payload of the reception data 114 with the encrypted data as described above during the encryption in step S107. By such overwriting, consumption of an extra storage area is suppressed.
  • the re-encryption unit 108 notifies the instruction unit 103 of the end of encryption when the encryption is completed. Then, the instruction unit 103 reselects an old key that is an encryption key different from the currently selected encryption key, and instructs the decryption unit 106 to decrypt the payload of the received data 114.
  • step S108 the decryption unit 106 decrypts the data re-encrypted by the re-encryption unit 108 with the old key. Specifically, the decryption unit 106 first obtains information from the instruction unit 103 that “the selected encryption key is an old key”. Then, the decryption unit 106 reads the old key from the key storage unit 102, and decrypts the payload of the received data 114 using the old key.
  • the decryption unit 106 also overwrites the ciphertext of the payload of the received data 114 with the decrypted data, similarly to step S102, at the time of decryption in step S108. By such overwriting, consumption of an extra storage area is suppressed.
  • step S109 the determination unit 107 extracts a feature value from the data decoded by the decoding unit 106, as in step S103.
  • step S110 the determination unit 107 calculates a feature value from the body of the data decoded by the decoding unit 106, as in step S104. Note that steps S109 and S110 may be executed in reverse order or in parallel.
  • step S111 the determination unit 107 determines whether or not the extracted feature value matches the calculated feature value.
  • the determination unit 107 determines that “the payload of the reception data 114 decoded in step S108 and stored in the memory 104 is normal plaintext data”. In this case, the determination unit 107 instructs the plaintext processing unit 109 to process the received data 114 on the memory 104.
  • the determination unit 107 further instructs the instruction unit 103 to reset the selected encryption key in preparation for reception of the next PDU. Then, the instruction unit 103 reselects the current key as the selected encryption key. Therefore, the selected encryption key at the time when the next PDU is received and the processing of FIG. 7 is started again becomes the current key. As described above, when the instruction to the plaintext processing unit 109 and the selection encryption key are switched, the process proceeds to step S106.
  • the determination unit 107 determines that “the payload of the reception data 114 decoded in step S108 and stored in the memory 104 is abnormal”.
  • the case where the two feature values do not match in step S111 is a case where correct plaintext data cannot be obtained even if the payload of the received PDU is decrypted with the current key or the old key. Therefore, in this case, the determination unit 107 determines that “some error has occurred”.
  • the key storage unit 102 since the key storage unit 102 holds only two generations of encryption keys, the current key and the old key, there are no further generations of encryption keys to be tested. . Therefore, even when the two feature values do not match, the determination unit 107 instructs the instruction unit 103 to reset the selected encryption key in preparation for reception of the next PDU. Then, the instruction unit 103 reselects the current key as the selected encryption key. Therefore, the selected encryption key at the time when the next PDU is received and the processing of FIG. 7 is started again becomes the current key. When the error occurrence is recognized and the selected encryption key is switched as described above, the process proceeds to step S112.
  • the determination unit 107 determines that “when the decryption unit 106 is notified of the end of decryption for the first time after issuing a re-encryption command to the re-encryption unit 108, the decryption result using the old key is verified. It can be recognized. On the contrary, the determination unit 107 is “when the result of the decryption by the current key is verified unless the first decryption end notification after issuing the re-encryption instruction to the re-encryption unit 108”. Can be recognized.
  • the determination unit 107 can behave appropriately without explicitly obtaining from the instructing unit 103 information on which encryption key the selected encryption key is. That is, the determination unit 107 explicitly indicates whether to instruct the re-encryption unit 108 to re-encrypt the payload of the received data 114 or to recognize the occurrence of an error. Can be recognized without. Of course, the determination unit 107 may explicitly obtain from the instruction unit 103 information indicating which encryption key the selected encryption key is.
  • the determination unit 107 performs appropriate error processing.
  • the determination unit 107 may instruct an error processing unit (not shown) to perform error processing.
  • Specific contents of the error processing are arbitrary.
  • the error process may be a process of simply releasing the storage area of the reception data 114 or a process of requesting retransmission of the PDU from the other communication apparatus 100 of the transmission source. After execution of the error processing, the processing in FIG.
  • step S101 when the receiving unit 105 determines that “the received PDU is not a type of PDU that is encrypted with an unfixed encryption key”, in step S113, the received PDU corresponds to the type of the received PDU. Appropriate processing is performed.
  • step S113 the subject of processing in step S113, the details of the processing, and the type of PDU are arbitrary depending on the embodiment.
  • a control PDU processing unit (not shown) may perform the process of step S113.
  • the time synchronization PDU may be encrypted with an encryption key fixed in the ad hoc network 140. In that case, time synchronization processing may be performed in step S113.
  • the plaintext processing unit 109 may perform the process of step S113. In any case, appropriate processing according to the type of PDU is performed, and the processing in FIG.
  • FIG. 8 is a diagram schematically illustrating an example of data transition on the memory according to the first embodiment.
  • FIG. 9 is a diagram schematically illustrating an example of data transition on the memory in the comparative example.
  • the black background indicates ciphertext
  • the white background with a solid frame indicates correct plaintext
  • a white background with a broken-line frame indicates abnormal data obtained as a result of decryption using an encryption key different from that used for encryption.
  • the type of encryption used by the communication device 100 is symmetric key encryption. If the type of encryption used by the communication apparatus 100 is described from another viewpoint, the communication apparatus 100 may use stream encryption or block encryption.
  • the length of the data unit to be encrypted and decrypted is the same between plaintext and ciphertext and the order of data units does not change between plaintext and ciphertext, It can be used in the embodiment.
  • the data unit to be encrypted and decrypted is 1 bit or 1 byte.
  • the data unit to be encrypted and decrypted is a block.
  • the prefix “0x” indicates a hexadecimal number. Then, overwriting of the area on the memory 104 in steps S102, S107, and S108 will be described with reference to FIG. 8, taking as an example a case where a PDU including a 4-byte payload is received.
  • FIGS. 8 and 9 the progress of decryption and encryption is schematically shown by the state every time processing for 4 bits is completed.
  • the reception unit 105 stores the ciphertext data C201 of 0x06ac7963 on the memory 104 as the payload of the reception data 114 at time TA201 in FIG.
  • the decryption unit 106 proceeds with decryption in step S102 of FIG. 7, the bits encrypted in the ciphertext data C201 are decrypted with the current key in order from the top as shown in FIG. 8 as the states of time TA202 to TA209. It will be done. The encrypted bit is overwritten with the decrypted bit. Therefore, when the decryption in step S102 is completed at time TA209, the decrypted data D201 obtained by the decryption is stored in the storage area of the memory 104 that originally stores the ciphertext data C201. In the example of FIG. 8, the decoded data D201 is 0x7a6025f3.
  • the storage area itself in which the ciphertext data C201 is stored is overwritten with the decrypted data D201, the memory use efficiency is good.
  • the ciphertext data C201 can be overwritten with the decrypted data D201, similarly to the case where the stream cipher is used. That is, even when the block cipher is used, it is sufficient if there is only a temporary storage area for the block size on the memory 104, and it is necessary to allocate separate storage areas for the entire ciphertext data C201 and the entire decrypted data D201. Absent.
  • the bits of the decrypted data D201 are encrypted with the current key in order from the top as shown in FIG. 8 as the states of times TA210 to TA217. To go. Each bit in the decrypted data D201 is overwritten with the encrypted bit. Therefore, when the re-encryption in step S107 is completed at time TA217, the ciphertext data C201 restored by the re-encryption is stored in the storage area of the memory 104 where the decrypted data D201 is stored.
  • the decryption unit 106 proceeds with decryption in step S108, the bits encrypted in the ciphertext data C201 are decrypted in order from the top with the current key, as shown in the state of time TA218 to TA225 in FIG. .
  • the encrypted bit is overwritten with the decrypted bit. Therefore, when the decryption in step S108 is completed at time TA225, the plaintext data P201 obtained by the decryption is stored in the storage area of the memory 104 where the ciphertext data C201 was originally stored.
  • the plaintext data P201 is 0x365a6bf0.
  • the feature value calculated from the body part (for example, the first 3 bytes of 0x7a6025) in the decoded data D201 is compared with the feature value included in the decoded data D201 (for example, the last 1 byte of 0xf3). If it is determined from the comparison result that the decrypted data D201 is not normal plaintext data, in the comparative example of FIG. 9, the encrypted text data C201 stored in a storage area different from the decrypted data D201 is the old key. Is decrypted by
  • the result of decryption with the old key may be overwritten, for example, in a storage area in which unnecessary decryption data D201 is stored.
  • Extra storage space is consumed. That is, in the decryption with the old key performed from time TA310 to TA317, each bit of the plaintext data P201 is sequentially written in a storage area different from the storage area of the ciphertext data C201.
  • the time required for re-encryption and the consumed storage area are in a trade-off relationship.
  • the capacity of the memory 104 is very limited for some reason, such as application to a sensor network, the old key can be used while saving storage space even if a little time is used for re-encryption.
  • the first embodiment that enables the decoding of is preferable.
  • the encryption and decryption processing speed of the symmetric key encryption is generally high. Therefore, in many cases, the time required for re-encryption can be ignored. In other words, even though there is a trade-off between processing time and storage capacity, in some types of environments such as sensor networks, reducing the capacity of the storage area is stronger than reducing the time required for re-encryption. Has an impact.
  • the communication device 100 of the first embodiment is not limited to the communication device in the sensor network, but the communication device 100 is suitable as a communication device in the sensor network, for example.
  • the processing performed by the communication apparatus 100 triggered by the reception of the PDU has been described with reference to FIGS. 7 to 9.
  • the communication apparatus 100 also performs processing independent of the reception of the PDU. That is, the communication device 100 also updates the encryption key. Therefore, in the following, two processing methods relating to encryption key update will be described with reference to FIGS.
  • FIG. 10 is a flowchart of encryption key update processing performed by the communication device in the first embodiment.
  • FIG. 11 is a diagram schematically illustrating an example of data transition associated with the encryption key update process.
  • FIG. 11 is a communication device 100A is a diagram for explaining the encryption key K A key is currently in a generation, a case where a specific examples.
  • step S201 the key management unit 101 waits until it is time to update the encryption key.
  • step S202 the process proceeds to step S202.
  • the timer IC 204 may output an interrupt signal for each interval for updating the encryption key. Then, the key management unit 101 realized by the MPU 201 or the tamper resistant PIC microcomputer 205 may recognize the transition from step S201 to step S202 when the interrupt signal is detected.
  • step S ⁇ b> 202 the key management unit 101 generates a new encryption key and stores it in the temporary storage area on the memory 104.
  • the current key stored in the key storage unit 102 is the a-th generation encryption key KA , a
  • the old key is the (a-1) -th generation.
  • Encryption key KA , a-1 the key management unit 101 generates a new encryption key KA , a + 1 of the next (a + 1) generation and stores it in the temporary storage area.
  • the key management unit 101 stores the current key stored in the key storage unit 102 as an old key.
  • the key management unit 101 copies the current key K A, a in the key storage unit 102 to the old key field.
  • the key management unit 101 stores the generated new encryption key in the key storage unit 102 as the current key.
  • the key management unit 101 copies the new encryption key K A, a + 1 stored in the temporary storage area to the current key field of the key storage unit 102.
  • the key storage unit 102 stores the new encryption key K A, a + 1 as the current key, and stores the encryption key K A, a that was the current key until immediately before as the old key.
  • step S204 a process returns to step S201.
  • the communication device 100 establishes an encryption key by key distribution with another communication device 100
  • the communication device 100 uses the generated new encryption key after another step S202, S203, or S204.
  • Delivered to the communication device 100 Since the time required for key distribution is longer than the time required for updating the key storage unit 102 in the communication device 100, the communication device 100 updates the current key in the key storage unit 102 in step S204 (for example, A new encryption key may be delivered (immediately after step S202).
  • the encryption key update process of FIG. 10 may be modified as shown in FIG. 12 for the purpose of reducing the execution frequency of the error process of step S112 of FIG.
  • the modified encryption key update process will be described first with reference to FIGS. 12 and 13 and then the advantages will be described.
  • FIG. 12 is a flowchart showing a modification of the encryption key update process.
  • FIG. 13 is a diagram schematically illustrating an example of data transition associated with the encryption key update process modified as shown in FIG. As in FIG. 11, FIG. 13 is a diagram illustrating a case where the current key is the a-th generation encryption key K A, a in the communication device 100A.
  • step S301 the key management unit 101 waits until it is time to update the encryption key.
  • the process proceeds to step S302. That is, step S301 is the same as step S201.
  • step S ⁇ b> 302 the key management unit 101 generates a new encryption key and stores it in the temporary storage area on the memory 104.
  • the current key stored in the key storage unit 102 is the a-th generation encryption key KA , a
  • the old key is the (a-1) -th generation.
  • Encryption key KA , a-1 the key management unit 101 generates a new encryption key KA , a + 1 of the next (a + 1) generation and stores it in the temporary storage area.
  • the key management unit 101 copies the current key to a temporary storage area on the memory 104 (more precisely, a temporary storage area different from the new encryption key stored in step S302). .
  • the key management unit 101 copies the current key KA , a to the temporary storage area on the memory 104.
  • the key management unit 101 stores the generated new encryption key in the key storage unit 102 as a current key.
  • the key management unit 101 copies the new encryption key K A, a + 1 stored in the temporary storage area to the current key field of the key storage unit 102.
  • step S305 the key management unit 101 stores the current key copied to the temporary storage area in step S303 in the key storage unit 102 as an old key.
  • the key management unit 101 copies the encryption key K A, a stored in the temporary storage area to the old key field of the key storage unit 102.
  • the key storage unit 102 stores the new encryption key K A, a + 1 as the current key, and stores the encryption key K A, a that was the current key until immediately before as the old key.
  • step S305 a process returns to step S301.
  • the communication device 100 establishes an encryption key by key distribution with another communication device 100
  • the communication device 100 after the step S302, S303, S304 or S305, as in the case of FIG.
  • the generated new encryption key is delivered to the other communication device 100.
  • the execution order of steps S302 and S303 may be reversed, or steps S302 and S303 may be executed in parallel.
  • the encryption key update process of FIG. 12 is “when the old key read when the decryption unit 106 performs decryption again after the decryption and re-encryption with the current key KA , a before the update is the first decryption. It is devised so as not to fall as much as possible when the situation is the same as the encryption key KA , a used in the above. Specifically, in the series of steps S302 to S305 for updating the key storage unit 102, step S305 in which the old key K A, a-1 before update is updated is the last step in FIG. Then, the encryption key update process is modified.
  • the key management unit 101 refers to the key storage unit 102 from the decryption unit 106 or the re-encryption unit 108 during the execution of steps S202 to S204 or the execution of steps S302 to S305. You may block.
  • the second embodiment will be described with reference to FIGS.
  • two types of encryption keys are used.
  • the key establishment method between the communication devices 100 is arbitrary as described above, but in the second embodiment, key establishment is performed by two different methods for the two types of encryption keys.
  • the first type of encryption key is an encryption key that is established between communication devices when the communication devices are generated according to the same algorithm, and is commonly used for encryption and decryption by a plurality of communication devices.
  • the encryption key to use
  • the first type of encryption key is referred to as a “common key”.
  • the second type of encryption key is an encryption key unique to each communication device, and is hereinafter referred to as an “access key”. Establishment of an access key between communication apparatuses is performed by key distribution. In the second embodiment, the access key is used for encrypting application data, and the shared key is used for encrypting the access key.
  • an access key generated by the communication device itself is referred to as an “internally-originated access key”, and an access key delivered from another communication device is referred to as an “externally-originated access key”. ".
  • the access key generated by the first communication device is an internally derived access key for the first communication device, but the second communication device Is an externally derived access key.
  • the access key generated by the second communication device is an externally derived access key for the first communication device, but an internally derived access key for the second communication device.
  • FIG. 14 is a block diagram of the communication apparatus according to the second embodiment. Note that the communication device 400 of FIG. 14 can also be realized by various hardware shown in FIG. 4, for example.
  • the communication device 400 includes a key management unit 401.
  • the key management unit 401 includes a common key management unit 402, an internal access key management unit 403, and an external access key management unit 404.
  • the common key management unit 402 is also a specific example of the key management unit 101 of the first embodiment, and has a part of the function of the key recognition unit 112. Specifically, the common key management unit 402 operates as a key generation unit that generates a common key as one type of encryption key by performing processing for obtaining a unique value with respect to time, and as an encryption key Also recognizes the common key.
  • the internal access key management unit 403 is one specific example of the key management unit 101. That is, the internal-origin access key management unit 403 also operates as a key generation unit that generates an internal-origin access key, which is an encryption key unique to the communication device 400, as one type of encryption key.
  • the externally derived access key management unit 404 is one specific example of the key recognizing unit 112 and manages externally derived access keys in association with other communication devices 400.
  • the internal origin access key management unit 403 is also a specific example of the plaintext processing unit 109, and creates plaintext transmission data 115 including an internal origin access key.
  • the externally derived access key management unit 404 is also a specific example of the plaintext processing unit 109, and processes the plaintext received data 114 including the externally derived access key to extract the externally derived access key.
  • the common key management unit 402 and the internally derived access key management unit 403 may be realized by the MPU 201 of FIG. 4 or may be realized by the tamper resistant PIC microcomputer 205.
  • An interrupt signal may be input to the common key management unit 402 and the internally derived access key management unit 403 at every encryption key update interval from, for example, a later-described clock 425 realized by the timer IC 204 of FIG.
  • the external access key management unit 404 can be realized by the MPU 201.
  • the communication device 400 includes a key storage unit 405.
  • the key storage unit 405 includes a common key storage unit 406, an internally derived access key storage unit 407, and an externally derived access key storage unit 408.
  • the common key storage unit 406 has a function of the key storage unit 102 that stores the decryption key and a part of the function of the key recognition unit 112 (that is, a function that recognizes the encryption key) in the first embodiment. Also, the internal access key storage unit 407 has the function of the key storage unit 102 that stores the decryption key. The external access key storage unit 408 has a part of the function of the key recognition unit 112 (that is, the function of recognizing the encryption key).
  • Each unit in the key storage unit 405 may be realized by the DRAM 206 or may be realized by a RAM in the tamper resistant PIC microcomputer 205.
  • each unit in the key storage unit 405 may be realized by the tamper resistant memory.
  • the communication device 400 has an instruction unit 409.
  • the instruction unit 409 is one specific example of the instruction unit 103 of the first embodiment. That is, the instruction unit 409 recognizes which encryption key is used for decryption and re-encryption.
  • the instruction unit 409 may be realized by the MPU 201.
  • the communication device 400 includes a memory 410 and a reception unit 411 that are similar to the memory 104 and the reception unit 105 of the first embodiment, respectively.
  • the memory 410 is realized by the DRAM 206
  • the reception unit 411 is realized by the MPU 201 and at least one of the wired processing unit 202 and the wireless processing unit 203.
  • the decryption unit 412 includes a received data decryption unit 413 and an externally derived access key decryption unit 414, all corresponding to a specific example of the decryption unit 106 of the first embodiment.
  • Each unit in the decoding unit 412 may be realized by the MPU 201 that executes a program, or may be realized by a dedicated decoding circuit.
  • one decryption circuit may function as the received data decryption unit 413 in some cases and function as the externally derived access key decryption unit 414 in some cases in accordance with the input signal.
  • one program module of the same decryption algorithm may cause the MPU 201 to function as the received data decryption unit 413 in some cases, and may cause the MPU 201 to function as the external access key decryption unit 414 in some cases. .
  • the communication device 400 includes a determination unit 415.
  • the determination unit 415 includes an external access key determination unit 416 and a received data determination unit 417, both of which correspond to specific examples of the determination unit 107 of the first embodiment.
  • Each unit in the determination unit 415 is realized by the MPU 201, for example.
  • the communication device 400 has an encryption unit 418.
  • the encryption unit 418 includes an external access key re-encryption unit 419 and a received data re-encryption unit 420, both corresponding to a specific example of the re-encryption unit 108 of the first embodiment.
  • the encryption unit 418 includes a transmission data encryption unit 421 having an encryption function in the encryption unit 111 of the first embodiment and an internal access key encryption unit 422.
  • Each unit in the encryption unit 418 may be realized by the MPU 201 that executes a program, or may be realized by a dedicated encryption circuit.
  • one encryption circuit has an externally derived access key re-encrypting unit 419, a received data re-encrypting unit 420, a transmission data encrypting unit 421, and an internally derived access key encryption according to an input signal. It may function as any of the units 422. Similarly, one program module of the same encryption algorithm may cause the MPU 201 to function as one of the units in the encryption unit 418 according to an argument.
  • the communication device 400 includes a data processing unit 423 corresponding to one specific example of the plaintext processing unit 109 of the first embodiment.
  • the data processing unit 423 is also a specific example of the plaintext processing unit 109 that processes the received data 114 whose payload is in a plaintext state, and is a data generation unit that generates plaintext transmission data 115 to be transmitted to another communication device 100. This is also a specific example of the plaintext processing unit 109.
  • the data processing unit 423 may be realized by the MPU 201.
  • the communication device 400 includes a transmission unit 424 having the same function as the transmission unit 113 of the first embodiment.
  • the transmission unit 424 is realized by the MPU 201 and at least one of the wired processing unit 202 and the wireless processing unit 203.
  • the internally derived access key management unit 403, the internally derived access key encryption unit 422, and the transmitting unit 424 cooperate to notify the other communication device 400 of the internally derived access key. Operates as a key distribution unit.
  • the internally derived access key distribution unit is an example of a notification unit that notifies an encryption key to another communication device.
  • the communication device 400 also has a clock 425.
  • the clock 425 may be realized by the timer IC 204.
  • the MPU 201 may function as the clock 425 based on the clock signal.
  • FIG. 14 also shows received data 426, transmitted data 427, externally derived access key distribution data 428, and internally derived access key distribution data 429 stored in the memory 410.
  • the same storage area as that in the first embodiment is overwritten during encryption and decryption. Therefore, the payload of each data shown in the memory 410 may be in a correct plaintext state, in a ciphertext state, or in a state where it has been decrypted with an encryption key that is different from the encrypted state. Sometimes.
  • each unit of the communication device 400 in the second embodiment has the same or similar function as each unit of the communication device 100 in the first embodiment. Therefore, the detailed operation of each unit of the communication device 400 is omitted here and will be described together with a flowchart described later. 14 may be used instead of the communication devices 100A to 100L in the ad hoc network 140 of FIG. 2, or the gateway device 120 may include each unit of the communication device 400.
  • FIG. 15 is a diagram illustrating an example of data stored in the communication device according to the second embodiment.
  • FIG. 15 illustrates data stored in the common key storage unit 406, the internal origin access key storage unit 407, and the external origin access key storage unit 408 of a certain communication apparatus 400.
  • the common key storage unit 406 illustrated in FIG. 15 stores the latest ⁇ th generation common key SK ⁇ generated by the common key management unit 402 as a current common key. Further, the common key storage unit 406 stores the ( ⁇ 1) generation common key SK ⁇ 1 previously generated by the common key management unit 402 as an old common key.
  • the current common key is one specific example of the current key in the first embodiment
  • the old common key is one specific example of the old key in the first embodiment.
  • the instruction unit 409 selects either the current common key or the old common key as the “selected common key”.
  • the internal-origin access key storage unit 407 shown in FIG. 15 stores the latest a-th generation internal-origin access key AK A, a generated by the internal-origin access key management unit 403 as the current internal-origin access key. Further, the internal origin access key storage unit 407 stores the (a-1) generation internal origin access key AK A, a-1 previously generated by the internal origin access key management unit 403 as the old internal origin access key. .
  • the current internal access key is one specific example of the current key in the first embodiment
  • the old internal access key is one specific example of the old key in the first embodiment
  • the instruction unit 409 selects either the current internal access key or the old internal access key as the “selected internal access key”.
  • storage part 408 shown in FIG. 15 memorize
  • the address is an example of identification information that uniquely identifies another communication device 400.
  • the second embodiment can be applied to various communication protocols. Therefore, the layer of the address stored in the externally derived access key storage unit 408 may vary depending on the layer of the communication protocol to be applied. For example, a MAC address or an IP address can be used.
  • the external access key storage unit 408 uses the latest external access key AK B, b delivered from another communication device 400 to which the address Adr B is assigned as the address Adr. It is stored in association with B. Similarly, the external access key storage unit 408 stores the latest external access key AK C, c delivered from another communication device 400 to which the address Adr C is assigned in association with the address Adr C. Furthermore, the external access key storage unit 408 stores the latest external access key AK D, d delivered from another communication device 400 to which the address Adr D is assigned, in association with the address Adr D.
  • FIG. 16 is a flowchart of a reception process performed by the communication device according to the second embodiment when data is received. Note that, when the receiving unit 411 receives the PDU, the receiving unit 411 stores the received PDU data in the memory 410. Therefore, the received data of the PDU is stored in the memory 410 when the processing of FIG. 16 is started. .
  • a PDU addressed to another communication device 400 may be physically received.
  • the reception unit 411 receives the received PDU before starting the reception process of FIG. It is determined from the header whether the destination is the communication device 400 itself. If the destination is not the communication device 400 itself, the reception unit 411 discards the received PDU data, and starts the reception process of FIG. 16 when the destination is the communication device 400 itself.
  • the reception unit 411 refers to the memory 410 and determines the type of the received PDU.
  • the reception unit 411 can determine the type of the PDU by referring to the value of the field indicating the type.
  • the access key distribution PDU data received by the communication device 400 is specifically the externally derived access key distribution data 428 of FIG. Therefore, in this case, the receiving unit 411 instructs the externally derived access key decryption unit 414 to decrypt the payload of the externally derived access key distribution data 428, and the process proceeds to step S402.
  • the access key distribution PDU is one type of ciphertext PDU 307 in FIG.
  • the encrypted body 305 in the access key distribution PDU is data obtained by encrypting data including an access key derived from the inside for the communication apparatus 400 that transmits the ciphertext PDU 307 with a common key.
  • the reception unit 411 instructs the reception data decoding unit 413 to decode the payload of the reception data 426, and the process proceeds to step S403.
  • step S404 If the received PDU is not one of the above two types, the process proceeds to step S404.
  • a plurality of communication devices 400 may be used instead of the communication devices 100A to 100L, and the communication devices 400 use an encryption key fixed in advance in the ad hoc network 140.
  • Time synchronization control PDUs may be exchanged.
  • the communication devices 400 may exchange specific types of PDUs without encryption. As described above, when a PDU whose payload is encrypted with a previously fixed encryption key, a PDU whose payload is clear text, or the like is received, the process proceeds to step S404.
  • step S402 the communication apparatus 400 performs an externally derived access key update process shown in FIG. Then, the reception process in FIG. 16 ends.
  • step S403 the communication apparatus 400 performs the encrypted PDU reception process illustrated in FIG. Then, the reception process in FIG. 16 ends.
  • step S404 the communication apparatus 400 performs appropriate processing according to the type of the received PDU.
  • the reception process in FIG. 16 is also terminated.
  • step S404 the control PDU processing unit (not shown) may perform time-synchronization processing for correcting the clock 425 as necessary.
  • FIG. 17 is a flowchart of the external access key update process performed by the communication device in the second embodiment.
  • description of points that are similar to the reception process of FIG. 7 of the first embodiment is omitted as appropriate.
  • step S501 the externally derived access key decryption unit 414 decrypts the payload of the externally derived access key delivery data 428 in accordance with the instruction from the receiving unit 411. Specifically, the external access key decryption unit 414 first obtains from the instructing unit 409 information indicating which of the current common key and the old common key is selected as the selected common key. Then, the externally derived access key decryption unit 414 reads the selected common key from the common key storage unit 406, and decrypts the payload of the externally derived access key distribution data 428 using the selected common key.
  • the instruction unit 409 selects the current common key as the selected common key in the initial state when the communication device 400 is powered on. 17 is performed every time an access key distribution PDU is received. As will be described later with respect to steps S504, S508, and S513, the instruction unit 409 does not presently execute the process of FIG. The common key is selected as the selected common key. Therefore, at the time of step S501, the selected common key is the current common key.
  • step S501 the externally derived access key decryption unit 414 first obtains information from the instruction unit 409 that “the selected common key is the current common key”. Then, the externally derived access key decryption unit 414 reads the current common key from the common key storage unit 406 and decrypts the payload of the externally derived access key distribution data 428 using the current common key.
  • the external access key decryption unit 414 overwrites the ciphertext of the payload of the external origin access key delivery data 428 with the decrypted data, similar to the decryption unit 106 of the first embodiment, at the time of decryption in step S501. To do. By such overwriting, consumption of an extra storage area is suppressed.
  • step S502 the external access key determination unit 416 that has received the notification from the external access key decryption unit 414 extracts a feature value from the data decrypted by the external access key decryption unit 414.
  • step S503 the external origin access key determination unit 416 calculates a feature value from the body of the data decrypted by the external origin access key decryption unit 414. Note that steps S502 and S503 may be executed in reverse order or in parallel.
  • step S504 the external access key determination unit 416 determines whether the extracted feature value matches the calculated feature value. When the two feature values match, the external access key determination unit 416 determines that the payload of the external access key distribution data 428 decrypted in step S501 and stored in the memory 410 is normal plaintext data. " In this case, the externally derived access key determination unit 416 uses the externally derived access key distribution data 428 on the memory 410 to perform processing for extracting the distributed externally derived access key and registering it in the externally derived access key storage unit 408. The external access key management unit 404 is instructed to do so.
  • the external access key determination unit 416 further instructs the instruction unit 409 to reset the selected common key in preparation for the next reception of the access key distribution PDU, and the instruction unit In step 409, the current common key may be selected again as the selected common key. Note that such an explicit reset can be omitted as in step S105 of FIG. If the two feature values match, the process proceeds to step S505.
  • the external access key determination unit 416 determines that the payload of the external access key delivery data 428 decrypted in step S501 and stored in the memory 410 is abnormal. Judge. Then, the process proceeds to step S508.
  • the external origin access key management unit 404 refers to the external origin access key distribution data 428 decrypted by the external origin access key decryption unit 414, extracts the distributed external origin access key, and extracts the external origin access key. A process of registering in the storage unit 408 is performed.
  • the external access key management unit 404 in steps S505 to S507 operates as a kind of the plaintext processing unit 109 in the first embodiment.
  • the external access key management unit 404 refers to the memory 410 and extracts the transmission source address from the header of the received PDU. In other words, the external access key management unit 404 extracts the source address included in the header 302 from the external access key distribution data 428 stored in the memory 410 in the state of the decryption PDU 310 of FIG.
  • the external origin access key management unit 404 extracts the external origin access key from the data decrypted by the external origin access key decryption unit 414. That is, the external access key management unit 404 extracts the external access key included in the decrypted body 308 from the external access key distribution data 428 stored in the memory 410 in the state of the decryption PDU 310 of FIG. Note that steps S505 and S506 may be executed in reverse order or in parallel.
  • step S507 the external access key management unit 404 stores the source address extracted in step S505 and the external access key extracted in step S506 in the external access key storage unit 408 in association with each other. To do.
  • the external access key management unit 404 searches the external access key storage unit 408 using the extracted transmission source address as a search key. If an entry having an address that matches the extracted transmission source address is found as a result of the search, the external access key management unit 404 overwrites the external access key in the found entry with the external access key extracted in step S506. To do. On the other hand, if no entry having an address that matches the extracted source address is found, the external access key management unit 404 creates a new entry that associates the extracted source address with the extracted external access key. It is added to the access key storage unit 408. Then, the process of FIG. 17 ends.
  • step S508 determines in step S508 whether the current time is within the validity period of the old common key.
  • “the current time is within the validity period of the old common key” means “the time elapsed from the most recent update of the common key to the present time is a predetermined allowable time (“ ST ”)”.
  • each communication device 400 in the network updates the common key at the same predetermined interval (“SI” in FIG. 20 described later).
  • the allowable time ST used as a threshold value in step S504 is a time shorter than the common key update interval SI.
  • the specific method by which the externally derived access key determining unit 416 recognizes the expiration date of the old common key may vary depending on the embodiment. For example, the externally derived access key determining unit 416 may You may recognize the expiration date.
  • the clock 425 may output a common key update timing signal that triggers the update of the common key to the common key management unit 402 every time the common key update interval SI elapses.
  • the common key update timing signal may be an interrupt signal, for example.
  • the clock 425 may assert an old common key valid signal indicating that the old common key is valid only during the allowable time ST after outputting the common key update timing signal. That is, the clock 425 may negate the old common key valid signal for a period until the next common key update timing signal is output after the allowable time ST has elapsed. Then, the external access key determination unit 416 can recognize from the old common key valid signal output from the clock 425 whether or not the current time is within the validity period of the old common key.
  • the external access key determination unit 416 obtains the current time from the clock 425, and uses the reference time for updating the common key, the common key update interval SI, and the current time to calculate the current time from the latest common key update time. The elapsed time until may be calculated. Then, the external access key determination unit 416 compares the calculated elapsed time with a threshold allowable time ST, and if the calculated elapsed time is within the allowable time ST, “the current time is within the validity period of the old common key. May be determined.
  • the determination by comparison with the threshold value is not limited to this example, and may be a determination whether “below the threshold value or exceeds the threshold value” or a determination “whether it is less than the threshold value or more than the threshold value” depending on the embodiment.
  • a policy can be established as appropriate.
  • the external access key determination unit 416 re-encrypts the payload of the external access key delivery data 428 to return to the original state.
  • the re-encryption unit 419 is instructed. Then, the process proceeds to step S509.
  • the external access key determination unit 416 determines that “the access key distribution PDU that triggered the processing in FIG. 17 is invalid”. To do. Then, the process proceeds to step S514.
  • step S514 the selected common key remains the current common key.
  • the selected common key may be explicitly reset.
  • step S509 the externally derived access key re-encrypting unit 419 re-encrypts the data decrypted by the externally derived access key decrypting unit 414. Specifically, the external access key re-encryption unit 419 first obtains information from the instruction unit 409 that “the selected common key is the current common key”. Then, the external access key re-encryption unit 419 reads the current common key from the common key storage unit 406 and encrypts the payload of the external access key distribution data 428 using the current common key.
  • the external access key re-encryption unit 419 overwrites the payload of the external access key delivery data 428 with the encrypted data at the time of encryption, similar to the re-encryption unit 108 of the first embodiment. To do. By such overwriting, consumption of an extra storage area is suppressed.
  • the external access key re-encrypting unit 419 notifies the instruction unit 409 of the end of encryption when the encryption is completed. Then, the instruction unit 409 reselects the old common key, which is a common key different from the currently selected common key, as the selected common key, and uses the external origin access to decrypt the payload of the external origin access key delivery data 428. Commands the key decryption unit 414.
  • step S510 the external origin access key decryption unit 414 decrypts the data re-encrypted by the external origin access key re-encryption unit 419 with the old common key. Specifically, the externally derived access key decryption unit 414 first obtains information from the instruction unit 409 that “the selected common key is the old common key”. Then, the externally derived access key decryption unit 414 reads the old common key from the common key storage unit 406 and decrypts the payload of the externally derived access key distribution data 428 using the old common key.
  • the external origin access key decryption unit 414 also overwrites the ciphertext of the payload of the external origin access key delivery data 428 with the decrypted data, similarly to step S501, at the time of decryption in step S510. By such overwriting, consumption of an extra storage area is suppressed.
  • step S511 the externally derived access key determination unit 416 extracts feature values from the data decrypted by the externally derived access key decryption unit 414, as in step S502.
  • step S512 the externally derived access key determination unit 416 calculates a feature value from the body of the data decrypted by the externally derived access key decryption unit 414, similarly to step S503. Note that steps S511 and S512 may be executed in reverse order or in parallel.
  • the external access key determination unit 416 determines whether the extracted feature value matches the calculated feature value. When the two feature values match, the external-origin access key determination unit 416 determines that the payload of the external-origin access key distribution data 428 decrypted in step S510 and stored in the memory 410 is normal plaintext data. " In this case, the externally derived access key determination unit 416 performs processing for registering the distributed externally derived access key in the externally derived access key storage unit 408 using the externally derived access key distribution data 428 on the memory 410. The external origin access key management unit 404 is instructed.
  • the externally derived access key determination unit 416 further instructs the instruction unit 409 to reset the selected common key in preparation for the next reception of the access key distribution PDU. Then, the instruction unit 409 reselects the current common key as the selected common key. Therefore, the selected common key when the access key distribution PDU is received next and the processing of FIG. 17 is started again becomes the current key.
  • the process proceeds to step S505.
  • the external access key determination unit 416 determines that “the external access key distribution data 428 decrypted in step S510 and stored in the memory 410 is abnormal and invalid. It is judged.
  • the common key storage unit 406 holds only two generations of common keys, the current common key and the old common key, there are no more common keys of other generations to be tested. Does not exist. Therefore, even when the two feature values do not match, the external access key determination unit 416 instructs the instruction unit 409 to reset the selected common key in preparation for the next reception of the access key distribution PDU. Then, the instruction unit 409 reselects the current common key as the selected common key, and the process proceeds to step S514.
  • step S514 the external access key determination unit 416 discards the received PDU.
  • the externally derived access key determination unit 416 may specifically discard the received PDU by releasing the storage area of the externally derived access key distribution data 428 on the memory 410.
  • the processing in FIG. 1 the processing in FIG. 1
  • FIG. 18 is a flowchart of encrypted packet reception processing performed by the communication device in the second embodiment.
  • the description of the points similar to the reception process of FIG. 7 of the first embodiment will be omitted as appropriate.
  • step S601 the received data decoding unit 413 decodes the payload of the received data 426 in accordance with the command from the receiving unit 411. Specifically, the reception data decryption unit 413 first obtains from the instructing unit 409 information indicating which of the current internal access key and the old internal access key is selected as the selected internal access key. The reception data decryption unit 413 reads the selected internal origin access key from the internal origin access key storage unit 407, and decrypts the payload of the reception data 426 using the selected internal origin access key.
  • the instruction unit 409 selects the currently internal access key as the selected internal access key in the initial state when the communication device 400 is powered on. 18 is performed every time a PDU encrypted with an access key is received. As will be described later with reference to steps S604, S606, and S611, the instruction unit 409 ends the process of FIG.
  • the internal access key is currently selected as the selected internal access key.
  • the selected internal access key is the current internal access key.
  • step S601 the reception data decryption unit 413 first obtains information from the instruction unit 409 that “the selected internal access key is the current internal access key”.
  • the reception data decryption unit 413 reads the current internal origin access key from the internal origin access key storage unit 407, and decrypts the payload of the reception data 426 using the current internal origin access key.
  • reception data decryption unit 413 overwrites the ciphertext of the payload of the reception data 426 with the decrypted data in the same manner as the decryption unit 106 of the first embodiment at the time of decryption in step S601. By such overwriting, consumption of an extra storage area is suppressed.
  • step S ⁇ b> 602 the reception data determination unit 417 that has received the notification from the reception data decoding unit 413 extracts a feature value from the data decoded by the reception data decoding unit 413.
  • the reception data determination unit 417 calculates a feature value from the body of the data decoded by the reception data decoding unit 413. Note that steps S602 and S603 may be executed in reverse order or in parallel.
  • step S604 the received data determination unit 417 determines whether the extracted feature value matches the calculated feature value.
  • the reception data determination unit 417 determines that “the payload of the reception data 426 decoded in step S601 and stored in the memory 410 is normal plaintext data”. In this case, the reception data determination unit 417 instructs the data processing unit 423 to process the reception data 426 on the memory 410.
  • the received data determination unit 417 further instructs the instruction unit 409 to reset the selected internal access key in preparation for the next reception of the PDU encrypted with the access key. Also good. Then, the instruction unit 409 may newly select the current internal access key as the selected internal access key. Note that such an explicit reset can be omitted as in step S105 of FIG. If the two feature values match, the process moves to step S605.
  • the reception data determination unit 417 determines that “the payload of the reception data 426 decoded in step S601 and stored in the memory 410 is abnormal”. Then, the process proceeds to step S606.
  • step S605 the data processing unit 423 processes the PDU decoded by the reception data decoding unit 413. That is, the data processing unit 423 reads the PDU data stored in the memory 410 as the received data 426 after the payload is decrypted into normal plain text, and performs appropriate processing. Note that the process performed by the data processing unit 423 in step S605 is arbitrary, but may be a process as exemplified with respect to step S106 of the first embodiment. When the processing by the data processing unit 423 in step S605 ends, the processing in FIG. 18 also ends.
  • the received data determination unit 417 determines in step S606 whether the current time is within the validity period of the old internal access key.
  • the current time is within the validity period of the old internal access key means that the time elapsed from the latest update of the internal access key to the present is a predetermined allowable time (described later). It means “within“ AT ”in FIG. 20”.
  • the communication device 400 updates the internal access key at a predetermined interval (“AI” in FIG. 20 described later).
  • the access key update interval AI is shorter than the aforementioned common key update interval SI.
  • the access key update interval AI is equal to the common key update interval SI so that any generation of the common key is used more than once for notification of the access key. It is preferably less than half.
  • the allowable time AT used as the threshold value in step S606 is a time shorter than the update interval AI of the internally derived access key.
  • the specific method for the received data determination unit 417 to recognize the expiration date of the old internal access key may vary depending on the embodiment. Specifically, the received data determination unit 417 performs the old internal origin access key by a method similar to the example in which the external origin access key determination unit 416 recognizes the expiration date of the old common key, which is exemplified with respect to step S508 of FIG. Can recognize the expiration date.
  • the received data determination unit 417 sends the received data re-encryption unit 420 to re-encrypt the payload of the received data 426 and restore the original state. Command. Then, the process proceeds to step S607.
  • the received data determination unit 417 determines that “the payload of the PDU that triggered the processing in FIG. 18 is abnormal”. In this case, the reception data determination unit 417 determines that “an error has occurred”, and the process proceeds to step S612.
  • step S606 the selected internal access key remains the current internal access key.
  • the access key derived from the selection may be explicitly reset.
  • step S607 the received data re-encrypting unit 420 re-encrypts the data decrypted by the received data decrypting unit 413. Specifically, the received data re-encryption unit 420 first obtains information from the instruction unit 409 that “the selected internal access key is the current internal access key”. Then, the received data re-encryption unit 420 reads the current internal origin access key from the internal origin access key storage unit 407, and encrypts the payload of the reception data 426 using the current internal origin access key.
  • reception data re-encryption unit 420 overwrites the payload of the reception data 426 with the encrypted data at the time of encryption, similarly to the re-encryption unit 108 of the first embodiment. By such overwriting, consumption of an extra storage area is suppressed.
  • the received data re-encryption unit 420 notifies the instruction unit 409 of the end of encryption when the encryption is completed. Then, the instruction unit 409 reselects the old internal access key, which is an internal access key different from the currently selected access key selected as the selected internal access key, and decrypts the payload of the received data 426. The received data decoding unit 413 is instructed.
  • the reception data decryption unit 413 decrypts the data re-encrypted by the reception data re-encryption unit 420 with the access key from the old internal source. Specifically, the received data decryption unit 413 first obtains from the instructing unit 409 information that “the selected internal access key is the old access key”. The reception data decryption unit 413 reads the old internal origin access key from the internal origin access key storage unit 407 and decrypts the payload of the reception data 426 using the old internal origin access key.
  • reception data decryption unit 413 also overwrites the ciphertext of the payload of the reception data 426 with the decrypted data, similarly to step S601, at the time of decryption in step S608. By such overwriting, consumption of an extra storage area is suppressed.
  • step S609 the reception data determination unit 417 extracts feature values from the data decoded by the reception data decoding unit 413, as in step S602.
  • the reception data determination unit 417 calculates a feature value from the body of the data decoded by the reception data decoding unit 413, similarly to step S603. Note that steps S5609 and S610 may be executed in reverse order or in parallel.
  • step S611 the received data determination unit 417 determines whether or not the extracted feature value matches the calculated feature value. If the two feature values match, the received data determination unit 417 determines that “the payload of the received data 426 decoded in step S608 and stored in the memory 410 is normal plaintext data”. In this case, the reception data determination unit 417 instructs the data processing unit 423 to process the reception data 426 on the memory 410.
  • the received data determination unit 417 further instructs the instruction unit 409 to reset the selected internal access key in preparation for the next reception of the PDU encrypted with the access key. Then, the instruction unit 409 reselects the current internal access key as the selected internal access key. Therefore, the selected internal access key at the time when the PDU encrypted with the access key is received next and the processing of FIG. 18 is started again becomes the current internal access key.
  • the process proceeds to step S605.
  • the reception data determination unit 417 determines that “the payload of the reception data 426 decoded in step S608 and stored in the memory 410 is abnormal”.
  • the internal access key storage unit 407 holds only two generations of internal access keys, the current internal access key and the old internal access key. There are no more generation-internal access keys. Therefore, even when the two feature values do not match, received data determination section 417 instructs instruction section 409 to reset the access key derived from the selection in preparation for the next reception of the PDU encrypted with the access key. . Then, the instruction unit 409 reselects the current internal access key as the selected internal access key, and the process proceeds to step S612.
  • the received data determination unit 417 performs appropriate error processing.
  • the reception data determination unit 417 may instruct an error processing unit (not shown) to perform error processing.
  • Specific contents of the error processing are arbitrary.
  • the error process may be a process of simply releasing the storage area of the received data 426 or a process of requesting retransmission of the PDU to the other communication apparatus 400 of the transmission source. After executing the error process, the process of FIG. 18 is also ended.
  • the second embodiment in the series of processes triggered by the reception of the PDU, the storage on the memory 410 is accompanied by decryption or re-encryption. The area is overwritten. Therefore, the second embodiment also has a storage area saving effect as in the first embodiment.
  • the communication device 400 also performs processing independent of PDU reception. That is, as described below, the communication apparatus 100 also performs PDU transmission, common key update, internal access key update, and internal access key delivery.
  • the data processing unit 423 creates plaintext transmission data 427 from data to be transmitted to another device.
  • the transmission data 427 created in this way is an example of the plaintext PDU 304 in FIG. That is, the data processing unit 423 generates or acquires an appropriate body 301, sets an appropriate header 302, calculates a feature value 303 from the body 301, and creates a plaintext PDU 304 corresponding to the transmission data 427.
  • the communication device 400 when the communication device 400 is a node in the sensor network, the communication device 400 may have a built-in sensor or may be connected to the sensor.
  • the data processing unit 423 may set data output from the sensor in the body 301.
  • the data processing unit 423 instructs the transmission data encryption unit 421 to encrypt the payload of the transmission data 427 when the plain text transmission data 427 is created on the memory 410. Then, the transmission data encryption unit 421 recognizes the address of the transmission destination (that is, the address of the other communication device 400) and associates the recognized address with the externally derived access key stored in the externally derived access key storage unit 408. Read the key.
  • the data processing unit 423 explicitly notifies the transmission data encryption unit 421 of the transmission destination of the transmission data 427 so that the transmission data encryption unit 421 recognizes the address of the transmission destination. May be.
  • the transmission data encryption unit 421 may recognize the transmission destination address by reading the transmission destination address from the header of the transmission data 427.
  • the transmission data encryption unit 421 encrypts the payload of the transmission data 427 using the read external access key.
  • the transmission data encryption unit 421 also overwrites the same storage area on the memory 410 in the same manner as the re-encryption by the external origin access key re-encryption unit 419 and the reception data re-encryption unit 420. That is, the transmission data encryption unit 421 encrypts the plaintext payload of the transmission data 427 and overwrites the payload with the ciphertext data obtained by the encryption. By such overwriting, the memory 410 can be used efficiently even when the transmission data 427 is transmitted.
  • the transmission data encryption unit 421 instructs the transmission unit 424 to transmit the transmission data 427 when the encryption process is completed. Then, the transmission unit 424 transmits the transmission data 427.
  • the common key management unit 402 of the communication device 400 is the same as the key management unit 101 of the first embodiment updates the encryption key on the key storage unit 102 by performing the processing of FIG. 10 or FIG.
  • the common key on the key storage unit 406 is updated. Therefore, although detailed description is omitted here, the following is a supplementary description of processing corresponding to step S201 in FIG. 10 or step S301 in FIG.
  • the clock 425 may output the above-described common key update timing signal every time the common key update interval SI elapses.
  • the common key management unit 402 may recognize that “the time for updating the common key has come” when the common key update timing signal is detected.
  • the common key management unit 402 obtains the current time from the clock 425, and uses the reference time for updating the common key, the common key update interval SI, and the current time to determine whether the time for updating the common key has come. May be judged.
  • the internal access key management unit 403 of the communication apparatus 400 is similar to the case where the key management unit 101 of the first embodiment updates the encryption key on the key storage unit 102 by performing the processing of FIG. 10 or FIG.
  • the internal origin access key on the internal origin access key storage unit 407 is updated. Therefore, although detailed description is omitted here, the following is a supplementary description of processing corresponding to step S201 in FIG. 10 or step S301 in FIG.
  • the clock 425 may output an internally derived access key update timing signal (for example, an interrupt signal) every time the internally derived access key update interval AI elapses. Then, the internal access key management unit 403 may recognize that “the time to update the internal access key has arrived” when detecting the internal access key update timing signal. Alternatively, the internal access key management unit 403 obtains the current time from the clock 425, and uses the reference time for updating the internal access key, the update interval AI of the internal access key, and the current time to obtain the internal access key. It may be determined whether or not it is time to update.
  • an internally derived access key update timing signal for example, an interrupt signal
  • FIG. 19 is a flowchart of an internally derived access key distribution process performed by the communication device in the second embodiment.
  • FIG. 19 is started after the communication device 400 is turned on and at least the current internal access key is set in the internal access key storage unit 407.
  • the internal access key management unit 403 when the communication device 400 is turned on, the internal access key management unit 403 generates a first generation internal access key and stores it in the internal access key storage unit 407 as the current internal access key, Thereafter, the processing of FIG. 19 may be started.
  • step S701 the internal-origin access key management unit 403 waits until it is time to notify the internal-origin access key.
  • the internally derived access key management unit 403 determines that it is time to notify the internally derived access key, the process proceeds to step S702.
  • the internally derived access key is delivered (that is, notified) to another communication device 400 at a predetermined notification interval (“AN” in FIG. 20 described later).
  • the access key notification interval AN is shorter than the access key update interval AI.
  • the access key notification interval AN is not more than half of the access key update interval AI in order to notify any generation of internally derived access keys multiple times. Is preferred.
  • the clock 425 may output an access key notification timing signal that triggers access key notification every time an access key notification interval AN elapses.
  • the access key notification timing signal may be an interrupt signal, for example.
  • the internal access key management unit 403 acquires the current time from the clock 425, and notifies the internal access key using the reference time for notifying the internal access key, the access key notification interval AN, and the current time. It may be determined whether the time has come.
  • step S702 the internal access key management unit 403 generates plaintext internal access key distribution data 429 including the current internal access key and stores it in the memory 410. Note that the internally derived access key management unit 403 in step S702 performs a similar function to the plaintext processing unit 109 that creates the transmission data 115 in the first embodiment.
  • the payload of the internally derived access key distribution data 429 generated in step S702 is still in plain text. That is, the internally derived access key distribution data 429 is an example of the plaintext PDU 304 of FIG. 6, and the body 301 currently includes the internally derived access key. Also, the internal access key management unit 403 calculates a feature value 303 from the body 301 and sets the header 302 as appropriate. As described with respect to step S703, in the second embodiment, a broadcast address is set as a transmission destination address in the header 302.
  • the internal origin access key management section 403 instructs the internal origin access key encryption section 422 to encrypt the payload.
  • the internally derived access key encryption unit 422 reads the current common key from the common key storage unit 406 and encrypts the payload of the internally derived access key distribution data 429 using the current common key.
  • the internal-origin access key encryption unit 422 also overwrites the same storage area on the memory 410 in the same manner as the re-encryption by the external-origin access key re-encryption unit 419 and the received data re-encryption unit 420. That is, the internal-origin access key encryption unit 422 encrypts the plaintext payload of the internal-origin access key distribution data 429, and overwrites the payload with the ciphertext data obtained by the encryption. By such overwriting, the memory 410 can be efficiently used even when the internally derived access key distribution data 429 is transmitted.
  • the internal origin access key encryption unit 422 instructs the transmission unit 424 to transmit the internal origin access key distribution data 429 when the encryption process is completed. Then, in the next step S703, the transmission unit 424 transmits the internally derived access key distribution data 429 obtained as a result of the encryption in step S702. Specifically, in the second embodiment, since a broadcast address is set as the transmission destination address, the communication apparatus 400 broadcasts the internal access key distribution data 429.
  • the broadcast in step S703 means transmission to all other communication devices 400 within a reachable range with one hop. Therefore, the PDU transmitted by the transmission unit 424 is the target of the processing in FIG. 17 in all other communication apparatuses 400 that can directly receive the PDU without relaying.
  • the broadcast in step S703 means transmission to all other communication devices 400 within a reachable range with one hop. That is, the internally derived access key distribution data 429 is transmitted to all other communication devices 400 that are directly connected to the communication device 400 that is the transmission source of the internally derived access key distribution data 429 by a cable.
  • the transmitted PDU is subjected to the processing of FIG. 17 in all the other communication devices 400 that are directly connected to the communication device 400 that is the transmission source of the internally derived access key distribution data 429 by a cable.
  • the second embodiment when the second embodiment is applied to Ethernet (registered trademark), all other communication devices 400 belonging to the same broadcast domain as the communication device 400 that is the transmission source of the internally derived access key distribution data 429 are internally derived. Access key distribution data 429 is transmitted. Then, the transmitted PDU is subjected to the processing of FIG. 17 in all the other communication apparatuses 400 belonging to the same broadcast domain as the transmission source communication apparatus 400.
  • the process returns to step S701.
  • the payload of the internally derived access key distribution data 429 is encrypted every time the internally derived access key is notified.
  • the internally derived access key distribution data 429 is reused. May be. In other words, if the internal access key update interval AI and the notification interval AN are set so that the same internal access key is notified multiple times, the internal access key is used only for the first notification after the internal access key is updated.
  • the origin access key distribution data 429 may be created.
  • the memory 410 may continue to hold the internally derived access key distribution data 429 with the payload encrypted until the internally derived access key is updated next time. Then, step S702 can be omitted in the second and subsequent notifications after the internal access key is updated. That is, the internal access key management unit 403 may instruct the transmission unit 424 to transmit the existing internal access key distribution data 429 on the memory 410 again.
  • FIG. 20 is a timing chart showing the updating of the common key and the internally derived access key in the second embodiment.
  • the common key management unit 402 periodically updates the common key at a predetermined update interval SI.
  • FIG. 20 illustrates the ( ⁇ 1) generation common key SK ⁇ 1 to the ( ⁇ + 2) generation common key SK ⁇ + 2 .
  • re-encryption and decryption with the old common key when decryption with the current common key has failed are performed for a certain allowable time from the update of the common key. Only performed during ST.
  • the allowable time ST is shorter than the update interval SI.
  • the update interval SI is preferably set to an appropriate value according to the amount of traffic in the network including the communication device 400, for example.
  • the update interval SI may be about 6 to 12 hours.
  • the allowable time ST is set to an appropriate value according to the embodiment based on, for example, the accuracy of synchronization between the communication devices 400 or the time required for communication between the communication devices 400 that distribute access keys. It is preferably set.
  • FIG. 20 illustrates the (a-1) generation internal access key AK A, a-1 to the (a + 4) generation internal access key AK A, a + 4 .
  • the internal access key update interval AI is shorter than the common key update interval SI, and is preferably less than or equal to half the common key update interval SI.
  • the internal access key update interval AI is preferably set to an appropriate value according to the amount of traffic in the network including the communication device 400, for example.
  • the internal-origin access key update interval AI may be about 10 to 20 minutes long.
  • the common key update interval SI does not have to be divisible by the internally derived access key update interval AI.
  • re-encryption when decryption with the current internal origin access key fails and decryption with the old internal origin access key are performed using the internal origin access key. It is performed only during a certain allowable time AT from the update.
  • the allowable time AT is shorter than the update interval AI.
  • the allowable time AT is preferably set to an appropriate value according to the embodiment based on, for example, the time required for communication between the communication apparatuses 400 that exchange PDUs encrypted with the access key.
  • the communication device 400 notifies the other communication device 400 of the internal access key at a predetermined notification interval AN.
  • the notification interval AN is shorter than the update interval AI of the internally derived access key, and is preferably not more than half of the update interval AI.
  • the notification interval AN may be about 1 to 5 minutes.
  • the update interval AI may not be a length divisible by the notification interval AN.
  • the notification interval AN is shorter than the update interval AI, for example, in the example of FIG. 20, the a-th generation internal access key AK A, a is recognized as the internal access key AK A, a as the current internal access key. You will be notified 5 times during that period. As described above, it is particularly preferable for the communication device 400 in the ad hoc network to notify the internal access key more frequently than the internal access key is updated.
  • the communication device connected to the ad hoc network may dynamically change from moment to moment. For example, a new communication device 400 may begin to join an ad hoc network at any point in time.
  • the access key AK A new communication device 400 has not been connected to the ad hoc network at the time of the first notification of a is, the access key AK A, the third alert a time Then, it may be already connected to the ad hoc network. Then, the communication device 400 newly participating in the ad hoc network does not wait until the next notification of the (a + 1) generation access key AK A, a + 1 , and from the time of the third notification of the access key AKA A, a. Immediately, encrypted communication using an access key can be started.
  • the installation position of the communication device 400 may be fixed, the communication device 400 may be a mobile object in a wireless ad hoc network. Then, it may happen that the access key notification cannot be received according to the movement of the communication device 400 or the change in the wireless communication environment such as the presence / absence of a shielding object.
  • the communication device 400 at the address Adr B may not be able to receive the first notification of the access key AK A, a from the communication device 400 at the address Adr A.
  • the communication device 400 with the address Adr B may be able to receive the second notification of the access key AK A, a from the communication device 400 with the address Adr A.
  • communication device 400 at address Adr B encrypts and transmits the PDU addressed to communication device 400 at address Adr A using access key AK A, a. be able to.
  • the communication device 400 at the address Adr A updates the access key from the (a-1) generation to the a generation
  • the PDU encrypted with the old access key AK A, a-1 is changed to the address Adr B.
  • the information received from the communication device 400 is at most a little after the second notification. For example, as shown in FIG. 20, it is assumed that the access key AK A, a is included in the allowable time AT until a little after the second notification.
  • the PDU encrypted with the access key AK A, a-1 is received within the validity period of the old internal origin access key AK A, a-1 . Therefore, transmission / reception of a PDU encrypted with the access key AK A, a-1 is not wasted, and error processing such as a PDU retransmission request is unnecessary.
  • the notification interval AN is not only shorter than the update interval AI, but more preferably half or less of the allowable time AT. It is as follows if the reason is supplemented.
  • the notification interval AN is less than half the allowable time AT, multiple notifications are included in the allowable time AT. Therefore, even if the first notification after the access key update is accidentally impossible to receive in the communication device 400 with the notification destination, the new communication device 400 after the update is updated within the allowable time AT. The possibility that “the access key can be recognized” increases. Then, the frequency of error processing is reduced. Further, if the notification interval AN is short, the frequency of re-encryption and decryption using the old internal access key is also reduced. Then, as a result, the processing load required for re-encryption and re-decryption of each communication device 400 is reduced, and unnecessary traffic on the network is reduced.
  • the access key notification interval AN may be the same as the access key update interval AI. That is, every time an internally derived access key is generated, the internally derived access key may be notified once immediately after generation. For example, in a wired network with good communication quality, the notification interval AN and the update interval AI may be the same.
  • the expiration date may be set only for one of the common key and the access key. That is, in the second embodiment, the branch regarding the expiration date in step S508 of FIG. 17 or step S606 of FIG. 18 may be omitted. Conversely, an expiration date similar to that of the second embodiment may be introduced into the first embodiment. Note that omission of the expiration date is the same as setting an expiration date equal to the encryption key update interval.
  • the update timing of the encryption key is set so that the plurality of communication devices can share common knowledge about the update timing of the encryption key. Is determined in advance.
  • the update at a fixed interval is a method for allowing a plurality of communication devices to have a common recognition about the update timing of the encryption key.
  • a schedule of irregular intervals related to the update timing of the encryption key may be shared between a plurality of communication apparatuses in advance.
  • the interval at which the communication device updates the encryption key may not be fixed.
  • the communication devices 400 of the second embodiment distribute access keys. Therefore, each communication device 400 does not need to recognize in advance the timing when the other communication device 400 updates the access key.
  • the second communication device 400 needs to know the interval at which the first communication device 400 updates the internal access key for the first communication device 400. Absent. Therefore, the first communication apparatus 400 may dynamically change the update interval of the internally derived access key according to a change in the situation such as the frequency of receiving PDUs.
  • the key storage unit 102 of the first embodiment may hold old keys of two or more generations.
  • the common key storage unit 406 of the second embodiment may hold two or more generations of old common keys
  • the internally derived access key storage unit 407 holds two or more generations of old internally derived access keys. May be. Then, re-encryption and decryption may be tried in sequence with respect to a plurality of old encryption keys that are held as necessary.
  • the key storage unit 102 may hold three generations of encryption keys: a current key, an old key one generation before, and an old key two generations before.
  • the key management unit 101 When the key management unit 101 generates a new encryption key, the key management unit 101 appropriately updates the three generations of encryption keys on the key storage unit 102. In this case, with regard to decryption of the payload of the received PDU, it is appropriate for the communication apparatus 100 to try in order from the new encryption key, such as “current key, old key before one generation, old key before two generations”. .
  • the determination unit 107 instructs the re-encryption unit 108 to re-encrypt the payload of the received data 114.
  • the selected encryption key is not reset in the step S111.
  • the re-encryption unit 108 re-encrypts the payload of the received data 114 with the old key one generation before. Further, the re-encryption unit 108 notifies the instruction unit 103 of the end of re-encryption. Then, the instruction unit 103 switches the selected encryption key from the currently selected old key of one generation before to the old key of two generations before.
  • the instruction unit 103 instructs the decoding unit 106 to decode the payload of the received data 114. Then, the decryption unit 106 decrypts the payload of the reception data 114 using the old key two generations before. Further, the decoding unit 106 notifies the determination unit 107 of the end of decoding.
  • the determination unit 107 extracts the feature value from the decoded payload, calculates the feature value from the body, and compares the two feature values. As a result, if the two feature values match, the selected encryption key is reset, and the process proceeds to step S106. Conversely, if the two feature values do not match, the selected encryption key is reset, and the process proceeds to step S112.
  • the second embodiment can be modified in the same manner as described above.
  • an embodiment that further uses an old key that is three generations or older is also possible.
  • the embodiment that uses an old key that is two or more generations ago is particularly suitable for encrypted communication between communication devices that require a long communication time.
  • the range in which the encryption key is established may be appropriately changed according to the embodiment.
  • the communication device 400 in FIG. 14 is used as a node in the ad hoc network 140 in FIG. 2, the same common key may be used among all the nodes in the ad hoc network 140.
  • the range in which the encryption key is established may be appropriately changed according to the network configuration, the layer of the protocol to be applied, the purpose of encrypted communication, and the like.
  • the internally derived access key is notified by broadcast to all other communication devices 400 within one hop.
  • the communication device 400 that is the notification destination of the internally derived access key may be limited to a specific one, for example.
  • the encryption key generation algorithm is arbitrary. That is, the key management unit 101, the common key management unit 402, and the internally derived access key management unit 403 can each generate an encryption key according to an arbitrary algorithm.
  • the key management unit 101, the common key management unit 402, and the internally derived access key management unit 403 may generate an encryption key by performing processing for obtaining a unique value with respect to time.
  • the process of obtaining a unique value with respect to time is, for example, a process of generating a random number using the current time as a seed and generating an encryption key using the random number.
  • the seed may be information obtained by combining information (for example, ID or address) for identifying the communication device and the current time.
  • HMAC keyed-Hashing for MAC
  • MAC message authentication code
  • the body 301 and the feature value 303 are encrypted with the same encryption key and the same encryption algorithm.
  • the body 301 and the feature value 303 may be encrypted with different encryption keys, or the body 301 and the feature value 303 may be encrypted with different encryption algorithms.
  • the received data decryption unit 413 may decrypt the encrypted body with the access key derived from the inside, and decrypt the encrypted feature value with the fixed encryption key.
  • the received data re-encryption unit 420 may re-encrypt the decrypted body with the internally derived access key and re-encrypt the decrypted feature value with a fixed encryption key.
  • a digital signature based on a public key encryption algorithm may be used for determination by the determination unit 107, the external access key determination unit 416, or the received data determination unit 417.
  • the first communication device 400 discloses the public key to the second communication device 400 in advance. Then, the data processing unit 423 of the first communication apparatus 400 calculates a hash value from the body 301 and encrypts the calculated hash value with a secret key, thereby generating a digital signature as the feature value 303. Good.
  • the transmission data encryption unit 421 may encrypt the entire payload including the digital signature with the access key of the second communication apparatus 400, or only the part of the body 301 may be the access key of the second communication apparatus 400. You may encrypt with.
  • the transmission data encryption unit 421 encrypts the entire payload including the digital signature as the feature value 303 with the access key of the second communication device 400
  • the reception data decryption unit 413 of the second communication device 400 The entire payload is decrypted with the access key.
  • the received data determination unit 417 then decrypts the decrypted feature value 309 with the public key to obtain a hash value. Also, the received data determination unit 417 calculates a hash value corresponding to the feature value 311 in FIG. 6 from the decrypted body 308.
  • the received data judgment unit 417 judges that “the payload has been decrypted with the same access key used for encryption”. That is, the reception data determination unit 417 determines that “the decrypted data is normal plaintext data and decryption is successful”.
  • the received data determination unit 417 determines that the payload has been decrypted with an access key different from that used for encryption. That is, the reception data determination unit 417 determines that “the decrypted data is abnormal and the decryption has failed”.
  • the decoded feature value 309 and the calculated feature value 311 completely match is determined between the decoded feature value 309 and the calculated feature value 311. Used to determine consistency. However, as described above, in some embodiments, the result of performing some operation such as decryption with the public key on the decrypted feature value 309 is compared with the feature value 311. In other words, in some embodiments, the consistency is determined based on a criterion other than the criterion “whether or not the decoded feature value 309 itself and the feature value 311 completely match”.
  • the transmission data encryption unit 421 of the first communication device 400 encrypts only the body 301 with the access key of the second communication device 400 is also possible.
  • the received data decryption unit 413 of the second communication device 400 decrypts only the encrypted body 305 with the access key.
  • the received data judgment unit 417 obtains a hash value by decrypting the digital signature as the feature value 303 with the public key. Also, the received data determination unit 417 calculates a hash value corresponding to the feature value 311 in FIG. 6 from the decrypted body 308. Then, the reception data determination unit 417 determines the consistency between the feature value 303 and the calculated feature value 311 by comparing the two hash values.
  • the key storage unit 102 may be realized by a ring buffer having a size of 3.
  • the key management unit 101 only needs to move the pointer indicating the current key every time an encryption key is generated.
  • the internal origin access key storage unit 407 may be realized by a ring buffer.
  • the data format in the key recognition unit 112 and the externally derived access key storage unit 408 may be a table format as shown in the figure. However, a linear list having a pair of an address and an encryption key as an element or First-In-First-Out (FIFO) queue or the like.
  • FIFO First-In-First-Out
  • the second embodiment may be modified so that the storage area is not overwritten for the access key delivery PDU. That is, the internal-origin access key encryption unit 422, the external-origin access key decryption unit 414, and the external-origin access key re-encryption unit 419 do not necessarily need to overwrite the storage area at the time of encryption or decryption.
  • control PDUs such as access key delivery PDUs generally have a short payload. Therefore, the influence of the consumption of the storage area due to the fact that the storage area is not overwritten is smaller in the case of the access key delivery PDU than in the case of the application data PDU encrypted by the access key. That is, depending on the embodiment, effective use of the memory 410 may be sufficiently achieved only by overwriting the storage area for the application data PDU encrypted with the access key.
  • the storage area of the transmission data 115 is not overwritten. Also good.
  • overwrite includes “rewriting”.
  • overwriting the first data directly with the second data is, from another viewpoint, writing the second data directly back to the storage area in which the first data is stored.
  • clearing the storage area in which the first data is stored and then writing the second data back to the same storage area is one type of “overwriting”.

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)
  • Mobile Radio Communication Systems (AREA)
  • Storage Device Security (AREA)

Abstract

 通信装置は、暗号化データまたは復号データを記憶するデータ記憶部と、暗号化データを復号する復号部と、復号データを暗号化する暗号化部と、暗号化部に対して命令を出す判断部を有する。上記命令は、第1の暗号化データを暗号鍵に基づいて復号部が復号した第1の復号データをデータ記憶部から読み出して、第1の復号データを暗号鍵に基づいて暗号化した第2の暗号化データをデータ記憶部に書き戻すよう、暗号化部に命じる命令である。

Description

通信装置、プログラムおよび方法
 本発明は、暗号化通信に関する。
 対称鍵暗号(symmetric cryptography)による暗号化通信に関する1つの話題は、送信者と受信者との間の鍵確立(key establishment)である。
 例えば、複数のノード装置によって構成されるネットワークの中の第1のノード装置において、アクセスキー生成部は、第1のノード装置に固有の暗号鍵である第1のアクセスキーを、第1の時間ごとに変更する。そして、共通鍵生成部は、複数のノード装置で共通の共通鍵を第2の時間ごとに変更する。
 また、第1のノード装置は、生成した第1のアクセスキーを生成した共通鍵で暗号化して送信するとともに、第2のノード装置から送信されてきた、第2のノード装置の第2のアクセスキーを共通鍵で暗号化したデータを含むアクセスキー通知フレームを受信する。そして、第1のノード装置において、復号化部は、受信したアクセスキー通知フレームを、生成された共通鍵を用いて復号することにより、第2のアクセスキーを取得する。さらに、第1のノード装置の送信部からは、平文フレームから計算されるハッシュ値を含むデータを共通鍵で暗号化した署名データの付与された平文フレームを、第2のアクセスキーで暗号化した、暗号化フレームが送信される。
 また、セキュアな通信のためのアーキテクチャとして、Security Architecture for Internet Protocol(IPsec)も知られており、IPsecを利用した暗号化通信システムも知られている。例えば、単一または複数の端末を接続したIPsecゲートウェイに、Virtual Local Area Network(VLAN)対応の暗号鍵を配布する監視制御サーバを含む、次のような暗号化通信システムが知られている。
 すなわち、監視制御サーバは、IPsecゲートウェイに配布するVLAN対応の暗号鍵の管理および配布を行う手段を備える。そして、IPsecゲートウェイは、監視制御サーバから今回配布された暗号鍵を新鍵として保持する新鍵メモリと、前回配布された暗号鍵を旧鍵として保持する旧鍵メモリを備える。IPsecゲートウェイはさらに、新鍵による暗号通信の不成功により旧鍵メモリに保持された旧鍵による暗号通信に切替える手段を備える。
 そのほかにも、無線Local Area Network(LAN)の鍵同期メカニズムが提案されている。この鍵同期メカニズムによれば、アクセスポイントは、新たな鍵で正しく暗号化された第1のデータフレームがステーションから受信されるまで、新たな暗号化鍵を使用し始めることはない。そして、新たな鍵は、このポイントからキーリフレッシュインターバルの期限切れまで使用される。
 ところで、暗号鍵が更新される暗号化通信システムにおいては、暗号文データが送信されるタイミングと、更新された暗号鍵が送信装置と受信装置の間で確立されるタイミングのずれにより、次のような問題が生じうる。すなわち、復号に用いる暗号鍵として受信装置が認識している最新の暗号鍵では、正しくデータを復号することができないことが起こりうる。
 例えば、受信装置が暗号鍵を更新する少し前の、送信装置がまだ暗号鍵を更新していない時点で、送信装置は、更新される前の暗号鍵を用いてデータを暗号化して暗号文データを生成し、生成した暗号文データを送信することがある。そして、受信装置は、暗号文データを受信する少し前に、暗号鍵を更新していることがある。すると、受信装置は、受信した暗号文データを、復号に用いる暗号鍵として現在認識している更新後の暗号鍵によって正しく復号することはできない。
 そこで、受信装置は、正しい平文データを得るための何らかの処理を行うことが望ましい。例えば、受信装置は、最新の暗号鍵だけではなく古い暗号鍵をも保持し、最新の暗号鍵による復号に失敗した場合は、古い暗号鍵を用いて暗号文データを再度復号してもよい。すると、受信装置は、更新される前の古い暗号鍵により暗号化された暗号文データを受信した場合であっても、正しい平文データを得ることができる。
 より具体的には、受信装置は、暗号文データを受信したとき、例えば以下のように動作してもよい。すなわち、受信装置は、まず最新の暗号鍵による復号を行い、復号が終わった後も、古い暗号鍵を用いる再度の復号に備えて暗号文データを保持し続ける。そして、受信装置は、復号されたデータを検証し、復号により正しい平文データが得られなかった場合は、古い暗号鍵を用いて暗号文データの復号を行う。
国際公開WO2009/130917号公報 特開2007-267301号公報 特表2007-500972号公報
 古い暗号鍵を用いる再度の復号に備えるために、上述の受信装置は、最新の暗号鍵による復号の結果として得られたデータを保持する記憶領域のほかに、さらに受信した暗号文データを保持する記憶領域を必要とする。
 他方で、暗号化通信システムの利用分野によっては、受信装置の記憶容量が非常に制限される場合がある。そして、発明者らが研究の結果得た知見によれば、記憶容量の小さな受信装置にとっては、最新の暗号鍵による復号の結果として得られたデータと受信した暗号文データの双方を保持することが、メモリ不足による性能低下またはエラーに直結しかねない。
 そこで本発明は、暗号鍵が更新される暗号化通信システムにおいて、古い暗号鍵を用いた復号を、記憶容量が小さな通信装置でも容易に行えるようにするための技術を提供することを目的とする。
 一態様により提供される通信装置は、暗号化データまたは復号データを記憶するデータ記憶部と、暗号化データを復号する復号部と、復号データを暗号化する暗号化部を備える。前記通信装置は、さらに、前記暗号化部に対して、第1の暗号化データを暗号鍵に基づいて前記復号部が復号した第1の復号データを前記データ記憶部から読み出して、前記第1の復号データを前記暗号鍵に基づいて暗号化した第2の暗号化データを前記データ記憶部に書き戻すように、命令を出す判断部を備える。
 第1の暗号化データを第1の復号データに復号するのに用いられる暗号鍵と、第1の復号データを第2の暗号化データに暗号化するのに用いられる暗号鍵は同じなので、第2の暗号化データの内容は、第1の暗号化データと同じである。よって、上記の通信装置には、データ記憶部への書き戻しによる記憶領域の節約効果がある。つまり、第1の暗号化データと同じ内容の第2の暗号化データがデータ記憶部に書き戻されるので、上記の通信装置によれば、第1の復号データとは別に第1の暗号化データをデータ記憶部が保持し続ける必要がない。すなわち、上記の通信装置は、記憶領域の消費抑制という効果を奏する。
 また、上記通信装置における上記暗号鍵は、更新される暗号鍵でもよいし、第1の暗号化データは、上記通信装置が他の装置から受信したデータであってもよい。その場合、上記通信装置は、受信したデータを復号して得られた復号データとは別に、受信したデータそのものを保持し続けるという必要なしに、古い暗号鍵を用いた復号に備えることができる。
第1実施形態における通信の一例を示すタイミングチャートである。 第1実施形態が適用される環境の一例を示すシステム構成図である。 第1実施形態の通信装置のブロック構成図である。 第1実施形態の通信装置のハードウェア構成の例を示す図である。 第1実施形態の通信装置が記憶するデータの一例を示す図である。 第1実施形態において送受信されるデータの形式を説明する図である。 第1実施形態の通信装置がデータの受信を契機として行う受信処理のフローチャートである。 第1実施形態におけるメモリ上のデータの変遷の例を模式的に説明する図である。 比較例におけるメモリ上のデータの変遷の例を模式的に説明する図である。 第1実施形態において通信装置が行う暗号鍵更新処理のフローチャートである。 暗号鍵更新処理にともなうデータの変遷の例を模式的に説明する図である。 暗号鍵更新処理の変形例を示すフローチャートである。 変形された暗号鍵更新処理にともなうデータの変遷の例を模式的に説明する図である。 第2実施形態の通信装置のブロック構成図である。 第2実施形態の通信装置が記憶するデータの一例を示す図である。 第2実施形態の通信装置がデータの受信を契機として行う受信処理のフローチャートである。 第2実施形態において通信装置が行う外部由来アクセス鍵更新処理のフローチャートである。 第2実施形態において通信装置が行う暗号化PDU受信処理のフローチャートである。 第2実施形態において通信装置が行う内部由来アクセス鍵配送処理のフローチャートである。 第2実施形態における共通鍵と内部由来アクセス鍵の更新を示すタイミングチャートである。
 以下、実施形態について、図面を参照しながら詳細に説明する。具体的には、まず図1~13を参照して第1実施形態について説明し、その後、図14~20を参照して第2実施形態について説明する。最後に、その他の実施形態についても説明する。
 なお、以下の本明細書の説明においては、特に断らない限り、対称鍵暗号による暗号化通信が行われるものとする。また、詳しくは図8~9とともに後述するが、どの実施形態においても、ストリーム暗号を利用することもできるし、ブロック暗号を利用することもできる。
 さて、図1は、第1実施形態における通信の一例を示すタイミングチャートである。図1は、通信装置100Bが通信装置100Aに暗号化したデータを送信する例を示す。
 通信装置100Aと100Bの双方は、何らかの鍵確立の方法にしたがい、通信装置100Aが復号に用いる現在の暗号鍵(cryptographic key)を認識する。なお、対称鍵暗号が使われるので、通信装置100Aにとっての復号鍵と通信装置100Bにとっての暗号化鍵は同じ暗号鍵である。
 例えば、通信装置100Aと100Bが同じアルゴリズムにしたがってそれぞれ暗号鍵を生成してもよい。あるいは、通信装置100Aが暗号鍵を生成し、生成した暗号鍵を通信装置100Bに配送してもよい。例えば、通信装置100Aは、生成した暗号鍵を、鍵配送用の他の暗号鍵を用いて暗号化して通信装置100Bに配送してもよい。配送対象の暗号鍵を暗号化するのに通信装置100Aが用いる鍵配送用の暗号鍵は、対称鍵暗号の暗号鍵でもよいし、公開鍵暗号における通信装置100Bの公開鍵でもよい。
 以上のように、第1実施形態は、通信装置100Aと100Bの間の鍵確立の具体的方法によらず様々な暗号化通信システムに適用可能である。
 また、暗号化通信のセキュリティ向上のため、通信装置100Aと100Bの間では、適宜の間隔で暗号鍵が更新される。以下では説明の便宜上、更新される暗号鍵を「第1世代、第2世代、……」のように世代で区別することとし、通信装置100Aが復号に用いる第a世代の暗号鍵を“KA,a”と表す。
 送信側の通信装置100Bは、送信先の通信装置100Aを識別する情報と対応づけて、通信装置100Aが復号に用いる現在の暗号鍵を記憶する。以下では説明の便宜上、通信装置100Aを識別する情報として、通信装置100AのアドレスAdrが使われるものとするが、識別番号など、アドレスAdr以外の識別情報も利用可能である。
 なお、第1実施形態の暗号化通信は、様々なレイヤのプロトコル上で実現可能である。換言すれば、第1実施形態におけるProtocol Data Unit(PDU)は、特定のレイヤの特定のプロトコルのPDUには限定されない。よって、通信装置100AのアドレスAdrも、プロトコルのレイヤに応じたアドレスでよい。
 例えば、データリンク層での通信に第1実施形態が適用される場合、Media Access Control(MAC)アドレスが、通信装置100Aを識別するためのアドレスAdrとして用いられてもよい。あるいは、ネットワーク層での通信に第1実施形態が適用される場合、Internet Protocol(IP)アドレスが、通信装置100Aを識別するためのアドレスAdrとして用いられてもよい。
 また、第1実施形態における暗号化通信は、無線通信、有線通信、またはその組み合わせのいずれでもよい。そして、通信装置100Aと100Bの間のホップ数は1でもよいし2以上でもよい。
 さて、図1に示すように、例えば時刻TB101において通信装置100Bは、通信装置100Aの最新の暗号鍵KA,aを認識する。そして、通信装置100Bは、通信装置100AのアドレスAdrと対応づけて記憶していた前の世代の暗号鍵KA,a-1を新たな暗号鍵KA,aに置き換える。
 他方、通信装置100Aも、時刻TA101において、最新の暗号鍵KA,aを生成し、通信装置100A自身が現在復号のために用いる暗号鍵(以下「現在鍵」という)を、前の世代の暗号鍵KA,a-1から新たな暗号鍵KA,aへと更新する。また、第1実施形態の通信装置100Aは、現在鍵の1つ前の世代の暗号鍵(以下「旧鍵」という)も記憶する。よって、時刻TA101において通信装置100Aは、旧鍵をKA,a-2からKA,a-1に更新する処理も行う。
 時刻TB101とTA101は、ほぼ同時であるが、時刻TB101の方が時刻TA101よりも早いこともありうるし、その逆の場合もありうる。いずれにせよ、時刻TB101と時刻TA101の遅い方の時点において、通信装置100Aと100Bの間で暗号鍵KA,aが確立される。
 そして、通信装置100Bは、例えば時刻TB102において、通信装置100Aに送信するための平文データP101を作成する。そして、通信装置100Bは、時刻TB103において、送信先である通信装置100AのアドレスAdrと対応づけて記憶している暗号鍵KA,aを用いて、平文データP101を暗号化し、暗号文データC101を得る。
 なお、上記のように第1実施形態が適用されるプロトコルは任意だが、一般にPDUはヘッダとペイロードを含む。平文データP101と暗号文データC101はペイロードに相当するデータである。なお、平文データP101の種類は任意である。平文データP101は、例えば、テキストデータでもよいし、画像データでもよいし、特定のアプリケーションソフトウェアのフォーマットのバイナリデータでもよい。
 通信装置100Bは、以上のようにして暗号文データC101を得ると、時刻TB104において、暗号文データC101を通信装置100Aに送信する。なお、正確には、通信装置100Bが送信するのは暗号文データC101をペイロードとして含むPDUだが、ヘッダは暗号化とは無関係なので、説明の簡略化のために以下ではヘッダに関する説明を適宜省略する。
 以上のようにして通信装置100Bから送信された暗号文データC101は、時刻TA102に、通信装置100Aにおいて受信される。そして、時刻TA102において通信装置100Aが現在鍵として記憶しているのは、時刻TA101で生成した暗号鍵KA,aである。よって、通信装置100Aは、時刻TA102に続く時刻TA103において、暗号鍵KA,aを用いて暗号文データC101を復号する。
 上記のように、暗号文データC101は、暗号鍵KA,aによる暗号化で得られたデータである。よって、時刻TA103における暗号鍵KA,aによる復号により、通信装置100Bが時刻TA102で生成したのと同じ平文データP101が得られる。
 また、詳しくは図6とともに後述するが、平文データP101は2つの部分を含み、第1の部分の特徴を第2の部分が示す。以下では第1の部分の特徴を示す値を「特徴値」ということにする。第2の部分には、特徴値そのもの、または特徴値に所定の操作を施して得られる値が設定される。
 詳しくは図6とともに後述するが、特徴値としては、例えばハッシュ値などが利用可能である。よって、通信装置100Aは、特徴値を用いることで平文データP101の完全性(integrity)をチェックし、復号により得た平文データP101が正しい平文データであることを確認することができる。
 ところで、図1の例では、通信装置100Bは、さらに時刻TB105において、通信装置100Aに送信するための別の平文データP102を作成する。すると、通信装置100Bは、時刻TB106において時刻TB103と同様に暗号鍵KA,aを用いて平文データP102を暗号化し、暗号文データC102を得る。そして、通信装置100Bは、時刻TB107において時刻TB104と同様に暗号文データC102を送信する。
 他方、通信装置100Aは、暗号文データC102を通信装置100Bから受信する少し前に、時刻TA104において、旧鍵をKA,a-1からKA,aに更新し、現在鍵をKA,aからKA,a+1に更新することがある。つまり、通信装置100Aは、時刻TA104での暗号鍵の更新の後の時刻TA105で、暗号文データC102を受信することがある。
 もちろん、通信装置100Bも、通信装置100Aが暗号鍵の更新を行う時刻TA104に近い時刻TB108において、通信装置100AのアドレスAdrに対応する暗号鍵をKA,aからKA,a+1に更新する。よって、時刻TA104と時刻TB108のうちの遅い方である時刻TB108には、新たな暗号鍵KA,a+1が、通信装置100Aと100Bの間で確立される。
 しかし、上記のように、たまたま時刻TB108での更新の直前の時刻TB106に通信装置100Bが平文データP102を暗号化することはありうる。また、通信装置100Aが、暗号文データC102を時刻TA105で受信する直前に、時刻TA104で現在鍵と旧鍵を更新することもありうる。
 例えば、鍵確立の方法として、通信装置100Aが生成した新たな暗号鍵KA,a+1を通信装置100Bに配送する方法が採用される場合、鍵配送の直前に暗号文データC102の送信が行われるかもしれない。あるいは、鍵確立の方法として、通信装置100Aと100Bがそれぞれ時刻を参照して同じアルゴリズムにしたがって暗号鍵を生成する方法が採用される場合、通信装置100Aの内蔵時計よりも通信装置100Bの内蔵時計が遅れているかもしれない。また、たとえ通信装置100Aと100Bの内蔵時計が正確に同期していたとしても、暗号文データC102の送信から受信までにかかる時間の間に、現在鍵の更新が行われるかもしれない。
 以上のような様々な理由から、図1に示すように、通信装置100Aが暗号文データC102を受信した時刻TA105では既に、暗号文データC102の生成に使われた暗号鍵KA,aよりも新しい暗号鍵KA,a+1が現在鍵として記憶されていることがある。その場合、暗号文データC102を受信した通信装置100Aは、時刻TA106において、現在鍵KA,a+1を用いて暗号文データC102を復号する。
 すると、復号の結果として復号データD102が得られるが、復号データD102は、元の平文データP102とは異なる。通信装置100Aは、特徴値のチェックを行うことで、復号データD102が正しい平文データではないと判断することができる。
 そして、通信装置100Aは、復号データD102が正しい平文データではないと判断すると、「暗号文データC102は旧鍵KA,aによって暗号化されたデータかもしれない」と認識する。よって、通信装置100Aは、暗号文データC102の旧鍵KA,aによる復号を試みる。
 ところで、第1実施形態の通信装置100Aは、時刻TA106において、メモリの節約のため、暗号文データC102とは別の記憶領域に復号データD102を作成するのではなく、暗号文データC102を記憶した記憶領域上に復号データD102を上書きする。よって、暗号文データC102の旧鍵KA,aによる復号を試みようとする段階では、通信装置100Aは暗号文データC102を保持していない。
 そこで、通信装置100Aは時刻TA107において、現在鍵KA,a+1を用いて復号データD102を再暗号化することで、暗号文データC102を復元する。なお、時刻TA107での再暗号化においても、通信装置100Aは、メモリの節約のため、復号データD102を記憶している記憶領域上に暗号文データC102を上書きする。
 そして、通信装置100Aは、こうして再暗号化により暗号文データC102を復元した後、時刻TA108において、暗号文データC102を旧鍵KA,aにより復号する。今度は、暗号化されたときと同じ暗号鍵KA,aにより暗号文データC102が復号されるので、復号の結果として、時刻TB105に通信装置100Bが作成したのと同じ平文データP102が得られる。
 なお、時刻TA108における復号においても、通信装置100Aは、メモリの節約のため、復元した暗号文データC102を記憶している記憶領域上に平文データP102を上書きする。そして、通信装置100Aは、特徴値のチェックにより平文データP102が正しい平文データであることを確認することができる。
 以上のような再暗号化と旧鍵による復号を通信装置100Aが行うことで、タイミングのずれに起因して現在鍵による復号では正しい平文データが得られない場合であっても、通信装置100Aは旧鍵による復号から正しい平文データを得ることができる。よって、データの再送は不要である。つまり、通信装置100Aが通信装置100Bへデータの再送を依頼する必要もないし、依頼に応じて通信装置100Bが平文データP102を新たな暗号鍵KA,a+1で暗号化しなおし、得られた暗号文データを通信装置100Aに送信する必要もない。また、通信装置100Bが再送に備えて平文データP102をしばらくの間保持しておく必要もない。
 よって、第1実施形態は次の(a1)~(a3)のような効果を奏する。
 (a1)通信装置100Aと100Bの間のトラフィック量が少なくて済む。
 (a2)通信装置100Bが再送に備えて余計な記憶領域を消費することもない。
 (a3)再送依頼とデータの再送にかかる時間よりも、通信装置100A内で再暗号化と再度の復号にかかる時間の方が一般に短いので、通信装置100Aは速やかに正しい平文データP102を得ることができる。
 さらに、第1実施形態の通信装置100Aは、上記のように、受信した暗号文データC102、復号データD102、再暗号化により復元した暗号文データC102、および平文データP102を、同じ記憶領域に次々と上書きしていく。よって、何らかの理由で通信装置100Aに搭載するメモリの容量が制限されている場合であっても、第1実施形態によれば、上記(a1)~(a3)のような効果が得られる。
 なお、図1に関しては以上のとおり通信装置100Bから通信装置100Aへのデータの送信のみを説明したが、もちろん、通信装置100Aが通信装置100Bにデータを送信してもよい。以下では、各通信装置がデータを受信する機能とデータを送信する機能の双方を備えるものとして説明する。
 通信装置100Aと100Bの間の双方向の通信のためには、通信装置100Aがさらに、通信装置100Bを識別するための通信装置100BのアドレスAdrと対応づけて通信装置100Bの最新の暗号鍵KB,bを記憶する。また、通信装置100Bは、通信装置100B自身が復号に用いる最新の暗号鍵KB,bを現在鍵として記憶するとともに、現在鍵の1つ前の世代の暗号鍵KB,b-1を旧鍵として記憶する。
 すると、双方向通信が可能となり、また、通信装置100Aから通信装置100Bに送信されたデータに関して、通信装置100Bが必要に応じて再暗号化と旧鍵による再度の復号を行うことも可能となる。よって、通信装置100Aと100Bの双方ともに小容量のメモリしか搭載していない場合であっても、上記(a1)~(a3)の効果が得られる。
 なお、メモリ容量が制限される通信装置の具体例としては、例えば、センサネットワークにおける通信装置が挙げられる。センサネットワークは、適宜の場所に配置された多数のセンサから様々な情報を収集するためのネットワークであり、センサネットワーク内の各ノードは、センサと接続されるか、センサを内蔵する通信装置である。センサは、例えば、画像センサ、温度センサ、湿度センサ、圧力センサ、加速度センサなど、任意の種類のセンサでよい。
 用途によっては、数千個~数十万個のオーダの多数の通信装置を含むセンサネットワークが設計されるかもしれない。そして、現実社会においては、個々の通信装置が高価な場合、非常に多くの通信装置を含むセンサネットワークを構築して運用することは非現実的である。よって、センサネットワーク向けの通信装置は、製造原価が安価であることが好ましい。
 そして、製造原価を抑えるためには、例えば、内蔵メモリの容量を制限することが有効である。なぜなら、内蔵メモリの容量を制限することで、通信装置に用いられる集積回路(Integrated Circuit;IC)の面積を小さくし、1枚の半導体ウェハからより多くのICを製造することができるようになり、ICの単価が下がるからである。
 よって、第1実施形態の通信装置100Aと100Bは、例えばセンサネットワーク内の通信装置など、何らかの理由から内蔵メモリの容量が制限されている場合の通信装置として好適である。もちろん、たとえ豊富なメモリを搭載している通信装置であっても、第1実施形態によるメモリ節約の効果と上記(a1)~(a3)の効果は得られる。
 このように、通信装置100Aと100Bは、様々な環境において利用可能であるが、以下では図2を参照して、環境の例をさらに具体的に説明する。
 図2は、第1実施形態が適用される環境の一例を示すシステム構成図である。第1実施形態は、無線通信ネットワークへの適用に限定されるものではないが、図2の例では、通信装置100Aと100Bは無線通信を行う。
 また、図2には、通信装置100Aおよび100Bと同様の他の通信装置100C~100Lも示されている。図2にはさらに、ゲートウェイ装置120と、サーバ130も図示されている。図2のアドホックネットワーク140は、以上の通信装置100A~100Lとゲートウェイ装置120が自律的に構築するネットワークである。
 図2の例では、アドホックネットワーク140内において通信装置100Aが直接通信可能なのは、通信装置100B~100Iである。つまり、通信装置100Aからのホップ数が1なのは通信装置100B~100Iであり、通信装置100Aから通信装置100J~100Lへのホップ数は2以上である。
 アドホックネットワーク140は、センサネットワークとして利用されてもよい。つまり、通信装置100A~100Lのそれぞれが、センサと接続されるかまたはセンサを内蔵していてもよい。その場合、通信装置100A~100Lのそれぞれは、センサが感知したデータを含むPDUを、アドホックネットワーク140を通じてゲートウェイ装置120に送信する。
 図2の例では、通信装置100Dと100Fと100Iがゲートウェイ装置120と直接通信可能である。よって、通信装置100Aが送信したPDUは、例えば通信装置100Dを介して2ホップでゲートウェイ装置120に到達するかもしれない。他の通信装置100B~100Lが送信したPDUも、アドホックネットワーク140内の適宜の経路を介してゲートウェイ装置120に到達する。
 そして、ゲートウェイ装置120は、サーバ130と接続されているので、各通信装置100A~100Lが送信したPDUは、ゲートウェイ装置120からさらにサーバ130へと転送される。なお、ゲートウェイ装置120はサーバ130と直接的に接続されていてもよいし、ネットワークを介して間接的に接続されていてもよい。また、ゲートウェイ装置120とサーバ130の間の接続は、有線、無線、またはその組み合わせである。
 以上のようにして、サーバ130は、アドホックネットワーク140内の各通信装置100A~100Lから、センサが感知したデータを収集し、分析することができる。例えば、各センサが温度センサの場合、サーバ130は、温度分布や温度変化を調べる処理を行ってもよいし、温度予測処理を行ってもよい。
 そして、図1に例示したように、アドホックネットワーク140内の通信は暗号化され、暗号鍵は適宜の間隔で更新される。具体的には、少なくとも、アドホックネットワーク140内で直接通信することが可能な隣接する2台の装置間では、適宜の間隔で更新される暗号鍵が何らかの方法により共有され、鍵確立が実現される。
 例えば、1ホップで通信可能な通信装置100Aと100Dの間では互いの暗号鍵が共有される。同様に、1ホップで通信可能な通信装置100Dとゲートウェイ装置120の間でも互いの暗号鍵が共有される。よって、通信装置100Aに接続または内蔵されるセンサが感知したデータは、以下のようにして、暗号化された状態で通信装置100Aから通信装置100Dを介してゲートウェイ装置120に到達する。
 なお、アドホックネットワーク140におけるデータ転送経路の決定アルゴリズムは任意であるが、説明の便宜上、次のように仮定する。すなわち、通信装置100Aは、アドホックネットワーク140内の最終的な送信先がゲートウェイ装置120である場合は、隣接する通信装置100B~100Iのうち通信装置100DにPDUを送信することに決定すると仮定する。
 よって、この仮定のもとでは、通信装置100Aは、通信装置100Dのアドレスに対応づけて記憶している通信装置100Dの暗号鍵を用いて、センサが感知したデータを暗号化する。そして、通信装置100Aは、暗号化により得られた暗号文データをペイロードとして含むPDUを生成し、生成したPDUを送信する。
 すると、通信装置100DがPDUを受信する。図1の例と同様にして、通信装置100Dは、現在鍵を用いる復号によりPDUから正しい平文データを得られるかもしれない。あるいは、場合によっては、鍵確立とPDUの送受信のタイミングのずれが原因で、通信装置100Dは、現在鍵を用いる1回目の復号では正しい平文データを得られないかもしれない。しかし、その場合も、通信装置100Dは、現在鍵を用いた再暗号化と旧鍵を用いた再度の復号により、結局は正しい平文データを得ることができる。
 よって、通信装置100Dは、復号により得た平文データを、ゲートウェイ装置120の暗号鍵で暗号化する。そして、通信装置100Dは暗号化により得られた暗号文データをペイロードとして含むPDUを生成し、生成したPDUをゲートウェイ装置120に宛てて送信する。
 すると、ゲートウェイ装置120がPDUを受信する。図1の例と同様にして、ゲートウェイ装置120は、現在鍵を用いる復号によりPDUから正しい平文データを得られるかもしれない。あるいは、場合によっては、鍵確立とPDUの送受信のタイミングのずれが原因で、ゲートウェイ装置120は、現在鍵を用いる1回目の復号では正しい平文データを得られないかもしれない。しかし、その場合も、ゲートウェイ装置120は、現在鍵を用いた再暗号化と旧鍵を用いた再度の復号により、結局は正しい平文データを得ることができる。
 すると、ゲートウェイ装置120は、復号により得た平文データを適宜暗号化し、暗号化により得られた暗号文データをペイロードとして含むPDUを生成し、生成したPDUをサーバ130に送信する。なお、アドホックネットワーク140内で使われる暗号化アルゴリズムと、ゲートウェイ装置120とサーバ130の間で使われる暗号化アルゴリズムは、同じでもよいし異なっていてもよい。
 サーバ130は、ゲートウェイ装置120からPDUを受信し、受信したPDUのペイロードを復号することで、通信装置100Aに接続された(または通信装置100Aに内蔵された)センサが感知したデータである平文データを得ることができる。サーバ130は、同様にして他の通信装置100B~100Lからも、センサが感知したデータを収集することができる。
 なお、上記では主にアドホックネットワーク140がセンサネットワークとして利用される場合を例に説明したが、アドホックネットワーク140はセンサネットワークでなくてもよい。
 さて、続いて、図3~13を参照して、第1実施形態についてさらに詳細に説明してゆく。
 図3は、第1実施形態の通信装置のブロック構成図である。なお、第1実施形態では、通信装置100A~100Lはいずれも図3の通信装置100であり、ゲートウェイ装置120も図3に示す各部を有する。また、図3および後述の図14では、矢印の線が交差している箇所があるが、線の交差は線同士の接続を意味しないので注意されたい。
 図3の通信装置100は、鍵管理部101、鍵記憶部102、指示部103、メモリ104、受信部105、復号部106、判断部107、再暗号化部108、平文処理部109、および配送部110を有する。そして、配送部110は暗号化部111を含み、暗号化部111は鍵認識部112を含む。通信装置100内のこれら各部の詳細は、以下のとおりである。
 鍵管理部101は、通信装置100が復号に用いる暗号鍵を繰り返し生成する。そして、鍵記憶部102は、鍵管理部101が生成した複数の暗号鍵を記憶する第1の記憶部の一例である。
 具体的には、第1実施形態の鍵記憶部102は、図1に示すように現在鍵と旧鍵という2つの暗号鍵を記憶する。しかし、実施形態によっては、鍵記憶部102は、2世代以上前の暗号鍵も含めた3つ以上の暗号鍵を記憶してもよい。また、鍵管理部101は、上記のように暗号鍵を繰り返し生成することで鍵生成部として動作するだけでなく、暗号鍵の生成にともなう旧鍵の更新など、暗号鍵に関するその他の管理も行う。
 また、指示部103は、鍵記憶部102に記憶されている複数の暗号鍵のうちの1つを選択暗号鍵として選択する。つまり、指示部103は、復号または再暗号化に用いる暗号鍵を選択暗号鍵として選択する。なお、選択暗号鍵は状況に応じて異なるが、詳しくは後述する。
 そして、メモリ104は、第2の記憶部の一例である。図3には、メモリ104上に記憶される受信データ114と送信データ115も図示されている。なお、図3では、ヘッダとペイロードを含むPDU全体のデータを、受信データ114および送信データ115として図示している。
 図1の説明から理解されるように、受信データ114のペイロードは、受信された暗号文の状態の場合もあるし、暗号化されたときとは異なる暗号鍵で復号された状態の場合もありうる。さらに、受信データ114のペイロードは、再暗号化された状態の場合もありうるし、暗号化されたときと同じ暗号鍵で復号された正しい平文の状態の場合もある。また、後述するように、送信データ115のペイロードも、平文の状態の場合もあるし、暗号文の状態の場合もある。
 換言すれば、メモリ104は、暗号化データまたは復号データを記憶するデータ記憶部の一例である。また、暗号化データは、換言すれば暗号文データである。復号データは、正しく復号された平文データのこともあるし、暗号化されたときとは異なる暗号鍵で復号されたデータのこともある。
 そして、受信部105は、暗号文データを受信し、受信した暗号文データをメモリ104に格納する。つまり、図3の受信データ114のペイロードは、最初は、受信部105がメモリ104に受信データ114を格納したときの暗号文の状態である。
 また、復号部106は、指示部103が指示する選択暗号鍵を鍵記憶部102から読み出し、メモリ104に受信データ114のペイロードとして記憶されている暗号文データを、選択暗号鍵を用いて復号する。なお、復号の際に、復号部106は、復号により得られる復号データによってメモリ104上の暗号文データを上書きする。その結果、受信データ114のペイロードは、選択暗号鍵で復号された状態となる。図1に関して説明したように、上書きによりメモリ104の効率的な利用が可能となる。
 判断部107は、受信データ114のペイロードとしてメモリ104上に記憶されている復号データに含まれる第1の部分から、第1の部分の特徴を示す特徴値を算出する。そして、算出した特徴値と復号データに含まれる第2の部分が整合すれば、判断部107は、復号データが正常な平文データだと判断する。逆に、算出した特徴値と復号データに含まれる第2の部分が整合しなければ、判断部107は、復号データが異常だと判断する。
 そして、再暗号化部108は、復号データが異常だと判断部107が判断したとき、指示部103が指示する選択暗号鍵を鍵記憶部102から読み出し、選択暗号鍵を用いてメモリ104上の復号データを暗号化する。このように、再暗号化部108は、復号データを暗号化する暗号化部の具体例である。
 なお、暗号化の際、再暗号化部108は、暗号化により再度得られる暗号文データによってメモリ104上の復号データを上書きする。その結果、受信データ114のペイロードは元の暗号文に戻る。図1に関して説明したように、上書きによりメモリ104の効率的な利用が可能となる。
 ところで、上記のように選択暗号鍵は状況に応じて異なる。
 例えば、受信部105が暗号文データを受信したときは、指示部103は、鍵管理部101が生成した最新の暗号鍵である現在鍵を選択暗号鍵として選択する。また、受信部105は、受信データ114のペイロードの復号を復号部106に命令する。よって、この場合、復号部106は、受信データ114のペイロードとして記憶されている暗号文データを、現在鍵を使って復号する。
 他方、復号データが異常だと判断部107が判断したときは、指示部103は、現在選択している選択暗号鍵とは異なる暗号鍵を選択暗号鍵として選択しなおす。なお、第1実施形態では、復号データが異常だと判断されるのは、具体的には選択暗号鍵が現在鍵の場合である。よって、指示部103が選択暗号鍵として選択しなおす暗号鍵は、具体的には旧鍵である。
 また、復号データが異常だと判断部107が判断したときに指示部103が選択暗号鍵を選択しなおすタイミングは、より正確には、判断部107の判断にしたがって再暗号化部108がメモリ104上の復号データを暗号文データによって上書きした後である。そして、選択暗号鍵を選択しなおすと、指示部103は、受信データ114のペイロードを復号するよう復号部106に命令する。よって、この場合、復号部106は、受信データ114のペイロードとして記憶されている暗号文データを、旧鍵で復号する。
 ここで、図1の通信装置100Aの例を参照しながら、図3の各部の具体的動作の例をさらに詳細に説明する。
 図1の例では、通信装置100Aの鍵管理部101は、暗号鍵KA,a-1、KA,a、KA,a+1などを生成する。鍵記憶部102は、時刻TA101から時刻TA104の直前までは現在鍵KA,aと旧鍵KA,a-1を記憶する。また、時刻TA104以降、鍵管理部101が次に暗号鍵の更新を行うまでは、鍵記憶部102は、現在鍵KA,a+1と旧鍵KA,aを記憶する。
 そして、時刻TA102で通信装置100Aの受信部105が暗号文データC101を受信したときは、指示部103は、最新の暗号鍵である現在鍵KA,aを選択暗号鍵として選択する。よって、メモリ104上に受信データ114のペイロードとして記憶されている暗号文データC101は、時刻TA103において復号部106により復号され、平文データP101で上書きされる。
 この場合、判断部107は、平文データP101の特徴値から、平文データP101が正常だと判断する。通信装置100Aの平文処理部109は、正常な平文データP101について実施形態に応じた適宜の処理を行う。
 また、時刻TA105で通信装置100Aの受信部105が暗号文データC102を受信したときは、指示部103は、現在鍵KA,a+1を選択暗号鍵として選択する。よって、メモリ104上に受信データ114のペイロードとして記憶されている暗号文データC102は、時刻TA106において復号部106により復号され、復号データD102で上書きされる。
 この場合、判断部107は、復号データD102の特徴値から、復号データD102が正常な平文データではない(すなわち復号データD102が異常である)と判断する。そこで、判断部107による判断にしたがい、時刻TA107において再暗号化部108が、選択暗号鍵として選択されている現在鍵KA,a+1を用いて復号データD102を暗号化する。その結果、メモリ104上の受信データ114のペイロードとして記憶されていた復号データD102は、暗号文データC102で上書きされる。
 さらに、再暗号化後の時刻TA108では、指示部103が、選択暗号鍵として現在選択している現在鍵KA,a+1とは異なる旧鍵KA,aを選択暗号鍵として選択しなおし、暗号文データC102を復号するよう復号部106に命令する。すると、メモリ104上に受信データ114のペイロードとして記憶されている暗号文データC102は、復号部106により復号され、平文データP102で上書きされる。
 この場合、判断部107は、平文データP102の特徴値から、平文データP102が正常だと判断する。そして、平文処理部109が平文データP102に対して適宜の処理を行う。
 ところで、以上説明したような、図3の通信装置100自身が復号に用いる暗号鍵の管理と、他の通信装置100からのデータの受信を契機とする処理のほかに、通信装置100は、データの送信も行うことができる。以下では、送信に関わる各部の詳細について、図1の通信装置100Bの例を参照しながら具体的に説明する。
 平文処理部109は、ペイロードが上記のように正しい平文データに復号された受信データ114を処理するだけでなく、他の通信装置100に送信する対象のデータとして平文の送信データ115をメモリ104上に生成してもよい。例えば、図1の通信装置100Bの平文処理部109は、時刻TB102において、平文データP101とヘッダを生成し、平文データP101とヘッダを含むPDUを送信データ115としてメモリ104に格納し、PDUを暗号化するよう暗号化部111に命令する。
 すると、時刻TB103で暗号化部111は、メモリ104上に送信データ115のペイロードとして記憶されている平文データP101を暗号化する。具体的には、暗号化部111内の鍵認識部112は、暗号化に用いる暗号鍵KA,aを認識することができるので、暗号化部111は、鍵認識部112が認識した暗号鍵KA,aを用いて平文データP101を暗号化する。
 例えば、平文処理部109が平文データP101の送信先である通信装置100AのアドレスAdrを明示的に暗号化部111に通知することにより、暗号化部111は送信先のアドレスAdrを認識することもできる。あるいは、暗号化部111がメモリ104上のヘッダから送信先の通信装置100AのアドレスAdrを読み取ってもよい。
 すると、暗号化部111内の鍵認識部112は、暗号化部111が送信先のアドレスとして認識したアドレスAdrから、アドレスAdr宛てに送信する送信データ115のペイロードの暗号化に用いる暗号鍵を認識することができる。図1Aの例では、鍵認識部112は、時刻TB103においては、「アドレスAdr宛てに送信する送信データ115のペイロードの暗号化に用いる暗号鍵は、暗号鍵KA,aである」と認識する。よって、暗号化部111は、送信データ115のペイロードとして記憶されている平文データP101を、暗号鍵KA,aを用いて暗号化する。
 その際、復号部106による復号や再暗号化部108による再暗号化と同様に、暗号化部111もメモリ104上の同一記憶領域への上書きを行う。つまり、暗号化部111は、送信データ115のペイロードとしてメモリ104上に記憶されている平文データP101を暗号化し、暗号化により得られる暗号文データC101によって平文データP101を上書きする。このような上書きにより、送信時においても、メモリ104の効率的な利用が可能となる。
 暗号化部111は、暗号化処理を終えると、送信データ115を送信するよう送信部113に命令する。例えば、時刻TB104では、送信部113が暗号化部111からの命令にしたがってメモリ104から送信データ115(すなわち暗号文データC101を含むPDUのデータ)を読み出す。そして、送信部113は、PDUを通信装置100Aに宛てて送信する。
 以上のように動作する配送部110内の暗号化部111と送信部113により、メモリ104上に記憶される送信データ115は、ペイロードが暗号化された状態で送信先の他の通信装置100へと配送される。
 続いて、図3の各部を実現するハードウェアの具体例について、図4を参照して説明する。図4は、第1実施形態の通信装置のハードウェア構成の例を示す図である。
 図4に示すように、通信装置100は、MicroProcessing Unit(MPU)201を有する。また、通信装置100は、有線物理層処理部202または無線処理部203の少なくとも一方を有する。通信装置100はさらに、タイマIC204と耐タンパ性Peripheral Interface Controllerマイクロコンピュータ(PICマイコン)205を有してもよい。また、通信装置100は、Dynamic Random Access Memory(DRAM)206とフラッシュメモリ207を有する。
 MPU201と有線処理部202の間の接続インタフェースは、例えば、Media Independent Interface(MII)またはManagement Data Input/Output(MDIO)である(以下「MII/MDIO208」と表記する)。MIIとMDIOはいずれも、物理層とMAC副層との間のインタフェースである。
 また、タイマIC204と耐タンパ性PICマイコン205は、Inter-Integrated Circuit(IC)バスまたはParallel Input/Output(PIO)バス(以下「IC/PIOバス209」と表記する)によりMPU201と接続されている。そして、無線処理部203とDRAM206とフラッシュメモリ207は、Peripheral Component Interconnect(PCI)バス210によりMPU201と接続されている。
 通信装置100において、MPU201は、不揮発性記憶装置の1種であるフラッシュメモリ207上に格納されたファームウェアなどの種々のプログラムを、DRAM206上にロードして実行することで、様々な処理を行う。MPU201が実行するプログラムの例は、例えば、耐タンパ性PICマイコン205のドライバ、後述の図7の処理のためのプログラム、後述の図10または図12の処理のためのプログラムなどである。
 有線処理部202は、ケーブルを接続する物理ポートおよび有線接続における物理層の処理を行う回路を含むハードウェアである。また、無線処理部203は、無線接続における物理層とMAC副層の処理を行うハードウェアであり、例えば、アンテナ、アナログ・ディジタル変換器、ディジタル・アナログ変換器、変調器、復調器などを含む。
 タイマIC204は、設定された時間が経過するまでカウントアップ動作を行い、設定された時間が経過すると割り込み信号を出力する回路である。また、耐タンパ性PICマイコン205は、所定のアルゴリズムが組み込まれたマイコンである。当該所定のアルゴリズムは、耐タンパ性PICマイコン205が耐タンパ性を有するので、外部から解析することができない。
 DRAM206は各種のデータを記憶し、フラッシュメモリ207は上記のとおり、ファームウェアプログラムなどを記憶する。フラッシュメモリ207は、通信装置100自身のIdentification(ID)やMACアドレスなど、通信装置100自身に固有の情報をさらに記憶していてもよい。また、実施形態に応じて通信装置100は、フラッシュメモリ207の代わりに、あるいはフラッシュメモリ207とともに、Read Only Memory(ROM)またはハードディスク装置などの他の不揮発性記憶装置を有していてもよい。
 また、プログラムは、フラッシュメモリ207またはその他の不揮発性記憶装置に予めインストールされていてもよい。あるいは、プログラムは、アドホックネットワーク140などのネットワークからダウンロードされて、フラッシュメモリ207またはその他の不揮発性記憶装置に格納されてもよい。
 もちろん、実施形態によっては、通信装置100がさらに、コンピュータ読み取り可能な記憶媒体の駆動装置を有してもよい。その場合、プログラムは、記憶媒体からフラッシュメモリ207またはその他の不揮発性記憶装置へとコピーされてもよい。記憶媒体としては、半導体メモリカード、Compact Disc(CD)やDigital Versatile Disk(DVD)などの光ディスク、光磁気ディスク、磁気ディスクなどが利用可能である。
 図4を参照して以上説明したような各種ハードウェアにより、図3の各部が実現される。
 例えば、図3の鍵管理部101は、通信装置100自身が復号に用いる暗号鍵を生成し、鍵記憶部102の記憶内容を更新するアルゴリズムが組み込まれた耐タンパ性PICマイコン205と、暗号鍵を更新する間隔が設定されたタイマIC204により実現されてもよい。あるいは、鍵管理部101は、通信装置100自身が復号に用いる暗号鍵を生成し、鍵記憶部102の記憶内容を更新するためのプログラムを実行するMPU201と、暗号鍵を更新する間隔が設定されたタイマIC204により実現されてもよい。もちろん、MPU201は、タイマIC204からの信号によってではなく、内部クロックによって時刻を認識し、暗号鍵を更新するタイミングを認識してもよい。
 なお、通信装置100自身が復号に用いる暗号鍵は、通信装置100が送信するデータの内容や応用分野に応じて、通信装置100ごとに異なる通信装置100に固有の暗号鍵の場合もあるし、複数の通信装置100間で共通の暗号鍵の場合もある。第1実施形態はどちらの場合にも適用可能である。
 また、鍵記憶部102は、耐タンパ性PICマイコン205内のRAMにより実現されてもよいし、DRAM206により実現されてもよい。あるいは、不図示の他の耐タンパ性メモリを通信装置100がさらに備え、当該耐タンパ性メモリが鍵記憶部102を実現してもよい。
 そして、指示部103と復号部106と判断部107と再暗号化部108と平文処理部109は、プログラムを実行するMPU201により実現される。もちろん、MPU201の代わりに各部を実現する専用のハードウェア回路が使われてもよい。例えば、復号部106は専用の復号回路により実現されてもよいし、再暗号化部108は専用の暗号化回路により実現されてもよい。
 また、メモリ104は、DRAM206により実現される。そして、受信部105と送信部113は、有線処理部202または無線処理部203の少なくとも一方と、プログラムを実行するMPU201により実現される。
 暗号化部111は、例えば、送信データ115のペイロードを暗号化するためのプログラムを実行するMPU201または専用の暗号化回路を含む。そして、暗号化部111内の鍵認識部112は、以下のようなハードウェアにより実現されてもよい。
 例えば、鍵認識部112は、他の通信装置100が復号に用いる暗号鍵を生成して管理するためのプログラムを実行するMPU201と、他の通信装置100が復号に用いる暗号鍵を更新する間隔が設定されたタイマIC204を含んでもよい。もちろん、他の通信装置100が復号に用いる暗号鍵を生成して管理するハードウェアは、MPU201ではなく耐タンパ性PICマイコン205でもよい。
 または、鍵認識部112は、他の通信装置100から暗号鍵の通知を受信する有線処理部202または無線処理部203を含んでもよい。その場合、鍵認識部112は、受信した通知から他の通信装置100が復号に用いる暗号鍵を認識し、他の通信装置100が復号に用いる暗号鍵に関する記憶内容の更新を行うためのプログラムを実行するMPU201を含む。
 なお、他の通信装置100が復号に用いる暗号鍵は、当該他の通信装置100に固有の暗号鍵の場合もあるし、複数の通信装置100間で共通の暗号鍵の場合もある。第1実施形態はどちらの場合にも適用可能である。
 さらに、鍵認識部112は、他の通信装置100が復号に用いる暗号鍵を記憶するハードウェアとして、DRAM206または耐タンパ性PICマイコン205内のRAMを含む。あるいは、不図示の他の耐タンパ性メモリを通信装置100がさらに備え、当該耐タンパ性メモリが、他の通信装置100が復号に用いる暗号鍵を記憶するハードウェアとして使われてもよい。
 以上、図4と図3を比較しながら説明したように、通信装置100は実施形態に応じて適宜のハードウェアにより実現することができる。続いて、通信装置100が用いるデータについて、図5~6を参照して説明し、その後、図7~13を参照して通信装置100が行う処理について説明する。
 図5は、第1実施形態の通信装置が記憶するデータの一例を示す図である。具体的には、図5には、図1の通信装置100Aの鍵記憶部102と鍵認識部112が記憶するデータが例示されている。
 図5に示す鍵記憶部102は、鍵管理部101が生成した最新の第a世代の暗号鍵KA,aを現在鍵として記憶し、鍵管理部101が以前に生成した第(a-1)世代の暗号鍵KA,a-1を旧鍵として記憶する。つまり、図5は、図1の時刻TA101以降、時刻TA104の直前までの期間の鍵記憶部102の状態を示す。なお、上記のとおり、鍵管理部101は暗号鍵を繰り返し生成し、鍵記憶部102の記憶内容を更新する。
 また、図5に示す鍵認識部112は、通信装置100Aとの間で鍵が確立している他の通信装置100の暗号鍵を、アドレスと対応づけて記憶する。図5の例は、具体的には、図2の通信装置100B、100C、100Dなどが復号に用いる暗号鍵を通信装置100Aの鍵認識部112が認識している場合の例である。
 この場合、通信装置100Aの鍵認識部112は、通信装置100BのアドレスAdrと対応づけて通信装置100Bの最新の暗号鍵KB,bを記憶する。同様に、鍵認識部112は、通信装置100CのアドレスAdrと対応づけて通信装置100Cの最新の暗号鍵KC,cを記憶し、通信装置100DのアドレスAdrと対応づけて通信装置100Dの最新の暗号鍵KD,dを記憶する。もちろん、通信装置100Aの鍵認識部112は、さらに別の通信装置100についても、アドレスと暗号鍵の組を記憶していてもよい。
 なお、通信装置100Aの鍵認識部112が、他の通信装置100B、100C、100Dなどの最新の暗号鍵を認識する方法は任意である。
 例えば、通信装置100Bが新たな暗号鍵KB,b+1を通信装置100Aに通知してもよい。その場合、通信装置100Aの鍵認識部112は、通信装置100Bからの通知により通信装置100Bの暗号鍵の更新を認識し、アドレスAdrに対応する暗号鍵を現在の第b世代の暗号鍵KB,bから新たな第(b+1)世代の暗号鍵KB,b+1に更新する。
 あるいは、通信装置100Aの鍵認識部112は、通信装置100Bと通信することなく、例えば時刻の経過にしたがって、通信装置100Bの暗号鍵KB,bの更新のタイミングを認識してもよい。その場合、通信装置100Aの鍵認識部112は、通信装置100Bの暗号鍵KB,bの更新のタイミングを認識すると、新たな暗号鍵KB,b+1を生成し、アドレスAdrに対応する暗号鍵を現在の暗号鍵KB,bから新たな暗号鍵KB,b+1に更新する。
 以上のように、鍵認識部112は、送信先の他の通信装置100のアドレスと対応づけて当該他の通信装置100の暗号鍵を記憶し、暗号鍵の更新を適宜のタイミングで行う。
 なお、各通信装置100が復号に用いる暗号鍵が異なる場合は、鍵認識部112は、図5に示すように、個々の通信装置100を識別するアドレスと対応づけて暗号鍵を記憶する。しかし、実施形態によっては、複数の通信装置100が復号に用いる暗号鍵が共通であってもよい。例えば、アドホックネットワーク140内のすべての通信装置100が共通の暗号鍵を用いる実施形態も可能である。その場合、鍵認識部112は、単に鍵記憶部102に記憶されている現在鍵を、送信データ115の暗号化用の暗号鍵として認識すればよく、図5のようにアドレス別に暗号鍵を記憶する必要はない。
 さて、図6は、第1実施形態において送受信されるデータの形式を説明する図である。以下では説明の便宜上、図1の例と同様に、通信装置100Bが通信装置100Aにデータを送信する場合を具体例として挙げながら図6について説明する。
 通信装置100Bの平文処理部109は、平文のボディ301を生成し、通信プロトコルに応じたヘッダ302を生成し、ボディ301から特徴値303を計算する。そして、平文処理部109は、ヘッダ302とボディ301と特徴値303を含む平文PDU304をメモリ104に格納する。平文PDU304のペイロードは、ボディ301と特徴値303の部分である。
 なお、特徴値303は、ボディ301の特徴を示す値であればよい。また、図6では説明の簡単化のためボディ301の末尾にまとめて特徴値303のデータが付加されているが、特徴値303のデータがボディ301内の複数箇所に分散して挿入されていてもよい。
 例えば、平文処理部109は、ボディ301の全部または一部から、ハッシュ関数により特徴値303を算出してもよい。つまり、特徴値303はハッシュ値でもよい。特徴値303の算出のためのハッシュ関数としては、例えば、メッセージ・ダイジェストまたはメッセージ完全性符号(Message Integrity Code;MIC)の生成のために利用される任意のハッシュ関数が利用可能である。また、特徴値303は、ハッシュ値を固定の暗号鍵で暗号化することで得られる値でもよい。
 あるいは、平文処理部109は、ボディ301の全部または一部に対する誤り検出符号を特徴値303として算出してもよい。例えば、パリティ、チェックサム、Cyclic Redundancy Check(CRC)などの誤り検出符号が特徴値303として利用可能である。また、誤り検出符号の中には誤り訂正符号も含まれるが、例えばハミング符号やリード・ソロモン符号などの誤り訂正符号も利用可能である。その場合、ボディ301が情報ビットに相当し、特徴値303は、情報ビットから算出される符号ビットに相当する。
 さて、平文処理部109は、特徴値303を含む平文PDU304をメモリ104に格納すると、図3の送信データ115に相当する平文PDU304に関して、ペイロードを暗号化するよう暗号化部111に命令する。その結果、平文のボディ301は暗号化されたボディ305に置き換わり、平文の特徴値303は暗号化された特徴値306に置き換わる。つまり、メモリ104上には、ヘッダ302と暗号化されたボディ305と暗号化された特徴値306を含む暗号文PDU307が送信データ115として記憶される。
 そして、通信装置100Bの送信部113は、暗号文PDU307を通信装置100Aに送信する。例えば、図1の暗号文データC101は、暗号文PDU307のペイロードの一例であり、暗号化されたボディ305と暗号化された特徴値306を含む。
 通信装置100Bから送信された暗号文PDU307は、通信装置100Aの受信部105において受信され、メモリ104上に格納される。すると、復号部106が現在鍵を用いて暗号文PDU307のペイロード(すなわち暗号化されたボディ305と暗号化された特徴値306)を復号する。
 その結果、メモリ104には、ヘッダ302と復号されたボディ308と復号された特徴値309を含む復号PDU310が記憶された状態となる。そこで、判断部107は、復号されたボディ308をメモリ104から読み出し、復号されたボディ308から特徴値311を算出する。なお、復号されたボディ308から判断部107が特徴値311を算出するアルゴリズムは、ボディ301から平文処理部109が特徴値303を算出するアルゴリズムと同じである。
 そして、判断部107は、算出した特徴値311を、復号された特徴値309と比較する。もし、算出した特徴値311と復号された特徴値309が一致すれば、判断部107は、「復号PDU310のペイロードは正常な平文データである」と判断する。
 逆に、算出した特徴値311と復号された特徴値309が一致しなければ、判断部107は、「復号PDU310のペイロードは異常である」と判断する。換言すれば、判断部107は、「暗号文PDU307の暗号化に使われたのは現在鍵ではなく旧鍵だった」と推測する。
 そこで、判断部107は、復号PDU310のペイロードを暗号化するよう再暗号化部108に命令する。すると、再暗号化部108は、現在鍵で復号PDU310のペイロードを暗号化し、メモリ104上に暗号文PDU307を復元する。なお、再暗号化部108は、暗号化の処理が終了すると、暗号化の終了を指示部103に通知する。
 よって、指示部103は、再暗号化部108からの通知を契機として選択暗号鍵を現在鍵から旧鍵に切り換え、暗号文PDU307のペイロードを復号するよう復号部106に命令する。復号部106による復号の後は、上記と同様にして再度判断部107による判断が行われ、正常な平文データが得られていれば、平文処理部109が正常な平文データを処理する。
 さて、続いて図7~13を参照して、以上説明した通信装置100の動作についてさらに詳しく説明する。
 図7は、第1実施形態の通信装置がデータの受信を契機として行う受信処理のフローチャートである。なお、受信部105は、PDUを受信すると、受信したPDUのデータをメモリ104に受信データ114として格納するので、図7の受信処理が開始される時点で、メモリ104には受信データ114が記憶されている。
 また、通信プロトコルによっては、他の通信装置100宛のPDUが物理的に受信されることもあるが、その場合、受信部105は、図7の受信処理を開始する前に、受信したPDUのヘッダから、宛先が通信装置100自身であるか否かを判断する。そして、受信部105は、宛先が通信装置100自身ではない場合は受信データ114を破棄し、宛先が通信装置100自身の場合に図7の受信処理を開始する。
 ステップS101で受信部105は、受信データ114として記憶したPDUが、固定されていない暗号鍵により暗号化される種類のPDUであるか否かを、ヘッダから判断する。
 受信したPDUが、固定されていない暗号鍵により暗号化される種類のPDUである場合、受信部105は、受信データ114のペイロードを復号するよう復号部106に命令し、処理はステップS102に移行する。また、受信したPDUが他の種類のPDUである場合、処理はステップS113に移行する。
 なお、第1実施形態は、ヘッダにPDUの種類を示すフィールドがある例である。しかし、例えば、すべての種類のPDUが、固定されていない暗号鍵により暗号化されるような実施形態においては、ステップS101と後述のステップS113は省略可能である。
 ステップS102で復号部106は、受信部105からの命令にしたがい、受信データ114のペイロードを復号する。具体的には、復号部106は、どの暗号鍵が選択暗号鍵であるかという情報を指示部103から得て、選択暗号鍵を鍵記憶部102から読み出し、選択暗号鍵を用いて受信データ114のペイロードを復号する。
 なお、指示部103は、通信装置100に電源が入れられた初期状態では、選択暗号鍵として現在鍵を選択する。また、図7の処理はPDUの受信のたびに行われるが、ステップS105とS111に関して後述するとおり、指示部103は、図7の処理を終了する時点では、デフォルトの選択暗号鍵である現在鍵を選択暗号鍵として選択している。よって、ステップS102の時点では、選択暗号鍵は現在鍵である。
 したがって、ステップS102において復号部106は、まず指示部103から「選択暗号鍵は現在鍵である」という情報を得て、鍵記憶部102から現在鍵を読み出し、現在鍵を用いて受信データ114のペイロードを復号する。なお、復号部106は、ステップS102における復号の際に、上記のとおり、受信データ114のペイロードの暗号文を、復号したデータで上書きする。このような上書きにより、余計な記憶領域の消費が抑制される。
 復号部106は、復号を終えると、復号の完了を判断部107に通知する。そして、処理はステップS103に移行する。
 ステップS103では、復号部106からの通知を受けた判断部107が、復号部106が復号したデータから特徴値を取り出す。つまり、判断部107は、メモリ104から図6の復号された特徴値309を読み出す。
 そして、次のステップS104で判断部107は、復号部106が復号したデータのボディから特徴値を計算する。つまり、判断部107は、メモリ104から図6の復号されたボディ308を読み出し、復号されたボディ308から所定のアルゴリズムにしたがって特徴値311を計算する。なお、ステップS103とステップS104は、逆順に実行されてもよいし、並行して実行されてもよい。
 続いて、ステップS105で判断部107は、取り出した特徴値と計算した特徴値が一致するか否かを判断する。
 2つの特徴値が一致する場合、判断部107は、「ステップS102で復号されてメモリ104上に記憶されている受信データ114のペイロードは、正常な平文データである」と判断する。この場合、判断部107は、メモリ104上の受信データ114の処理を行うよう平文処理部109に命令する。
 2つの特徴値が一致する場合はさらに、判断部107が、次のPDUの受信に備えて選択暗号鍵をリセットするよう、指示部103に命令してもよい。そして、指示部103はデフォルトの選択暗号鍵である現在鍵を改めて選択暗号鍵として選択しなおしてもよい。もちろん、ステップS105の時点での選択暗号鍵は現在鍵なので、このような明示的な選択暗号鍵のリセットは省略可能である。そして、2つの特徴値が一致する場合、処理はステップS106に移行する。
 他方、2つの特徴値が一致しない場合、判断部107は、「ステップS102で復号されてメモリ104上に記憶されている受信データ114のペイロードは、異常である」と判断する。この場合、判断部107は、メモリ104上の受信データ114のペイロードを再暗号化して受信データ114を元の状態に戻すよう、再暗号化部108に命令する。つまり、判断部107は、再暗号化部108に対して、選択暗号鍵に基づいて復号部106が復号した復号データをメモリ104から読み出して、復号データを選択暗号鍵に基づいて暗号化した暗号化データをメモリ104に上書きするように、命令を出す。そして、処理はステップS107に移行する。
 ステップS106で平文処理部109は、復号部106が復号したPDUを処理する。つまり、平文処理部109は、ペイロードが正常な平文に復号されて受信データ114としてメモリ104に記憶されているデータを読み出し、適宜の処理を行う。そして、図7の処理は終了する。
 なお、ステップS106における処理の種類は実施形態に応じて任意であるが、例えば、センサネットワークとして使われるアドホックネットワーク140内のノードとして通信装置100が使われる場合は、平文処理部109は、次のような処理を行ってもよい。
 例えば、図2の通信装置100Aが通信装置100EからPDUを受信したとする。また、実施形態に応じた適宜のアルゴリズムにより、通信装置100Aは経路に関して次のように認識しているとする。すなわち、通信装置100Aは、「アドホックネットワーク140内での最終的な宛先がゲートウェイ装置120であるPDUを受信したら、受信したPDUを通信装置100Dに転送するのが適切である」と認識しているとする。
 この場合、通信装置100Aの平文処理部109は、通信装置100Eまたは不図示の他の通信装置100がセンサから得たデータを含む受信データ114のペイロードを、送信データ115のペイロードとして用いることを決定する。例えば、平文処理部109は、転送先の通信装置100DのアドレスAdrを受信データ114のヘッダに上書きすることで、受信データ114の記憶領域に上書きして送信データ115を生成してもよい。送信データ115の用意が整うと、平文処理部109は、送信データ115を暗号化するよう暗号化部111に命令する。
 すると、転送先の通信装置100DのアドレスAdrと対応づけて鍵認識部112が認識している暗号鍵KD,dを用いて、暗号化部111が送信データ115を暗号化し、送信部113が送信データ115を送信する。その結果、通信装置100Eまたは不図示の他の通信装置100がセンサから得たデータを含むPDUは、通信装置100Aから通信装置100Dへと転送される。
 もちろん、実施形態によっては、上記のような転送処理以外の処理がステップS106で行われてもよい。例えば、受信データ114や送信データ115がデータリンク層のPDUのデータである場合、平文処理部109は、ネットワーク層より上層のレイヤのプロトコルにしたがったデータ処理を行ってもよい。あるいは、受信データ114や送信データ115がネットワーク層のPDUのデータである場合、平文処理部109は、トランスポート層より上層のレイヤのプロトコルにしたがったデータ処理を行ってもよい。
 さて、ステップS107では、復号部106が復号したデータを再暗号化部108が現在鍵で再暗号化する。具体的には、再暗号化部108は、まず指示部103から「選択暗号鍵は現在鍵である」という情報を得る。そして、再暗号化部108は、鍵記憶部102から現在鍵を読み出し、現在鍵を用いて受信データ114のペイロードを暗号化する。
 なお、再暗号化部108は、ステップS107における暗号化の際に、上記のとおり、受信データ114のペイロードを、暗号化したデータで上書きする。このような上書きにより、余計な記憶領域の消費が抑制される。
 そして、再暗号化部108は、暗号化を終えると、暗号化の終了を指示部103に通知する。すると、指示部103は、現在選択している選択暗号鍵とは異なる暗号鍵である旧鍵を選択暗号鍵として選択しなおし、受信データ114のペイロードを復号するよう復号部106に命令する。
 続いて、ステップS108で復号部106は、再暗号化部108が再暗号化したデータを旧鍵で復号する。具体的には、復号部106は、まず指示部103から「選択暗号鍵は旧鍵である」という情報を得る。そして、復号部106は、鍵記憶部102から旧鍵を読み出し、旧鍵を用いて受信データ114のペイロードを復号する。
 なお、復号部106は、ステップS108における復号の際にも、ステップS102と同様に、受信データ114のペイロードの暗号文を、復号したデータで上書きする。このような上書きにより、余計な記憶領域の消費が抑制される。
 そして、復号部106は、復号を終えると、復号の完了を判断部107に通知する。すると、処理はステップS109に移行する。
 ステップS109で判断部107は、ステップS103と同様に、復号部106が復号したデータから特徴値を取り出す。
 また、次のステップS110で判断部107は、ステップS104と同様に、復号部106が復号したデータのボディから特徴値を計算する。なお、ステップS109とS110は、逆順に実行されてもよいし、並行して実行されてもよい。
 続いて、ステップS111で判断部107は、取り出した特徴値と計算した特徴値が一致するか否かを判断する。
 2つの特徴値が一致する場合、判断部107は、「ステップS108で復号されてメモリ104上に記憶されている受信データ114のペイロードは、正常な平文データである」と判断する。この場合、判断部107は、メモリ104上の受信データ114の処理を行うよう平文処理部109に命令する。
 2つの特徴値が一致する場合はさらに、判断部107が、次のPDUの受信に備えて選択暗号鍵をリセットするよう、指示部103に命令する。すると、指示部103は、選択暗号鍵として現在鍵を選択しなおす。よって、次のPDUが受信されて再度図7の処理が開始される時点での選択暗号鍵は、現在鍵となる。以上のように平文処理部109への命令と選択暗号鍵の切り換えが行われると、処理はステップS106に移行する。
 他方、2つの特徴値が一致しない場合、判断部107は、「ステップS108で復号されてメモリ104上に記憶されている受信データ114のペイロードは、異常である」と判断する。ステップS111において2つの特徴値が一致しない場合とは、受信したPDUのペイロードを現在鍵で復号しても旧鍵で復号しても正しい平文データが得られないという場合である。よって、この場合、判断部107は、「何らかのエラーが生じた」と判断する。
 また、第1実施形態では、鍵記憶部102は現在鍵と旧鍵という2つの世代の暗号鍵のみを保持しているので、試す対象となる他の世代の暗号鍵は、これ以上は存在しない。そこで、2つの特徴値が一致しない場合も、判断部107は、次のPDUの受信に備えて選択暗号鍵をリセットするよう、指示部103に命令する。すると、指示部103は、選択暗号鍵として現在鍵を選択しなおす。よって、次のPDUが受信されて再度図7の処理が開始される時点での選択暗号鍵は、現在鍵となる。以上のようにエラー発生の認識と選択暗号鍵の切り換えが行われると、処理はステップS112に移行する。
 なお、判断部107は、「再暗号化部108への再暗号化の命令を発した後、初めて復号部106から復号の終了を通知された場合は、旧鍵による復号の結果を検証する場合である」と認識することができる。逆に、判断部107は、「再暗号化部108への再暗号化の命令を発した後の初めての復号の終了の通知でなければ、現在鍵による復号の結果を検証する場合である」と認識することができる。
 よって、判断部107は、選択暗号鍵がいずれの暗号鍵であるのかという情報を指示部103から明示的に得なくても、適正にふるまうことができる。つまり、判断部107は、受信データ114のペイロードを再暗号化するよう再暗号化部108に命令すればよいか、それともエラー発生を認識すればよいかを、指示部103からの明示的な情報なしに認識することができる。もちろん、判断部107は、選択暗号鍵がいずれの暗号鍵であるのかという情報を指示部103から明示的に得てもよい。
 ステップS112では、判断部107が適宜のエラー処理を行う。あるいは、判断部107は不図示のエラー処理部に対してエラー処理を行うよう命令してもよい。エラー処理の具体的内容は任意である。例えば、エラー処理は、単に受信データ114の記憶領域を解放する処理でもよいし、送信元の他の通信装置100に対してPDUの再送を要求する処理でもよい。エラー処理の実行後、図7の処理も終了する。
 ところで、ステップS101において、「受信したPDUは、固定されていない暗号鍵により暗号化される種類のPDUではない」と受信部105が判断した場合、ステップS113では、受信したPDUの種類に応じた適宜の処理が行われる。
 なお、ステップS113における処理の主体、処理の内容、およびPDUの種類は実施形態に応じて任意である。例えば、固定された暗号鍵により暗号化される制御用PDUが受信された場合、不図示の制御用PDU処理部がステップS113の処理を行ってもよい。例えば、時刻同期用のPDUは、アドホックネットワーク140内で固定された暗号鍵によって暗号化されているかもしれない。その場合、ステップS113では時刻同期処理が行われてもよい。あるいは、まったく暗号化されずに送信されるPDUが受信された場合、平文処理部109がステップS113の処理を行ってもよい。いずれにしろ、PDUの種類に応じた適宜の処理が行われ、図7の処理も終了する。
 続いて、図8と9を参照して、メモリの節約についてより詳しく説明する。
 図8は、第1実施形態におけるメモリ上のデータの変遷の例を模式的に説明する図である。また、図9は、比較例におけるメモリ上のデータの変遷の例を模式的に説明する図である。
 なお、図8と図9において、黒い背景は暗号文を示し、実線の枠のついた白い背景は正しい平文を示す。また、破線の枠のついた白い背景は、暗号化されたときとは異なる暗号鍵により復号された結果として得られる異常なデータを示す。
 さて、通信装置100が用いる暗号の種類は、対称鍵暗号である。また、通信装置100が用いる暗号の種類を別の観点から述べれば、通信装置100は、ストリーム暗号を使ってもよいし、ブロック暗号を使ってもよい。
 すなわち、暗号化および復号の対象となるデータ単位の長さが平文と暗号文の間で等しく、データ単位の並び順が平文と暗号文の間で変わらなければ、どのような種類の暗号でも各実施形態において利用可能である。ストリーム暗号の場合は、暗号化および復号の対象となるデータ単位は1ビットあるいは1バイトである。ブロック暗号の場合は、暗号化および復号の対象となるデータ単位はブロックである。以下では説明の便宜上、ストリーム暗号が使われる場合について主に説明する。
 また、以下では“0x”という接頭辞が16進数を示すものとする。そして、4バイトのペイロードを含むPDUが受信された場合を例にして、図8を参照してステップS102とS107とS108におけるメモリ104上の領域の上書きについて説明する。なお、図8と図9では、復号と暗号化の進捗の様子が、4ビット分の処理が終わるごとの状態により模式的に示されている。
 例えば、図8の時刻TA201において、受信部105が、受信データ114のペイロードとして、メモリ104上に0x06ac7963という暗号文データC201を格納したとする。
 すると、復号部106が図7のステップS102の復号を進めるにつれ、図8に時刻TA202~TA209の状態として示すように、暗号文データC201において暗号化されているビットが先頭から順に現在鍵により復号されていく。そして、暗号化されたビットは、復号されたビットで上書きされる。よって、時刻TA209にステップS102の復号が終了すると、もともと暗号文データC201が記憶されていたメモリ104の記憶領域上には、復号により得られた復号データD201が記憶されている。図8の例では、復号データD201は0x7a6025f3である。
 このように、第1実施形態によれば、暗号文データC201が記憶されている記憶領域自体が復号データD201で上書きされるので、メモリの使用効率がよい。なお、ブロック暗号が使われる場合も、ストリーム暗号が使われる場合と同様に、復号データD201で暗号文データC201を上書きすることが可能である。すなわち、ブロック暗号が使われる場合でも、メモリ104上にブロックサイズ分の一時記憶領域さえあれば十分であり、暗号文データC201全体と復号データD201全体に対してそれぞれ別の記憶領域を割り当てる必要はない。
 また、ステップS102での復号だけでなく、ステップS107における再暗号化とステップS108における復号でも、同様の上書きが行われるので、第1実施形態ではメモリの使用効率がよい。
 具体的には、再暗号化部108がステップS107の再暗号化を進めるにつれ、図8に時刻TA210~TA217の状態として示すように、復号データD201のビットが先頭から順に現在鍵により暗号化されていく。そして、復号データD201における各ビットは、暗号化されたビットで上書きされる。よって、時刻TA217にステップS107の再暗号化が終了すると、復号データD201が記憶されていたメモリ104の記憶領域上には、再暗号化により復元された暗号文データC201が記憶されている。
 そして、復号部106がステップS108の復号を進めるにつれ、図8に時刻TA218~TA225の状態として示すように、暗号文データC201において暗号化されているビットが先頭から順に現在鍵により復号されていく。そして、暗号化されたビットは、復号されたビットで上書きされる。よって、時刻TA225にステップS108の復号が終了すると、もともと暗号文データC201が記憶されていたメモリ104の記憶領域上には、復号により得られた平文データP201が記憶されている。図8の例では、平文データP201は0x365a6bf0である。
 以上のような上書きによるメモリ節約の効果は、図9の比較例と図8を比較すれば、より一層明らかである。図9の比較例では、時刻TA301において暗号文データC201がメモリ104に記憶されると、現在鍵による復号で正しい平文データが得られない場合の旧鍵による復号に備えて、暗号文データC201はそのままメモリ104に保持され続ける。つまり、時刻TA302~TA309にかけて行われる復号においては、暗号文データC201の記憶領域とは別の記憶領域に、現在鍵を用いた復号によって得られる復号データD201の各ビットが順に書き込まれてゆく。
 そして、復号データD201においてボディの部分(例えば最初の3バイトの0x7a6025)から算出される特徴値と、復号データD201に含まれる特徴値(例えば最後の1バイトの0xf3)が比較される。比較結果から、復号データD201が正常な平文データではないと判断されると、図9の比較例においては、復号データD201とは別の記憶領域に記憶されている暗号文データC201が、旧鍵によって復号される。
 旧鍵による復号の結果は、例えば、不要な復号データD201が記憶されている記憶領域に上書きされてもよいが、それでも図8の第1実施形態の例と比較すると、図9の比較例では余計な記憶領域が消費される。すなわち、時刻TA310~TA317にかけて行われる旧鍵による復号において、暗号文データC201の記憶領域とは別の記憶領域に平文データP201の各ビットが順に書き込まれてゆく。
 なお、第1実施形態と図9の比較例を比べると、再暗号化にかかる時間と消費される記憶領域がトレードオフの関係にあることが見て取れる。しかし、例えばセンサネットワークへの適用などの何らかの理由により、メモリ104の容量が非常に限定されている場合には、たとえ再暗号化に少々時間を使ってでも、記憶領域を節約しつつ旧鍵での復号を可能にする第1実施形態が好適である。
 また、暗号化および復号が、プログラムを実行するMPU201により行われるにしろ、ハードウェア回路により行われるにしろ、対称鍵暗号の暗号化および復号の処理速度は一般に高速である。よって、再暗号化にかかる時間は、多くの場合、無視しても構わない程度である。すなわち、処理時間と記憶容量がトレードオフの関係にあるとは言っても、センサネットワークなどのある種の環境においては、記憶領域の容量削減の方が再暗号化にかかる時間の短縮よりも強いインパクトを持つ。もちろん、第1実施形態の通信装置100は、センサネットワーク内の通信装置に限定されるわけではないが、通信装置100は例えばセンサネットワーク内の通信装置として好適である。
 以上、図7~9を参照して、通信装置100がPDUの受信を契機として行う処理について説明したが、通信装置100はPDUの受信とは独立した処理も行う。すなわち、通信装置100は暗号鍵の更新も行う。そこで、以下では、暗号鍵の更新に関する2つの処理方法を、図10~13を参照して説明する。
 図10は、第1実施形態において通信装置が行う暗号鍵更新処理のフローチャートである。また、図11は、暗号鍵更新処理にともなうデータの変遷の例を模式的に説明する図である。なお、図11は、通信装置100Aにおいて現在鍵が第a世代の暗号鍵KA,aである場合を具体例として説明する図である。
 ステップS201で鍵管理部101は、暗号鍵を更新する時刻になるまで待機する。そして、暗号鍵を更新する時刻になったと鍵管理部101が判断すると、処理はステップS202に移行する。
 例えば、暗号鍵を更新する間隔がタイマIC204に予め設定されている場合、暗号鍵を更新する間隔ごとにタイマIC204は割り込み信号を出力してもよい。そして、MPU201または耐タンパ性PICマイコン205により実現される鍵管理部101は、割り込み信号の検出を契機に、ステップS201からステップS202への移行を認識してもよい。
 ステップS202で鍵管理部101は、新たな暗号鍵を生成してメモリ104上の一時記憶領域に記憶する。例えば、図11に例示するように、通信装置100Aにおいて、鍵記憶部102に記憶されている現在鍵が第a世代の暗号鍵KA,aであり、旧鍵が第(a-1)世代の暗号鍵KA,a-1であるとする。すると、ステップS202で鍵管理部101は、次の第(a+1)世代の新たな暗号鍵KA,a+1を生成して一時記憶領域に記憶する。
 そして、次のステップS203で鍵管理部101は、鍵記憶部102が記憶している現在鍵を旧鍵として記憶する。図11の例では、鍵管理部101は、鍵記憶部102において現在鍵KA,aを旧鍵のフィールドにコピーする。
 さらに、次のステップS204で鍵管理部101は、生成した新たな暗号鍵を現在鍵として鍵記憶部102に記憶する。図11の例では、鍵管理部101は、一時記憶領域に記憶した新たな暗号鍵KA,a+1を、鍵記憶部102の現在鍵のフィールドにコピーする。その結果、鍵記憶部102は、現在鍵として新たな暗号鍵KA,a+1を記憶するとともに、旧鍵として、直前まで現在鍵であった暗号鍵KA,aを記憶する状態となる。
 そして、ステップS204の実行後、処理はステップS201に戻る。
 なお、通信装置100が他の通信装置100との間で鍵配送により暗号鍵を確立する場合には、通信装置100は、ステップS202、S203またはS204の後に、生成した新たな暗号鍵を他の通信装置100に配送する。鍵配送にかかる時間は、通信装置100内部での鍵記憶部102の更新にかかる時間よりも長いので、通信装置100は、ステップS204で鍵記憶部102内の現在鍵を更新する前に(例えばステップS202の直後に)新たな暗号鍵を配送してもよい。
 ところで、図10の暗号鍵更新処理は、図7のステップS112のエラー処理の実行頻度を減らすことを目的として、図12のように変形されてもよい。以下では、変形された暗号鍵更新処理について、まず図12と図13を参照して処理の流れを説明し、その後、利点について説明する。
 図12は、暗号鍵更新処理の変形例を示すフローチャートである。また、図13は、図12のように変形された暗号鍵更新処理にともなうデータの変遷の例を模式的に説明する図である。なお、図11と同様に図13も、通信装置100Aにおいて現在鍵が第a世代の暗号鍵KA,aである場合を具体例として説明する図である。
 ステップS301で鍵管理部101は、暗号鍵を更新する時刻になるまで待機する。そして、暗号鍵を更新する時刻になったと鍵管理部101が判断すると、処理はステップS302に移行する。つまり、ステップS301はステップS201と同様である。
 ステップS302で鍵管理部101は、新たな暗号鍵を生成してメモリ104上の一時記憶領域に記憶する。例えば、図13に例示するように、通信装置100Aにおいて、鍵記憶部102に記憶されている現在鍵が第a世代の暗号鍵KA,aであり、旧鍵が第(a-1)世代の暗号鍵KA,a-1であるとする。すると、ステップS302で鍵管理部101は、次の第(a+1)世代の新たな暗号鍵KA,a+1を生成して一時記憶領域に記憶する。
 そして、次のステップS303で鍵管理部101は、現在鍵をメモリ104上の一時記憶領域(正確には、ステップS302で新たな暗号鍵を記憶したのとは別の一時記憶領域)にコピーする。図13の例では、鍵管理部101は、現在鍵KA,aをメモリ104上の一時記憶領域にコピーする。
 さらに、次のステップS304で鍵管理部101は、生成した新たな暗号鍵を現在鍵として鍵記憶部102に記憶する。図13の例では、鍵管理部101は、一時記憶領域に記憶した新たな暗号鍵KA,a+1を、鍵記憶部102の現在鍵のフィールドにコピーする。
 そして、次のステップS305で鍵管理部101は、ステップS303で一時記憶領域にコピーした現在鍵を旧鍵として鍵記憶部102に記憶する。図13の例では、鍵管理部101は、一時記憶領域に記憶した暗号鍵KA,aを、鍵記憶部102の旧鍵のフィールドにコピーする。その結果、鍵記憶部102は、現在鍵として新たな暗号鍵KA,a+1を記憶するとともに、旧鍵として、直前まで現在鍵であった暗号鍵KA,aを記憶する状態となる。
 そして、ステップS305の実行後、処理はステップS301に戻る。なお、通信装置100が他の通信装置100との間で鍵配送により暗号鍵を確立する場合には、通信装置100は、図10の場合と同様に、ステップS302、S303、S304またはS305の後に、生成した新たな暗号鍵を他の通信装置100に配送する。また、この図12の暗号鍵更新処理では、ステップS302とS303の実行順は逆でもよいし、ステップS302とS303が並列に実行されてもよい。
 さて、以上の図12のように変形された暗号鍵更新処理は、鍵記憶部102の更新中に鍵記憶部102が参照される場合にも、なるべく旧鍵による復号から正しい平文データが得られるように工夫されている。つまり、図12の暗号鍵更新処理は、「更新前の現在鍵KA,aによる復号と再暗号化の後、復号部106が再度復号を行う際に読み出す旧鍵が、最初の復号のときに用いた暗号鍵KA,aと同じ」といった事態になるべく陥らないよう、工夫されている。具体的には、鍵記憶部102の更新のための一連のステップS302~S305の中で、更新前の旧鍵KA,a-1が更新されるステップS305が最後になるように、図12では暗号鍵更新処理が変形されている。
 なお、実施形態によっては、鍵管理部101は、ステップS202~S204の実行中またはステップS302~S305の実行中には、復号部106や再暗号化部108からの鍵記憶部102への参照をブロックしてもよい。
 続いて、図14~20を参照して第2実施形態について説明する。第2実施形態では2種類の暗号鍵が利用される。そして、第1実施形態では上記のとおり通信装置100間の鍵確立の方法が任意であるが、第2実施形態では2種類の暗号鍵について異なる2つの方法で鍵確立が行われる。
 具体的には、1種類目の暗号鍵は、通信装置同士が同じアルゴリズムにしたがって生成することにより通信装置間で確立される暗号鍵であり、複数の通信装置で共通して暗号化および復号に用いる暗号鍵である。以下では1種類目の暗号鍵を「共通鍵」という。そして、2種類目の暗号鍵は、各通信装置に固有の暗号鍵であり、以下では「アクセス鍵」という。通信装置間でのアクセス鍵の確立は、鍵配送によってなされる。また、第2実施形態では、アクセス鍵はアプリケーションデータの暗号化に用いられ、共有鍵はアクセス鍵の配送のための暗号化に用いられる。
 以下では説明の便宜上、通信装置自身が生成したアクセス鍵を「内部由来(internally-originated)アクセス鍵」と称し、他の通信装置から配送されたアクセス鍵を「外部由来(externally-originated)アクセス鍵」と称する。
 例えば、第1と第2の通信装置がアクセス鍵を互いに配送しあう場合、第1の通信装置が生成したアクセス鍵は、第1の通信装置にとっては内部由来アクセス鍵だが、第2の通信装置にとっては外部由来アクセス鍵である。同様に、第2の通信装置が生成したアクセス鍵は、第1の通信装置にとっては外部由来アクセス鍵だが、第2の通信装置にとっては内部由来アクセス鍵である。
 さて、図14は、第2実施形態の通信装置のブロック構成図である。なお、図14の通信装置400も、例えば図4に示した各種ハードウェアにより実現することができる。
 通信装置400は鍵管理部401を有する。そして、鍵管理部401は共通鍵管理部402と内部由来アクセス鍵管理部403と外部由来アクセス鍵管理部404を有する。
 共通鍵管理部402は、第1実施形態の鍵管理部101の具体例の1つでもあり、鍵認識部112の一部の機能も有する。具体的には、共通鍵管理部402は、時刻に対して一意な値を求める処理を行うことにより、暗号鍵の1種として共通鍵を生成する鍵生成部として動作するとともに、暗号化鍵としての共通鍵も認識する。
 また、内部由来アクセス鍵管理部403は鍵管理部101の具体例の1つである。すなわち、内部由来アクセス鍵管理部403は、暗号鍵の1種として、通信装置400事態に固有の暗号鍵である内部由来アクセス鍵を生成する鍵生成部としても動作する。
 そして、外部由来アクセス鍵管理部404は鍵認識部112の具体例の1つであり、外部由来アクセス鍵を他の通信装置400と対応づけて管理する。
 また、内部由来アクセス鍵管理部403は、平文処理部109の具体例の1つでもあり、内部由来アクセス鍵を含む平文の送信データ115を作成する。そして、外部由来アクセス鍵管理部404は、平文処理部109の具体例の1つでもあり、外部由来アクセス鍵を含む平文の受信データ114を処理して外部由来アクセス鍵を抽出する。
 なお、共通鍵管理部402と内部由来アクセス鍵管理部403は、図4のMPU201により実現されてもよいし、耐タンパ性PICマイコン205により実現されてもよい。なお、共通鍵管理部402と内部由来アクセス鍵管理部403には、例えば図4のタイマIC204により実現される後述の時計425から、暗号鍵の更新間隔ごとに割り込み信号が入力されてもよい。外部由来アクセス鍵管理部404は、MPU201により実現することができる。
 また、通信装置400は鍵記憶部405を有する。そして、鍵記憶部405は共通鍵記憶部406と内部由来アクセス鍵記憶部407と外部由来アクセス鍵記憶部408を有する。
 共通鍵記憶部406は、第1実施形態において復号鍵を記憶する鍵記憶部102の機能と、鍵認識部112の一部の機能(すなわち暗号化鍵を認識する機能)を有する。また、内部由来アクセス鍵記憶部407は、復号鍵を記憶する鍵記憶部102の機能を有する。そして、外部由来アクセス鍵記憶部408は、鍵認識部112の一部の機能(すなわち暗号化鍵を認識する機能)を有する。
 なお、鍵記憶部405内の各部は、DRAM206により実現されてもよいし、耐タンパ性PICマイコン205内のRAMにより実現されてもよい。あるいは、通信装置400が耐タンパ性メモリをハードウェアとして含む場合は、鍵記憶部405内の各部は、当該耐タンパ性メモリにより実現されてもよい。
 さらに、通信装置400は指示部409を有する。指示部409は、第1実施形態の指示部103の具体例の1つである。すなわち、指示部409は、復号および再暗号化にどの暗号鍵を用いるのかを認識する。なお、指示部409は、MPU201により実現されてもよい。
 また、通信装置400は、第1実施形態のメモリ104および受信部105とそれぞれ類似のメモリ410および受信部411を有する。メモリ410はDRAM206により実現され、受信部411は有線処理部202と無線処理部203少なくとも一方と、MPU201によって実現される。
 そして、通信装置400は復号部412を有する。復号部412は、いずれも第1実施形態の復号部106の具体例に相当する受信データ復号部413および外部由来アクセス鍵復号部414を有する。なお、復号部412内の各部は、プログラムを実行するMPU201により実現されてもよいし、専用の復号回路により実現されてもよい。
 また、物理的には1つの復号回路が、入力信号に応じて、あるときは受信データ復号部413として機能し、あるときは外部由来アクセス鍵復号部414として機能してもよい。同様に、1つの同じ復号アルゴリズムのプログラムモジュールが、引数に応じて、あるときはMPU201を受信データ復号部413として機能させ、あるときはMPU201を外部由来アクセス鍵復号部414として機能させてもよい。
 さらに、通信装置400は判断部415を有する。判断部415は、いずれも第1実施形態の判断部107の具体例に相当する外部由来アクセス鍵判断部416と受信データ判断部417を有する。判断部415内の各部は、例えばMPU201により実現される。
 さらに、通信装置400は暗号化部418を有する。暗号化部418は、いずれも第1実施形態の再暗号化部108の具体例に相当する外部由来アクセス鍵再暗号化部419と受信データ再暗号化部420を有する。さらに暗号化部418は、いずれも第1実施形態の暗号化部111における暗号化の機能を有する送信データ暗号化部421と内部由来アクセス鍵暗号化部422を有する。なお、暗号化部418内の各部は、プログラムを実行するMPU201により実現されてもよいし、専用の暗号化回路により実現されてもよい。
 また、物理的には1つの暗号化回路が、入力信号に応じて、外部由来アクセス鍵再暗号化部419、受信データ再暗号化部420、送信データ暗号化部421、内部由来アクセス鍵暗号化部422のいずれかとして機能してもよい。同様に、1つの同じ暗号化アルゴリズムのプログラムモジュールが、引数に応じて、MPU201を暗号化部418内の各部のうちの1つとして機能させてもよい。
 そして、通信装置400は、第1実施形態の平文処理部109の具体例の1つに相当するデータ処理部423を有する。データ処理部423は、ペイロードが平文の状態になった受信データ114を処理する平文処理部109の具体例でもあり、他の通信装置100に送信する平文の送信データ115を生成するデータ生成部としての平文処理部109の具体例でもある。なお、データ処理部423は、MPU201により実現されてもよい。
 さらに、通信装置400は、第1実施形態の送信部113と同様の機能を有する送信部424を有する。送信部424は、有線処理部202と無線処理部203少なくとも一方と、MPU201によって実現される。なお、第2実施形態では、内部由来アクセス鍵管理部403と内部由来アクセス鍵暗号化部422と送信部424が協働して、内部由来アクセス鍵を他の通信装置400に通知する内部由来アクセス鍵配送部として動作する。内部由来アクセス鍵配送部は、暗号鍵を他の通信装置に通知する通知部の一例である。
 そして、通信装置400は時計425も有する。時計425はタイマIC204により実現されてもよい。あるいは、MPU201がクロック信号に基づいて時計425として機能してもよい。
 また、図14には、メモリ410内に記憶される受信データ426と送信データ427と外部由来アクセス鍵配送データ428と内部由来アクセス鍵配送データ429も図示されている。なお、第2実施形態においても、暗号化と復号の際には第1実施形態と同様の記憶領域の上書きが行われる。よって、メモリ410内に示した各データのペイロードは、正しい平文の状態のときもあるし、暗号文の状態のときもあるし、暗号化されたときとは異なる暗号鍵によって復号された状態のときもある。
 以上のように、第2実施形態における通信装置400の各部は、第1実施形態における通信装置100の各部と同じか類似の機能を有する。そこで、通信装置400の各部の詳細な動作については、ここでは説明を割愛し、後述のフローチャートとともに説明することにする。なお、図14の通信装置400は、図2のアドホックネットワーク140において通信装置100A~100Lの代わりに用いられてもよいし、ゲートウェイ装置120が通信装置400の各部を備えていてもよい。
 さて、図15は、第2実施形態の通信装置が記憶するデータの一例を示す図である。
 図15には、ある通信装置400の共通鍵記憶部406と内部由来アクセス鍵記憶部407と外部由来アクセス鍵記憶部408が記憶するデータが例示されている。
 図15に示す共通鍵記憶部406は、共通鍵管理部402が生成した最新の第γ世代の共通鍵SKγを現在共通鍵として記憶する。さらに、共通鍵記憶部406は、共通鍵管理部402が以前に生成した第(γ-1)世代の共通鍵SKγ-1を旧共通鍵として記憶する。
 なお、現在共通鍵は第1実施形態における現在鍵の具体例の1つであり、旧共通鍵は第1実施形態における旧鍵の具体例の1つである。また、指示部409は、「選択共通鍵」として、現在共通鍵または旧共通鍵の一方を選択する。
 そして、図15に示す内部由来アクセス鍵記憶部407は、内部由来アクセス鍵管理部403が生成した最新の第a世代の内部由来アクセス鍵AKA,aを現在内部由来アクセス鍵として記憶する。さらに、内部由来アクセス鍵記憶部407は、内部由来アクセス鍵管理部403が以前に生成した第(a-1)世代の内部由来アクセス鍵AKA,a-1を旧内部由来アクセス鍵として記憶する。
 なお、現在内部由来アクセス鍵は第1実施形態における現在鍵の具体例の1つであり、旧内部由来アクセス鍵は第1実施形態における旧鍵の具体例の1つである。また、指示部409は、「選択内部由来アクセス鍵」として、現在内部由来アクセス鍵または旧内部由来アクセス鍵の一方を選択する。
 そして、図15に示す外部由来アクセス鍵記憶部408は、当該通信装置400との間で鍵が確立している他の通信装置400のアクセス鍵を、アドレスと対応づけて記憶する。なお、アドレスは、他の通信装置400を一意に識別する識別情報の一例である。また、第1実施形態と同様に第2実施形態も、様々な通信プロトコルに適用可能である。よって、外部由来アクセス鍵記憶部408が記憶するアドレスのレイヤも、適用対象の通信プロトコルのレイヤに応じて様々であってよく、例えば、MACアドレスやIPアドレスなどが利用可能である。
 具体的には、図15の例では、外部由来アクセス鍵記憶部408は、アドレスAdrが割り当てられた他の通信装置400から配送された最新の外部由来アクセス鍵AKB,bを、アドレスAdrと対応づけて記憶する。同様に、外部由来アクセス鍵記憶部408は、アドレスAdrが割り当てられた他の通信装置400から配送された最新の外部由来アクセス鍵AKC,cを、アドレスAdrと対応づけて記憶する。さらに、外部由来アクセス鍵記憶部408は、アドレスAdrが割り当てられた他の通信装置400から配送された最新の外部由来アクセス鍵AKD,dを、アドレスAdrと対応づけて記憶する。
 図16は、第2実施形態の通信装置がデータの受信を契機として行う受信処理のフローチャートである。なお、受信部411は、PDUを受信すると、受信したPDUのデータをメモリ410に格納するので、図16の処理が開始される時点で、メモリ410には受信したPDUのデータが記憶されている。
 また、通信プロトコルによっては、他の通信装置400宛のPDUが物理的に受信されることもあるが、その場合、受信部411は、図16の受信処理を開始する前に、受信したPDUのヘッダから、宛先が通信装置400自身であるか否かを判断する。そして、受信部411は、宛先が通信装置400自身ではない場合は受信したPDUのデータを破棄し、宛先が通信装置400自身の場合に図16の受信処理を開始する。
 ステップS401で受信部411は、メモリ410を参照して、受信したPDUの種類を判定する。なお、第2実施形態では、ヘッダにPDUの種類を示すフィールドがある。よって、受信部411は、種類を示すフィールドの値を参照することで、PDUの種類を判定することができる。
 受信したPDUがアクセス鍵の配布用PDUである場合、通信装置400が受信したアクセス鍵の配布用PDUのデータとは、具体的には図14の外部由来アクセス鍵配送データ428である。よって、この場合に受信部411は、外部由来アクセス鍵配送データ428のペイロードを復号するよう外部由来アクセス鍵復号部414に命令し、処理はステップS402に移行する。
 なお、アクセス鍵の配布用PDUは、図6の暗号文PDU307の1種である。アクセス鍵の配布用PDUにおける暗号化されたボディ305は、暗号文PDU307を送信する通信装置400にとっての内部由来アクセス鍵を含むデータを共通鍵で暗号化したデータである。
 あるいは、受信したPDUがアクセス鍵で暗号化されるPDUである場合、通信装置400が受信したPDUのデータとは、具体的には図14の受信データ426である。よって、この場合に受信部411は、受信データ426のペイロードを復号するよう受信データ復号部413に命令し、処理はステップS403に移行する。
 また、受信したPDUが上記2種類のいずれでもない場合、処理はステップS404に移行する。
 例えば、図2のアドホックネットワーク140において、通信装置100A~100Lの代わりに複数の通信装置400が用いられてもよく、通信装置400同士は、アドホックネットワーク140内で予め固定された暗号鍵を使って時刻同期の制御用PDUをやりとりしてもよい。あるいは、通信装置400同士は、特定の種類のPDUを暗号化せずにやりとりしてもよい。このように、予め固定された暗号鍵によりペイロードが暗号化されるPDUや、ペイロードがクリアテキストのPDUなどが受信された場合、処理はステップS404に移行する。
 さて、ステップS402で通信装置400は、図17に示す外部由来アクセス鍵更新処理を行う。そして、図16の受信処理は終了する。
 また、ステップS403で通信装置400は、図18に示す暗号化PDU受信処理を行う。そして、図16の受信処理は終了する。
 また、ステップS404で通信装置400は、受信したPDUの種類に応じた適宜の処理を行う。そして、PDUの種類に応じた処理が終了すると、図16の受信処理も終了する。
 なお、ステップS404における処理の主体、処理の内容、およびPDUの種類は実施形態に応じて任意である。例えば、ステップS401に関して例示した時刻同期の制御用PDUが受信された場合、ステップS404では、不図示の制御用PDU処理部が、時計425を必要に応じて修正する時刻同期処理を行ってもよい。
 図17は、第2実施形態において通信装置が行う外部由来アクセス鍵更新処理のフローチャートである。なお、図17の処理において、第1実施形態の図7の受信処理と類似する点については、適宜説明を省略する。
 ステップS501で外部由来アクセス鍵復号部414は、受信部411からの命令にしたがい、外部由来アクセス鍵配送データ428のペイロードを復号する。具体的には、外部由来アクセス鍵復号部414は、まず現在共通鍵と旧共通鍵のどちらが選択共通鍵として選択されているかという情報を指示部409から得る。そして、外部由来アクセス鍵復号部414は、選択共通鍵を共通鍵記憶部406から読み出し、選択共通鍵を用いて外部由来アクセス鍵配送データ428のペイロードを復号する。
 なお、指示部409は、通信装置400に電源が入れられた初期状態では、選択共通鍵として現在共通鍵を選択する。また、図17の処理は、アクセス鍵の配布用PDUの受信のたびに行われるが、ステップS504とS508とS513に関して後述するとおり、指示部409は、図17の処理を終了する時点では、現在共通鍵を選択共通鍵として選択している。よって、ステップS501の時点では、選択共通鍵は現在共通鍵である。
 したがって、ステップS501において外部由来アクセス鍵復号部414は、まず指示部409から「選択共通鍵は現在共通鍵である」という情報を得る。そして、外部由来アクセス鍵復号部414は、共通鍵記憶部406から現在共通鍵を読み出し、現在共通鍵を用いて外部由来アクセス鍵配送データ428のペイロードを復号する。
 なお、外部由来アクセス鍵復号部414は、ステップS501における復号の際に、第1実施形態の復号部106と同様に、外部由来アクセス鍵配送データ428のペイロードの暗号文を、復号したデータで上書きする。このような上書きにより、余計な記憶領域の消費が抑制される。
 外部由来アクセス鍵復号部414は、復号を終えると、復号の完了を外部由来アクセス鍵判断部416に通知する。そして、処理はステップS502に移行する。
 ステップS502では、外部由来アクセス鍵復号部414からの通知を受けた外部由来アクセス鍵判断部416が、外部由来アクセス鍵復号部414が復号したデータから特徴値を取り出す。
 そして、次のステップS503で外部由来アクセス鍵判断部416は、外部由来アクセス鍵復号部414が復号したデータのボディから特徴値を計算する。なお、ステップS502とS503は、逆順に実行されてもよいし、並行して実行されてもよい。
 続いて、ステップS504で外部由来アクセス鍵判断部416は、取り出した特徴値と計算した特徴値が一致するか否かを判断する。
 2つの特徴値が一致する場合、外部由来アクセス鍵判断部416は、「ステップS501で復号されてメモリ410上に記憶されている外部由来アクセス鍵配送データ428のペイロードは、正常な平文データである」と判断する。この場合、外部由来アクセス鍵判断部416は、配送された外部由来アクセス鍵を抽出して外部由来アクセス鍵記憶部408に登録する処理を、メモリ410上の外部由来アクセス鍵配送データ428を用いて行うよう、外部由来アクセス鍵管理部404に命令する。
 2つの特徴値が一致する場合はさらに、外部由来アクセス鍵判断部416が、アクセス鍵の配布用PDUの次の受信に備えて選択共通鍵をリセットするよう、指示部409に命令し、指示部409が改めて現在共通鍵を選択共通鍵として選択しなおしてもよい。なお、図7のステップS105と同様、このような明示的なリセットは省略可能である。そして、2つの特徴値が一致する場合、処理はステップS505に移行する。
 他方、2つの特徴値が一致しない場合、外部由来アクセス鍵判断部416は、「ステップS501で復号されてメモリ410上に記憶されている外部由来アクセス鍵配送データ428のペイロードは、異常である」と判断する。そして、処理はステップS508に移行する。
 ステップS505~S507で外部由来アクセス鍵管理部404は、外部由来アクセス鍵復号部414が復号した外部由来アクセス鍵配送データ428を参照し、配送された外部由来アクセス鍵を抽出して外部由来アクセス鍵記憶部408に登録する処理を行う。ステップS505~S507における外部由来アクセス鍵管理部404は、第1実施形態における平文処理部109の1種として動作する。
 具体的には、ステップS505で外部由来アクセス鍵管理部404は、メモリ410を参照し、受信したPDUのヘッダから送信元アドレスを取り出す。つまり、外部由来アクセス鍵管理部404は、図6の復号PDU310の状態でメモリ410に記憶されている外部由来アクセス鍵配送データ428から、ヘッダ302に含まれる送信元アドレスを取り出す。
 そして、次のステップS506で外部由来アクセス鍵管理部404は、外部由来アクセス鍵復号部414が復号したデータから外部由来アクセス鍵を取り出す。つまり、外部由来アクセス鍵管理部404は、図6の復号PDU310の状態でメモリ410に記憶されている外部由来アクセス鍵配送データ428から、復号されたボディ308に含まれる外部由来アクセス鍵を取り出す。なお、ステップS505とS506は、逆順で実行されてもよいし、並行して実行されてもよい。
 続いて、ステップS507で外部由来アクセス鍵管理部404は、ステップS505で取り出した送信元アドレスと、ステップS506で取り出した外部由来アクセス鍵を、互いに対応づけて、外部由来アクセス鍵記憶部408に格納する。
 具体的には、外部由来アクセス鍵管理部404は、取り出した送信元アドレスを検索キーにして外部由来アクセス鍵記憶部408を検索する。検索の結果、取り出した送信元アドレスと一致するアドレスを持つエントリが見つかれば、外部由来アクセス鍵管理部404は、見つかったエントリにおける外部由来アクセス鍵を、ステップS506で取り出した外部由来アクセス鍵で上書きする。逆に、取り出した送信元アドレスと一致するアドレスを持つエントリが見つからなければ、外部由来アクセス鍵管理部404は、取り出した送信元アドレスと取り出した外部由来アクセス鍵を対応づける新たなエントリを外部由来アクセス鍵記憶部408に追加する。そして、図17の処理は終了する。
 さて、ステップS504において2つの特徴値が一致しなかった場合、ステップS508で外部由来アクセス鍵判断部416は、現在時刻が旧共通鍵の有効期限内か否かを判断する。なお、第2実施形態において「現在時刻が旧共通鍵の有効期限内である」とは、「共通鍵の直近の更新から現在までに経過した時間が所定の許容時間(後述の図20における“ST”)以内である」という意味である。
 なお、第2実施形態では、ネットワーク内の各通信装置400が、同じ所定の間隔(後述の図20における“SI”)でそれぞれ共通鍵を更新する。ステップS504で閾値として用いられる許容時間STは、共通鍵の更新間隔SIよりも短い時間である。旧共通鍵の有効期限を外部由来アクセス鍵判断部416が認識する具体的方法は実施形態に応じて様々であってよいが、例えば以下のようにして外部由来アクセス鍵判断部416は旧共通鍵の有効期限を認識してもよい。
 例えば、時計425は、共通鍵の更新間隔SIが経過するたびに共通鍵管理部402に共通鍵の更新の契機となる共通鍵更新タイミング信号を出力してもよい。共通鍵更新タイミング信号は、例えば割り込み信号でもよい。
 さらに、時計425は、共通鍵更新タイミング信号を出力してから許容時間STの間だけ、旧共通鍵が有効であることを示す旧共通鍵有効信号をアサート(assert)してもよい。つまり、時計425は、許容時間STの経過後、次に共通鍵更新タイミング信号を出力するまでの期間は、旧共通鍵有効信号をネゲート(negate)してもよい。すると、外部由来アクセス鍵判断部416は、時計425から出力される旧共通鍵有効信号から、現在時刻が旧共通鍵の有効期限内であるか否かを認識することができる。
 あるいは、外部由来アクセス鍵判断部416は、時計425から現在時刻を取得し、共通鍵を更新する基準時刻と共通鍵の更新間隔SIと現在時刻を用いて、直近の共通鍵の更新時刻から現在までの経過時間を計算してもよい。そして、外部由来アクセス鍵判断部416は、計算した経過時間を閾値である許容時間STと比較し、計算した経過時間が許容時間ST以内ならば「現在時刻が旧共通鍵の有効期限内である」と判断してもよい。なお、この例に限らず、閾値との比較による判断は、実施形態により「閾値以下か、それとも閾値を超えるか」という判断でもよいし、「閾値未満か、それとも閾値以上か」という判断でもよく、適宜方針を定めることができる。
 そして、現在時刻が旧共通鍵の有効期限内である場合、外部由来アクセス鍵判断部416は、外部由来アクセス鍵配送データ428のペイロードを再暗号化して元の状態に戻すよう、外部由来アクセス鍵再暗号化部419に命令する。そして、処理はステップS509に移行する。
 他方、現在時刻が旧共通鍵の有効期限を過ぎている場合、外部由来アクセス鍵判断部416は、「図17の処理の契機となったアクセス鍵の配布用PDUは、無効である」と判断する。そして、処理はステップS514に移行する。
 なお、処理がステップS508からステップS514に移行する場合、選択共通鍵は現在共通鍵のままである。もちろん、実施形態によっては、明示的に選択共通鍵のリセットが行われてもよい。
 また、ステップS509では、外部由来アクセス鍵復号部414が復号したデータを外部由来アクセス鍵再暗号化部419が再暗号化する。具体的には、外部由来アクセス鍵再暗号化部419は、まず指示部409から「選択共通鍵は現在共通鍵である」という情報を得る。そして、外部由来アクセス鍵再暗号化部419は、共通鍵記憶部406から現在共通鍵を読み出し、現在共通鍵を用いて外部由来アクセス鍵配送データ428のペイロードを暗号化する。
 なお、外部由来アクセス鍵再暗号化部419は、第1実施形態の再暗号化部108と同様に、暗号化の際に、外部由来アクセス鍵配送データ428のペイロードを、暗号化したデータで上書きする。このような上書きにより、余計な記憶領域の消費が抑制される。
 そして、外部由来アクセス鍵再暗号化部419は、暗号化を終えると、暗号化の終了を指示部409に通知する。すると、指示部409は、現在選択している選択共通鍵とは異なる共通鍵である旧共通鍵を選択共通鍵として選択しなおし、外部由来アクセス鍵配送データ428のペイロードを復号するよう外部由来アクセス鍵復号部414に命令する。
 続いて、ステップS510で外部由来アクセス鍵復号部414は、外部由来アクセス鍵再暗号化部419が再暗号化したデータを旧共通鍵で復号する。具体的には、外部由来アクセス鍵復号部414は、まず指示部409から「選択共通鍵は旧共通鍵である」という情報を得る。そして、外部由来アクセス鍵復号部414は、共通鍵記憶部406から旧共通鍵を読み出し、旧共通鍵を用いて外部由来アクセス鍵配送データ428のペイロードを復号する。
 なお、外部由来アクセス鍵復号部414は、ステップS510における復号の際にも、ステップS501と同様に、外部由来アクセス鍵配送データ428のペイロードの暗号文を、復号したデータで上書きする。このような上書きにより、余計な記憶領域の消費が抑制される。
 そして、外部由来アクセス鍵復号部414は、復号を終えると、復号の完了を外部由来アクセス鍵判断部416に通知する。すると、処理はステップS511に移行する。
 ステップS511で外部由来アクセス鍵判断部416は、ステップS502と同様に、外部由来アクセス鍵復号部414が復号したデータから特徴値を取り出す。
 また、次のステップS512で外部由来アクセス鍵判断部416は、ステップS503と同様に、外部由来アクセス鍵復号部414が復号したデータのボディから特徴値を計算する。なお、ステップS511とS512は、逆順に実行されてもよいし、並行して実行されてもよい。
 続いて、ステップS513で外部由来アクセス鍵判断部416は、取り出した特徴値と計算した特徴値が一致するか否かを判断する。
 2つの特徴値が一致する場合、外部由来アクセス鍵判断部416は、「ステップS510で復号されてメモリ410上に記憶されている外部由来アクセス鍵配送データ428のペイロードは、正常な平文データである」と判断する。この場合、外部由来アクセス鍵判断部416は、配送された外部由来アクセス鍵を外部由来アクセス鍵記憶部408に登録する処理を、メモリ410上の外部由来アクセス鍵配送データ428を用いて行うよう、外部由来アクセス鍵管理部404に命令する。
 2つの特徴値が一致する場合はさらに、外部由来アクセス鍵判断部416が、アクセス鍵の配布用PDUの次の受信に備えて選択共通鍵をリセットするよう、指示部409に命令する。そして、指示部409は現在共通鍵を選択共通鍵として選択しなおす。よって、アクセス鍵の配布用PDUが次に受信されて再度図17の処理が開始される時点での選択共通鍵は、現在鍵となる。そして、以上のように選択共通鍵が選択しなおされると、処理はステップS505に移行する。
 他方、2つの特徴値が一致しない場合、外部由来アクセス鍵判断部416は、「ステップS510で復号されてメモリ410上に記憶されている外部由来アクセス鍵配送データ428は、異常であり、無効である」と判断する。
 また、第2実施形態では、共通鍵記憶部406は現在共通鍵と旧共通鍵という2つの世代の共通鍵のみを保持しているので、試す対象となる他の世代の共通鍵は、これ以上は存在しない。そこで、2つの特徴値が一致しない場合も、外部由来アクセス鍵判断部416は、アクセス鍵の配布用PDUの次の受信に備えて選択共通鍵をリセットするよう、指示部409に命令する。そして、指示部409は現在共通鍵を選択共通鍵として選択しなおし、処理はステップS514に移行する。
 また、ステップS514で外部由来アクセス鍵判断部416は、受信したPDUを破棄する。例えば、外部由来アクセス鍵判断部416は、具体的にはメモリ410上の外部由来アクセス鍵配送データ428の記憶領域を解放することにより、受信したPDUを破棄してもよい。そして、破棄が済むと図17の処理も終わる。
 図18は、第2実施形態において通信装置が行う暗号化パケット受信処理のフローチャートである。なお、図18の処理において、第1実施形態の図7の受信処理と類似する点については、適宜説明を省略する。
 ステップS601で受信データ復号部413は、受信部411からの命令にしたがい、受信データ426のペイロードを復号する。具体的には、受信データ復号部413は、まず現在内部由来アクセス鍵と旧内部由来アクセス鍵のどちらが選択内部由来アクセス鍵として選択されているかという情報を指示部409から得る。そして、受信データ復号部413は、選択内部由来アクセス鍵を内部由来アクセス鍵記憶部407から読み出し、選択内部由来アクセス鍵を用いて受信データ426のペイロードを復号する。
 なお、指示部409は、通信装置400に電源が入れられた初期状態では、選択内部由来アクセス鍵として現在内部由来アクセス鍵を選択する。また、図18の処理は、アクセス鍵で暗号化されるPDUの受信のたびに行われるが、ステップS604とS606とS611に関して後述するとおり、指示部409は、図18の処理を終了する時点では、現在内部由来アクセス鍵を選択内部由来アクセス鍵として選択している。よって、ステップS601の時点では、選択内部由来アクセス鍵は現在内部由来アクセス鍵である。
 したがって、ステップS601において受信データ復号部413は、まず指示部409から「選択内部由来アクセス鍵は現在内部由来アクセス鍵である」という情報を得る。そして、受信データ復号部413は、内部由来アクセス鍵記憶部407から現在内部由来アクセス鍵を読み出し、現在内部由来アクセス鍵を用いて受信データ426のペイロードを復号する。
 なお、受信データ復号部413は、ステップS601における復号の際に、第1実施形態の復号部106と同様に、受信データ426のペイロードの暗号文を、復号したデータで上書きする。このような上書きにより、余計な記憶領域の消費が抑制される。
 受信データ復号部413は、復号を終えると、復号の完了を受信データ判断部417に通知する。そして、処理はステップS602に移行する。
 ステップS602では、受信データ復号部413からの通知を受けた受信データ判断部417が、受信データ復号部413が復号したデータから特徴値を取り出す。
 そして、次のステップS603で受信データ判断部417は、受信データ復号部413が復号したデータのボディから特徴値を計算する。なお、ステップS602とS603は、逆順に実行されてもよいし、並行して実行されてもよい。
 続いて、ステップS604で受信データ判断部417は、取り出した特徴値と計算した特徴値が一致するか否かを判断する。
 2つの特徴値が一致する場合、受信データ判断部417は、「ステップS601で復号されてメモリ410上に記憶されている受信データ426のペイロードは正常な平文データである」と判断する。この場合、受信データ判断部417は、メモリ410上の受信データ426の処理を行うようデータ処理部423に命令する。
 2つの特徴値が一致する場合はさらに、受信データ判断部417が、アクセス鍵で暗号化されるPDUの次の受信に備えて選択内部由来アクセス鍵をリセットするよう、指示部409に命令してもよい。そして、指示部409が改めて現在内部由来アクセス鍵を選択内部由来アクセス鍵として選択しなおしてもよい。なお、図7のステップS105と同様、このような明示的なリセットは省略可能である。そして、2つの特徴値が一致する場合、処理はステップS605に移行する。
 他方、2つの特徴値が一致しない場合、受信データ判断部417は、「ステップS601で復号されてメモリ410上に記憶されている受信データ426のペイロードは、異常である」と判断する。そして、処理はステップS606に移行する。
 ステップS605でデータ処理部423は、受信データ復号部413が復号したPDUを処理する。つまり、データ処理部423は、ペイロードが正常な平文に復号されて受信データ426としてメモリ410に記憶されているPDUのデータを読み出し、適宜の処理を行う。なお、ステップS605でデータ処理部423が行う処理は、任意であるが、第1実施形態のステップS106に関して例示したような処理でもよい。ステップS605でのデータ処理部423による処理が終了すると、図18の処理も終了する。
 さて、ステップS604において2つの特徴値が一致しなかった場合、ステップS606で受信データ判断部417は、現在時刻が旧内部由来アクセス鍵の有効期限内か否かを判断する。なお、第2実施形態において「現在時刻が旧内部由来アクセス鍵の有効期限内である」とは、「内部由来アクセス鍵の直近の更新から現在までに経過した時間が所定の許容時間(後述の図20における“AT”)以内である」という意味である。
 なお、第2実施形態では、通信装置400は、所定の間隔(後述の図20における“AI”)で内部由来アクセス鍵を更新する。アクセス鍵の更新間隔AIは、前述の共通鍵の更新間隔SIよりも短い。また、詳しくは図20とともに後述するが、どの世代の共通鍵も、アクセス鍵の通知に2回以上利用されるようにするために、アクセス鍵の更新間隔AIは、共通鍵の更新間隔SIの半分以下であることが好ましい。
 そして、ステップS606で閾値として用いられる許容時間ATは、内部由来アクセス鍵の更新間隔AIよりも短い時間である。旧内部由来アクセス鍵の有効期限を受信データ判断部417が認識する具体的方法は実施形態に応じて様々であってよい。具体的には、受信データ判断部417は、図17のステップS508に関して例示した、外部由来アクセス鍵判断部416が旧共通鍵の有効期限を認識するのと類似の方法により、旧内部由来アクセス鍵の有効期限を認識することができる。
 そして、現在時刻が旧内部由来アクセス鍵の有効期限内である場合、受信データ判断部417は、受信データ426のペイロードを再暗号化して元の状態に戻すよう、受信データ再暗号化部420に命令する。そして、処理はステップS607に移行する。
 他方、現在時刻が旧内部由来アクセス鍵の有効期限を過ぎている場合、受信データ判断部417は、「図18の処理の契機となったPDUのペイロードは、異常である」と判断する。この場合、受信データ判断部417は「何らかのエラーが生じた」と判断し、処理はステップS612に移行する。
 なお、処理がステップS606からステップS612に移行する場合、選択内部由来アクセス鍵は現在内部由来アクセス鍵のままである。もちろん、実施形態によっては、明示的に選択内部由来アクセス鍵のリセットが行われてもよい。
 また、ステップS607では、受信データ復号部413が復号したデータを受信データ再暗号化部420が再暗号化する。具体的には、受信データ再暗号化部420は、まず指示部409から「選択内部由来アクセス鍵は現在内部由来アクセス鍵である」という情報を得る。そして、受信データ再暗号化部420は、内部由来アクセス鍵記憶部407から現在内部由来アクセス鍵を読み出し、現在内部由来アクセス鍵を用いて受信データ426のペイロードを暗号化する。
 なお、受信データ再暗号化部420は、第1実施形態の再暗号化部108と同様に、暗号化の際に、受信データ426のペイロードを、暗号化したデータで上書きする。このような上書きにより、余計な記憶領域の消費が抑制される。
 そして、受信データ再暗号化部420は、暗号化を終えると、暗号化の終了を指示部409に通知する。すると、指示部409は、現在選択している選択内部由来アクセス鍵とは異なる内部由来アクセス鍵である旧内部由来アクセス鍵を選択内部由来アクセス鍵として選択しなおし、受信データ426のペイロードを復号するよう受信データ復号部413に命令する。
 続いて、ステップS608で受信データ復号部413は、受信データ再暗号化部420が再暗号化したデータを旧内部由来アクセス鍵で復号する。具体的には、受信データ復号部413は、まず指示部409から「選択内部由来アクセス鍵は旧由来アクセス鍵である」という情報を得る。そして、受信データ復号部413は、内部由来アクセス鍵記憶部407から旧内部由来アクセス鍵を読み出し、旧内部由来アクセス鍵を用いて受信データ426のペイロードを復号する。
 なお、受信データ復号部413は、ステップS608における復号の際にも、ステップS601と同様に、受信データ426のペイロードの暗号文を、復号したデータで上書きする。このような上書きにより、余計な記憶領域の消費が抑制される。
 そして、受信データ復号部413は、復号を終えると、復号の完了を受信データ判断部417に通知する。すると、処理はステップS609に移行する。
 ステップS609で受信データ判断部417は、ステップS602と同様に、受信データ復号部413がが復号したデータから特徴値を取り出す。
 また、次のステップS610で受信データ判断部417は、ステップS603と同様に、受信データ復号部413が復号したデータのボディから特徴値を計算する。なお、ステップS5609とS610は、逆順に実行されてもよいし、並行して実行されてもよい。
 続いて、ステップS611で受信データ判断部417は、取り出した特徴値と計算した特徴値が一致するか否かを判断する。
 2つの特徴値が一致する場合、受信データ判断部417は、「ステップS608で復号されてメモリ410上に記憶されている受信データ426のペイロードは正常な平文データである」と判断する。この場合、受信データ判断部417は、メモリ410上の受信データ426の処理を行うようデータ処理部423に命令する。
 2つの特徴値が一致する場合はさらに、受信データ判断部417が、アクセス鍵で暗号化されるPDUの次の受信に備えて選択内部由来アクセス鍵をリセットするよう、指示部409に命令する。そして、指示部409は現在内部由来アクセス鍵を選択内部由来アクセス鍵として選択しなおす。よって、アクセス鍵で暗号化されるPDUが次に受信されて再度図18の処理が開始される時点での選択内部由来アクセス鍵は、現在内部由来アクセス鍵となる。そして、以上のように選択内部由来アクセス鍵が選択しなおされると、処理はステップS605に移行する。
 他方、2つの特徴値が一致しない場合、受信データ判断部417は、「ステップS608で復号されてメモリ410上に記憶されている受信データ426のペイロードは、異常である」と判断する。
 また、第2実施形態では、内部由来アクセス鍵記憶部407は現在内部由来アクセス鍵と旧内部由来アクセス鍵という2つの世代の内部由来アクセス鍵のみを保持しているので、試す対象となる他の世代の内部由来アクセス鍵は、これ以上は存在しない。そこで、2つの特徴値が一致しない場合も、受信データ判断部417は、アクセス鍵で暗号化されるPDUの次の受信に備えて選択内部由来アクセス鍵をリセットするよう、指示部409に命令する。そして、指示部409は現在内部由来アクセス鍵を選択内部由来アクセス鍵として選択しなおし、処理はステップS612に移行する。
 ステップS612では、受信データ判断部417が適宜のエラー処理を行う。あるいは、受信データ判断部417は不図示のエラー処理部に対してエラー処理を行うよう命令してもよい。エラー処理の具体的内容は任意である。例えば、エラー処理は、単に受信データ426の記憶領域を解放する処理でもよいし、送信元の他の通信装置400に対してPDUの再送を要求する処理でもよい。エラー処理の実行後、図18の処理も終了する。
 以上、図16~18を参照して説明したように、第2実施形態においても、PDUの受信を契機とした一連の処理の中で、復号または再暗号化にともなって、メモリ410上の記憶領域の上書きが行われる。よって、第2実施形態も第1実施形態と同様に、記憶領域の節約効果がある。
 ところで、通信装置400はPDUの受信とは独立した処理も行う。すなわち、通信装置100は、以下に説明するように、PDUの送信、共通鍵の更新、内部由来アクセス鍵の更新、および内部由来アクセス鍵の配送も行う。
 具体的には、データ処理部423は、他の装置に送信しようとするデータから、平文の送信データ427を作成する。こうして作成される送信データ427は、図6の平文PDU304の一例である。つまり、データ処理部423は適宜のボディ301を生成または取得し、適宜のヘッダ302を設定し、ボディ301から特徴値303を計算して、送信データ427に相当する平文PDU304を作成する。
 例えば、通信装置400がセンサネットワーク内のノードである場合、通信装置400はセンサを内蔵していてもよいし、センサと接続されていてもよい。そして、データ処理部423は、センサから出力されたデータをボディ301に設定してもよい。
 データ処理部423は、平文の送信データ427をメモリ410上に作成し終わると、送信データ427のペイロードを暗号化するよう送信データ暗号化部421に命令する。すると、送信データ暗号化部421は送信先のアドレス(すなわち他の通信装置400のアドレス)を認識し、認識したアドレスに対応づけられて外部由来アクセス鍵記憶部408に記憶されている外部由来アクセス鍵を読み出す。
 なお、第1実施形態と同様に、データ処理部423が送信データ427の送信先を明示的に送信データ暗号化部421に通知することにより、送信データ暗号化部421が送信先のアドレスを認識してもよい。あるいは、送信データ暗号化部421は、送信データ427のヘッダから送信先のアドレスを読み取ることにより、送信先のアドレスを認識してもよい。
 そして、送信データ暗号化部421は、読み出した外部由来アクセス鍵を用いて送信データ427のペイロードを暗号化する。その際、外部由来アクセス鍵再暗号化部419と受信データ再暗号化部420による再暗号化と同様に、送信データ暗号化部421もメモリ410上の同一記憶領域への上書きを行う。つまり、送信データ暗号化部421は、送信データ427の平文のペイロードを暗号化し、暗号化により得られる暗号文のデータによってペイロードを上書きする。このような上書きにより、送信データ427の送信時においても、メモリ410の効率的な利用が可能となる。
 また、送信データ暗号化部421は、暗号化処理を終えると、送信データ427を送信するよう送信部424に命令する。そして、送信部424が送信データ427を送信する。
 さて、続いて通信装置400における共通鍵の更新について説明する。通信装置400の共通鍵管理部402は、第1実施形態の鍵管理部101が図10または図12の処理を行うことで鍵記憶部102上の暗号鍵を更新するのと同様にして、共通鍵記憶部406上の共通鍵を更新する。よって、ここでは詳細な説明は割愛するが、図10のステップS201または図12のステップS301に相当する処理について補足すれば下記のとおりである。
 第2実施形態においては、時計425が、共通鍵の更新間隔SIが経過するたびに前述の共通鍵更新タイミング信号を出力してもよい。そして、共通鍵管理部402は、共通鍵更新タイミング信号を検出したときに、「共通鍵を更新する時刻になった」と認識してもよい。あるいは、共通鍵管理部402は、時計425から現在時刻を取得し、共通鍵を更新する基準時刻と共通鍵の更新間隔SIと現在時刻を用いて、共通鍵を更新する時刻になったか否かを判断してもよい。
 続いて、通信装置400における内部由来アクセス鍵の更新について説明する。通信装置400の内部由来アクセス鍵管理部403は、第1実施形態の鍵管理部101が図10または図12の処理を行うことで鍵記憶部102上の暗号鍵を更新するのと同様にして、内部由来アクセス鍵記憶部407上の内部由来アクセス鍵を更新する。よって、ここでは詳細な説明は割愛するが、図10のステップS201または図12のステップS301に相当する処理について補足すれば下記のとおりである。
 第2実施形態においては、時計425が、内部由来アクセス鍵の更新間隔AIが経過するたびに内部由来アクセス鍵更新タイミング信号(例えば割り込み信号)を出力してもよい。そして、内部由来アクセス鍵管理部403は、内部由来アクセス鍵更新タイミング信号を検出したときに、「内部由来アクセス鍵を更新する時刻になった」と認識してもよい。あるいは、内部由来アクセス鍵管理部403は、時計425から現在時刻を取得し、内部由来アクセス鍵を更新する基準時刻と内部由来アクセス鍵の更新間隔AIと現在時刻を用いて、内部由来アクセス鍵を更新する時刻になったか否かを判断してもよい。
 続いて、図19を参照して内部由来アクセス鍵の配送について説明する。図19は、第2実施形態において通信装置が行う内部由来アクセス鍵配送処理のフローチャートである。
 図19の処理は、通信装置400に電源が入れられた後、少なくとも内部由来アクセス鍵記憶部407に現在内部由来アクセス鍵が設定されてから開始される。例えば、内部由来アクセス鍵管理部403は、通信装置400に電源が入れられると、第1世代の内部由来アクセス鍵を生成して内部由来アクセス鍵記憶部407に現在内部由来アクセス鍵として格納し、その後、図19の処理を開始してもよい。
 ステップS701で内部由来アクセス鍵管理部403は、内部由来アクセス鍵を通知する時刻になるまで待機する。そして、内部由来アクセス鍵を通知する時刻になったと内部由来アクセス鍵管理部403が判断すると、処理はステップS702に移行する。
 なお、第2実施形態では、所定の通知間隔(後述の図20における“AN”)で内部由来アクセス鍵が他の通信装置400に配送される(つまり通知される)。第2実施形態では、アクセス鍵の通知間隔ANは、アクセス鍵の更新間隔AIよりも短い。また、詳しくは図20とともに後述するが、どの世代の内部由来アクセス鍵も複数回通知されるようにするために、アクセス鍵の通知間隔ANは、アクセス鍵の更新間隔AIの半分以下であることが好ましい。
 なお、内部由来アクセス鍵を通知する時刻になったか否かを内部由来アクセス鍵管理部403が認識する具体的方法は任意である。
 例えば、時計425は、アクセス鍵の通知間隔ANが経過するたびに、アクセス鍵の通知の契機となるアクセス鍵通知タイミング信号を出力してもよい。アクセス鍵通知タイミング信号は、例えば割り込み信号でもよい。内部由来アクセス鍵管理部403は、時計425からのアクセス鍵通知タイミング信号を検出すると、内部由来アクセス鍵を通知する時刻になったと認識する。
 あるいは、内部由来アクセス鍵管理部403は、時計425から現在時刻を取得し、内部由来アクセス鍵を通知する基準時刻とアクセス鍵の通知間隔ANと現在時刻を用いて、内部由来アクセス鍵を通知する時刻になったか否かを判断してもよい。
 さて、ステップS702では、内部由来アクセス鍵管理部403は、現在内部由来アクセス鍵を含む平文の内部由来アクセス鍵配送データ429を生成してメモリ410上に格納する。なお、ステップS702における内部由来アクセス鍵管理部403は、第1実施形態において送信データ115を作成する平文処理部109と類似の機能を果たす。
 ステップS702で生成される内部由来アクセス鍵配送データ429のペイロードは、まだ平文の状態である。つまり、内部由来アクセス鍵配送データ429は図6の平文PDU304の一例であり、ボディ301は現在内部由来アクセス鍵を含む。また、内部由来アクセス鍵管理部403はボディ301から特徴値303を計算し、ヘッダ302を適宜設定する。なお、ステップS703に関して述べるように、第2実施形態では、ヘッダ302内の送信先アドレスとしてブロードキャストアドレスが設定される。
 そして、内部由来アクセス鍵管理部403は、平文の内部由来アクセス鍵配送データ429をメモリ410上に生成し終わると、ペイロードを暗号化するよう内部由来アクセス鍵暗号化部422に命令する。すると、内部由来アクセス鍵暗号化部422は、共通鍵記憶部406から現在共通鍵を読み出し、現在共通鍵を用いて内部由来アクセス鍵配送データ429のペイロードを暗号化する。
 その際、外部由来アクセス鍵再暗号化部419と受信データ再暗号化部420による再暗号化と同様に、内部由来アクセス鍵暗号化部422もメモリ410上の同一記憶領域への上書きを行う。つまり、内部由来アクセス鍵暗号化部422は、内部由来アクセス鍵配送データ429の平文のペイロードを暗号化し、暗号化により得られる暗号文のデータによってペイロードを上書きする。このような上書きにより、内部由来アクセス鍵配送データ429の送信時においても、メモリ410の効率的な利用が可能となる。
 また、内部由来アクセス鍵暗号化部422は、暗号化処理を終えると、内部由来アクセス鍵配送データ429を送信するよう送信部424に命令する。
 すると、次のステップS703で送信部424は、ステップS702での暗号化の結果として得られた内部由来アクセス鍵配送データ429を送信する。具体的には、第2実施形態では、送信先アドレスとしてブロードキャストアドレスが設定されるので、通信装置400は内部由来アクセス鍵配送データ429をブロードキャストする。
 例えば、複数の通信装置400が無線アドホックネットワークを構築する場合、ステップS703におけるブロードキャストとは、1ホップで到達可能な範囲のすべての他の通信装置400への送信を意味する。よって、送信部424が送信したPDUは、中継を経ずに当該PDUを直接受信することができるすべての他の通信装置400において、図17の処理の対象となる。
 また、複数の通信装置400が有線アドホックネットワークを構築する場合、ステップS703におけるブロードキャストとは、1ホップで到達可能な範囲の他のすべての通信装置400への送信を意味する。つまり、内部由来アクセス鍵配送データ429の送信元の通信装置400と直接ケーブルで接続されているすべての他の通信装置400へ、内部由来アクセス鍵配送データ429が送信される。そして、送信されたPDUは、内部由来アクセス鍵配送データ429の送信元の通信装置400と直接ケーブルで接続されているすべての他の通信装置400において、図17の処理の対象となる。
 あるいは、第2実施形態がイーサネット(登録商標)に適用される場合は、内部由来アクセス鍵配送データ429の送信元の通信装置400と同じブロードキャストドメインに属するすべての他の通信装置400へ、内部由来アクセス鍵配送データ429が送信される。そして、送信されたPDUは、送信元の通信装置400と同じブロードキャストドメインに属するすべての他の通信装置400において、図17の処理の対象となる。
 いずれにせよ、ステップS703でのブロードキャストの後、処理はステップS701に戻る。
 なお、図19によれば、内部由来アクセス鍵の通知のたびに内部由来アクセス鍵配送データ429のペイロードの暗号化が行われるが、実施形態によっては、内部由来アクセス鍵配送データ429が再利用されてもよい。つまり、同じ内部由来アクセス鍵が複数回通知されるように内部由来アクセス鍵の更新間隔AIと通知間隔ANが設定されている場合は、内部由来アクセス鍵の更新後の初めての通知のときのみ内部由来アクセス鍵配送データ429の作成が行われてもよい。
 そして、メモリ410は、ペイロードが暗号化された状態の内部由来アクセス鍵配送データ429を、次に内部由来アクセス鍵が更新されるまで保持し続けてもよい。すると、内部由来アクセス鍵の更新後の2回目以降の通知においては、ステップS702が省略可能である。つまり、内部由来アクセス鍵管理部403は、メモリ410上の既存の内部由来アクセス鍵配送データ429を再度送信するよう、送信部424に命令してもよい。
 続いて、上記で説明した各種処理の実行タイミングについて図20を参照して説明する。図20は、第2実施形態における共通鍵と内部由来アクセス鍵の更新を示すタイミングチャートである。
 第2実施形態では、共通鍵管理部402が所定の更新間隔SIで定期的に共通鍵を更新する。図20には、第(γ-1)世代の共通鍵SKγ-1から第(γ+2)世代の共通鍵SKγ+2までが図示されている。
 また、図17のステップS508に関して説明したように、第2実施形態では、現在共通鍵での復号が失敗した場合の再暗号化と旧共通鍵による復号は、共通鍵の更新から一定の許容時間STの間でのみ行われる。そして、許容時間STは更新間隔SIよりも短い。
 なお、更新間隔SIは、例えば、通信装置400が含まれるネットワークにおけるトラフィック量に応じた適宜の値に設定されることが好ましい。一例として、更新間隔SIは6時間~12時間程度の長さでもよい。また、許容時間STは、例えば、通信装置400間での同期の精度、またはアクセス鍵を配送しあう通信装置400間での通信にかかる時間などに基づいて、実施形態に応じた適宜の値に設定されることが好ましい。
 そして、共通鍵管理部402による共通鍵の更新とは独立に、内部由来アクセス鍵管理部403は、所定の更新間隔AIで定期的に内部由来アクセス鍵を更新する。図20には、第(a-1)世代の内部由来アクセス鍵AKA,a-1から第(a+4)世代の内部由来アクセス鍵AKA,a+4までが図示されている。
 内部由来アクセス鍵の更新間隔AIは、共通鍵の更新間隔SIよりも短く、好ましくは共通鍵の更新間隔SIの半分以下である。内部由来アクセス鍵の更新間隔AIは、例えば、通信装置400が含まれるネットワークにおけるトラフィック量に応じた適宜の値に設定されることが好ましい。一例として、内部由来アクセス鍵の更新間隔AIは、10分~20分程度の長さでもよい。なお、共通鍵の更新間隔SIは、内部由来アクセス鍵の更新間隔AIで割り切れる長さでなくてもよい。
 また、第2実施形態では、図18のステップS606に関して説明したように、現在内部由来アクセス鍵での復号が失敗した場合の再暗号化と旧内部由来アクセス鍵による復号は、内部由来アクセス鍵の更新から一定の許容時間ATの間でのみ行われる。そして、許容時間ATは更新間隔AIよりも短い。許容時間ATは、例えば、アクセス鍵によって暗号化したPDUをやりとりする通信装置400間での通信にかかる時間などに基づいて、実施形態に応じた適宜の値に設定されることが好ましい。
 さらに、第2実施形態では、図19のステップS701に関して説明したように、通信装置400は所定の通知間隔ANで内部由来アクセス鍵を他の通信装置400に通知する。通知間隔ANは、内部由来アクセス鍵の更新間隔AIよりも短く、好ましくは更新間隔AIの半分以下である。一例として、通知間隔ANは1~5分程度の長さでもよい。なお、更新間隔AIは、通知間隔ANで割り切れる長さでなくてもよい。
 通知間隔ANが更新間隔AIよりも短いため、図20の例では、例えば第a世代の内部由来アクセス鍵AKA,aは、内部由来アクセス鍵AKA,aが現在内部由来アクセス鍵として認識されている期間中に5回、通知される。このように内部由来アクセス鍵の更新よりも頻繁に内部由来アクセス鍵の通知を行うことは、アドホックネットワーク内の通信装置400に特に好適である。
 なぜなら、アドホックネットワークに接続される通信装置が時々刻々と動的に変化する可能性があるからである。例えば、新たな通信装置400が任意の時点でアドホックネットワークに参加し始めることがある。
 より具体的には、例えば、アクセス鍵AKA,aの1回目の通知の時点ではアドホックネットワークに接続されていなかった新たな通信装置400が、アクセス鍵AKA,aの3回目の通知の時点では既にアドホックネットワークに接続されている場合もありうる。すると、新たにアドホックネットワークに参加した当該通信装置400は、次の第(a+1)世代のアクセス鍵AKA,a+1の通知まで待たずに、アクセス鍵AKA,aの3回目の通知の時点からすぐに、アクセス鍵による暗号化通信を始めることが可能となる。
 また、通信装置400の設置位置は固定されていてもよいが、無線アドホックネットワークでは、通信装置400が移動体であってもよい。すると、通信装置400の移動に応じて、あるいは遮蔽物の有無などの無線通信環境の変化に応じて、たまたまアクセス鍵の通知を受信することができない場合もありうる。
 例えば、アドレスAdrの通信装置400は、アドレスAdrの通信装置400からのアクセス鍵AKA,aの1回目の通知を受信することがでできないかもしれない。しかし、無線通信環境の変化に応じて、アドレスAdrの通信装置400は、アドレスAdrの通信装置400からのアクセス鍵AKA,aの2回目の通知を受信することはできるかもしれない。すると、アドレスAdrの通信装置400は、アクセス鍵AKA,aの2回目の通知以降は、アドレスAdrの通信装置400宛のPDUをアクセス鍵AKA,aを用いて暗号化して送信することができる。
 よって、アドレスAdrの通信装置400が、アクセス鍵を第(a-1)世代から第a世代に更新した後、古いアクセス鍵AKA,a-1で暗号化されたPDUをアドレスAdrの通信装置400から受信するのは、せいぜい2回目の通知の少し後までである。そして、例えば図20のようにアクセス鍵AKA,aの2回目の通知の少し後まで、許容時間ATの範囲に含まれているとする。すると、アドレスAdrの通信装置400にとっては、アクセス鍵AKA,a-1で暗号化されたPDUを受信するのは、旧内部由来アクセス鍵AKA,a-1の有効期限内である。よって、アクセス鍵AKA,a-1で暗号化されたPDUの送受信が無駄にならず、PDUの再送要求などのエラー処理も不要である。
 すなわち、上記の例から理解されるように、通知間隔ANは、更新間隔AIより短いだけではなく、許容時間ATの半分以下であることがより好ましい。その理由について補足すれば次のとおりである。
 通知間隔ANが許容時間ATの半分以下だと、許容時間AT内に複数回の通知が含まれる。よって、「アクセス鍵の更新後の1回目の通知が、通知先のある通信装置400において偶然受信不能であっても、許容時間AT内には、通知先の通信装置400が更新後の新たなアクセス鍵を認識することができる」という見込みが高まる。すると、エラー処理の頻度が低減する。また、通知間隔ANが短ければ、再暗号化と旧内部由来アクセス鍵による復号の頻度も低減する。すると、結果として、個々の通信装置400の再暗号化と再度の復号にかかる処理負荷も低減し、ネットワークの無駄なトラフィックも低減する。
 ところで、本発明は上記実施形態に限られるものではない。上記の説明においてもいくつかの変形について説明したが、上記実施形態は、さらに例えば下記(b1)~(b7)の観点から様々に変形することもでき、これらの変形は、相互に矛盾しない限り、任意に組み合わせることが可能である。
 (b1)暗号鍵の更新間隔と通知間隔に関する観点
 実施形態によっては、アクセス鍵の通知間隔ANは、アクセス鍵の更新間隔AIと同じでもよい。つまり内部由来アクセス鍵が生成されるごとに、生成の直後に1回、内部由来アクセス鍵が通知されてもよい。例えば、通信品質の良い有線ネットワークでは、通知間隔ANと更新間隔AIが同じでもよい。
 また、有効期限は、共通鍵とアクセス鍵の一方にのみ設定されていてもよい。つまり、第2実施形態で、図17のステップS508または図18のステップS606の、有効期限に関する分岐が省略されてもよい。逆に、第1実施形態に、第2実施形態と同様の有効期限が導入されてもよい。なお、有効期限が省略されるということは、暗号鍵の更新間隔と等しい有効期限が設定されるのと同じことである。
 ところで、複数の通信装置が互いに同じアルゴリズムにしたがって暗号鍵を生成および更新する場合には、複数の通信装置が暗号鍵の更新のタイミングについて共通認識を持つことができるように、暗号鍵の更新タイミングが事前に決められる。固定の間隔での更新は、複数の通信装置が暗号鍵の更新のタイミングについて共通認識を持つための一法である。もちろん、実施形態によっては、暗号鍵の更新のタイミングに関する不規則な間隔のスケジュールが、予め複数の通信装置間で共有されていてもよい。
 それに対して、鍵配送により通信装置間で確立される暗号鍵に関しては、通信装置が暗号鍵を更新する間隔は固定されていなくてもよい。例えば、第2実施形態の通信装置400同士はアクセス鍵を配送しあう。よって、個々の通信装置400は、他の通信装置400がアクセス鍵を更新するタイミングについて事前に認識していなくてもよい。
 例えば、第1と第2の通信装置400がある場合、第2の通信装置400は、第1の通信装置400が第1の通信装置400にとっての内部由来アクセス鍵を更新する間隔について知る必要はない。よって、第1の通信装置400は、例えばPDUの受信頻度などの状況の変化に応じて、内部由来アクセス鍵の更新間隔を動的に変更してもよい。
 (b2)保持する暗号鍵の数に関する観点
 第1実施形態の鍵記憶部102は、2世代以上の旧鍵を保持してもよい。同様に、第2実施形態の共通鍵記憶部406は、2世代以上の旧共通鍵を保持してもよいし、内部由来アクセス鍵記憶部407は、2世代以上の旧内部由来アクセス鍵を保持してもよい。そして、再暗号化と復号が、必要に応じて、保持されている複数の古い暗号鍵に関して順々に試されてもよい。
 例えば鍵記憶部102は、現在鍵と、1世代前の旧鍵と、2世代前の旧鍵という3つの世代の暗号鍵を保持してもよい。なお、鍵管理部101は、新たな暗号鍵を生成すると、鍵記憶部102上の3つの世代の暗号鍵を適宜更新する。この場合、受信したPDUのペイロードの復号に関して、通信装置100は、「現在鍵、1世代前の旧鍵、2世代前の旧鍵」というように、新しい暗号鍵から順に試すのが適切である。
 具体的には、図7のステップS111で2つの特徴値が一致しなかった場合、判断部107は、受信データ114のペイロードを再暗号化するよう、再暗号化部108に命令する。なお、この場合、選択暗号鍵のリセットはステップS111の段階では行われない。
 そして、再暗号化部108は1世代前の旧鍵で受信データ114のペイロードを再暗号化する。さらに、再暗号化部108は再暗号化の終了を指示部103に通知する。すると、指示部103は、選択暗号鍵を、現在選択している1世代前の旧鍵から2世代前の旧鍵に切り換える。
 そして、指示部103は、復号部106に受信データ114のペイロードを復号するよう命令する。すると、復号部106は、2世代前の旧鍵を用いて受信データ114のペイロードを復号する。さらに、復号部106は復号の終了を判断部107に通知する。
 すると、判断部107は復号されたペイロードから特徴値を取り出し、ボディから特徴値を計算し、2つの特徴値を比較する。その結果、2つの特徴値が一致すれば、選択暗号鍵のリセットが行われ、処理がステップS106に移行する。逆に、2つの特徴値が一致しない場合は、選択暗号鍵のリセットが行われ、処理がステップS112に移行する。
 もちろん、第2実施形態も、上記と同様にして変形可能である。また、3世代以上前の旧鍵をさらに利用する実施形態も可能である。以上のように2世代以上前の旧鍵も利用する実施形態は、通信に時間のかかる通信装置間での暗号化通信に特に好適である。
 (b3)暗号鍵が確立される範囲に関する観点
 暗号鍵が確立される範囲は実施形態に応じて適宜変更されてよい。例えば、図14の通信装置400が図2のアドホックネットワーク140内のノードとして利用される場合、アドホックネットワーク140のすべてのノード間で同じ共通鍵が使われてもよい。しかし、ネットワークの構成、適用対象のプロトコルのレイヤ、暗号化通信の目的などに応じて、暗号鍵が確立される範囲は適宜変形されてもよい。
 例えば、第2実施形態においては、図19のステップS703で、内部由来アクセス鍵が1ホップ以内の他のすべての通信装置400にブロードキャストにより通知される。しかし、実施形態によっては、内部由来アクセス鍵の通知先の通信装置400は、例えば特定の1つに限定されてもよい。
 (b4)暗号鍵の生成アルゴリズムに関する観点
 暗号鍵の生成アルゴリズムは任意である。つまり、鍵管理部101と共通鍵管理部402と内部由来アクセス鍵管理部403は、それぞれ任意のアルゴリズムにしたがって、暗号鍵を生成することができる。
 例えば、鍵管理部101と共通鍵管理部402と内部由来アクセス鍵管理部403は、時刻に対して一意な値を求める処理を行うことで暗号鍵を生成してもよい。時刻に対して一意な値を求める処理とは、例えば、現在時刻をシード(seed)として用いて乱数を発生させ、乱数を使って暗号鍵を生成する処理である。また、シードは、通信装置を識別する情報(例えばIDまたはアドレス)と現在時刻を組み合わせて得られる情報でもよい。
 (b5)特徴値に関する観点
 上述のとおり、図6の特徴値303としては、例えばハッシュ値が利用可能である。その場合、暗号化された特徴値306は、メッセージ認証コード(Message Authentication Code;MAC)の1種であるkeyed-Hashing for MAC(HMAC)に相当する。
 なお、第1および第2実施形態では、ボディ301と特徴値303が同じ暗号鍵で同じ暗号化アルゴリズムにより暗号化される。しかし、ボディ301と特徴値303が別の暗号鍵で暗号化されてもよいし、ボディ301と特徴値303が別の暗号化アルゴリズムにより暗号化されてもよい。
 例えば、第2実施形態において、アクセス鍵により暗号化される種類のPDUに関して、ペイロードのうちボディ301の部分がアクセス鍵により暗号化され、特徴値303の部分が固定の暗号鍵により暗号化されてもよい。その場合、受信データ復号部413は、暗号化されたボディを内部由来アクセス鍵で復号し、暗号化された特徴値を固定の暗号鍵により復号すればよい。また、受信データ再暗号化部420は、復号されたボディを内部由来アクセス鍵で再暗号化し、復号された特徴値を固定の暗号鍵で再暗号化すればよい。
 また、実施形態によっては、判断部107、外部由来アクセス鍵判断部416または受信データ判断部417による判断のために、公開鍵暗号アルゴリズムによるディジタル署名が利用されてもよい。
 例えば、第1の通信装置400は、予め公開鍵を第2の通信装置400に公開する。そして、第1の通信装置400のデータ処理部423は、ボディ301からハッシュ値を計算し、計算したハッシュ値を秘密鍵で暗号化することで、特徴値303としてのディジタル署名を生成してもよい。この場合、送信データ暗号化部421は、ディジタル署名を含むペイロード全体を第2の通信装置400のアクセス鍵で暗号化してもよいし、ボディ301の部分のみを第2の通信装置400のアクセス鍵で暗号化してもよい。
 送信データ暗号化部421が、特徴値303としてのディジタル署名を含むペイロード全体を第2の通信装置400のアクセス鍵で暗号化する実施形態では、第2の通信装置400の受信データ復号部413は、ペイロード全体をアクセス鍵で復号する。そして、受信データ判断部417は、復号された特徴値309を公開鍵で復号し、ハッシュ値を得る。また、受信データ判断部417は、復号されたボディ308から、図6の特徴値311に相当するハッシュ値を計算する。
 そして、得られた2つのハッシュ値が等しければ、受信データ判断部417は、「暗号化に使われたのと同じアクセス鍵でペイロードが復号された」と判断する。つまり、受信データ判断部417は、「復号されたデータは正常な平文データであり、復号は成功した」と判断する。
 他方、得られた2つのハッシュ値が異なる場合は、受信データ判断部417は、「暗号化に使われたのと違うアクセス鍵でペイロードが復号された」と判断する。つまり、受信データ判断部417は、「復号されたデータは異常であり、復号は失敗した」と判断する。
 つまり、第1および第2実施形態では、復号された特徴値309と計算された特徴値311が完全に一致するか否かが、復号された特徴値309と計算された特徴値311の間の整合性の判断に使われる。しかし、上記のとおり実施形態によっては、復号された特徴値309に対して公開鍵による復号などの何らかの操作を施した結果が、特徴値311と比較される。換言すれば、実施形態によっては、「復号された特徴値309自体と特徴値311が完全に一致するか否か」という基準以外の基準により整合性の判断が行われる。
 なお、ディジタル署名が使われる場合は、第1の通信装置400の送信データ暗号化部421が、ボディ301の部分のみを第2の通信装置400のアクセス鍵で暗号化する実施形態も可能である。その場合、第2の通信装置400の受信データ復号部413は、暗号化されたボディ305のみをアクセス鍵で復号する。
 そして、受信データ判断部417は、特徴値303としてのディジタル署名を公開鍵で復号してハッシュ値を得る。また、受信データ判断部417は、復号されたボディ308から、図6の特徴値311に相当するハッシュ値を算出する。そして、受信データ判断部417は、2つのハッシュ値を比較することで、特徴値303と計算された特徴値311との間の整合性を判断する。
 (b6)データ形式に関する観点
 図5と図15にはテーブル形式でデータを例示したが、鍵記憶部102、鍵認識部112、共通鍵記憶部406、内部由来アクセス鍵記憶部407、および外部由来アクセス鍵記憶部408に保持されるデータの形式はテーブル形式に限られない。
 例えば、鍵記憶部102は、大きさが3のリングバッファにより実現されてもよい。そして、リングバッファにおいて1つのエントリは現在鍵用に、1つのエントリは旧鍵用に、1つのエントリは新たに生成される暗号鍵の一時記憶領域用に使われてもよい。この場合、鍵管理部101は、暗号鍵の生成のたびに、現在鍵を指すポインタを動かせばよい。内部由来アクセス鍵記憶部407も同様に、リングバッファにより実現されてもよい。
 また、鍵認識部112と外部由来アクセス鍵記憶部408におけるデータ形式は、図示したようなテーブル形式でもよいが、アドレスと暗号鍵のペアを要素として持つ線形リストまたはFirst-In-First-Out(FIFO)キューなどでもよい。
 (b7)上書きを行う対象についての観点
 第2実施形態は、アクセス鍵の配送用PDUに関して記憶領域の上書きが行われないように変形されてもよい。つまり、内部由来アクセス鍵暗号化部422と外部由来アクセス鍵復号部414と外部由来アクセス鍵再暗号化部419は、暗号化または復号の際に、必ずしも記憶領域の上書きを行わなくてもよい。
 その理由は、アクセス鍵の配送用PDUなどの制御用PDUは、一般にペイロードが短いからである。そのため、記憶領域の上書きが行われないことによる記憶領域の消費の影響は、アクセス鍵の配送用PDUの場合は、アクセス鍵により暗号化されるアプリケーションデータ用PDUの場合よりも小さい。つまり、実施形態によっては、アクセス鍵により暗号化されるアプリケーションデータ用PDUについて記憶領域の上書きを行うだけで、メモリ410の有効利用が十分に達成されることもある。
 同様の理由から、例えば、「受信頻度に比べて送信頻度が少ない」、あるいは「送信データ115のデータ長が短い」といった特定の環境においては、送信データ115について記憶領域の上書きが行われなくてもよい。
 なお、以上の本明細書の説明において、「上書き」という用語の意味は、「書き戻す」ことも含む。例えば、第1のデータを直接第2のデータで上書きすることは、別の観点から表現すれば、第1のデータが記憶されている記憶領域に直接第2のデータを書き戻すことである。また、第1のデータが記憶されている記憶領域をクリアしてから同じ記憶領域に第2のデータを書き戻すことも、「上書き」の1種である。

Claims (7)

  1.  暗号化データまたは復号データを記憶するデータ記憶部と、
     暗号化データを復号する復号部と、
     復号データを暗号化する暗号化部と、
     前記暗号化部に対して、第1の暗号化データを暗号鍵に基づいて前記復号部が復号した第1の復号データを前記データ記憶部から読み出して、前記第1の復号データを前記暗号鍵に基づいて暗号化した第2の暗号化データを前記データ記憶部に書き戻すように、命令を出す判断部と
     を備える通信装置。
  2.  前記復号部は、前記第2の暗号化データを前記データ記憶部から読み出し、前記第2の暗号化データを前記暗号鍵とは異なる暗号鍵に基づいて復号した第2の復号データを前記データ記憶部に書き戻す
     ことを特徴とする請求項1記載の通信装置。
  3.  前記暗号鍵を記憶する第1の記憶領域と、前記暗号鍵とは異なる暗号鍵を記憶する第2の記憶領域を含む鍵記憶部と、
     新たな暗号鍵を第3の記憶領域に記憶し、前記第1の記憶領域に記憶されている前記暗号鍵を第4の記憶領域にコピーし、前記暗号鍵の前記第1の記憶領域から前記第4の記憶領域へのコピーの後に前記新たな暗号鍵を前記第3の記憶領域から前記第1の記憶領域にコピーし、前記第4の記憶領域にコピーされた前記暗号鍵を、前記新たな暗号鍵の前記第3の記憶領域から前記第1の記憶領域へのコピーの後に、前記第2の記憶領域にコピーする鍵管理部
     をさらに備えることを特徴とする請求項1または2に記載の通信装置。
  4.  前記暗号鍵の更新を繰り返す鍵管理部と、
     前記鍵管理部が前記暗号鍵を更新する更新間隔の半分以下の間隔で、前記鍵管理部が更新した前記暗号鍵を他の通信装置に通知する通知部
     をさらに備えることを特徴とする請求項1または2に記載の通信装置。
  5.  前記暗号鍵を更新する鍵管理部と、
     前記鍵管理部が更新した前記暗号鍵の他の通信装置への通知を繰り返し行う通知部をさらに備え、
     前記鍵管理部が前記暗号鍵を更新してから、決められた許容時間が経過するまでの間でのみ、前記判断部は、前記暗号化部に対して前記命令を出し、
     前記通知部が前記通知を行う通知間隔は、前記許容時間の長さの半分以下である
     ことを特徴とする請求項1または2に記載の通信装置。
  6.  コンピュータに、
     前記コンピュータが備えるデータ記憶部に第1の暗号化データを記憶し、
     記憶した前記第1の暗号化データを暗号鍵に基づいて復号することで復号データを得、
     得た前記復号データを前記データ記憶部に記憶し、
     記憶した前記復号データを前記データ記憶部から読み出し、
     読み出した前記復号データを前記暗号鍵に基づいて暗号化することで第2の暗号化データを得、
     得た前記第2の暗号化データを前記データ記憶部に書き戻す
     ことを含む処理を行わせるプログラム。
  7.  通信装置が、
     前記通信装置が備えるデータ記憶部に第1の暗号化データを記憶し、
     記憶した前記第1の暗号化データを暗号鍵に基づいて復号することで復号データを得、
     得た前記復号データを前記データ記憶部に記憶し、
     記憶した前記復号データを前記データ記憶部から読み出し、
     読み出した前記復号データを前記暗号鍵に基づいて暗号化することで第2の暗号化データを得、
     得た前記第2の暗号化データを前記データ記憶部に書き戻す
     ことを特徴とする方法。
PCT/JP2010/001912 2010-03-17 2010-03-17 通信装置、プログラムおよび方法 WO2011114373A1 (ja)

Priority Applications (4)

Application Number Priority Date Filing Date Title
JP2012505306A JP5454673B2 (ja) 2010-03-17 2010-03-17 通信装置、プログラムおよび方法
PCT/JP2010/001912 WO2011114373A1 (ja) 2010-03-17 2010-03-17 通信装置、プログラムおよび方法
CN201080065354.4A CN103109493B (zh) 2010-03-17 2010-03-17 通信装置、程序以及方法
US13/613,633 US20130070925A1 (en) 2010-03-17 2012-09-13 Communication device, recording medium, and method thereof

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/JP2010/001912 WO2011114373A1 (ja) 2010-03-17 2010-03-17 通信装置、プログラムおよび方法

Related Child Applications (1)

Application Number Title Priority Date Filing Date
US13/613,633 Continuation US20130070925A1 (en) 2010-03-17 2012-09-13 Communication device, recording medium, and method thereof

Publications (1)

Publication Number Publication Date
WO2011114373A1 true WO2011114373A1 (ja) 2011-09-22

Family

ID=44648512

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/JP2010/001912 WO2011114373A1 (ja) 2010-03-17 2010-03-17 通信装置、プログラムおよび方法

Country Status (4)

Country Link
US (1) US20130070925A1 (ja)
JP (1) JP5454673B2 (ja)
CN (1) CN103109493B (ja)
WO (1) WO2011114373A1 (ja)

Cited By (14)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2013153978A (ja) * 2012-01-30 2013-08-15 Sanyo Product Co Ltd 遊技機
JP2013153976A (ja) * 2012-01-30 2013-08-15 Sanyo Product Co Ltd 遊技機
JP2013153979A (ja) * 2012-01-30 2013-08-15 Sanyo Product Co Ltd 遊技機
JP2013153986A (ja) * 2012-01-30 2013-08-15 Sanyo Product Co Ltd 遊技機
JP2013153981A (ja) * 2012-01-30 2013-08-15 Sanyo Product Co Ltd 遊技機
JP2013153977A (ja) * 2012-01-30 2013-08-15 Sanyo Product Co Ltd 遊技機
JP2013153980A (ja) * 2012-01-30 2013-08-15 Sanyo Product Co Ltd 遊技機
WO2014076911A1 (ja) * 2012-11-13 2014-05-22 日本電気株式会社 メッセージ認証システム、およびメッセージ認証方法
JP2015226072A (ja) * 2014-05-26 2015-12-14 株式会社リコー 情報処理システム、情報処理方法、及びプログラム
JP2018042081A (ja) * 2016-09-07 2018-03-15 日本電信電話株式会社 データ送受信方法およびセンシングシステム
JP2018046366A (ja) * 2016-09-13 2018-03-22 株式会社Jvcケンウッド 復号装置、暗号化装置、復号方法、暗号化方法、プログラム
WO2018066506A1 (ja) * 2016-10-03 2018-04-12 日本電気株式会社 通信装置、通信方法、通信システム及び記録媒体
JP2018074481A (ja) * 2016-11-01 2018-05-10 住友電工システムソリューション株式会社 無線機、路側通信機、更新方法、及びコンピュータプログラム
JP2020092323A (ja) * 2018-12-05 2020-06-11 凸版印刷株式会社 暗号化通信システム及び暗号化通信方法

Families Citing this family (24)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP5285778B2 (ja) * 2009-08-03 2013-09-11 日本電信電話株式会社 関数暗号応用システム及び方法
US20140064107A1 (en) * 2012-08-28 2014-03-06 Palo Alto Research Center Incorporated Method and system for feature-based addressing
KR20150006131A (ko) * 2013-07-08 2015-01-16 삼성전자주식회사 단말 간 통신에서 암호화 적용 방법 및 장치
US9509605B2 (en) * 2014-02-06 2016-11-29 Telefonaktiebolaget Lm Ericsson (Publ) Methods and apparatuses for handling communication in a communication system comprising an access point and a wire line network node connected via wire line to the access point
FR3019416A1 (fr) * 2014-03-28 2015-10-02 Orange Procede de traitement de donnees
US9923719B2 (en) * 2014-12-09 2018-03-20 Cryptography Research, Inc. Location aware cryptography
US10412069B2 (en) * 2015-01-19 2019-09-10 Mitsubishi Electric Corporation Packet transmitting apparatus, packet receiving apparatus, and computer readable medium
US9734095B2 (en) * 2015-09-01 2017-08-15 International Business Machines Corporation Nonvolatile memory data security
CN106599698B (zh) * 2015-10-19 2019-09-20 腾讯科技(深圳)有限公司 一种加密图片、解密图片的方法和装置
WO2017156414A2 (en) * 2016-03-11 2017-09-14 Maydanik Boris Systems and methods for securing electronic data with embedded security engines
US10103883B2 (en) * 2016-03-25 2018-10-16 Ca, Inc. Queueing construct for X.509 digital certificates
US9591479B1 (en) * 2016-04-14 2017-03-07 Wickr Inc. Secure telecommunications
CN106022806A (zh) * 2016-05-27 2016-10-12 乐视控股(北京)有限公司 移动终端查验方法、装置及电子终端
US10887291B2 (en) 2016-12-16 2021-01-05 Amazon Technologies, Inc. Secure data distribution of sensitive data across content delivery networks
US10860724B2 (en) * 2017-06-13 2020-12-08 Microsoft Technology Licensing, Llc Active key rolling for sensitive data protection
US10855440B1 (en) 2017-11-08 2020-12-01 Wickr Inc. Generating new encryption keys during a secure communication session
US11101999B2 (en) 2017-11-08 2021-08-24 Amazon Technologies, Inc. Two-way handshake for key establishment for secure communications
US10778432B2 (en) 2017-11-08 2020-09-15 Wickr Inc. End-to-end encryption during a secure communication session
US10541814B2 (en) 2017-11-08 2020-01-21 Wickr Inc. End-to-end encryption during a secure communication session
US11039309B2 (en) * 2018-02-15 2021-06-15 Huawei Technologies Co., Ltd. User plane security for disaggregated RAN nodes
US11159498B1 (en) 2018-03-21 2021-10-26 Amazon Technologies, Inc. Information security proxy service
US10979403B1 (en) 2018-06-08 2021-04-13 Amazon Technologies, Inc. Cryptographic configuration enforcement
US11671251B1 (en) 2019-11-29 2023-06-06 Amazon Technologies, Inc. Application programming interface to generate data key pairs
US11626985B1 (en) * 2019-11-29 2023-04-11 Amazon Technologies, Inc. Data reencryption techniques

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2002518935A (ja) * 1998-06-15 2002-06-25 テレフオンアクチーボラゲット エル エム エリクソン(パブル) 報知サービスに対するアクセス制御方法及びシステム
JP2007141095A (ja) * 2005-11-21 2007-06-07 Toshiba Corp データ処理装置およびデータ処理方法
JP2007199949A (ja) * 2006-01-25 2007-08-09 Mitsubishi Electric Corp 情報管理システムおよび情報処理装置
JP2007267301A (ja) * 2006-03-30 2007-10-11 Fujitsu Access Ltd 暗号化通信システム及び暗号鍵更新方法

Family Cites Families (21)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2001086527A1 (fr) * 2000-05-08 2001-11-15 Sony Corporation Systeme de transactions de donnees numeriques
ATE425622T1 (de) * 2002-05-29 2009-03-15 Panasonic Corp Datenübertragungsgerät, datenempfangsgerät, datenübertragungssystem und datenübertragungsverfahren
JP2004186814A (ja) * 2002-11-29 2004-07-02 Fujitsu Ltd 共通鍵暗号化通信システム
US8010688B2 (en) * 2003-01-15 2011-08-30 Panasonic Corporation Content use management system, content use management method, and client device
JP4734244B2 (ja) * 2003-07-29 2011-07-27 トムソン ライセンシング 無線ローカルエリアネットワークのための鍵同期メカニズム
JP4612817B2 (ja) * 2004-08-20 2011-01-12 キヤノン株式会社 グループ管理装置及び情報処理方法、ならびにコンピュータプログラム及び記録媒体
US8189786B2 (en) * 2005-05-25 2012-05-29 Zenith Electronics Llc Encryption system
US8775319B2 (en) * 2006-05-15 2014-07-08 The Directv Group, Inc. Secure content transfer systems and methods to operate the same
JP5060081B2 (ja) * 2006-08-09 2012-10-31 富士通株式会社 フレームを暗号化して中継する中継装置
JP4256415B2 (ja) * 2006-09-04 2009-04-22 株式会社日立製作所 暗号化装置、復号装置、情報システム、暗号化方法、復号方法及びプログラム
JP2008103988A (ja) * 2006-10-19 2008-05-01 Fujitsu Ltd 暗号通信システム、装置、方法及びプログラム
JP2008104040A (ja) * 2006-10-20 2008-05-01 Fujitsu Ltd 共通鍵生成装置および共通鍵生成方法
JPWO2008096396A1 (ja) * 2007-02-02 2010-05-20 パナソニック株式会社 無線通信装置および暗号鍵更新方法
US8104073B2 (en) * 2007-08-10 2012-01-24 Juniper Networks, Inc. Exchange of network access control information using tightly-constrained network access control protocols
WO2009097577A1 (en) * 2008-01-30 2009-08-06 Neology, Inc. Rfid authentication architecture and methods for rfid authentication
JP5077186B2 (ja) * 2008-10-17 2012-11-21 富士通株式会社 通信装置、通信方法及び通信プログラム
US8538027B2 (en) * 2009-10-16 2013-09-17 Brocade Communications Systems, Inc. Storage of keyID in customer data area
US8667575B2 (en) * 2009-12-23 2014-03-04 Citrix Systems, Inc. Systems and methods for AAA-traffic management information sharing across cores in a multi-core system
WO2011114460A1 (ja) * 2010-03-17 2011-09-22 富士通株式会社 通信装置及び方法並びに通信システム
US20110255689A1 (en) * 2010-04-15 2011-10-20 Lsi Corporation Multiple-mode cryptographic module usable with memory controllers
IL210169A0 (en) * 2010-12-22 2011-03-31 Yehuda Binder System and method for routing-based internet security

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2002518935A (ja) * 1998-06-15 2002-06-25 テレフオンアクチーボラゲット エル エム エリクソン(パブル) 報知サービスに対するアクセス制御方法及びシステム
JP2007141095A (ja) * 2005-11-21 2007-06-07 Toshiba Corp データ処理装置およびデータ処理方法
JP2007199949A (ja) * 2006-01-25 2007-08-09 Mitsubishi Electric Corp 情報管理システムおよび情報処理装置
JP2007267301A (ja) * 2006-03-30 2007-10-11 Fujitsu Access Ltd 暗号化通信システム及び暗号鍵更新方法

Cited By (21)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2013153978A (ja) * 2012-01-30 2013-08-15 Sanyo Product Co Ltd 遊技機
JP2013153976A (ja) * 2012-01-30 2013-08-15 Sanyo Product Co Ltd 遊技機
JP2013153979A (ja) * 2012-01-30 2013-08-15 Sanyo Product Co Ltd 遊技機
JP2013153986A (ja) * 2012-01-30 2013-08-15 Sanyo Product Co Ltd 遊技機
JP2013153981A (ja) * 2012-01-30 2013-08-15 Sanyo Product Co Ltd 遊技機
JP2013153977A (ja) * 2012-01-30 2013-08-15 Sanyo Product Co Ltd 遊技機
JP2013153980A (ja) * 2012-01-30 2013-08-15 Sanyo Product Co Ltd 遊技機
WO2014076911A1 (ja) * 2012-11-13 2014-05-22 日本電気株式会社 メッセージ認証システム、およびメッセージ認証方法
JPWO2014076911A1 (ja) * 2012-11-13 2017-01-05 日本電気株式会社 メッセージ認証システム、およびメッセージ認証方法
JP2015226072A (ja) * 2014-05-26 2015-12-14 株式会社リコー 情報処理システム、情報処理方法、及びプログラム
JP2018042081A (ja) * 2016-09-07 2018-03-15 日本電信電話株式会社 データ送受信方法およびセンシングシステム
JP2018046366A (ja) * 2016-09-13 2018-03-22 株式会社Jvcケンウッド 復号装置、暗号化装置、復号方法、暗号化方法、プログラム
WO2018066506A1 (ja) * 2016-10-03 2018-04-12 日本電気株式会社 通信装置、通信方法、通信システム及び記録媒体
CN109792384A (zh) * 2016-10-03 2019-05-21 日本电气株式会社 通信设备、通信方法、通信系统和记录介质
JPWO2018066506A1 (ja) * 2016-10-03 2019-06-24 日本電気株式会社 通信装置、通信方法、通信システム及び記録媒体
TWI688252B (zh) * 2016-10-03 2020-03-11 日商日本電氣股份有限公司 通信裝置、通信方法及記錄媒體
US11101998B2 (en) 2016-10-03 2021-08-24 Nec Corporation Communication device, communication method, and recording medium
CN109792384B (zh) * 2016-10-03 2022-03-29 日本电气株式会社 通信设备、通信方法和记录介质
JP2018074481A (ja) * 2016-11-01 2018-05-10 住友電工システムソリューション株式会社 無線機、路側通信機、更新方法、及びコンピュータプログラム
JP2020092323A (ja) * 2018-12-05 2020-06-11 凸版印刷株式会社 暗号化通信システム及び暗号化通信方法
JP7206869B2 (ja) 2018-12-05 2023-01-18 凸版印刷株式会社 暗号化通信システム及び暗号化通信方法

Also Published As

Publication number Publication date
JP5454673B2 (ja) 2014-03-26
JPWO2011114373A1 (ja) 2013-06-27
CN103109493A (zh) 2013-05-15
US20130070925A1 (en) 2013-03-21
CN103109493B (zh) 2016-01-13

Similar Documents

Publication Publication Date Title
JP5454673B2 (ja) 通信装置、プログラムおよび方法
JP4883219B2 (ja) ノード装置及びプログラム
US11218477B2 (en) Encryption key updates in wireless communication systems
JP5077186B2 (ja) 通信装置、通信方法及び通信プログラム
JP6126980B2 (ja) ネットワーク装置およびネットワークシステム
US8781132B2 (en) Method and device for managing encrypted group rekeying in a radio network link layer encryption system
CN108810887B (zh) 多个管理器或接入点在无线网络中的不相交安全
WO2011141523A1 (en) Processing transport packets
KR101562311B1 (ko) 보안 터널링 및 데이터 재전송을 수행하는 물리적 단방향 통신의 보안 게이트웨이의 송신/수신 장치 및 그것을 이용하는 데이터 전송 방법
JP2018182665A (ja) 通信装置、通信システム及び暗号化通信制御方法
JPWO2009078217A1 (ja) ネットワークシステムおよびデータ送信方法
KR102437864B1 (ko) 펌웨어를 수신하는 방법 및 펌웨어를 전송하는 방법
JP6108235B2 (ja) 鍵情報制御装置、鍵情報更新装置、プログラム及び記録媒体、鍵情報更新方法、鍵情報更新システム
US20210266102A1 (en) Systems and Methods for Relaying and Updating Payload Counter Data Between Hearing Devices
JP2018182767A (ja) Ecu、ネットワーク装置、及び車用ネットワーク装置
US20120254611A1 (en) Communication apparatus, communication system, and communication method
JP6814976B2 (ja) 通信装置及び通信システム
WO2013145026A1 (ja) ネットワークシステム、ノード、検証ノードおよび通信方法
JP6194775B2 (ja) ノード装置、データ中継方法、及び、プログラム
WO2022003975A1 (ja) 通信装置、方法、およびプログラム
JP7476979B2 (ja) 通信装置、通信方法及び通信プログラム
CN117640261A (zh) 数据传输方法、数据中转装置、数据管理设备及系统
JPWO2013145026A1 (ja) ネットワークシステム、ノード、検証ノードおよび通信方法
JP2009278306A (ja) 復号装置

Legal Events

Date Code Title Description
WWE Wipo information: entry into national phase

Ref document number: 201080065354.4

Country of ref document: CN

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

Ref document number: 10847795

Country of ref document: EP

Kind code of ref document: A1

WWE Wipo information: entry into national phase

Ref document number: 2012505306

Country of ref document: JP

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 10847795

Country of ref document: EP

Kind code of ref document: A1