Signal processing device, signal processing method, and program
The signal processing device adjusts encrypted data length within communication protocol limits by selective encryption or division, addressing inefficiencies in data transmission and ensuring compliance with protocol constraints.
Patent Information
- Application Number
- JP2020084462
- Authority / Receiving Office
- JP · JP
- Patent Type
- Patents
- Current Assignee / Owner
- Filing Date
- 2020-05-13
- Publication Date
- 2024-08-27
- Estimated Expiration
- 2040-05-13
AI Technical Summary
The data length of encrypted data often exceeds the data length specified in communication protocols due to the addition of padding bytes during encryption, leading to inefficiencies in data transmission.
A signal processing device and method that adjusts the data length of encrypted data by selectively encrypting or dividing the data to ensure it remains within the specified limits of the communication protocol, using modes such as data length adjustment, data division, or a combination of both.
Ensures that the data length of encrypted data does not exceed the limits set by the communication protocol, enhancing data transmission efficiency and security.
Smart Images

Figure 0007540193000004 
Figure 0007540193000009 
Figure 0007540193000007
Abstract
Description
[Technical field]
[0001] The present invention relates to a signal processing device, a signal processing method, and a program. [Background technology]
[0002] In the field of IoT (Internet of Things), there is a system in which a plurality of devices transmit and receive data to perform signal processing. In order to strengthen the security of data transmitted from one device to another device, there is a technology for encrypting data (for example, Patent Document 1). Such data transmission and reception between devices is performed according to a predetermined communication protocol. For example, the communication protocol specifies the data length of data transmitted from one device to another device. [Prior art documents] [Patent documents]
[0003] [Patent Document 1] JP 2019-213085 A Summary of the Invention [Problem to be solved by the invention]
[0004] However, the data length of encrypted data tends to be longer than that of data before encryption (hereinafter also referred to as original data). The encryption here includes a process of encrypting the original data, generating authentication data from the original data using a hash function, and formatting the data into a predetermined message format. This is because, in the encryption process, padding bytes may be added to the data before encryption to make the data length a multiple of the unit byte number of the encryption process (e.g., 8 bytes or 16 bytes), or an authenticator may be added to prevent tampering. In this case, there is a problem that the data length of the encrypted data becomes longer and may exceed the data length specified in the communication protocol.
[0005] The present invention has been made in view of the above circumstances, and an object of the present invention is to provide a signal processing device, a signal processing method, and a program that are capable of adjusting the data length of encrypted data so that it does not exceed the data length defined in a communication protocol. [Means for solving the problem]
[0006] The signal processing device of the present invention includes a data acquisition unit that acquires response corresponding data indicating a response to data notified from a communication destination device, and a data processing unit that adjusts a data length of the response data, which includes information obtained by encrypting the response corresponding data and is to be transmitted to the communication destination device as a response to the data notified from the communication destination device, to be less than a predetermined threshold value. The data processing unit has a first processing unit that determines whether to encrypt all or a part of the response corresponding data based on a data length of the response corresponding data, and when it is determined that a part of the response corresponding data is to be encrypted, adjusts the data length of the response data to be less than a predetermined threshold by encrypting data of a predetermined data length from the beginning of the response corresponding data. do.
[0007] In the signal processing method of the present invention, a data acquisition unit acquires response corresponding data indicating a response to data notified from a communication destination device, and a data processing unit adjusts the data length of the response data, which includes information obtained by encrypting the response corresponding data and is to be transmitted to the communication destination device as a response to the data notified from the communication destination device, to be less than a predetermined threshold value. and determining whether to encrypt all or a part of the response corresponding data based on a data length of the response corresponding data, and when determining that a part of the response corresponding data is to be encrypted, adjusting the data length of the response data to be less than a predetermined threshold by encrypting data of a predetermined data length from the beginning of the response corresponding data. do.
[0008] The program of the present invention includes a data acquisition unit that acquires response corresponding data indicating a response to data notified from a communication destination device, and response data including information obtained by encrypting the response corresponding data, the response data being adjusted so that the data length of the response data to be transmitted to the communication destination device as a response to the data notified from the communication destination device is less than a predetermined threshold. and determining whether to encrypt all or a part of the response corresponding data based on a data length of the response corresponding data, and when determining that a part of the response corresponding data is to be encrypted, adjusting the data length of the response data to be less than a predetermined threshold by encrypting data of a predetermined data length from the beginning of the response corresponding data. The program is a program for causing the device to function as a data processing means. Effect of the Invention
[0009] According to the present invention, the data length of the encrypted data can be adjusted so as not to exceed the data length defined in the communication protocol. [Brief description of the drawings]
[0010] [Figure 1] 1 is a block diagram showing an example of a configuration of a communication system 1 according to an embodiment of the present invention. [Diagram 2] FIG. 2 is a diagram showing an example of a data format configuration according to an embodiment of the present invention. [Diagram 3] FIG. 2 is a diagram showing an example of a data format configuration according to an embodiment of the present invention. [Figure 4] FIG. 2 is a diagram showing an example of the configuration of a processing mode 220 according to an embodiment of the present invention. [Diagram 5] 5 is a flowchart showing a flow of processing performed by a second communication device 20 according to an embodiment of the present invention. [Figure 6] 2 is a sequence diagram showing a flow of processing performed by the communication system 1 according to the embodiment of the present invention. [Figure 7] 10 is a flowchart showing a flow of processing performed by a second communication device 20 according to a first modified example of the embodiment of the present invention. [Figure 8] FIG. 11 is a sequence diagram showing a flow of processing performed by a communication system 1 according to a first modified example of an embodiment of the present invention. [Figure 9] 10 is a flowchart showing a flow of processing performed by a second communication device 20 according to a second modified example of the embodiment of the present invention. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS
[0011] Hereinafter, an embodiment of the present invention will be described with reference to the drawings.
[0012] 1 is a block diagram showing a configuration example of a communication system 1 according to an embodiment of the present invention. The communication system 1 includes, for example, a first communication device 10 and a second communication device 20. The first communication device 10 and the second communication device 20 are connected to each other so as to be able to communicate with each other.
[0013] The first communication device 10 is a computer device such as a PC (Personal Computer) or a server. The first communication device 10 communicates with the second communication device 20. For example, the first communication device 10 transmits a command to the second communication device 20, and the second communication device 20 responds to the command. For example, the first communication device 10 requests the second communication device 20 to perform a predetermined signal processing, and receives a result of the predetermined signal processing from the second communication device 20. The predetermined signal processing here may be any signal processing, and is, for example, signal processing such as modulation and demodulation corresponding to a specific communication method, various filter processing, processing related to signal compression and decompression, acquisition of an identification number, or reading out data stored in a specific address.
[0014] For example, the first communication device 10 transmits a read command to the second communication device 20, and obtains data specified by the read command from the second communication device 20 as a response to the read command.
[0015] In this case, the first communication device 10 receives encrypted data from the second communication device 20. This is to make it difficult to decrypt the contents of the data even if the data is intercepted on the communication path between the first communication device 10 and the second communication device 20. This enhances the security of data transmitted from one device to the other.
[0016] The first communication device 10 includes, for example, a communication unit 11, a storage unit 12, and a control unit 13. The communication unit 11 communicates with the second communication device 20.
[0017] The memory unit 12 is configured with a storage medium, for example, a hard disk drive (HDD), a flash memory, an electrically erasable programmable read only memory (EEPROM), a random access read / write memory (RAM), a read only memory (ROM), or any combination of these storage media.
[0018] The storage unit 12 stores, for example, transmission data 120 and reception data 121. The transmission data 120 is information to be transmitted to the second communication device 20, and is, for example, measurement data measured by a sensor, or information indicating the location (address) of data to be read from the second communication device. The transmission data 120 may be encrypted data. That is, the transmission data 120 may be, for example, information in which the location (address) of data to be read from the second communication device is encrypted.
[0019] The received data 121 is information received from the second communication device 20, and is, for example, data that has undergone a specified signal processing requested by the first communication device 10, or data that has been encrypted after the specified signal processing has been performed.
[0020] The control unit 13 is realized, for example, by causing a CPU (Central Processing Unit) provided as hardware in the first communication device 10 to execute a program stored in the storage unit 12. The control unit 13 includes, for example, a data acquisition unit 130, a communication control unit 131, and a device control unit 132.
[0021] The data acquisition unit 130 acquires data for requesting the second communication device 20 to perform predetermined signal processing. The data acquisition unit 130 acquires transmission data 120 as data for which the second communication device 20 is requested to perform predetermined signal processing, for example, by referring to the storage unit 12. The data acquisition unit 130 outputs the acquired data to the communication control unit 131.
[0022] The communication control unit 131 transmits the transmission data 120 acquired by the data acquisition unit 130 to the second communication device 20 to request a predetermined signal processing, and receives a response to the request. For example, if the predetermined signal processing is a process of reading data stored in the second communication device 20, the communication control unit 131 transmits a read command to the second communication device 20 via the communication unit 11. In this case, the transmission data 120 is a read command. Then, the communication control unit 131 receives data stored in the second communication device 20 and specified by the read command from the second communication device 20. The communication control unit 131 receives data encrypted after the predetermined signal processing from the second communication device 20, and stores the received data in the storage unit 12 as received data 121.
[0023] The device control unit 132 performs overall control of the first communication device 10. For example, the device control unit 132 transmits data requesting predetermined signal processing by the communication control unit 131 to the second communication device 20 via the communication unit 11. In addition, the device control unit 132 outputs data received from the second communication device 20 via the communication unit 11 to the communication control unit 131.
[0024] The second communication device 20 includes, for example, a communication unit 21, a storage unit 22, and a control unit 23. The communication unit 21 communicates with the first communication device 10. The storage unit 22 is configured by a storage medium, for example, a HDD, a flash memory, an EEPROM, a RAM, a ROM, or any combination of these storage media. The storage unit 22 stores, for example, a processing mode 220. The processing mode 220 is information that specifies a processing mode of encryption of data that has been subjected to a predetermined signal processing performed by the second communication device 20. The processing mode will be described in detail later.
[0025] The control unit 23 is realized by, for example, causing a CPU provided as hardware in the second communication device 20 to execute a program stored in the storage unit 22. The control unit 23 includes, for example, a data acquisition unit 230, a data processing unit 231, and a device control unit 232. The data acquisition unit 230 acquires response corresponding data. The response corresponding data is data indicating a response to the transmission data 120 received from the first communication device 10, and is plaintext data before being encrypted by the data processing unit 231. For example, when the predetermined signal processing is a process of reading data stored in the second communication device 20, the data acquisition unit 230 acquires data to be read that is stored in the storage unit 22 or the like. The data acquisition unit 230 outputs the acquired data to the data processing unit 231.
[0026] The data processing unit 231 encrypts the response corresponding data acquired by the data acquisition unit 230. For example, the data processing unit 231 acquires a specified processing mode by referring to the storage unit 12, and performs encryption corresponding to the acquired processing mode. The data processing unit 231 sends the encrypted data back to the first communication device 10.
[0027] The device control unit 232 performs overall control of the second communication device 20. For example, the device control unit 232 refers to the storage unit 22 based on the address of the data to be read received from the first communication device 10 via the communication unit 21, and acquires the data to be read. The device control unit 232 outputs the acquired data to be read to the data acquisition unit 230 as response corresponding data. Alternatively, the device control unit 232 outputs data received from the first communication device 10 via the communication unit 21 to the data acquisition unit 230. In addition, the device control unit 232 transmits the response corresponding data encrypted by the data processing unit 231 to the first communication device 10 via the communication unit 21.
[0028] Data transmission and reception between the first communication device 10 and the second communication device 20 in the communication system 1 is performed according to a predetermined communication protocol. Specifically, data is transmitted and received using a data format defined in the predetermined communication protocol.
[0029] Here, the data format applied to the communication system 1 of this embodiment will be described with reference to Fig. 2 and Fig. 3. Fig. 2 and Fig. 3 are diagrams showing configuration examples of data formats according to the embodiment of the present invention. Fig. 2 shows a data format (hereinafter referred to as a transmission data format) when transmitting transmission data 120 (command) from the first communication device 10 to the second communication device 20. Fig. 3 shows a data format (hereinafter referred to as a response data format) when the second communication device 20 responds to the first communication device 10.
[0030] As shown in FIG. 2, the transmission data format is composed of a header H, a transmission data length Lc, data DT1, a reception data length Le, and a footer F. The header H is additional information related to the data to be transmitted, and for example, identification information of the sender and the destination is indicated. The transmission data length Lc is information indicating the data length of the transmission data. The data DT1 is the transmission data itself. The reception data length Le is information indicating the data length of the reception data. The reception data here is a response to the data transmitted in the transmission data format shown in FIG. 2. The footer F is additional information related to the data to be transmitted, and for example, information used for error correction, such as CRC (Cyclic Redundancy Check). The transmission data length Lc may be part of the header H. The reception data length Le may be part or all of the footer F.
[0031] The transmission data length Lc is specified as a predetermined number of bytes (for example, 1 byte) and is set to a value that can be expressed by that number of bytes. For example, when the transmission data length Lc is set to "02h", it indicates that the data length of the data DT1 is 2 bytes. Alternatively, when the transmission data length Lc is set to "7Fh", it indicates that the data length of the data DT1 is 127 bytes.
[0032] The received data length Le is specified as a predetermined number of bytes (for example, 1 byte) and is set to a value that can be expressed by that number of bytes. For example, when the received data length Le is set to "FFh", it indicates that a request is made to send a response to the data DT1 with a data length of 255 bytes.
[0033] As shown in FIG. 3, the response data format is composed of a header H, data DT2, an end flag Ef, a footer F, etc. The header H and the footer F are the same as the header H and the footer F in the transmission data format. The data DT2 is the response data itself. Note that the response data format may be configured in a format that starts with the DT2 section without providing the header H section. Also, the end flag Ef may be part of the footer F, or the end flag Ef may not exist in the response data format. Here, the data length of the data DT2 is the length specified in the transmission data format shown in FIG. 2. That is, when the reception data length Le is set to "FFh", the data length of the data DT2 is 255 bytes.
[0034] In encryption processing, the specifications for encryption and authenticator addition generally differ depending on the settings of the encryption algorithm, padding parameters, etc. Therefore, the data length of the response data (data DT2) differs depending on the specifications for encryption and authenticator addition. In this case, even if the data length is specified by the received data length Le, the response is not necessarily made with data DT2 of that data length, and it becomes difficult for the first communication device 10 to estimate the data length of the data DT2.
[0035] In this case, for example, the first communication device 10 sets the received data length Le to "00h." When the received data length Le is set to "00h," it instructs the first communication device 10 to reply using data DT2 of any data length within a predetermined range (for example, within a range of 256 bytes).
[0036] However, when the received data length Le is set to "00h", it is assumed that the data length of the data DT2 may differ due to differences in encryption algorithms, etc. For example, when the data length of the plaintext (data before encryption) is 231 bytes, if encryption is performed with general parameter settings using DES (Data Encryption Standard) encryption, the data length of the encrypted data will be 250 bytes. In this case, it is possible to respond according to the reception data length Le specified as "00h".
[0037] On the other hand, when encryption is performed with general parameter settings using the Advanced Encryption Standard (AES), the data length of the encrypted data will be 258 bytes. In this case, the data length of the encrypted data will exceed the prescribed 256 bytes, making it difficult to respond according to the "00h" specified for the received data length Le.
[0038] To address this issue, in this embodiment, the data length of the encrypted data is adjusted so that it does not exceed a predetermined data length. Specifically, the data processing unit 231 performs encryption according to the processing mode, thereby adjusting the data length of the encrypted data so that it does not exceed a predetermined data length.
[0039] Here, the processing mode will be described in detail. FIG. 4 is a diagram showing an example of the configuration of the processing mode 220 according to an embodiment of the present invention. As shown in FIG. 4, the processing mode 220 includes items such as a mode ID, a mode, and a processing flag. The mode ID is identification information that uniquely identifies the processing mode. The mode is information indicating the content of the processing mode specified by the mode ID. The processing flag is information indicating whether the processing mode specified by the mode ID is applied or not. For example, when the processing flag is set to "1", it indicates that the processing is applied, and when the processing flag is set to "0 (zero)", it indicates that the processing is not applied. In this example, modes Md1 to Md4 are defined, and it is indicated that mode Md1 is applied. Below, the modes Md1 to Md4 will be described in order.
[0040] Mode Md1 is a process (in the figure, this is indicated as "automatic data length adjustment") that adjusts the data length of the response data so that it does not exceed a predetermined data length by adjusting the data length of the data before encryption.
[0041] When mode Md1 is set, data processing unit 231 judges whether or not the data length of response corresponding data (hereinafter referred to as pre-processing data) acquired by data acquisition unit 230 before encryption processing by data processing unit 231 is equal to or greater than a predetermined first threshold (e.g., 231 bytes). Here, the first threshold is a value that makes the data length of encrypted data equal to or less than a specified data length (e.g., 256 bytes). Here, the first threshold may be arbitrarily determined according to the encryption algorithm, the parameter setting value, etc.
[0042] When the data length of the pre-processing data is equal to or greater than a predetermined first threshold, the data processing unit 231 deletes a portion of the pre-processing data so that the data length of the pre-processing data is less than the predetermined first threshold. For example, when the predetermined signal processing is a process of reading data stored in the second communication device 20, the data processing unit 231 first acquires the data to be read from the data acquisition unit 230. When the data length of the data to be read is less than the predetermined first threshold, the data processing unit 231 reads all of the data to be read. On the other hand, when the data length of the data to be read is equal to or greater than the predetermined first threshold, the data processing unit 231 reads a portion of the data to be read (for example, data from the beginning to a data length less than the predetermined first threshold) so that the data length of the data to be read is less than the predetermined first threshold.
[0043] Alternatively, when the predetermined signal processing is processing for requesting signal processing on the transmission data 120, the data processing unit 231 acquires the data length of the data that has been subjected to the predetermined signal processing on the transmission data 120. When the data length is less than a predetermined first threshold, the data processing unit 231 acquires all of the data that has been subjected to the predetermined signal processing. On the other hand, when the data length is equal to or greater than the predetermined first threshold, the data processing unit 231 acquires a portion of the data that has been subjected to the predetermined signal processing (for example, data from the beginning to a data length less than the predetermined first threshold) from the data that has been subjected to the predetermined signal processing so that the data length is less than the predetermined first threshold.
[0044] In this way, when the data length of the pre-processed data is equal to or greater than the predetermined first threshold, the data processing unit 231 makes the data length of the pre-processed data less than the predetermined first threshold by leaving data with a data length corresponding to less than the predetermined first threshold from the beginning of the pre-processed data and deleting subsequent data, etc. Then, the data processing unit 231 encrypts the pre-processed data with a data length less than the predetermined first threshold, and sends back information according to the response data format, using the encrypted data as data DT2, to the first communication device 10.
[0045] Mode Md2 is a process in which the pre-processing data is divided into encrypted data, thereby adjusting the data length of the response data so that it does not exceed a predetermined data length (in the figure, this is indicated as "data division output").
[0046] When mode Md2 is set, data processing unit 231 first encrypts the unprocessed data. Then, data processing unit 231 determines whether the data length of the encrypted data (hereinafter, referred to as encrypted data) is equal to or greater than a predetermined second threshold (e.g., 256 bytes). Here, the threshold may be arbitrarily determined according to the encryption algorithm, the parameter setting value, etc.
[0047] When the data length of the encrypted data is equal to or greater than the second threshold, the data processing unit 231 divides the encrypted data into a plurality of pieces of data so that the data length of each piece of data is less than the second threshold. For example, when the data length of the encrypted data is equal to or greater than the second threshold, the data processing unit 231 divides the encrypted data into two pieces of data, one piece of data having a data length corresponding to less than the second threshold from the beginning of the encrypted data and the other piece of data following the second threshold. In this way, the data processing unit 231 makes the data length of each piece of data after division less than the second threshold. Then, the data processing unit 231 returns information according to the response data format to the first communication device 10, using the encrypted data having a data length less than the second threshold as data DT2.
[0048] When transmitting divided data, the data processing unit 231 may attach information indicating whether or not remaining data exists. For example, consider a case where the data processing unit 231 divides encrypted data into first half data and second half data. In this case, the data processing unit 231 first maps the first half data to data DT2 and transmits it to the first communication device 10. At this time, the data processing unit 231 indicates that remaining data exists by setting, for example, "61h" at a predetermined position in footer F in the response data format.
[0049] Then, when the data processing unit 231 receives a notification indicating an instruction to request the remaining data from the first communication device 10, it maps the latter half of the data to the data DT2 and transmits it to the first communication device 10. At this time, the data processing unit 231 indicates that there is no remaining data by setting "00h" to a predetermined position in the footer F in the response data format, for example.
[0050] Alternatively, when transmitting divided data, the data processing unit 231 may attach information indicating the data length of the remaining data. For example, consider a case where the data processing unit 231 divides 258 bytes of encrypted data into two pieces, a first half of 256 bytes and a second half of 2 bytes. In this case, the data processing unit 231 first maps the first half of 256 bytes of data to data DT2 and transmits it to the first communication device 10. At this time, the data processing unit 231 indicates that there are 2 bytes of remaining data by setting, for example, "02h" in a predetermined position in the footer F in the response data format.
[0051] Then, when the data processing unit 231 receives a notification indicating an instruction to request the remaining data from the first communication device 10, it maps the latter 2 bytes of data into data DT2 and transmits it to the first communication device 10. At this time, the data processing unit 231 indicates that there is 0 bytes of remaining data, that is, that there is no remaining data, by setting "00h" to a predetermined position in footer F in the response data format, for example.
[0052] Mode Md3 is a process that combines modes Md1 and Md2 to adjust the data length of response data so that it does not exceed a predetermined data length (in the figure, this is indicated as "combination of Md1 and Md2").
[0053] When mode Md3 is set, data processing unit 231 first determines whether the data length of the pre-processed data is equal to or greater than a predetermined first threshold, as in mode Md1. If the data length of the pre-processed data is equal to or greater than the predetermined first threshold, data processing unit 231 divides the pre-processed data into multiple pieces of data so that the data length of the data to be encrypted at one time is less than the predetermined first threshold.
[0054] For example, when the data length of the pre-processed data is equal to or greater than a predetermined first threshold, the data processing unit 231 divides the pre-processed data into two parts, with the data from the beginning of the pre-processed data having a data length less than the predetermined first threshold as a first part, and the data thereafter as second half data. In this way, the data processing unit 231 ensures that the data length of the pre-processed data encrypted at one time is less than the predetermined first threshold. The data processing unit 231 then encrypts the divided pre-processed data (for example, the first part of the pre-processed data), and sends the encrypted data as data DT2, and information according to the response data format, back to the first communication device 10.
[0055] When transmitting the divided encrypted data, the data processing unit 231 may attach information indicating whether or not remaining data exists. For example, consider a case where the data processing unit 231 divides the unprocessed data into two parts, a first part and a second part. In this case, the data processing unit 231 first encrypts the first part, maps it to data DT2, and transmits it to the first communication device 10. At this time, the data processing unit 231 indicates that remaining data exists by setting, for example, "61h" at a predetermined position in the footer F in the response data format.
[0056] Then, when the data processing unit 231 receives a notification indicating an instruction to request the remaining data from the first communication device 10, it maps the second data to the encrypted data DT2 and transmits it to the first communication device 10. At this time, the data processing unit 231 indicates that there is no remaining data by setting "00h" to a predetermined position in the footer F in the response data format, for example.
[0057] Alternatively, when transmitting the encrypted data after division, the data processing unit 231 may attach information indicating the data length of the remaining data. For example, consider a case where the data processing unit 231 divides the unprocessed data into two parts, a first part and a second part. In this case, the data processing unit 231 first encrypts the first part, maps it to the data DT2, and transmits it to the first communication device 10. In this case, the data processing unit 231 derives in advance the data length when the second part is encrypted. For example, the data processing unit 231 derives the data length when the second part is encrypted based on the setting contents such as the encryption algorithm and the padding parameters. Then, when the data processing unit 231 sends the data DT2 obtained by encrypting the first part according to the response data format, it sets the data length when the second part is encrypted at a predetermined position in the footer F of the response data format. For example, if the data length of the data obtained by encrypting the second part is 10 bytes, it sets "0Ah" at a predetermined position in the footer F of the response data format.
[0058] Then, when the data processing unit 231 receives a notification indicating an instruction to request the remaining data from the first communication device 10, it maps the 10-byte data (the data with the second portion encrypted) to the data DT2 and transmits it to the first communication device 10. At this time, the data processing unit 231 indicates that there is 0 bytes of remaining data, that is, that there is no remaining data, by setting "00h" to a predetermined position in the footer F in the response data format, for example.
[0059] Although not shown in Fig. 4, in addition to modes Md1 to Md3, mode Md4 may be defined. Mode Md4 is a process that adjusts the data length of encrypted data so that it does not exceed a predetermined data length by a process different from modes Md1, Md2, and Md3. For example, mode Md4 is a process that, when the data length of encrypted data is equal to or greater than a predetermined second threshold, maps data from the beginning of the encrypted data that is less than the predetermined second threshold into data DT2 and sends it.
[0060] In the above, a case where the mode Md1 to Md4 is determined based on the processing mode 220 has been described as an example. However, the present invention is not limited to this. For example, the data processing unit 231 may determine the processing mode in response to a designation from the first communication device 10. In this case, for example, a value corresponding to one of the modes Md1 to Md4 is set in a predetermined position of the header H or footer F in the transmission data format, thereby designating the processing mode. In addition, when the processing mode is designated by the processing mode 220, the timing at which information is set in the processing mode 220 may be any timing. For example, information may be set in the processing mode 220 at the time of shipment from the factory, or may be set during operation. In addition, the processing mode 220 may be set manually by a person who sets the processing mode, or may be set automatically by the second communication device 20 referring to a previously set table, etc.
[0061] 5 is a flowchart showing the flow of processing performed by the second communication device 20 according to an embodiment of the present invention. In this embodiment, it is assumed that the processing mode 220 is set to execute processing in mode Md1.
[0062] In step S11, the second communication device 20 acquires pre-processing data. The pre-processing data here is information indicating a response to the transmission data 120 notified from the first communication device 10, and is so-called plaintext data before encryption processing by the second communication device 20. In step S12, the second communication device 20 determines whether the data length of the pre-processing data is equal to or greater than a predetermined first threshold.
[0063] In step S13, if the data length of the pre-processed data is equal to or greater than a first threshold, the second communication device 20 adjusts the data length of the pre-processed data to be less than the first threshold. For example, the second communication device 20 adjusts the data length of the pre-processed data to be less than the first threshold by leaving data less than the first threshold from the beginning of the pre-processed data and deleting the subsequent data.
[0064] In step S14, the second communication device 20 encrypts the unprocessed data whose length has been adjusted to be less than a predetermined first threshold value. In step S15, the second communication device 20 transmits (outputs) the encrypted data to the first communication device 10 according to the response data format.
[0065] On the other hand, in step S16, if the data length of the unprocessed data is less than a predetermined first threshold, the second communication device 20 encrypts the unprocessed data, and in step S15, transmits (outputs) the encrypted data to the first communication device 10 in accordance with the response data format.
[0066] 6 is a sequence diagram showing a flow of processing performed by the communication system 1 according to an embodiment of the present invention. The first communication device 10 maps the transmission data 120 to a transmission data format in step S1, and transmits it to the second communication device 20 in step S2. The processing shown in steps S3 to S7 is similar to the processing shown in steps S11 to S15 in FIG. 5 described above, and therefore a description thereof will be omitted. In step S16, the first communication device 10 receives a response from the second communication device 20. The response from the second communication device 20 is information in which data corresponding to the response is encrypted.
[0067] 7 is a flowchart showing a flow of processing performed by the second communication device 20 according to the first modification of the embodiment of the present invention. In the first modification of the embodiment, it is assumed that the processing mode 220 is set to execute processing in the mode Md2.
[0068] The second communication device 20 obtains unprocessed data in step S21, and encrypts the unprocessed data in step S22. In step S23, the second communication device 20 determines whether the data length of the encrypted data is equal to or greater than a predetermined second threshold value.
[0069] In step S24, if the data length of the encrypted data is equal to or greater than the second threshold, the second communication device 20 divides the encrypted data so that the data length of each piece of data is less than the second threshold. For example, the second communication device 20 divides the encrypted data so that the data length of the encrypted data is less than the second threshold by dividing the encrypted data into the first half data and the subsequent data into the second half data.
[0070] In step S25, the second communication device 20 transmits (outputs) any one of the divided data (for example, the first data) to the first communication device 10 in accordance with the response data format. In step S26, the second communication device 20 determines whether or not there is remaining data in the data transmitted in step S25.
[0071] In step S27, if remaining data exists in the data transmitted in step S25, the second communication device 20 acquires a notification indicating an instruction to request the remaining data from the first communication device 10. In step S28, the second communication device 20 transmits (outputs) the remaining data to the first communication device 10 in accordance with the request from the first communication device 10.
[0072] On the other hand, if in step S23 the data length of the encrypted data is less than a predetermined second threshold, the second communication device 20 performs the processing shown in step S25 without dividing the encrypted data, and transmits (outputs) the response data to the first communication device 10.
[0073] Furthermore, in step S26, if there is no remaining data in the data transmitted in step S25, the second communication device 20 ends the process.
[0074] Fig. 8 is a sequence diagram showing the flow of processing performed by the communication system 1 according to the modified embodiment of the present invention. The processing shown in steps S31 to S32 is similar to the processing shown in steps S1 to S2 in Fig. 6 described above, and therefore the description thereof will be omitted. The processing shown in steps S33 to S36 is similar to the processing shown in steps S21 to S24 in Fig. 7 described above, and therefore the description thereof will be omitted.
[0075] In step S37, the second communication device 20 transmits (outputs) the information obtained by dividing the encrypted data to the first communication device 10 in accordance with the response data format. In this case, the second communication device 20 attaches information indicating whether or not there is remaining data to the transmitted data.
[0076] In step S38, the first communication device 10 receives the information obtained by dividing the encrypted data, and if the information contains remaining data, in step S39, issues a notification indicating an instruction to request the remaining data. The processes shown in steps S40 to S41 are similar to the processes shown in steps S27 to S28 in Fig. 7 described above, and therefore description thereof will be omitted.
[0077] In step S42, the first communication device 10 receives the remaining data from the second communication device 20.
[0078] 9 is a flowchart showing a flow of processing performed by the second communication device 20 according to the second modification of the embodiment of the present invention. In the second modification of the embodiment, it is assumed that the processing mode 220 is set to execute processing in the mode Md3.
[0079] The second communication device 20 acquires pre-processed data in step S51, and determines whether the pre-processed data is equal to or greater than a threshold in step S52.
[0080] In step S53, if the pre-processing data is equal to or greater than the threshold, the second communication device 20 divides the pre-processing data into a plurality of pieces so that the data length is less than a predetermined threshold, thereby adjusting the data length of the response data to be less than the first threshold.
[0081] In step S54, the second communication device 20 encrypts any one of the divided unprocessed data (for example, the first data), and transmits (outputs) the encrypted data to the first communication device 10 according to the response data format in step S55.
[0082] In step S56, the second communication device 20 determines whether or not remaining data exists in the data transmitted in step 55. If remaining data exists in the transmitted data, the second communication device 20 acquires a notification indicating an instruction to request the remaining data from the first communication device 10 in step S57. In step S58, the second communication device 20 encrypts the remaining data in accordance with the request from the first communication device 10, and transmits (outputs) it to the first communication device 10 in step S59.
[0083] On the other hand, if the pre-processed data is less than the threshold value in step S52, the second communication device 20 performs encryption processing shown in step S54 without dividing the pre-processed data, and transmits (outputs) the response data to the first communication device 10.
[0084] Furthermore, in step S56, if there is no remaining data in the data transmitted to the communication device 10 in step S55, the second communication device 20 ends the process.
[0085] As described above, the second communication device 20 of the embodiment includes the data acquisition unit 230 and the data processing unit 231. The data acquisition unit 230 acquires response corresponding data. The response corresponding data is a response to the transmission data 120 notified from the first communication device 10, and is data before being encrypted by the data acquisition unit 230. The data processing unit 231 adjusts the data length of the response data so as to be less than a predetermined threshold. The response data is response data including information obtained by encrypting the response corresponding data, and is data to be transmitted to the communication destination device as a response to the transmission data.
[0086] The first communication device 10 is an example of a "destination device." The second communication device 20 is an example of a "signal processing device." The transmission data 120 is an example of "data notified from the communication destination device."
[0087] Also, in the second communication device 20 of the embodiment, the data processing unit 231 adjusts the data length of the response data in mode Md1 so that it is less than a predetermined threshold. In mode Md1, it is determined whether to encrypt all or a part of the response corresponding data based on the data length of the response corresponding data, and when it is determined to encrypt a part of the response corresponding data, it adjusts the data length of the response data so that it is less than the predetermined threshold by encrypting data of a predetermined data length from the beginning of the response corresponding data. The data processing unit 231 that performs mode Md1 is an example of a "first processing unit".
[0088] Furthermore, in the second communication device 20 of the embodiment, the data processing unit 231 adjusts the data length of the response data in mode Md2 so that it is less than a predetermined threshold. In mode Md2, when the data length of data obtained by encrypting all of the response corresponding data is equal to or greater than the predetermined threshold, the data obtained by encrypting all of the response corresponding data is divided into a plurality of data whose data length is less than the predetermined threshold, thereby adjusting the data length of the response data so that it is less than the predetermined threshold. The data processing unit 231 that performs mode Md2 is an example of a "second processing unit."
[0089] Furthermore, in the second communication device 20 of the embodiment, the data processing unit 231 adjusts the data length of the response data in mode Md3 so that it is less than a predetermined threshold. In mode Md3, when the response corresponding data is equal to or greater than the predetermined threshold, the response corresponding data is divided into a plurality of pieces so that the response corresponding data is less than the threshold. Then, each divided response corresponding data is encrypted to adjust the response data so that the data length is less than the predetermined threshold. The data processing unit 231 that performs mode Md3 is an example of a "third processing unit."
[0090] As a result, in the second communication device 20 of the embodiment, the data processing unit 231 can adjust the data length of the encrypted data so that it does not exceed the data length defined in the communication protocol.
[0091] In addition, in the second communication device 20 of the embodiment, when the data processing unit 231 outputs a part of the data divided in the mode Md2 or the mode Md3 as response data, the data processing unit 231 outputs additional information indicating that the response data to be output is a part of the data together with the response data. This allows the second communication device 20 of the embodiment to notify that there is remaining data in the response data, and enables the first communication device 10 to request the remaining data as necessary.
[0092] Furthermore, in the second communication device 20 of the embodiment, when the data processing unit 231 outputs a part of the data divided in the mode Md2 or the mode Md3 as response data, the data processing unit 231 outputs additional information indicating the data length of the remaining unoutput data in the output response data together with the response data. This allows the second communication device 20 of the embodiment to notify the data length of the remaining data in the response data, and enables the first communication device 10 to request the remaining data as necessary.
[0093] Moreover, the second communication device 20 of the embodiment further includes a storage unit 22. The storage unit 22 stores a processing mode 220 that specifies a mode of encryption processing performed by the data acquisition unit 230. The data processing unit 231 performs encryption processing corresponding to the mode specified by the processing mode 220. The processing mode 220 includes any of modes Md1, Md2, and Md3. The mode Md1 is an example of a "first processing mode". The mode Md2 is an example of a "second processing mode". The mode Md3 is an example of a "third processing mode". As a result, in the second communication device 20 of the embodiment, the data processing unit 231 can adjust the data length by any of the methods of modes Md1, Md2, and Md3, so that it is possible to flexibly respond according to the communication specifications with the first communication device 10.
[0094] The functions described in the above embodiments can be realized not only by using hardware but also by loading a program that describes each function into a computer using software. Also, each function may be realized by selecting either software or hardware as appropriate.
[0095] The communication system 1 and the second communication device 20 in the above-mentioned embodiment may be realized in whole or in part by a computer. In that case, a program for realizing this function may be recorded in a computer-readable recording medium, and the program recorded in the recording medium may be read into a computer system and executed to realize the function. The term "computer system" as used herein includes hardware such as an OS and peripheral devices. The term "computer-readable recording medium" refers to portable media such as flexible disks, optical magnetic disks, ROMs, and CD-ROMs, and storage devices such as hard disks built into a computer system. The term "computer-readable recording medium" may also include a medium that dynamically holds a program for a short period of time, such as a communication line when a program is transmitted via a network such as the Internet or a communication line such as a telephone line, and a medium that holds a program for a certain period of time, such as a volatile memory inside a computer system that is a server or client in that case. The above-mentioned program may be a program for realizing a part of the above-mentioned function, or may be a program that can realize the above-mentioned function in combination with a program already recorded in the computer system, or may be a program that is realized using a programmable logic device such as an FPGA.
[0096] Although an embodiment of the present invention has been described in detail above with reference to the drawings, the specific configuration is not limited to this embodiment, and designs that do not deviate from the gist of the present invention are also included. [Explanation of symbols]
[0097] 1. Communication systems 10...First communication device 20...Second communication device (signal processing device) 220... Processing mode 230…Data acquisition section 231...Data processing unit
Claims
1. a data acquisition unit that acquires response corresponding data indicating a response to the data notified from the communication destination device; a data processing unit that adjusts a data length of response data, the response data including information obtained by encrypting the response corresponding data, to be transmitted to the communication destination device as a response to data notified from the communication destination device, so that the data length of the response data is less than a predetermined threshold value; Equipped with The data processing unit includes: a first processing unit that determines whether to encrypt all or a part of the response corresponding data based on a data length of the response corresponding data, and when it is determined that a part of the response corresponding data is to be encrypted, adjusts the data length of the response data to be less than a predetermined threshold by encrypting data of a predetermined data length from the beginning of the response corresponding data; Signal processing device.
2. The data processing unit includes: a second processing unit that, when a data length of the data obtained by encrypting all of the response corresponding data is equal to or greater than a predetermined threshold, divides the data obtained by encrypting all of the response corresponding data into a plurality of data whose data length is less than the predetermined threshold, thereby adjusting the data length of the response data to be less than the predetermined threshold; The signal processing device according to claim 1 .
3. The data processing unit includes: a third processing unit that, when a data length of the response corresponding data is equal to or greater than a predetermined threshold, divides the response corresponding data into a plurality of data, and adjusts the data length of the divided response corresponding data into encrypted data so that the data length of the response data is less than the predetermined threshold, The signal processing device according to claim 1 .
4. When the data processing unit outputs, as the response data, a part of the data obtained by encrypting all of the response corresponding data or a part of the response corresponding data obtained by encrypting a part of the response corresponding data, the data processing unit outputs, together with the response data, incidental information indicating that the response data to be output is a part of the data.
4. The signal processing device according to claim 2 or 3.
5. When the data processing unit outputs, as the response data, a part of the data obtained by encrypting all of the response corresponding data or a part of the response corresponding data obtained by encrypting the part of the response corresponding data, the data processing unit outputs, together with the response data, supplementary information indicating a data length of the remaining unoutput data in the output response data. The signal processing device according to claim 4.
6. a data acquisition unit that acquires response corresponding data indicating a response to the data notified from the communication destination device; a data processing unit that adjusts a data length of response data, the response data including information obtained by encrypting the response corresponding data, to be transmitted to the communication destination device as a response to data notified from the communication destination device, so that the data length of the response data is less than a predetermined threshold value; A storage unit that stores a processing mode that specifies a mode of the encryption processing to be performed by the data acquisition unit, The data processing unit performs an encryption process corresponding to a mode designated by the processing mode, The processing modes include: a first processing mode for determining whether to encrypt all or a part of the response corresponding data based on a data length of the response corresponding data, and, when it is determined that a part of the response corresponding data is to be encrypted, adjusting the data length of the response data to be less than a predetermined threshold by encrypting data of a predetermined data length from the beginning of the response corresponding data; a second processing mode for adjusting the data length of the response data to be less than the predetermined threshold by dividing the data obtained by encrypting all of the response data into a plurality of data whose data length is less than the predetermined threshold when the data length of the data obtained by encrypting all of the response data is equal to or greater than a predetermined threshold; a third processing mode in which, when a data length of the response corresponding data is equal to or greater than a predetermined threshold, the response corresponding data is divided into a plurality of pieces of data, and the data length of the divided response corresponding data is adjusted so as to be less than the predetermined threshold by encrypting the data. Signal processing device.
7. The data acquisition unit acquires response corresponding data indicating a response to the data notified from the communication destination device, a data processing unit adjusts the data length of response data, which includes information obtained by encrypting the response corresponding data, to be sent to the communication destination device in response to data notified from the communication destination device so that the data length is less than a predetermined threshold, determines whether to encrypt all or a part of the response corresponding data based on the data length of the response corresponding data, and when it is determined that a part of the response corresponding data is to be encrypted, adjusts the data length of the response data to be less than the predetermined threshold by encrypting data of the predetermined data length from the beginning of the response corresponding data. Signal processing methods.
8. Computer, A data acquisition means for acquiring response corresponding data indicating a response to the data notified from the communication destination device; a data processing means for adjusting a data length of response data including information obtained by encrypting the response corresponding data, the response data being transmitted to the communication destination device in response to data notified from the communication destination device, so that the data length of the response data is less than a predetermined threshold value, determining whether to encrypt all or a part of the response corresponding data based on the data length of the response corresponding data, and, when it is determined that a part of the response corresponding data is to be encrypted, adjusting the data length of the response data to be less than the predetermined threshold value by encrypting data of the predetermined data length from the beginning of the response corresponding data; A program to function as a
Citation Information
Patent Citations
Printing control system
JP1992032921A
Network scanner device
JP2005094486A
Content distribution server and content distribution method
JP2008009303A
Collection data collecting system, collection data collecting program, and recording medium
JP2008143095A
Digital data recording / reproducing device
JP2011145719A
