WO2012131856A1 - 情報処理装置、改ざん検出装置、情報処理方法、改ざん検出方法、情報処理プログラムおよび改ざん検出プログラム - Google Patents

情報処理装置、改ざん検出装置、情報処理方法、改ざん検出方法、情報処理プログラムおよび改ざん検出プログラム Download PDF

Info

Publication number
WO2012131856A1
WO2012131856A1 PCT/JP2011/057480 JP2011057480W WO2012131856A1 WO 2012131856 A1 WO2012131856 A1 WO 2012131856A1 JP 2011057480 W JP2011057480 W JP 2011057480W WO 2012131856 A1 WO2012131856 A1 WO 2012131856A1
Authority
WO
WIPO (PCT)
Prior art keywords
code
data
length
data length
padding
Prior art date
Application number
PCT/JP2011/057480
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 JP2013506884A priority Critical patent/JP5641133B2/ja
Priority to PCT/JP2011/057480 priority patent/WO2012131856A1/ja
Publication of WO2012131856A1 publication Critical patent/WO2012131856A1/ja
Priority to US14/032,513 priority patent/US9071420B2/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
    • H04L9/0816Key establishment, i.e. cryptographic processes or cryptographic protocols whereby a shared secret becomes available to two or more parties, for subsequent use
    • H04L9/0819Key transport or distribution, i.e. key establishment techniques where one party creates or otherwise obtains a secret value, and securely transfers it to the other(s)
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/06Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols the encryption apparatus using shift registers or memories for block-wise or stream coding, e.g. DES systems or RC4; Hash functions; Pseudorandom sequence generators
    • H04L9/0618Block ciphers, i.e. encrypting groups of characters of a plain text message using fixed encryption transformation
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L2209/00Additional information or applications relating to cryptographic mechanisms or cryptographic arrangements for secret or secure communication H04L9/00
    • H04L2209/20Manipulating the length of blocks of bits, e.g. padding or block truncation
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L2209/00Additional information or applications relating to cryptographic mechanisms or cryptographic arrangements for secret or secure communication H04L9/00
    • H04L2209/34Encoding or coding, e.g. Huffman coding or error correction

Definitions

  • the present invention relates to an information processing apparatus that handles block ciphers, an alteration detection apparatus, an information processing method, an alteration detection method, an information processing program, and an alteration detection program.
  • Encryption techniques include common key encryption (hereinafter referred to as common key encryption) and public key encryption (hereinafter referred to as public key encryption).
  • common key encryption has an advantage that the processing speed is high and can be implemented compactly when compared with the public key encryption. For this reason, when an encryption function is added to a small device such as a mobile phone or an IC card, common key encryption is used.
  • block cipher which is a kind of common key cipher
  • plaintext data to be encrypted
  • block length Since encryption is performed in units of blocks, the plaintext data length needs to be a multiple of the block data length (hereinafter referred to as “block length”).
  • the concatenated padding includes information necessary for removing the padding at the time of decoding.
  • the padding includes information indicating the data length of padding (hereinafter referred to as “padding length”).
  • the contents of padding in plaintext decrypted from a series of blocks encrypted for each block length are used as padding rules.
  • a CRC for identifying plaintext is connected to plaintext. Further, padding is further concatenated with plaintext concatenated with CRC, and the data is processed into a data length that is a multiple of the block length, and then encrypted.
  • Patent Document 1 can be used only for a fixed plaintext data length, and no consideration is given to any case where the data length is arbitrary. There is a problem in that it is necessary to newly connect CRC, and the amount of data increases. Therefore, in an embedded environment where resources are severe, there is a problem that a region for connecting CRCs cannot be prepared, and the technique according to Patent Document 1 described above cannot be applied.
  • the present invention eliminates the above-described problems caused by the prior art, and is an information processing apparatus, a falsification detection apparatus, an information processing method, a falsification detection method, an information processing program, and a falsification detection that can detect falsification of the entire plaintext without increasing the amount of resources used.
  • the purpose is to provide a program.
  • a data length that is longer than the data length of the plaintext data and that is a multiple of the predetermined block length is specified, and the data length of the difference between the data length of the plaintext data and the specified data length
  • the first code indicating the calculated difference data length is generated, and the second code calculated based on the plaintext data is converted from the calculated difference data length to the first code data length.
  • An information processing apparatus, an information processing method, and an information processing program are proposed for generating concatenated data by concatenating padding to the end of plain text data and outputting the obtained concatenated data.
  • encrypted data obtained by encrypting plaintext data for each predetermined block length is input, and a key that is commonly used for encryption and decryption is input from the input encrypted data.
  • the first code is extracted from the first area that is the end of the generated decoded data that generates the decoded data that is decoded by using and stores the padding data length, and the extracted first code indicates Based on the data length, the second region of the generated decrypted data storing the code calculated from the plaintext data is determined, the second code is extracted from the determined second region, and the extracted first
  • the third code is extracted from the third area of the generated decoded data excluding the end area of the generated decoded data having the data length indicated by the code of 1, and is calculated from the extracted third code 4th code, 2nd A falsification detection device, a falsification detection method, and a falsification detection program for generating a code with the same data length as that of the code, performing a match determination between the generated fourth code and the second code, and outputting
  • FIG. 1 is an explanatory diagram showing the contents of falsification detection.
  • FIG. 2 is a block diagram illustrating a hardware configuration example of the information processing apparatus 101 or the falsification detection apparatus 102 according to the embodiment.
  • FIG. 3 is a block diagram illustrating a functional configuration of the information processing apparatus 101.
  • FIG. 4 is a block diagram illustrating a functional configuration of the tampering detection apparatus 102.
  • FIG. 5 is an explanatory diagram showing an example of the data structure of the connected sentence APT.
  • FIG. 6 is an explanatory diagram showing a specific example 1 of plain text PT encryption by the information processing apparatus 101.
  • FIG. 7 is an explanatory diagram showing a specific example 1 of falsification detection by the falsification detection apparatus 102.
  • FIG. 1 is an explanatory diagram showing the contents of falsification detection.
  • FIG. 2 is a block diagram illustrating a hardware configuration example of the information processing apparatus 101 or the falsification detection apparatus 102 according to the embodiment.
  • FIG. 8 is an explanatory diagram showing a specific example 2 of plain text PT encryption by the information processing apparatus 101.
  • FIG. 9 is an explanatory diagram showing a specific example 2 of falsification detection by the falsification detection apparatus 102.
  • FIG. 10 is an explanatory diagram showing a specific example 3 of plain text PT encryption by the information processing apparatus 101.
  • FIG. 11 is an explanatory diagram showing a specific example 3 of alteration detection by the alteration detection device 102.
  • FIG. 12 is a flowchart showing details of padding connection processing performed by the information processing apparatus 101.
  • FIG. 13 is a flowchart showing details of the falsification detection process performed by the falsification detection apparatus 102.
  • Embodiments of an information processing apparatus, a falsification detection apparatus, an information processing method, a falsification detection method, an information processing program, and a falsification detection program according to the present invention will be described in detail below with reference to the accompanying drawings.
  • the information processing apparatus and the tampering detection apparatus are separate apparatuses.
  • the information processing apparatus may have the function of the falsification detection apparatus, and the falsification detection apparatus may have the function of the information processing apparatus.
  • FIG. 1 is an explanatory diagram illustrating an example of falsification detection.
  • an apparatus that encrypts and transmits plaintext PT is an information processing apparatus 101.
  • a device that receives the encrypted plaintext PT and detects whether or not the encrypted plaintext PT has been tampered with is referred to as a tamper detection device 102.
  • the information processing apparatus 101 and the falsification detection apparatus 102 are connected to the network 110.
  • An attacker's computer 103 is connected to the network 110.
  • the information processing apparatus 101 and the falsification detection apparatus 102 have an encryption key (hereinafter referred to as “common key”) that can be used in common for encryption and decryption.
  • the information processing apparatus 101 encrypts the plain text PT by block cipher using a common key.
  • the information processing apparatus 101 needs to process the plaintext PT into a data length that can be divided into blocks (that is, a data length that is a multiple of the block length bl) by connecting the plaintext PT to be encrypted with the padding pd.
  • the plain text PT in which the padding pd is linked is referred to as “linked text APT”.
  • the padding pd connected to the plain text PT includes a data length pl (hereinafter referred to as “padding length”) of the padding pd necessary for removing the padding pd in the falsification detection apparatus 102.
  • the padding pd connected to the plain text PT includes data used for detection of alteration in the alteration detection device 102.
  • the falsification detection device 102 decrypts the encrypted block received via the network 110 by block encryption using a common key. Then, the tampering detection apparatus 102 detects the presence / absence of tampering based on the decrypted data.
  • alteration detection in the alteration detection device 102 will be described by taking as an example the case where the information processing device 101 encrypts a plain text PT with a data length of 44 [bytes] and transmits it to the alteration detection device 102. .
  • the block length bl is 16 [bytes].
  • the padding pd In the padding pd, information on the padding length pl of the padding pd necessary for the tampering detection apparatus 102 to remove the padding pd is stored in an area that is the end of the padding pd.
  • the data length ll (hereinafter referred to as “padding length area length ll”) of the area (hereinafter referred to as “padding length area”) which is the end of the padding pd storing the information of the padding length pl is a fixed length.
  • the tampering detection apparatus 102 can determine that the padding length pl is 4 [bytes] with reference to 4 indicated by the padding length area that is the last 4 [bits] of the padding pd.
  • the information processing apparatus 101 stores the data length cl (hereinafter referred to as “storage area length”) of the area (hereinafter referred to as “storage area”) in the padding pd that stores the code calculated from the plain text PT. Is calculated.
  • a code calculated from the plain text PT for example, a CRC of the plain text PT can be adopted.
  • the information processing apparatus 101 calculates a CRC having the same data length as the calculated storage area length cl from the plain text PT. That is, the information processing apparatus 101 calculates a CRC of 28 [bits] from the plain text PT.
  • the information processing apparatus 101 stores the calculated 28-bit CRC in the storage area in the padding pd. As a result, the information processing apparatus 101 processes the padding pd in the connected sentence APT into the padding pd including the padding length pl in the padding length area at the end and the CRC calculated in the storage area.
  • the connected sentence APT is divided into three blocks.
  • the divided blocks are blocks B1 to B3 from the top.
  • the information processing apparatus 101 encrypts the divided blocks B1 to B3 with a block cipher and transmits them to the falsification detection apparatus 102.
  • the blocks B1 to B3 encrypted by the block cipher are referred to as encrypted blocks C1 to C3, respectively.
  • the tampering detection apparatus 102 receives the encrypted blocks C1 to C3. Then, the falsification detection apparatus 102 decrypts the block from the received encrypted blocks C1 to C3. Then, the tampering detection apparatus 102 creates a concatenated sentence APT ′ by concatenating the decrypted blocks.
  • the concatenated text APT ′ created by the tampering detection apparatus 102 based on the encrypted block C2 is different from the concatenated text APT in the information processing apparatus 101. .
  • the tampering detection apparatus 102 refers to 4 indicated by the padding length area at the end of the connected sentence APT ′, specifies that the padding length pl is 4 [bytes], and determines 4 [bytes] from the end of the connected sentence APT ′.
  • Byte] padding pd is removed to create plain text PT ′.
  • the plaintext PT ′ created by the tampering detection apparatus 102 is different from the plaintext PT in the information processing apparatus 101 due to the tampering of the encrypted block C2.
  • the tampering detection apparatus 102 extracts the CRC of the plain text PT from the specified 28 [bit] storage area. Then, the tampering detection apparatus 102 determines whether the calculated CRC ′ matches the CRC extracted from the padding pd. Then, the tampering detection apparatus 102 outputs a determination result.
  • the tampering detection apparatus 102 can determine that the plaintext PT ′ is different from the plaintext PT in the information processing apparatus 101, and the tampering has occurred. Is output. If CRC 'and CRC are the same data, the tampering detection apparatus 102 can determine that the plain text PT' remains the plain text PT in the information processing apparatus 101, and outputs that the tampering has not been made.
  • the information processing apparatus 101 stores the code calculated from the plain text PT in the padding pd. Then, the tampering detection apparatus 102 determines whether the code calculated from the entire decrypted plaintext PT 'matches the code calculated from the plaintext PT stored in the padding pd. Thereby, the tampering detection apparatus 102 can detect tampering even if any part of the plain text PT changes due to tampering.
  • the information processing apparatus 101 calculates the padding length pl of the padding connected to the plaintext PT, and then calculates the storage area length cl of the code calculated from the plaintext PT within the calculated padding length pl. Then, the information processing apparatus 101 generates a code calculated from the plain text PT with a length equal to or smaller than the calculated storage area length cl and stores the code in the storage area. As a result, an increase in the data length of the connected sentence APT can be prevented, and the resource usage can be reduced.
  • the information processing apparatus 101 reserves a padding length area when calculating the storage area.
  • the tampering detection apparatus 102 removes the padding pd from the concatenated sentence APT for which tampering has not been detected based on the data length indicated by the code of the last padding length area, and the plaintext PT in the information processing apparatus 101 The same plain text PT can be obtained.
  • FIG. 2 is a block diagram illustrating a hardware configuration example of the information processing apparatus 101 or the falsification detection apparatus 102 according to the embodiment. In the embodiment, it is assumed that the information processing apparatus 101 and the falsification detection apparatus 102 have the same hardware configuration.
  • the information processing apparatus 101 or the falsification detection apparatus 102 includes a CPU (Central Processing Unit) 201, a ROM (Read-Only Memory) 202, a RAM (Random Access Memory) 203, and an HDD (Hard Disk Drive) 204.
  • the CPU 201 governs overall control of the information processing apparatus 101 or the falsification detection apparatus 102.
  • the ROM 202 stores a program such as a boot program.
  • the ROM 202 stores an API (Application Programming Interface).
  • the RAM 203 is used as a work area for the CPU 201.
  • the HDD 204 is a drive device that controls reading / writing of data with respect to a built-in hard disk in accordance with the control of the CPU 201.
  • the encryption circuit 205 encrypts data and decrypts the encrypted data.
  • I / F An interface (hereinafter abbreviated as “I / F”) 206 is connected to a network 110 such as a LAN (Local Area Network), a WAN (Wide Area Network), or the Internet through a communication line, and the other via the network 110. Connected to other devices.
  • the I / F 206 controls an internal interface with the network 110 and controls data input / output from an external device.
  • a modem or a LAN adapter may be employed as the I / F 206.
  • the display 207 displays data such as a document, an image, and function information as well as a cursor, an icon, or a tool box.
  • a CRT a CRT
  • a TFT liquid crystal display a plasma display, or the like
  • the keyboard 208 includes keys for inputting characters, numbers, various instructions, and the like, and inputs data.
  • a touch panel type input pad or a numeric keypad may be used.
  • one apparatus may have both the function of the information processing apparatus 101 and the function of the falsification detection apparatus 102.
  • FIG. 3 is a block diagram showing a functional configuration of the information processing apparatus 101.
  • the information processing apparatus 101 includes a specifying unit 301, a calculation unit 302, a first generation unit 303, a second generation unit 304, a creation unit 305, a connection unit 306, an output unit 307, and an encryption unit. 308 and a third generation unit 309.
  • the functions (specification unit 301 to encryption unit 308) serving as the control unit for example, cause the CPU 201 to execute a program stored in a storage device such as the ROM 202 and the RAM 203 illustrated in FIG.
  • the function is realized by the I / F 206.
  • Data processed by each functional unit is stored in a storage area such as the RAM 203.
  • the identifying unit 301 has a function of identifying a data length that is longer than the data length of the plaintext data and that is a multiple of the predetermined block length bl.
  • the plaintext data is data to be encrypted by block cipher and is the above-described plaintext PT.
  • the specifying unit 301 specifies the shortest data length in the data length group that is longer than the data length of the plaintext data and is a multiple of the predetermined block length bl. That is, the specifying unit 301 determines how many blocks the plaintext PT is divided into at least and can be encrypted, and calculates the data length in the minimum number of blocks necessary for encryption. More specifically, for example, if the block length bl is 16 [bytes] and the plaintext PT is 44 [bytes], the specifying unit 301 can encrypt the plaintext PT by dividing it into a minimum of 3 blocks. Specify 48 [bytes], which is three times the length bl.
  • the identifying unit 301 can identify a data length that is a multiple of the block length bl that is the data length of the concatenated text APT, based on how many blocks the plaintext PT can be divided into.
  • the specifying unit 301 can limit the data length of the created connected sentence APT by specifying the data length of the connected sentence APT.
  • the calculation unit 302 has a function of calculating a difference data length between the data length of the plaintext data and the data length specified by the specifying unit 301.
  • the difference data length is the data length that becomes the padding length pl.
  • the calculation unit 302 has a difference data length of 4 [bytes] that becomes the padding length pl. Is calculated. Thereby, the calculation unit 302 can calculate the padding length pl.
  • the first generation unit 303 has a function of generating a first code indicating the data length of the difference calculated by the calculation unit 302.
  • the first code is a binary code indicating the data length of the difference.
  • the first generation unit 303 generates the first code indicating the difference data length with the shortest data length that can indicate the predetermined block length bl.
  • the shortest data length that can indicate the predetermined block length bl is the shortest data length that is necessary to indicate the block length bl that is the longest data length that can be the padding length pl.
  • the first generation unit 303 has the shortest data length of 4 that can indicate 16. In [bit], a first code indicating a difference data length of 4 [bytes] is generated. That is, the first generation unit 303 generates code 4 (hexadecimal notation, which is “0100” in binary notation) indicating the data length 4 [bytes] of the difference.
  • the first generation unit 303 can generate a code indicating the padding length pl necessary for removing the padding pd in the tampering detection apparatus 102.
  • the second generation unit 304 obtains the remaining data obtained by subtracting the data length of the first code generated by the first generation unit 303 from the difference data length of the second code calculated based on the plaintext data. It has a function to generate data with a data length within the maximum.
  • the second code is a code calculated from the plain text PT, for example, a hash value (for example, CRC) calculated from the plain text PT by a hash function or a parity code calculated from the plain text PT.
  • the data length of the first code is equal to or less than the padding length area length ll described above.
  • the second generation unit 304 has a function of generating a second code calculated from plaintext data with a residual data length obtained by subtracting the data length of the first code from the difference data length.
  • a residual data length obtained by subtracting the data length of the first code from the difference data length.
  • the padding length pl is 4 [bytes]
  • the padding length region length ll is 4 [bits]
  • the remaining data length is 28 [bits].
  • CRC is generated from plain text PT with 28 [bits].
  • an API stored in the ROM 202 is used to calculate the CRC.
  • a plurality of APIs for calculating CRCs having a plurality of data lengths may be stored in the ROM 202, and the CRCs may be calculated using different APIs according to the CRC data lengths to be calculated.
  • the ROM 202 may store only the API for calculating the CRC with the longest data length among the CRCs that can be calculated, and extract a part of the CRC calculated according to the necessary data length.
  • the second generation unit 304 can generate a code calculated from the plain text PT that is an index for detection of alteration in the alteration detection device 102 with the storage area length cl.
  • the creation unit 305 has a function of creating a padding including the second code generated by the second generation unit 304 and ending with the first code with a difference data length. Specifically, for example, the creation unit 305 creates padding that starts with the first code and ends with the second code.
  • the creation unit 305 creates padding with the first code as the end and the second code as the head. More specifically, for example, the creation unit 305 creates a padding pd starting with a CRC calculated from the plain text PT, with the code indicating the padding length pl as the end, with the calculated padding length pl.
  • the padding length pl is 7 [bytes] and the CRC is 32 [bits] “63350373”
  • the padding pd has “7” indicating the padding length pl at the end and “63350373” at the beginning 7 [bytes]. "63335037307707".
  • the padding pd is expressed in hexadecimal notation.
  • the padding pd has a data length starting with “4” indicating the padding length pl and having “3F459A1” as the head. It will be “3F459A14” of 4 [bytes].
  • the padding pd is expressed in hexadecimal notation.
  • the creation unit 305 creates padding in which the first code is the end and the second code is adjacent to the top of the first code with the difference data length. More specifically, for example, the creation unit 305 uses the calculated padding as the padding pd in which the code indicating the padding length pl ends and the CRC calculated from the plain text PT is adjacent to the head of the code indicating the padding length pl. Create with length pl.
  • the padding length pl is 7 [bytes] and the CRC is “633350373” of 32 [bits].
  • the padding pd is “070706335037737” of 7 [bytes] with “7” indicating the padding length pl at the end and “633350373” adjacent to the head of the code indicating the padding length pl.
  • the padding pd is expressed in hexadecimal notation.
  • the creation unit 305 may store the code corresponding to the padding length pl generated by the third generation unit 309 in an area other than the padding length area and the storage area.
  • the creation unit 305 can create the padding pd including the padding length necessary for removing the padding pd and the code calculated from the plain text PT used as an index for detecting the alteration in the tampering detection apparatus 102. it can. Further, the tampering detection apparatus 102 generated by the third generation unit 309 can create padding that further includes a code serving as an index for determining whether the padding length pl is correct.
  • the concatenating unit 306 has a function of generating concatenated data by concatenating the padding created by the creating unit 305 to the end of the plaintext data.
  • the connection data is the connection sentence APT described above.
  • the concatenation unit 306 concatenates the padding pd to the end of the plain text PT, and generates a concatenated sentence APT whose data length is a multiple of the block length bl.
  • the concatenation unit 306 can generate a concatenated text APT in which the data length that can be encrypted by the block cipher is a multiple of the block length bl.
  • the output unit 307 has a function of outputting the connection data obtained by the connection unit 306. Specifically, for example, the output unit 307 transmits the connected statement APT to another device via the network 110 by the I / F 206. Further, the output unit 307 outputs a connected sentence APT to the optical disc via the optical disc drive.
  • the output unit 307 has a function of outputting the encrypted concatenated data encrypted by the encryption unit 308 for each predetermined block length bl.
  • the encrypted concatenated data is one encrypted block generated by encrypting the concatenated text APT for each block length bl, or a series of encrypted blocks.
  • the output unit 307 transmits an encrypted block generated by encrypting the concatenated text APT for each block length bl to the tampering detection apparatus 102 via the network 110 by the I / F 206.
  • the initialization vector IV is used in the encryption by the encryption unit 308, the initialization vector IV is transmitted together with the encryption block.
  • the initialization vector IV does not need to be concealed information, and may be transmitted without being encrypted.
  • the output unit 307 outputs an encrypted block generated by encrypting the concatenated text APT for each block length bl to the optical disc via the optical disc drive.
  • the encryption unit 308 has a function of encrypting the concatenated data for each predetermined block length bl using a key commonly used for encryption and decryption.
  • the key used in common for encryption and decryption is a common key.
  • the encryption unit 308 divides the concatenated text APT for each block length bl and encrypts it with a block cipher using a common key to generate an encrypted block.
  • the encryption unit 308 performs encryption using the encryption circuit 205 of the DES (Data Encryption Standard) method or the AES method (Advanced Encryption Standard).
  • a plurality of operation modes are defined for each encryption method, and specific encryption and decryption processes are performed according to these operation modes.
  • ECB Electronic Codebook
  • CBC Cipher Block Chaining
  • CFB Cipher Feedback
  • OFB Output Feedback
  • CTR Counter
  • the encryption unit 308 can encrypt the concatenated text APT for each block length bl by block cipher using the common key, and can ensure the confidentiality of the concatenated text APT.
  • the third generation unit 309 generates a third code that identifies the first code with a residual data length obtained by subtracting the data length of the first code and the predetermined data length from the difference data length.
  • the third code is a code corresponding to the padding length pl.
  • the third generation unit 309 generates a code for the data length of the remaining area extracted from the top of a code in which 1-byte codes indicating the padding length are continuously arranged. Accordingly, the third generation unit 309 can generate a code serving as an index for determining whether the padding length pl is correct in the tampering detection apparatus 102.
  • FIG. 4 is a block diagram showing a functional configuration of the tampering detection apparatus 102.
  • the tampering detection apparatus 102 includes an input unit 401, a decoding unit 402, a first extraction unit 403, a determination unit 404, a second extraction unit 405, a third extraction unit 406, a generation unit 407,
  • the configuration includes a determination unit 408 and an output unit 409.
  • the functions (input unit 401 to output unit 409) serving as the control unit are, for example, by causing the CPU 201 to execute a program stored in a storage device such as the ROM 202 and the RAM 203 illustrated in FIG.
  • the function is realized by the I / F 206.
  • Data processed by each functional unit is stored in a storage area such as the RAM 203.
  • the input unit 401 has a function of inputting encrypted data obtained by encrypting plaintext data for each predetermined block length bl.
  • the plaintext data is the above-described plaintext PT.
  • Encrypted data is the above-described encrypted block.
  • the input unit 401 receives an encrypted block from the information processing apparatus 101 via the network 110 by the I / F 206.
  • the input unit 401 reads the encrypted block from the optical disc via the optical disc drive. Thereby, the input unit 401 can input an encrypted block that is a target of tampering detection.
  • the decryption unit 402 has a function of generating decrypted data decrypted from the encrypted data input by the input unit 401 using a key commonly used for encryption and decryption.
  • the key used in common for encryption and decryption is a common key.
  • the decrypted data is a concatenated text APT in the information processing apparatus 101 when decrypted from an encrypted block that has not been tampered with.
  • the decrypted data is a concatenated text APT ′ having a different content from the concatenated text APT in the information processing apparatus 101 when decrypted from the altered encrypted block.
  • the decryption unit 402 decrypts the concatenated text APT or the concatenated text APT ′ from the initialization vector IV (Initial Vector) and the encrypted block by the CBC mode of the block cipher using the common key.
  • the initialization vector IV is the same data as the initialization vector IV used for encryption by the information processing apparatus 101. Thereby, the decryption unit 402 can decrypt the concatenated text from the encrypted block.
  • the first extraction unit 403 has a function of extracting the first code from the first area that is the end of the decoded data storing the data length of the padding pd.
  • the first region is the padding length region described above.
  • the first code is the padding length pl when there is no tampering with the encrypted block or when there is no tampering effect on the padding pd.
  • the first code is a meaningless code when the padding pd is affected by tampering.
  • the first extraction unit 403 refers to the last 4 [bits] of the connected sentence decrypted by the decryption unit 402 and extracts 4 [bytes] estimated to be the padding length pl. Accordingly, the first extraction unit 403 can extract the data length estimated as the padding length pl.
  • the determination unit 404 has a function of determining the second area of the decrypted data in which the code calculated from the plaintext data is stored based on the data length indicated by the first code extracted by the first extraction unit 403. .
  • the second area is a code storage area calculated from the plain text PT estimated from the padding length pl extracted by the first extraction unit 403.
  • the determination unit 404 is an area that is in contact with the head of the first area, and is an area having a remaining data length obtained by subtracting the data length of the first area from the data length indicated by the first code. Is determined as the second region. More specifically, for example, if the padding length pl is 4 [bytes], the first extraction unit 403 determines a 28 [bit] area in contact with the head of the padding length area as the storage area. Thereby, the determination unit 404 can determine an area estimated as a storage area in which the information processing apparatus 101 stores a code calculated from the plain text PT.
  • the determination unit 404 is an area in the decoded data that is in contact with the head of the second area, and subtracts the data length of the first code and a predetermined data length from the data length indicated by the first code. The remaining data length area is determined as the fourth area. As a result, the determination unit 404 can determine an area estimated to be an area where the information processing apparatus 101 stores a code corresponding to padding.
  • the second extraction unit 405 has a function of extracting the second code from the second area determined by the determination unit 404.
  • the second code is a code calculated from the plain text PT stored in the information processing apparatus 101 (for example, for example, when the encrypted block has not been tampered with or when the padding pd has not been tampered with. CRC).
  • the second code is a meaningless code that is affected by tampering when the padding pd is affected by tampering.
  • the second extraction unit 405 extracts a CRC stored by the information processing apparatus 101 or a meaningless code affected by falsification from an area estimated as a CRC storage area. .
  • the second extraction unit 405 can extract a code that serves as an index for detection of tampering.
  • the third extraction unit 406 has a function of extracting the third code from the third area of the decoded data excluding the end area of the decoded data having the data length indicated by the first code.
  • the tail region is a region that becomes the tail of the concatenated text decrypted by the decryption unit 402, and when the encrypted block is not tampered or when the padding pd is not affected by tampering, the padding pd is used. is there.
  • the tail region is a region that becomes the tail of the concatenated sentence decrypted by the decrypting unit 402, and is a meaningless region when the padding pd is affected by tampering.
  • the third extraction unit 406 extracts the plain text PT in the information processing apparatus 101 excluding the tail data estimated to be the padding pd or the plain text PT ′ that has been tampered with. As a result, the third extraction unit 406 can extract plain text that is a target for detection of tampering.
  • the generation unit 407 has a function of generating a fourth code that specifies the third code extracted by the third extraction unit 406 with the same data length as the data length of the second code.
  • the fourth code is a code that specifies the third code, and is, for example, a hash value (for example, CRC) obtained from the third code by a hash function and a parity code obtained from the third code.
  • the generation unit 407 can generate a code calculated from the plain text PT in the information processing apparatus 101 or a code calculated from the tampered plain text PT '.
  • the length of the second code may be shared in advance like the key.
  • the determining unit 408 has a function of determining whether the fourth code generated by the generating unit 407 matches the second code. Specifically, for example, the determination unit 408 determines whether the CRC calculated from the plain text PT matches the CRC stored in the padding pd.
  • the determination unit 408 determines whether the CRC 'calculated from the plain text PT' affected by the tampering with the encrypted block matches the CRC stored in the padding pd. In addition, the determination unit 408 determines whether the CRC ′ calculated from the plain text PT ′ affected by the alteration of the encrypted block matches the CRC ′′ stored in the padding pd affected by the alteration of the encrypted block. To do.
  • the determination unit 408 is determined to match by the match determination, and can be determined to have no falsification. Further, when the plaintext extracted by the third extraction unit 406 is affected by falsification, the determination unit 408 determines that they do not match by the matching determination, and can determine that there is falsification.
  • the determination unit 408 has a function of determining whether the code specified by the fifth code extracted by the fourth extraction unit 410 matches the first code. Specifically, it is determined whether the code extracted by the first extraction unit 403 is a correct code from the code corresponding to the padding length pl stored in the information processing apparatus 101. As a result, the determination unit 408 can determine that tampering has occurred if the code is not correct.
  • the output unit 409 has a function of outputting the determination result determined by the determination unit 408. Specifically, for example, the output unit 409 outputs to the display 207 that the fourth code matches the second code, that is, the received encrypted block has not been tampered with. Further, the output unit 409 outputs to the display 207 that the fourth code and the second code do not match, that is, that the received encrypted block has been tampered with.
  • the output unit 409 can output whether or not the received encrypted block has been tampered with, that is, whether or not the plaintext extracted by the third extraction unit 406 is affected by tampering. Also, the decrypted data of the decryption result is output to the disk.
  • the fourth extraction unit 410 has a function of extracting the fifth code from the fourth area in which the code specifying the first code is stored. Specifically, for example, the fourth extraction unit 410 extracts a code stored in an area where it is estimated that the information processing apparatus 101 determined by the determination unit 404 stores a code corresponding to the padding length pl. To do. Thereby, the fourth extraction unit 410 can extract the code corresponding to the padding length pl stored in the information processing apparatus 101 when the padding pd is not affected by the tampering.
  • FIG. 5 is an explanatory diagram showing an example of the data structure of the concatenated sentence APT.
  • the plain texts PT1 to PT7 are plain text PTs encrypted by block cipher.
  • the block length bl is 16 [bytes].
  • the padding pd connected to the plain text PT has a padding length area at the end and includes a CRC storage area.
  • the CRC storage area is an area in contact with the top of the padding length area.
  • the CRC storage area length cl is a maximum of 32 [bits].
  • the contents of padding pd are expressed in hexadecimal notation. However, CRC is indicated by “$”.
  • the padding pd stores the code corresponding to the padding length pl in the remaining area.
  • the code corresponding to the padding length pl is a code corresponding to the data length of the remaining area extracted from the top of a code in which 1-byte codes indicating the padding length are continuously arranged.
  • the plain text PT1 is data having a data length that is 15 [bytes] longer than a multiple of the block length bl. Therefore, padding pd of 1 [byte] is required to encrypt the plain text PT1 with the block cipher.
  • the padding pd includes 1 indicating 1 [byte] as the padding length pl in the padding length area having the last 4 [bits], and plain text PT1 in the storage area having the remaining 4 [bits] in contact with the head of the padding length area.
  • the CRC obtained from is included.
  • the plain text PT2 is data having a data length that is 14 [bytes] longer than a multiple of the block length bl. Therefore, padding pd of 2 [bytes] is required to encrypt the plain text PT2 with the block cipher.
  • the padding pd includes 2 indicating 2 [bytes] of the padding length pl in the padding length area having the last 4 [bits], and plain text PT2 in the storage area of the remaining 12 [bits] in contact with the head of the padding length area.
  • the CRC obtained from is included.
  • the plain text PT3 is data having a data length that is 13 [bytes] longer than a multiple of the block length bl. Therefore, in order to encrypt the plain text PT3 with the block cipher, a padding pd of 3 [bytes] is required.
  • the padding pd includes 3 indicating 3 [bytes] as the padding length pl in the padding length area having the last 4 [bits], and the plain text PT3 in the remaining 20 [bit] storage area in contact with the head of the padding length area.
  • the CRC obtained from is included.
  • the plain text PT4 is data having a data length 12 [bytes] longer than a multiple of the block length bl. Therefore, padding pd of 4 [bytes] is required to encrypt the plain text PT4 with the block cipher.
  • the padding pd includes 4 indicating the padding length pl of 4 [bytes] in the padding length area of the last 4 [bits] and the plain text PT4 in the storage area of the remaining 28 [bits] in contact with the head of the padding length area.
  • the CRC obtained from is included.
  • the plain text PT5 is data having a data length that is 11 [bytes] longer than a multiple of the block length bl. Therefore, in order to encrypt the plain text PT5 with the block cipher, a padding pd of 5 [bytes] is required.
  • the padding pd includes 5 indicating 5 [bytes] as the padding length pl in the padding length area having the last 4 [bits], and 32 [bits] of the remaining 36 [bits] in contact with the head of the padding length area.
  • the CRC obtained from the plain text PT5 is included in the storage area.
  • the code “0” is the first 4 [bits] of “050505505...” In which 1-byte codes indicating the padding length pl are continuously arranged.
  • the plain text PT6 is data having a data length that is 10 [bytes] longer than a multiple of the block length bl. Therefore, in order to encrypt the plain text PT6 with the block cipher, a padding pd of 6 [bytes] is required.
  • the padding pd includes 6 indicating 6 [bytes] as the padding length pl in the padding length area having the last 4 [bits], and 32 [bits] of the remaining 44 [bits] in contact with the head of the padding length area.
  • the CRC obtained from the plain text PT6 is included in the storage area.
  • the code “060” is the top 12 [bits] of “06060606...” In which 1-byte codes indicating the padding length pl are continuously arranged.
  • the plain text PT7 is data having a multiple length of the block length bl. However, if the padding pd is not connected, information indicating that the padding pd is not connected needs to be connected to the plain text PT7. As a result, the plain text PT7 does not have a multiple length of the block length bl. That is, even if the plain text PT7 is data having a multiple length of the block length bl, it is necessary to connect the padding pd.
  • a padding pd of 16 [bytes] is required to encrypt the plain text PT7 using the block cipher.
  • the padding pd includes “0” indicating the padding length pl of 16 [bytes] in the padding length area of the last 4 [bits], and 32 [of the remaining 124 [bits] in contact with the head of the padding length area. bit]] includes the CRC obtained from the plain text PT7.
  • the code “1010101010101010101101” is the head 92 [bits] of “101010101010101010101010...” In which 1-byte codes indicating the padding length pl are continuously arranged.
  • a maximum 32 [bit] area that is the head of the padding pd may be adopted. Further, as a storage area, the remaining 32 bits of padding pd may be adopted without providing the threshold value 32 [bit].
  • a hash value may be adopted as a code calculated from the plain text PT stored in the storage area. Further, a parity may be adopted as a code calculated from the plain text PT stored in the storage area. Further, a hash value or a parity may be adopted as the code corresponding to the padding length pl.
  • the CRC When calculating the CRC of each data length, the CRC may be calculated by a CRC calculation function corresponding to each data length. Further, regardless of the padding length pl, the CRC may be calculated with a predetermined data length, and a code having a required data length may be extracted from the head. For example, when the padding length pl is 8 [bits], the information processing apparatus 101 calculates a CRC of 32 [bits], extracts the top 4 [bits] of the CRC, and stores it in the storage area.
  • Tamper detection example 1 Next, a specific example 1 of falsification detection will be described with reference to FIGS.
  • the information processing apparatus 101 performs encryption in the CBC mode of block cipher. Further, the tampering detection apparatus 102 performs decryption in the block cipher CBC mode.
  • FIG. 6 is an explanatory diagram showing a specific example 1 of plain text PT encryption by the information processing apparatus 101.
  • the information processing apparatus 101 encrypts a plain text PT having a data length 9 [bytes] longer than a multiple length of the block length bl.
  • the information processing apparatus 101 generates a concatenated text APT by concatenating 7 [bytes] of the padding pd with the plain text PT for encryption by block cipher.
  • the information processing apparatus 101 divides the connected sentence APT for each block length bl to generate blocks B1 to Bn.
  • the information processing apparatus 101 encrypts the blocks B1 to Bn using the block cipher CBC mode to generate encrypted blocks C1 to Cn.
  • the padding pd to be “07070” is connected to the plain text PT.
  • the information processing apparatus 101 generates the blocks B1 to Bn by dividing the concatenated sentence APT obtained by concatenating the padding pd for each block length bl.
  • the generated block Bn includes padding pd.
  • the information processing apparatus 101 encrypts the generated blocks B1 to Bn to generate encrypted blocks C1 to Cn. For example, when encrypting the first block B1 from the beginning, the information processing apparatus 101 takes the exclusive OR of the block B1 and the initialization vector IV and encrypts it with the common key to generate the encrypted block C1. To do. Further, when encrypting the i-th block Bi from the beginning, the information processing apparatus 101 performs exclusive OR operation between the block Bi and the encrypted block Ci-1, encrypts it with the common key, and encrypts the encrypted block Ci. Is generated.
  • the information processing apparatus 101 transmits the generated encrypted blocks C1 to Cn to the tampering detection apparatus 102. Next, detection of tampering by the tampering detection apparatus 102 that has received the transmitted encrypted blocks C1 to Cn will be described.
  • FIG. 7 is an explanatory diagram showing a specific example 1 of alteration detection by the alteration detection device 102.
  • the encrypted blocks C1 to Cn shown in FIG. 6 transmitted by the information processing apparatus 101 are received by the tampering detection apparatus 102 without being tampered with.
  • the tampering detection apparatus 102 detects whether or not the received encrypted blocks C1 to Cn have been tampered with.
  • the tampering detection apparatus 102 decrypts the blocks B1 to Bn from the encrypted blocks C1 to Cn. For example, when decrypting the first encrypted block C1 from the beginning, the falsification detection apparatus 102 decrypts the encrypted block C1 with the common key and takes an exclusive OR with the initialization vector IV to obtain the block B1. Is generated. Further, when decrypting the i-th encrypted block Ci from the beginning, the tampering detection apparatus 102 decrypts the encrypted block Ci with the common key, performs exclusive OR with the encrypted block Ci-1, and Bi is generated.
  • the tampering detection apparatus 102 extracts the padding length pl from the padding length area that is the end of the generated final block Bn.
  • the tampering detection apparatus 102 extracts the last 7 of the padding pd and determines that the padding length pl is 7 [bytes].
  • the tampering detection apparatus 102 extracts the CRC from the padding pd. Since the padding length pl is 7 [bytes], the tampering detection apparatus 102 determines that the CRC storage area length is 32 [bits]. Then, the tampering detection apparatus 102 extracts the CRC “633350373” from the CRC storage area.
  • the tampering detection apparatus 102 determines the tail data 7 [byte] of the decrypted block Bn as the padding pd and removes it, and generates a plain text PT.
  • the tampering detection apparatus 102 generates a 32 [bit] CRC from the plain text PT from which the padding pd has been removed.
  • the tampering detection apparatus 102 determines whether the extracted CRC matches the generated CRC and detects the presence or absence of tampering. If the plain text PT generated by the falsification detection device 102 is the same as the plain text PT of the information processing device 101, the CRC generated from each plain text PT is also the same.
  • the falsification detection device 102 since the encrypted blocks C1 to Cn were not falsified, the CRC generated by the falsification detection device 102 and the CRC stored in the padding pd by the information processing device 101 are the same. Therefore, the falsification detection device 102 does not falsify the received encrypted blocks C1 to Cn, and the plain text PT obtained by removing the padding pd by the falsification detection device 102 remains as the plain text PT in the information processing device 101. Judge that there is.
  • Tamer detection example 2 Next, specific example 2 of falsification detection will be described with reference to FIGS. 8 and 9.
  • the information processing apparatus 101 performs encryption in the CBC mode of block cipher. Further, the tampering detection apparatus 102 performs decryption in the block cipher CBC mode.
  • FIG. 8 is an explanatory diagram showing a specific example 2 of plain text PT encryption by the information processing apparatus 101.
  • the information processing apparatus 101 encrypts a plain text PT having a data length 9 [bytes] longer than a multiple of the block length bl. Then, the encrypted blocks C1 to Cn are transmitted to the tampering detection apparatus 102.
  • FIG. 9 is an explanatory diagram showing a specific example 2 of alteration detection by the alteration detection device 102.
  • the tampering detection apparatus 102 detects whether or not the received encrypted blocks C1 to Cn-2, Cn-1 ', and Cn have been tampered with.
  • the blocks decrypted based on the altered encrypted block Cn-1 ' are different from the blocks B1 to Bn of the information processing device 101. That is, blocks Bn-1 ′ and Bn ′ different from the blocks Bn ⁇ 1 and Bn are generated from the encrypted block Cn ⁇ 1′Cn from which the blocks Bn ⁇ 1 and Bn are to be generated by the decryption of the information processing apparatus 101. Is done. As a result, the contents of the padding pd change.
  • the tampering detection apparatus 102 extracts the padding length pl from the padding length area that is the end of the generated final block Bn ′.
  • the tampering detection apparatus 102 extracts the last 6 and determines that the padding length pl is 6 [bytes].
  • the tampering detection apparatus 102 determines that the padding pd has changed due to tampering with the encrypted block. Then, the tampering detection device 102 does not perform a CRC match determination, and the content of the plain text PT obtained by removing the padding pd by the tampering detection device 102 changes due to the tampering of the encrypted block. Judge that
  • the tampering detection apparatus 102 extracts a CRC from the padding pd. Since the padding length pl is 6 [bytes], the tampering detection apparatus 102 determines that the CRC storage area length is 32 [bits]. The tampering detection apparatus 102 extracts CRC ′ “651988243A” from the CRC storage area.
  • the tampering detection apparatus 102 determines the tail data 6 [bytes] of the decrypted block Bn ′ as the padding pd and removes it, and generates plaintext. Since the blocks Bn-1 ′ and Bn ′ are affected by falsification, a plain text PT ′ different from the plain text PT in the information processing apparatus 101 is generated. The tampering detection apparatus 102 generates a 32-bit CRC ′′ from the plain text PT ′ from which the padding pd has been removed.
  • the tampering detection apparatus 102 determines whether the extracted CRC ′ matches the generated CRC ′′, and detects the presence or absence of tampering. If the plain text PT ′ generated by the tampering detection apparatus 102 is the same as the plain text PT of the information processing apparatus 101, the CRC generated from each plain text is also the same.
  • the stored CRC changes due to the alteration of the encrypted block Cn-1 'and becomes CRC'.
  • CRC ′′ is generated from the plain text PT ′ that has changed due to the tampering of the encrypted block Cn-1 ′. That is, the CRC ′ stored in the padding pd and the CRC ′′ generated by the tampering detection apparatus 102 are different. Therefore, the tampering detection apparatus 102 can determine that the content of the plain text PT obtained by removing the padding pd by the tampering detection apparatus 102 has changed due to the tampering of the encrypted block.
  • the information processing apparatus 101 performs encryption in the CBC mode of block cipher. Further, the tampering detection apparatus 102 performs decryption in the block cipher CBC mode.
  • FIG. 10 is an explanatory diagram showing a specific example 3 of plain text PT encryption by the information processing apparatus 101.
  • the information processing apparatus 101 encrypts a plain text PT having a data length 9 [bytes] longer than a multiple of the block length bl. Then, the encrypted blocks C1 to Cn are transmitted to the tampering detection apparatus 102.
  • FIG. 11 is an explanatory diagram showing a specific example 3 of falsification detection by the falsification detection apparatus 102.
  • the tampering detection apparatus 102 detects whether or not the received encrypted blocks C1, C2 ', C3 to Cn-1, and Cn have been tampered with.
  • the blocks decrypted based on the altered encrypted block C2 ' are different from the blocks B1 to Bn of the information processing device 101. That is, blocks B2 'and B3' different from the blocks B2 and B3 are generated from the encrypted block C2'C3 from which the blocks B2 and B3 are to be generated by the decryption of the information processing apparatus 101. As a result, the content of the padding pd does not change.
  • the tampering detection apparatus 102 extracts the padding length pl from the padding length area that is the end of the generated final block Bn.
  • the tampering detection apparatus 102 extracts the end 7 and determines that the padding length pl is 7 [bytes].
  • the tampering detection apparatus 102 extracts the CRC from the padding pd. Since the padding length pl is 7 [bytes], the tampering detection apparatus 102 determines that the CRC storage area length is 32 [bits]. Then, the tampering detection apparatus 102 extracts the CRC “633350373” from the CRC storage area.
  • the tampering detection apparatus 102 determines that the end data 7 [byte] of the decrypted block Bn is removed as the padding pd, and generates plain text. Since the blocks B ⁇ b> 2 ′ and B ⁇ b> 3 ′ are affected by tampering, plain text PT ′ different from the plain text PT in the information processing apparatus 101 is generated. The tampering detection apparatus 102 generates a 32-bit CRC 'from the plain text PT' from which the padding pd has been removed.
  • the falsification detection device 102 determines whether the extracted CRC matches the generated CRC ', and detects the presence or absence of falsification. If the plain text PT ′ generated by the tampering detection apparatus 102 is the same as the plain text PT of the information processing apparatus 101, the CRC generated from each plain text is also the same.
  • CRC ′ is generated from the plain text PT ′ that has changed due to the tampering of the encrypted block C2 ′. That is, the CRC stored in the padding pd and the CRC ′ generated by the falsification detection device 102 are different. Therefore, the tampering detection apparatus 102 can determine that the content of the plain text PT obtained by removing the padding pd by the tampering detection apparatus 102 has changed due to the tampering of the encrypted block.
  • FIG. 12 is a flowchart showing details of padding connection processing performed by the information processing apparatus 101.
  • the CPU 201 determines whether or not a plain text PT has been input (step S1201). If there is no input of plaintext PT (step S1201: No), the process returns to step S1201, and the CPU 201 waits for input of plaintext PT. On the other hand, when plain text PT is input (step S1201: Yes), the process proceeds to step S1202.
  • the CPU 201 calculates the padding length pl of the padding pd connected to the input plain text PT (step S1202). Then, the CPU 201 concatenates the padding pd having the calculated padding length pl at the end of the plain text PT (step S1203).
  • the CPU 201 calculates a CRC corresponding to the calculated padding length pl (step S1204). Then, the CPU 201 stores the calculated CRC in the CRC storage area of the padding pd (step S1205).
  • the CPU 201 encrypts the concatenated text APT storing the CRC in the block cipher CBC mode for each block length bl (step S1206). Then, the CPU 201 outputs the encrypted block (step S1207) and ends the padding connection process.
  • the information processing apparatus 101 can create the padding pd including the code indicating the padding length pl at the end and including the code calculated from the plain text PT in the storage area. Further, as a result, when the padding pd includes a remaining area excluding the padding length area and the storage area, the information processing apparatus 101 can create a padding pd that includes a code corresponding to the padding length pl in the remaining area. Then, the information processing apparatus 101 can create a linked sentence APT by connecting the created padding pd to the input plain text PT.
  • FIG. 13 is a flowchart showing details of falsification detection processing performed by the falsification detection apparatus 102.
  • the CPU 201 determines whether an encrypted block has been input (step S1301). When there is no input of an encryption block (step S1301: No), it returns to step S1301 and CPU201 waits for the input of an encryption block. On the other hand, if an encrypted block has been input (step S1301: Yes), the process proceeds to step S1302.
  • the CPU 201 decrypts the plaintext from the encrypted block in the block cipher CBC mode (step S1302). Then, the CPU 201 extracts the padding length pl from the end, and calculates the CRC storage area length based on the padding length pl (step S1303). Next, the CPU 201 extracts a CRC from the storage area (step S1304).
  • step S1305 determines whether or not the padding length pl is 4 [bytes] or less.
  • step S1305: Yes the process proceeds to step S1308.
  • step S1305 determines whether the padding length pl is correct (step S1306). If the padding length pl is correct (step S1306: YES), the process proceeds to step S1308.
  • step S1306 determines that there is falsification, outputs the determination result (step S1307), and ends the falsification detection process.
  • step S1308 the CPU 201 removes the padding pd from the decrypted plaintext (step S1308).
  • the CPU 201 calculates a CRC from the plain text after removing the padding (step S1309).
  • step S1310 determines whether or not the CRC extracted in step S1304 matches the CRC calculated in step S1309 (step S1310). If they match (step S1310: YES), the CPU 201 determines that the message has not been tampered with, outputs the decrypted plaintext (step S1311), and ends the tampering detection process.
  • step S1310 determines that there has been falsification, outputs the determination result (step S1307), and ends the falsification detection processing.
  • the tampering detection apparatus 102 determines whether the padding length pl is correct, thereby affecting the padding pd. It can be determined whether or not.
  • the tampering detection apparatus 102 determines whether the code calculated from the plaintext PT in the information processing apparatus 101 included in the padding pd and the code calculated from the plaintext obtained by the tampering detection apparatus 102 are matched. Therefore, the tampering detection apparatus 102 can determine whether or not the plaintext obtained by the tampering detection apparatus 102 has changed from the plaintext PT in the information processing apparatus 101 due to the tampering of the encrypted block.
  • the information processing apparatus 101 calculates the padding length pl of the padding pd connected to the plain text PT, and then calculates the storage area length cl of the code calculated from the plain text PT within the range of the padding length pl. .
  • the code calculated from the plain text PT can be generated with a data length that can be stored in the padding pd.
  • the data length of the padding pd does not increase, thus preventing the data length of the concatenated text APT from increasing and reducing the resource usage. Can be done.
  • the tampering detection apparatus 102 determines whether the code calculated from the plaintext obtained by decryption matches the code calculated from the plaintext PT stored in the padding pd. Thereby, it is possible to detect that the plaintext has changed due to the alteration of the encrypted block.
  • the information processing apparatus 101 reserves a padding length area at the end of the padding pd when calculating the storage area.
  • the tampering detection apparatus 102 removes the padding pd from the concatenated sentence APT for which tampering has not been detected based on the data length indicated by the code of the last padding length area, and the plaintext PT in the information processing apparatus 101 The same plain text PT can be obtained.
  • the information processing apparatus 101 generates the padding length area length 11 with the shortest data length that can indicate the block length bl. Thereby, the code indicating the padding length pl can be stored with the minimum necessary data length.
  • the information processing apparatus 101 generates the padding pd with a minimum data length necessary for encrypting the plain text PT. As a result, an increase in the amount of transmission data due to concatenation of padding pd can be minimized.
  • the information processing method and falsification detection method described in this embodiment can be realized by executing a program prepared in advance on a computer such as a personal computer or a workstation.
  • the information processing program and the alteration detection program are recorded on a computer-readable recording medium such as a hard disk, a flexible disk, a CD-ROM, an MO, and a DVD, and are executed by being read from the recording medium by the computer.
  • the information processing program and the falsification detection program may be distributed via a network such as the Internet.

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Storage Device Security (AREA)
  • Document Processing Apparatus (AREA)

Abstract

 情報処理装置(101)は、暗号化対象の平文(PT)に連結するパディング(pd)のパディング長(pl)を算出する。情報処理装置(101)は、算出したパディング長(pl)の範囲内でパディング(pd)にパディング長(pl)を格納し、また、算出したパディング長(pl)の範囲内でパディング(pd)に平文(PT)から算出するCRCを格納する。情報処理装置(101)は、パディング長(pl)とCRCを含むパディング(pd)を連結した平文(PT)を暗号化して改ざん検出装置(102)に送信する。一方、改ざん検出装置(102)は、受信した暗号化ブロックから復号した平文(PT)に含まれるパディング長(pl)とCRCに基づいて、パディング(pd)の除去と改ざんの検出をおこなうことができる。

Description

情報処理装置、改ざん検出装置、情報処理方法、改ざん検出方法、情報処理プログラムおよび改ざん検出プログラム
 本発明は、ブロック暗号を扱う情報処理装置、改ざん検出装置、情報処理方法、改ざん検出方法、情報処理プログラムおよび改ざん検出プログラムに関する。
 近年、情報化社会において、情報を扱う際の安全性を確保することが重要となっている。情報の安全性を確保するためには、情報を秘匿するための暗号化技術および情報の改ざんを検出する技術が必要となる。
 暗号化技術には、共通鍵方式の暗号(以下、共通鍵暗号と呼ぶ)や公開鍵方式の暗号(以下、公開鍵暗号と呼ぶ)がある。共通鍵暗号は、公開鍵暗号と比較した場合、処理速度が速くコンパクトに実装できるという利点がある。このため、携帯電話やICカードなどの小型機器に暗号化機能を付加する場合には、共通鍵暗号が使用される。
 共通鍵暗号の一種であるブロック暗号においては、暗号化の対象となるデータ(以下、「平文」という)をブロック単位に分割して暗号化をおこなう。暗号化がブロック単位でおこなわれるため、平文のデータ長はブロックのデータ長(以下、「ブロック長」という)の倍数である必要がある。
 そのため、平文のデータ長がブロック長の倍数でない場合、パディングを平文に連結して、平文をブロック長の倍数のデータ長に加工する技術がある。連結されるパディングには、復号の際にパディングを除去するために必要な情報が含まれる。例えば、パディングには、パディングのデータ長(以下、「パディング長」という)を示す情報が含まれる。
 また、情報の改ざんを検出する技術としては、例えば、ブロック長ごとに暗号化された一連のブロック(以下、「暗号化ブロック」という)から復号した平文内のパディングの内容が、パディングの規則に則っているか否かを判定する技術がある。すなわち、暗号化ブロックの改ざんにより、復号した平文内のパディングの内容に変化があった場合には、パディングがパディングの規則を外れるため、改ざんを検出することができる。
 また、情報の改ざんを検出する技術としては、例えば、暗号化の際に、平文を識別するCRCを平文に連結する。CRCを連結した平文にさらにパディングを連結して、ブロック長の倍数のデータ長に加工して、暗号化をおこなう。そして、復号の際に、復号した平文を識別するCRCと、復号した平文に付与されていたCRCと、を比較する技術がある。すなわち、暗号化ブロックの改ざんにより、平文に変化があった場合には、復号した平文のCRCと、復号した平文に付与されていたCRCが異なるため、改ざんを検出することができる(例えば、下記特許文献1参照)。
特開2006-220747号公報
 しかしながら、パディングとしての規則に基づいて改ざんを検出する技術では、暗号化ブロックの改ざんにより、パディングを付与するブロック、つまり暗号文の最終ブロック以外を改ざんした場合には、改ざんを検出することができないという問題があった。
 また、上述した特許文献1にかかる技術では、固定の平文データ長のみに使用可能であり、データ長が任意の場合については全く考慮されておらず、仮に任意のデータ長について使用した場合にはCRCをあらたに連結する必要があり、データ量が増えてしまうという問題があった。そのため、リソースが厳しい組み込み環境においては、CRCを連結する領域を用意できず、上述した特許文献1にかかる技術を適用することができないという問題があった。
 本発明は、上述した従来技術による問題点を解消するため、使用リソースの増加なく平文全体の改ざんを検出できる情報処理装置、改ざん検出装置、情報処理方法、改ざん検出方法、情報処理プログラムおよび改ざん検出プログラムを提供することを目的とする。
 本発明の一側面によれば、平文データのデータ長より長く、かつ、所定のブロック長の倍数となるデータ長を特定し、平文データのデータ長と特定されたデータ長との差分のデータ長を算出し、算出された差分のデータ長を示す第1のコードを生成し、平文データに基づいて算出される第2のコードを、算出された差分のデータ長から第1のコードのデータ長を引いた残余のデータ長以内のデータ長で生成し、生成された第2のコードを含み、生成された第1のコードを末尾とするパディングを、差分のデータ長で作成し、作成されたパディングを平文データの末尾に連結させて連結データを生成し、得られた連結データを出力する情報処理装置、情報処理方法および情報処理プログラムが提案される。
 また、本発明の一側面によれば、平文データを所定のブロック長ごとに暗号化した暗号化データを入力し、入力された暗号化データから、暗号化と復号に共通して使用される鍵を用いて復号した復号データを生成し、パディングのデータ長を格納する生成された復号データの末尾となる第1の領域から、第1のコードを抽出し、抽出された第1のコードが示すデータ長に基づいて、平文データから算出されたコードを格納する生成された復号データの第2の領域を決定し、決定された第2の領域から第2のコードを抽出し、抽出された第1のコードが示すデータ長となる生成された復号データの末尾領域を除いた生成された復号データの第3の領域から第3のコードを抽出し、抽出された第3のコードから算出される第4のコードを、第2のコードのデータ長と同一データ長で生成し、生成された第4のコードと第2のコードとの一致判定をおこない、判定結果を出力する改ざん検出装置、改ざん検出方法および改ざん検出プログラムが提案される。
 本発明の一側面によれば、使用リソースの増加なく平文全体の改ざんの検出を図ることができるという効果を奏する。
図1は、改ざん検出の内容を示す説明図である。 図2は、実施の形態にかかる情報処理装置101または改ざん検出装置102のハードウェア構成例を示すブロック図である。 図3は、情報処理装置101の機能的構成を示すブロック図である。 図4は、改ざん検出装置102の機能的構成を示すブロック図である。 図5は、連結文APTのデータ構造の一例を示す説明図である。 図6は、情報処理装置101による平文PTの暗号化の具体例1を示す説明図である。 図7は、改ざん検出装置102による改ざん検出の具体例1を示す説明図である。 図8は、情報処理装置101による平文PTの暗号化の具体例2を示す説明図である。 図9は、改ざん検出装置102による改ざん検出の具体例2を示す説明図である。 図10は、情報処理装置101による平文PTの暗号化の具体例3を示す説明図である。 図11は、改ざん検出装置102による改ざん検出の具体例3を示す説明図である。 図12は、情報処理装置101がおこなうパディング連結処理の詳細を示すフローチャートである。 図13は、改ざん検出装置102がおこなう改ざん検出処理の詳細を示すフローチャートである。
 以下に添付図面を参照して、この発明にかかる情報処理装置、改ざん検出装置、情報処理方法、改ざん検出方法、情報処理プログラムおよび改ざん検出プログラムの実施の形態を詳細に説明する。以下では、説明の簡単のため、情報処理装置と改ざん検出装置とが別の装置であるとする。しかし、情報処理装置は、改ざん検出装置の機能を併せて持っていてもよく、改ざん検出装置は、情報処理装置の機能を併せて持っていてもよい。
(改ざん検出の内容)
 図1は、改ざん検出の一例を示す説明図である。図1において、平文PTを暗号化して送信する側の装置を情報処理装置101とする。暗号化された平文PTを受信して、暗号化された平文PTの改ざんの有無を検出する側の装置を改ざん検出装置102とする。
 情報処理装置101と改ざん検出装置102とは、ネットワーク110に接続されている。また、ネットワーク110には、攻撃者のコンピュータ103が接続されている。情報処理装置101と改ざん検出装置102とは、暗号化と復号に共通して使用できる暗号鍵(以下、「共通鍵」という)を有する。
 情報処理装置101は、共通鍵を用いたブロック暗号により平文PTを暗号化する。ブロック暗号では、情報処理装置101は、暗号化する平文PTにパディングpdを連結することにより、平文PTをブロック単位に分割できるデータ長(すなわち、ブロック長blの倍数のデータ長)に加工する必要がある。以下では、パディングpdが連結された平文PTを「連結文APT」という。
 ここで、平文PTに連結されるパディングpdには、改ざん検出装置102においてパディングpdを除去するために必要なパディングpdのデータ長pl(以下、「パディング長」という)が含まれる。また、平文PTに連結されるパディングpdには、改ざん検出装置102において改ざんの検出に用いるデータが含まれる。
 改ざん検出装置102は、ネットワーク110を介して受信された暗号化ブロックを、共通鍵を用いたブロック暗号により復号する。そして、改ざん検出装置102は、復号されたデータに基づいて、改ざんの有無を検出する。
 以下では、情報処理装置101が、データ長が44[byte]の平文PTを暗号化して改ざん検出装置102に送信する場合を例に挙げて、改ざん検出装置102における改ざんの検出の内容について説明する。ただし、ブロック長blは、16[byte]であるとする。
 (1)まず、情報処理装置101は、送信する平文PTのデータ長を確認して、平文PTに連結するパディングpdのパディング長plを算出する。具体的には、平文PTは、データ長が44[byte]であるから、ブロック長bl=16[byte]の3倍のデータ長となる48[byte]に4[byte]不足している。よって、情報処理装置101は、パディング長plを4[byte]と算出する。
 (2)次に、情報処理装置101は、ブロック暗号による暗号化のために、ブロック長bl=16[byte]の3倍となる48[byte]のデータ長となる連結文APTに平文PTを加工する。具体的には、情報処理装置101は、算出したパディング長pl=4[byte]のパディングpdを平文PTの末尾に連結することにより、データ長をブロック長blの倍数のデータ長とする連結文APTを作成する。
 パディングpdには、改ざん検出装置102がパディングpdを除去するために必要なパディングpdのパディング長plの情報がパディングpdの末尾となる領域に格納されている。
 ここで、パディング長plの情報を格納するパディングpdの末尾となる領域(以下、「パディング長領域」という)のデータ長ll(以下、「パディング長領域長ll」という)は、固定長であり、平文PTに連結されうる最長のパディング長plを示すことが可能なデータ長である。例えば、ブロック長blが16[byte]であれば、平文PTに連結されうるパディングpdは最長でも16[byte]であるから、16を示すことが可能な4[bit]がパディング長領域長llである。
 例えば、ここでのパディングpdとしては、pkcs#7に記載されたパディング方式に基づいて「04040404」が採用される。ただし、「04040404」は、16進数表記である。これにより、改ざん検出装置102は、パディングpdの末尾4[bit]となるパディング長領域が示す4を参照して、パディング長plが4[byte]であると判断できる。
 (3)次に、情報処理装置101は、平文PTから算出されるコードを格納するパディングpd内の領域(以下、「格納領域」という)のデータ長cl(以下、「格納領域長」という)を算出する。平文PTから算出されるコードとしては、例えば、平文PTのCRCを採用できる。
 具体的には、例えば、情報処理装置101は、パディング長領域を除いたパディングpd内の領域をCRCの格納領域とする。よって、格納領域長clは、パディング長pl=4[byte]から、パディング長領域長ll=4[bit]を除いた28[bit]である。
 (4)そして、情報処理装置101は、算出した格納領域長clと同一データ長のCRCを平文PTから算出する。すなわち、情報処理装置101は、平文PTから28[bit]のCRCを算出する。
 (5)情報処理装置101は、算出した28[bit]のCRCをパディングpd内の格納領域に格納する。情報処理装置101は、結果として、連結文APT内のパディングpdを、末尾となるパディング長領域にパディング長plを含み、格納領域に算出したCRCを含むパディングpdに加工する。
 (6)そして、情報処理装置101は、連結文APTを、ブロック長bl=16[byte]ごとに分割する。ここでは、連結文APTのデータ長は48[byte]であるから、連結文APTは3ブロックに分割される。ここで、分割されたブロックを、先頭からそれぞれブロックB1~B3とする。
 (7)情報処理装置101は、分割したブロックB1~B3を、ブロック暗号により暗号化して、改ざん検出装置102に送信する。ここで、ブロック暗号により暗号化されたブロックB1~B3を、それぞれ暗号化ブロックC1~C3とする。
 (8)ここで、情報処理装置101により送信された暗号化ブロックC1~C3が、攻撃者のコンピュータ103でキャプチャされ、暗号化ブロックC2の一部が改ざんされたとする。
 (9)改ざん検出装置102は、暗号化ブロックC1~C3を受信する。そして、改ざん検出装置102は、受信した暗号化ブロックC1~C3から、ブロックを復号する。そして、改ざん検出装置102は、復号したブロックを連結させて連結文APT’を作成する。
 しかしながら、暗号化ブロックC2が改ざんされているため、改ざん検出装置102が暗号化ブロックC2に基づいて作成した連結文APT’は、情報処理装置101での連結文APTとは異なるデータになっている。
 (10)改ざん検出装置102は、連結文APT’の末尾のパディング長領域が示す4を参照して、パディング長plが4[byte]であると特定し、連結文APT’の末尾から4[byte]のパディングpdを除去して平文PT’を作成する。しかしながら、暗号化ブロックC2の改ざんの影響により、改ざん検出装置102が作成した平文PT’は、情報処理装置101での平文PTとは異なるデータになっている。
 (11)次に、改ざん検出装置102は、平文PT’から算出されるコードを、格納領域長clと同一データ長で算出する。具体的には、改ざん検出装置102は、パディング長pl=4[byte]とパディング長領域長ll=4[bit]より、格納領域長clは28[bit]であると特定する。そして、改ざん検出装置102は、平文PT’から28[bit]のCRC’を算出する。ここで、平文PT’は平文PTとは異なるデータになっているため、算出されるCRC’は、情報処理装置101でのCRCとは異なるデータになる。
 (12)改ざん検出装置102は、特定された28[bit]の格納領域から、平文PTのCRCを抽出する。そして、改ざん検出装置102は、算出したCRC’と、パディングpdから抽出したCRCとの一致判定をおこなう。そして、改ざん検出装置102は、判定結果を出力する。
 具体的には、CRC’とCRCとが異なるデータであれば、改ざん検出装置102は、平文PT’は情報処理装置101での平文PTとは異なるデータであると判定でき、改ざんがあったことを出力する。また、CRC’とCRCとが同一のデータであれば、改ざん検出装置102は、平文PT’は情報処理装置101での平文PTのままであると判定でき、改ざんされていないことを出力する。
 以上のように、情報処理装置101は、パディングpdに平文PTから算出されるコードを格納しておく。そして、改ざん検出装置102は、復号した平文PT’全体から算出されるコードとパディングpdに格納された平文PTから算出されたコードとの一致判定をおこなう。これにより、改ざん検出装置102は、改ざんにより平文PTのどの部分が変化した場合であっても改ざんを検出することができる。
 また、情報処理装置101は、平文PTに連結するパディングのパディング長plを算出してから、算出したパディング長plの範囲内で平文PTから算出するコードの格納領域長clを算出する。そして、情報処理装置101は、算出した格納領域長clと同一データ長以下の長さで平文PTから算出するコードを生成し、格納領域に格納する。これにより、連結文APTのデータ長の増加を防止し、リソースの使用量の削減をおこなうことができる。
 また、情報処理装置101は、格納領域を算出する際に、パディング長領域を確保しておく。これにより、改ざん検出装置102は、末尾のパディング長領域のコードが示すデータ長に基づいて、改ざんが検出されなかった連結文APTから、パディングpdを除去して、情報処理装置101での平文PTと同一の平文PTを得ることができる。
(情報処理装置101または改ざん検出装置102のハードウェア構成例)
 図2は、実施の形態にかかる情報処理装置101または改ざん検出装置102のハードウェア構成例を示すブロック図である。実施の形態では、情報処理装置101と改ざん検出装置102とは、同一のハードウェア構成であるとする。
 図2において、情報処理装置101または改ざん検出装置102は、CPU(Central Processing Unit)201と、ROM(Read‐Only Memory)202と、RAM(Random Access Memory)203と、HDD(Hard Disk Drive)204と、暗号化回路205と、I/F(Interface)206と、ディスプレイ207と、キーボード208と、を備えている。また、各構成部はバス200によってそれぞれ接続されている。
 ここで、CPU201は、情報処理装置101または改ざん検出装置102の全体の制御を司る。ROM202は、ブートプログラムなどのプログラムを記憶している。また、ROM202は、API(Application Programming Interface)を記憶している。RAM203は、CPU201のワークエリアとして使用される。HDD204は、CPU201の制御にしたがって内蔵するハードディスクに対するデータのリード/ライトを制御する駆動装置である。暗号化回路205は、データを暗号化したり、暗号化されたデータを復号する。
 インターフェース(以下、「I/F」と略する。)206は、通信回線を通じてLAN(Local Area Network)、WAN(Wide Area Network)、インターネットなどのネットワーク110に接続され、このネットワーク110を介して他の装置に接続される。そして、I/F206は、ネットワーク110と内部のインターフェースを司り、外部装置からのデータの入出力を制御する。I/F206には、たとえばモデムやLANアダプタなどを採用することができる。
 ディスプレイ207は、カーソル、アイコンあるいはツールボックスをはじめ、文書、画像、機能情報などのデータを表示する。このディスプレイ207は、たとえば、CRT、TFT液晶ディスプレイ、プラズマディスプレイなどを採用することができる。キーボード208は、文字、数字、各種指示などの入力のためのキーを備え、データの入力をおこなう。また、タッチパネル式の入力パッドやテンキーなどであってもよい。
 次に、図3および図4を用いて、情報処理装置101の機能および改ざん検出装置102の機能について説明する。ただし、1装置が情報処理装置101の機能と改ざん検出装置102の機能とを併せて持っていてもよい。
(情報処理装置101の機能的構成例)
 まず、図3を用いて、情報処理装置101の機能的構成例について説明する。
 図3は、情報処理装置101の機能的構成を示すブロック図である。情報処理装置101は、特定部301と、算出部302と、第1の生成部303と、第2の生成部304と、作成部305と、連結部306と、出力部307と、暗号化部308と、第3の生成部309と、を含む構成である。この制御部となる機能(特定部301~暗号化部308)は、具体的には、例えば、図2に示したROM202、RAM203などの記憶装置に記憶されたプログラムをCPU201に実行させることにより、または、I/F206により、その機能を実現する。なお、各機能部によって処理されたデータは、RAM203などの記憶領域に記憶される。
 特定部301は、平文データのデータ長より長く、かつ、所定のブロック長blの倍数となるデータ長を特定する機能を有する。ここで、平文データとは、ブロック暗号による暗号化の対象となるデータであり、上述した平文PTである。所定のブロック長blとは、ブロック暗号に規定される分割単位となる1ブロックのデータ長であり、例えば、上述したブロック長bl=16[byte]である。
 具体的には、例えば、特定部301は、平文データのデータ長より長く、かつ、所定のブロック長blの倍数となるデータ長群の中において、最も短いデータ長を特定する。すなわち、特定部301は、平文PTを最小で何ブロックに分割すれば暗号化可能かを判断して、暗号化に必要となる最小のブロック数におけるデータ長を算出する。より具体的には、例えば、特定部301は、ブロック長blが16[byte]、平文PTが44[byte]とすると、平文PTは最小3ブロックに分割すれば暗号化可能であるため、ブロック長blの3倍の48[byte]を特定する。
 これにより、特定部301は、平文PTが最小何ブロックに分割すればブロック暗号化できるかに基づいて、連結文APTのデータ長となるブロック長blの倍数のデータ長を特定することができる。ここで、特定部301が連結文APTのデータ長を特定することにより、作成される連結文APTのデータ長を制限することができる。
 算出部302は、平文データのデータ長と特定部301によって特定されたデータ長との差分のデータ長を算出する機能を有する。ここで、差分のデータ長とは、パディング長plとなるデータ長である。具体的には、例えば、算出部302は、平文PTが44[byte]、特定部301によって特定されたデータ長が48[byte]とすると、パディング長plとなる差分のデータ長4[byte]を算出する。これにより、算出部302は、パディング長plを算出できる。
 第1の生成部303は、算出部302によって算出された差分のデータ長を示す第1のコードを生成する機能を有する。ここで、第1のコードとは、差分のデータ長を示す2進数のコードである。
 具体的には、例えば、第1の生成部303は、差分のデータ長を示す第1のコードを、所定のブロック長blを示すことができる最も短いデータ長で生成する。ここで、所定のブロック長blを示すことができる最も短いデータ長とは、パディング長plとなりうる最長のデータ長であるブロック長blを示すために必要かつ最も短いデータ長である。
 より具体的には、例えば、第1の生成部303は、ブロック長blが16[byte]、差分のデータ長が4[byte]であれば、16を示すことができる最も短いデータ長の4[bit]で、差分のデータ長4[byte]を示す第1のコードを生成する。すなわち、第1の生成部303は、差分のデータ長4[byte]を示すコード4(16進数表記、なお、2進数表記では「0100」である)を生成する。
 これにより、第1の生成部303は、改ざん検出装置102においてパディングpdを除去するために必要となるパディング長plを示すコードを生成することができる。
 第2の生成部304は、平文データに基づいて算出される第2のコードを、差分のデータ長から第1の生成部303によって生成された第1のコードのデータ長を引いた残余のデータ長以内のデータ長で生成する機能を有する。ここで、第2のコードとは、平文PTから算出されたコードであり、例えば、平文PTからハッシュ関数により算出したハッシュ値(例えば、CRC)、または、平文PTから算出したパリティ符号である。第1のコードのデータ長とは、上述したパディング長領域長ll以下である。
 具体的には、例えば、第2の生成部304は、平文データから算出する第2のコードを、差分のデータ長から第1のコードのデータ長を引いた残余のデータ長で生成する機能を有する。より具体的には、例えば、パディング長plを4[byte]、パディング長領域長llを4[bit]とすると、残余のデータ長は28[bit]となるから、第2の生成部304は、平文PTからCRCを28[bit]で生成する。
 ここで、CRCの算出には、例えば、ROM202に記憶されているAPIを用いる。ROM202に複数のデータ長のCRCのそれぞれを算出する複数のAPIを記憶しておき、算出するCRCのデータ長に応じてAPIを使い分けてCRCを算出してもよい。また、ROM202には算出しうるCRCのうち、最長のデータ長のCRCを算出するAPIのみを記憶しておき、必要なデータ長に応じて算出したCRCの一部を抜き出してもよい。
 これにより、第2の生成部304は、改ざん検出装置102における改ざんの検出の指標となる平文PTから算出するコードを、格納領域長clで生成することができる。
 作成部305は、第2の生成部304によって生成された第2のコードを含み、第1のコードを末尾とするパディングを、差分のデータ長で作成する機能を有する。具体的には、例えば、作成部305は、第1のコードを末尾とし、第2のコードを先頭とするパディングを作成する。
 より具体的には、例えば、作成部305は、第1のコードを末尾とし、第2のコードを先頭とするパディングを作成する。より具体的には、例えば、作成部305は、パディング長plを示すコードを末尾とし、平文PTから算出するCRCを先頭とするパディングpdを、算出されたパディング長plで作成する。パディング長plを7[byte]とし、CRCを32[bit]の「63350373」とすると、パディングpdは、パディング長plを示す「7」を末尾とし、「63350373」を先頭とする7[byte]の「63350373070707」となる。なお、パディングpdは、16進数表記である。
 また、パディング長plを4[byte]とし、CRCを28[bit]の「3F459A1」とすると、パディングpdは、パディング長plを示す「4」を末尾とし、「3F459A1」を先頭とするデータ長4[byte]の「3F459A14」となる。なお、パディングpdは、16進数表記である。
 また、具体的には、例えば、作成部305は、第1のコードを末尾とし、第2のコードを第1のコードの先頭と隣接させたパディングを、差分のデータ長で作成する。より具体的には、例えば、作成部305は、パディング長plを示すコードを末尾とし、平文PTから算出するCRCをパディング長plを示すコードの先頭と隣接させたパディングpdを、算出されたパディング長plで作成する。ここで、パディング長plを7[byte]とし、CRCを32[bit]の「63350373」とする場合を想定する。この場合、パディングpdは、パディング長plを示す「7」を末尾とし、「63350373」をパディング長plを示すコードの先頭と隣接させた7[byte]の「07070633503737」となる。なお、パディングpdは、16進数表記である。
 また、作成部305は、第3の生成部309によって生成されたパディング長plに対応するコードを、パディング長領域と格納領域以外の領域に格納してもよい。
 これにより、作成部305は、改ざん検出装置102において、パディングpdの除去に必要となるパディング長と、改ざんの検出の指標となる平文PTから算出するコードと、を含むパディングpdを作成することができる。また、第3の生成部309によって生成された改ざん検出装置102においてパディング長plが正しいかを判定する指標となるコードをさらに含むパディングを作成することができる。
 連結部306は、作成部305によって作成されたパディングを平文データの末尾に連結させて連結データを生成する機能を有する。ここで、連結データとは、上述した連結文APTである。具体的には、例えば、連結部306は、平文PTの末尾にパディングpdを連結させて、データ長がブロック長blの倍数となる連結文APTを生成する。これにより、連結部306は、ブロック暗号による暗号化が可能となるデータ長がブロック長blの倍数となる連結文APTを生成することができる。
 出力部307は、連結部306によって得られた連結データを出力する機能を有する。具体的には、例えば、出力部307は、I/F206によりネットワーク110を介して他の装置に連結文APTを送信する。また、出力部307は、光ディスクドライブを介して光ディスクに連結文APTを出力する。
 出力部307は、暗号化部308によって所定のブロック長blごとに暗号化された暗号化連結データを出力する機能を有する。ここで、暗号化連結データとは、連結文APTをブロック長blごとに暗号化して生成した1暗号化ブロック、または、一連の暗号化ブロックである。
 具体的には、例えば、出力部307は、I/F206によりネットワーク110を介して改ざん検出装置102に、連結文APTをブロック長blごとに暗号化して生成した暗号化ブロックを送信する。また、暗号化部308による暗号化の際に、初期化ベクトルIVを使用した場合は、初期化ベクトルIVを暗号化ブロックと併せて送信する。なお、初期化ベクトルIVは、秘匿された情報である必要はなく、暗号化せずに送信されてもよい。また、出力部307は、光ディスクドライブを介して光ディスクに、連結文APTをブロック長blごとに暗号化して生成した暗号化ブロックを出力する。
 暗号化部308は、連結データを、暗号化と復号に共通して使用される鍵を用いて所定のブロック長blごとに暗号化する機能を有する。暗号化と復号に共通して使用される鍵とは、共通鍵である。具体的には、例えば、暗号化部308は、連結文APTをブロック長blごとに分割して、共通鍵を用いたブロック暗号により、暗号化して、暗号化ブロックを生成する。
 より具体的には、例えば、暗号化部308は、DES(Data Encryption Standard)方式やAES方式(Advanced Encryption Standard)の暗号化回路205を用いて暗号化をおこなう。DES方式ではブロック長bl=8[byte]であり、AES方式ではブロック長bl=16[byte]である。また、各暗号化方式には複数の動作モードが規定されており、それらの動作モードに応じて、具体的な暗号化および復号化処理がおこなわれる。
 動作モードとしては、DES方式、AES方式ともに、ECB(Electronic Codebook)モードとCBC(Cipher Block Chaining)モードとCFB(Cipher Feedback)モードとOFB(Output Feedback)モードとCTR(Counter)モードが利用できる。なお、暗号化に使用される初期化ベクトルIVとしては、例えば、暗号化ごとに生成された乱数を採用できる。
 これにより、暗号化部308は、共通鍵を用いたブロック暗号により、連結文APTをブロック長blごとに暗号化して、連結文APTの秘匿性を確保することができる。
 第3の生成部309は、第1のコードを特定する第3のコードを、差分のデータ長から第1のコードのデータ長と所定のデータ長とを引いた残余のデータ長で生成する機能を有する。ここで、第3のコードとは、パディング長plに対応するコードである。
 具体的には、例えば、第3の生成部309は、パディング長を示す1byteコードを連続して並べたコードの先頭から抽出した残余の領域のデータ長分のコードを生成する。これにより、第3の生成部309は、改ざん検出装置102にて、パディング長plが正しいかを判定する指標となるコードを生成できる。
(改ざん検出装置102の機能的構成例)
 次に、まず、図4を用いて、改ざん検出装置102の機能的構成例について説明する。
 図4は、改ざん検出装置102の機能的構成を示すブロック図である。改ざん検出装置102は、入力部401と、復号部402と、第1の抽出部403と、決定部404と、第2の抽出部405と、第3の抽出部406と、生成部407と、判定部408と、出力部409と、を含む構成である。この制御部となる機能(入力部401~出力部409)は、具体的には、たとえば、図2に示したROM202、RAM203などの記憶装置に記憶されたプログラムをCPU201に実行させることにより、または、I/F206により、その機能を実現する。なお、各機能部によって処理されたデータは、RAM203などの記憶領域に記憶される。
 入力部401は、平文データを所定のブロック長blごとに暗号化した暗号化データを入力する機能を有する。ここで、平文データとは、上述した平文PTである。暗号化データとは、上述した暗号化ブロックである。
 具体的には、例えば、入力部401は、I/F206によりネットワーク110を介して情報処理装置101から、暗号化ブロックを受信する。また、入力部401は、光ディスクドライブを介して光ディスクから、暗号化ブロックを読み取る。これにより、入力部401は、改ざん検出の対象となる暗号化ブロックを入力することができる。
 復号部402は、入力部401によって入力された暗号化データから、暗号化と復号に共通して使用される鍵を用いて復号した復号データを生成する機能を有する。暗号化と復号に共通して使用される鍵とは、共通鍵である。復号データとは、改ざんされていない暗号化ブロックから復号した場合は、情報処理装置101での連結文APTである。ただし、復号データとは、改ざんされた暗号化ブロックから復号した場合は、情報処理装置101での連結文APTとは内容の異なる連結文APT’となる。
 具体的には、例えば、復号部402は、共通鍵を用いたブロック暗号のCBCモードにより、初期化ベクトルIV(Initial Vector)と暗号化ブロックから、連結文APTまたは、連結文APT’を復号する。なお、初期化ベクトルIVは、情報処理装置101が暗号化に使用した初期化ベクトルIVと同一データである。これにより、復号部402は、暗号化ブロックから、連結文を復号できる。
 第1の抽出部403は、パディングpdのデータ長を格納する復号データの末尾となる第1の領域から、第1のコードを抽出する機能を有する。ここで、第1の領域とは、上述したパディング長領域である。第1のコードとは、暗号化ブロックの改ざんがなかった場合、または、パディングpdに改ざんの影響がなかった場合、パディング長plである。一方、第1のコードとは、パディングpdに改ざんの影響があった場合、無意味なコードである。
 具体的には、例えば、第1の抽出部403は、復号部402によって復号された連結文の末尾4[bit]を参照して、パディング長plと推定される4[byte]を抽出する。これにより、第1の抽出部403は、パディング長plと推定されるデータ長を抽出できる。
 決定部404は、第1の抽出部403によって抽出された第1のコードが示すデータ長に基づいて、平文データから算出されたコードを格納する復号データの第2の領域を決定する機能を有する。ここで、第2の領域とは、第1の抽出部403によって抽出されたパディング長plから推定される平文PTから算出されたコードの格納領域である。
 具体的には、例えば、決定部404は、第1の領域の先頭と接する領域であって、第1のコードが示すデータ長から第1の領域のデータ長を引いた残余のデータ長の領域を、第2の領域に決定する。より具体的には、例えば、第1の抽出部403は、パディング長plが4[byte]であれば、パディング長領域の先頭と接する28[bit]の領域を格納領域に決定する。これにより、決定部404は、情報処理装置101が平文PTから算出したコードを格納した格納領域と推定される領域を決定することができる。
 また、例えば、決定部404は、第2の領域の先頭に接する復号データ内の領域であって、第1のコードが示すデータ長から第1のコードのデータ長と所定のデータ長とを引いた残余のデータ長の領域を、第4の領域として決定する。これにより、決定部404は、情報処理装置101がパディングに対応するコードを格納した領域と推定される領域を決定することができる。
 第2の抽出部405は、決定部404によって決定された第2の領域から第2のコードを抽出する機能を有する。ここで、第2のコードとは、暗号化ブロックが改ざんされなかった場合、または、パディングpdに改ざんの影響がなかった場合、情報処理装置101が格納した平文PTから算出されたコード(例えば、CRC)である。一方、第2のコードとは、パディングpdに改ざんの影響があった場合、改ざんの影響を受けた無意味なコードである。
 具体的には、例えば、第2の抽出部405は、CRCの格納領域として推定された領域から、情報処理装置101が格納したCRC、または、改ざんの影響を受けた無意味なコードを抽出する。これにより、第2の抽出部405は、改ざんの検出の指標となるコードを抽出することができる。
 第3の抽出部406は、第1のコードが示すデータ長となる復号データの末尾領域を除いた復号データの第3の領域から第3のコードを抽出する機能を有する。ここで、末尾領域とは、復号部402によって復号された連結文の末尾となる領域であり、暗号化ブロックが改ざんされなかった場合、または、パディングpdに改ざんの影響がない場合、パディングpdである。一方、末尾領域とは、復号部402によって復号された連結文の末尾となる領域であり、パディングpdに改ざんの影響があった場合、無意味な領域である。
 具体的には、例えば、第3の抽出部406は、パディングpdと推定される末尾データを除いた情報処理装置101での平文PT、または、改ざんされた平文PT’を抽出する。これにより、第3の抽出部406は、改ざんの検出の対象となる平文を抽出することができる。
 生成部407は、第3の抽出部406によって抽出された第3のコードを特定する第4のコードを、第2のコードのデータ長と同一データ長で生成する機能を有する。第4のコードとは、第3のコードを特定するコードであり、例えば、第3のコードからハッシュ関数により得られるハッシュ値(例えば、CRC)、第3のコードから得られるパリティ符号である。
 具体的には、例えば、第2のコードが28[bit]であれば、第3のコードから28[bit]のCRCを生成する。これにより、生成部407は、情報処理装置101での平文PTから算出されるコード、または、改ざんされた平文PT’から算出されるコードを生成することができる。または第2のコードの長さは鍵と同様に事前に共有しておいてもよい。
 判定部408は、生成部407によって生成された第4のコードと第2のコードとの一致判定をおこなう機能を有する。具体的には、例えば、判定部408は、平文PTから算出したCRCとパディングpdに格納されていたCRCとの一致判定をおこなう。
 また、判定部408は、暗号化ブロックの改ざんの影響を受けた平文PT’から算出したCRC’とパディングpdに格納されていたCRCとの一致判定をおこなう。また、判定部408は、暗号化ブロックの改ざんの影響を受けた平文PT’から算出したCRC’と暗号化ブロックの改ざんの影響を受けたパディングpdに格納されていたCRC’’との一致判定をおこなう。
 これにより、判定部408は、第3の抽出部406に抽出された平文が改ざんの影響を受けていない場合は、一致判定により一致すると判定され、改ざんなしと判定できる。また、判定部408は、第3の抽出部406に抽出された平文が改ざんの影響を受けている場合は、一致判定により一致しないと判定され、改ざんありと判定できる。
 また、判定部408は、第4の抽出部410によって抽出された第5のコードにより特定されるコードと第1のコードとの一致判定をおこなう機能を有する。具体的には、情報処理装置101が格納したパディング長plに対応するコードから、第1の抽出部403が抽出したコードが正しいコードか判定する。これにより、判定部408は、正しいコードでない場合は、改ざんありと判定できる。
 出力部409は、判定部408によって判定された判定結果を出力する機能を有する。具体的には、例えば、出力部409は、ディスプレイ207に、第4のコードと第2のコードとが一致したこと、すなわち、受信した暗号化ブロックは改ざんされていないことを出力する。また、出力部409は、ディスプレイ207に、第4のコードと第2のコードとが一致していないこと、すなわち、受信した暗号化ブロックは改ざんされていることを出力する。
 これにより、出力部409は、受信した暗号化ブロックの改ざんの有無、すなわち、第3の抽出部406によって抽出された平文に改ざんの影響があるか否かを、出力することができる。また復号結果の復号データをディスクに出力する。
 第4の抽出部410は、第1のコードを特定するコードを格納する第4の領域から第5のコードを抽出する機能を有する。具体的には、例えば、第4の抽出部410は、決定部404によって決定された情報処理装置101がパディング長plに対応するコードを格納したと推定される領域に格納されているコードを抽出する。これにより、第4の抽出部410は、パディングpdが改ざんの影響を受けていない場合は、情報処理装置101が格納したパディング長plに対応するコードを抽出できる。
(連結文APTのデータ構造)
 次に、図5を用いて、連結文APTのデータ構造について説明する。
 図5は、連結文APTのデータ構造の一例を示す説明図である。ここで、平文PT1~PT7は、ブロック暗号により暗号化される平文PTである。ここでは、ブロック長blを16[byte]とする。平文PTに連結されるパディングpdは、末尾をパディング長領域とし、CRCの格納領域を含む。
 CRCの格納領域は、パディング長領域の先頭に接する領域である。パディング長領域長llは、ブロック長bl=16[byte]を示すために必要な最小限のデータ長となる4[bit]である。CRCの格納領域長clは、最大32[bit]である。パディングpdの内容は、16進数表記とする。ただし、CRCは、「$」で示す。
 また、パディングpdは、パディング長領域と格納領域とを除いた残余の領域がある場合、パディング長plに対応するコードを残余の領域に格納する。パディング長plに対応するコードとは、パディング長を示す1byteコードを連続して並べたコードの先頭から抽出した残余の領域のデータ長分のコードである。
 平文PT1は、ブロック長blの倍数長より15[byte]長いデータ長のデータである。そのため、平文PT1を、ブロック暗号により暗号化するためには、1[byte]のパディングpdが必要となる。パディングpdは、末尾4[bit]となるパディング長領域にパディング長plである1[byte]を示す1を含み、パディング長領域の先頭に接する残余の4[bit]となる格納領域に平文PT1から得られたCRCを含む。
 平文PT2は、ブロック長blの倍数長より14[byte]長いデータ長のデータである。そのため、平文PT2を、ブロック暗号により暗号化するためには、2[byte]のパディングpdが必要となる。パディングpdは、末尾4[bit]となるパディング長領域にパディング長plである2[byte]を示す2を含み、パディング長領域の先頭に接する残余の12[bit]となる格納領域に平文PT2から得られたCRCを含む。
 平文PT3は、ブロック長blの倍数長より13[byte]長いデータ長のデータである。そのため、平文PT3を、ブロック暗号により暗号化するためには、3[byte]のパディングpdが必要となる。パディングpdは、末尾4[bit]となるパディング長領域にパディング長plである3[byte]を示す3を含み、パディング長領域の先頭に接する残余の20[bit]となる格納領域に平文PT3から得られたCRCを含む。
 平文PT4は、ブロック長blの倍数長より12[byte]長いデータ長のデータである。そのため、平文PT4を、ブロック暗号により暗号化するためには、4[byte]のパディングpdが必要となる。パディングpdは、末尾4[bit]となるパディング長領域にパディング長plである4[byte]を示す4を含み、パディング長領域の先頭に接する残余の28[bit]となる格納領域に平文PT4から得られたCRCを含む。
 平文PT5は、ブロック長blの倍数長より11[byte]長いデータ長のデータである。そのため、平文PT5を、ブロック暗号により暗号化するためには、5[byte]のパディングpdが必要となる。パディングpdは、末尾4[bit]となるパディング長領域にパディング長plである5[byte]を示す5を含み、パディング長領域の先頭に接する残余の36[bit]のうちの32[bit]となる格納領域に平文PT5から得られたCRCを含む。
 また、パディングpdは、残余の4[bit]に、パディング長pl=5[byte]に対応するコード「0」を含む。コード「0」とは、パディング長plを示す1byteコードを連続して並べた「05050505…」の先頭4[bit]である。
 平文PT6は、ブロック長blの倍数長より10[byte]長いデータ長のデータである。そのため、平文PT6を、ブロック暗号により暗号化するためには、6[byte]のパディングpdが必要となる。パディングpdは、末尾4[bit]となるパディング長領域にパディング長plである6[byte]を示す6を含み、パディング長領域の先頭に接する残余の44[bit]のうちの32[bit]となる格納領域に平文PT6から得られたCRCを含む。
 また、パディングpdは、残余の12[bit]に、パディング長pl=6[byte]に対応するコード「060」を含む。コード「060」とは、パディング長plを示す1byteコードを連続して並べた「06060606…」の先頭12[bit]である。
 平文PT7は、ブロック長blの倍数長のデータである。しかし、パディングpdを連結しない場合、パディングpdを連結していないことを示す情報を平文PT7に連結する必要があり、結果として、平文PT7は、ブロック長blの倍数長とならない。すなわち、平文PT7が、ブロック長blの倍数長のデータであっても、パディングpdを連結する必要がある。
 そのため、平文PT7を、ブロック暗号により暗号化するためには、16[byte]のパディングpdが必要となる。パディングpdは、末尾4[bit]となるパディング長領域にパディング長plである16[byte]を示す「0」を含み、パディング長領域の先頭に接する残余の124[bit]のうちの32[bit]となる格納領域に平文PT7から得られたCRCを含む。
 また、パディングpdは、残余の92[bit]に、パディング長pl=16[byte]に対応するコード「10101010101010101010101」を含む。コード「10101010101010101010101」とは、パディング長plを示す1byteコードを連続して並べた「101010101010101010101010…」の先頭92[bit]である。
 ここで、格納領域としては、パディングpdの先頭となる最大32[bit]の領域を採用してもよい。また、格納領域として、閾値32[bit]を設けず、パディングpdの残余の全ての領域を採用してもよい。
 格納領域に格納される平文PTから算出するコードとして、ハッシュ値を採用してもよい。また、格納領域に格納される平文PTから算出するコードとして、パリティを採用してもよい。また、パディング長plに対応するコードとして、ハッシュ値を採用してもよいし、パリティを採用してもよい。
 各データ長のCRCを算出する場合は、各データ長に対応するCRC計算関数によりCRCを算出してもよい。また、パディング長plに関わらず、所定のデータ長でCRCを算出して、先頭から必要なデータ長のコードを抽出して算出してもよい。例えば、情報処理装置101は、パディング長plが8[bit]の場合に、32[bit]のCRCを算出し、CRCの先頭4[bit]を抽出して、格納領域に格納する。
(改ざん検出の具体例1)
 次に、図6および図7を用いて、改ざん検出の具体例1について説明する。ここでは、情報処理装置101は、ブロック暗号のCBCモードにより暗号化をおこなう。また、改ざん検出装置102は、ブロック暗号のCBCモードにより復号をおこなう。
 図6は、情報処理装置101による平文PTの暗号化の具体例1を示す説明図である。ここで、情報処理装置101は、ブロック長blの倍数長より9[byte]長いデータ長となる平文PTを暗号化する。
 よって、情報処理装置101は、ブロック暗号による暗号化のために、平文PTに7[byte]のパディングpdを連結して連結文APTを生成する。次に、情報処理装置101は、連結文APTをブロック長blごとに分割して、ブロックB1~Bnを生成する。そして、情報処理装置101は、ブロックB1~Bnを、ブロック暗号のCBCモードにより暗号化して、暗号化ブロックC1~Cnを生成する。
 具体的には、情報処理装置101は、末尾をパディング長pl=7[byte]を示す7とし、32[bit]のCRC「63350373」を含み、残余をパディング長pl=7[byte]に対応する「07070」とするパディングpdを、平文PTに連結する。
 次に、情報処理装置101は、パディングpdを連結した連結文APTをブロック長blごとに分割して、ブロックB1~Bnを生成する。生成されたブロックBnには、パディングpdが含まれる。
 そして、情報処理装置101は、生成されたブロックB1~Bnごとに暗号化して、暗号化ブロックC1~Cnを生成する。例えば、情報処理装置101は、先頭から1番目のブロックB1を暗号化する場合、ブロックB1と初期化ベクトルIVとの排他的論理和をとり、共通鍵で暗号化して、暗号化ブロックC1を生成する。また、情報処理装置101は、先頭からi番目のブロックBiを暗号化する場合、ブロックBiと暗号化ブロックCi-1との排他的論理和をとり、共通鍵で暗号化して、暗号化ブロックCiを生成する。
 情報処理装置101は、生成した暗号化ブロックC1~Cnを改ざん検出装置102に送信する。次に、送信された暗号化ブロックC1~Cnを受信した改ざん検出装置102による改ざんの検出について説明する。
 図7は、改ざん検出装置102による改ざん検出の具体例1を示す説明図である。ここで、情報処理装置101により送信された図6に示した暗号化ブロックC1~Cnは、改ざんされずに改ざん検出装置102に受信されたとする。そして、改ざん検出装置102は、受信した暗号化ブロックC1~Cnの改ざんの有無を検出する。
 具体的には、まず、改ざん検出装置102は、暗号化ブロックC1~CnからブロックB1~Bnを復号する。例えば、改ざん検出装置102は、先頭から1番目の暗号化ブロックC1を復号する場合、暗号化ブロックC1を共通鍵で復号して、初期化ベクトルIVとの排他的論理和をとって、ブロックB1を生成する。また、改ざん検出装置102は、先頭からi番目の暗号化ブロックCiを復号する場合、暗号化ブロックCiを共通鍵で復号して、暗号化ブロックCi-1との排他的論理和をとり、ブロックBiを生成する。
 次に、改ざん検出装置102は、生成した最終ブロックBnの末尾となるパディング長領域からパディング長plを抽出する。ここで、改ざん検出装置102は、パディングpdの末尾7を抽出し、パディング長plを7[byte]と判断する。
 改ざん検出装置102は、抽出したパディング長pl=7[byte]が正しいか否かを判断するため、パディングpdから、パディング長plに対応するコードを抽出する。パディング長plに対応するコードとして、「07070」が抽出される。パディング長plに対応するコードは、「07070」であり、抽出されたコードと同一であるため、改ざん検出装置102は、パディング長pl=7[byte]を正しいと判断する。
 また、改ざん検出装置102は、パディングpdからCRCを抽出する。改ざん検出装置102は、パディング長plが7[byte]であるから、CRCの格納領域長は、32[bit]であると判断する。そして、改ざん検出装置102は、CRCの格納領域から、CRC「63350373」を抽出する。
 改ざん検出装置102は、復号したブロックBnの末尾データ7[byte]をパディングpdと判断して除去し、平文PTを生成する。改ざん検出装置102は、パディングpdを除去した平文PTから32[bit]のCRCを生成する。
 ここで、改ざん検出装置102は、抽出したCRCと生成したCRCとの一致判定をおこない、改ざんの有無を検出する。改ざん検出装置102により生成された平文PTが情報処理装置101の平文PTと同一であれば、それぞれの平文PTから生成されるCRCも同一となる。
 ここでは、暗号化ブロックC1~Cnの改ざんがなかったので、改ざん検出装置102により生成されたCRCと情報処理装置101によりパディングpdに格納されたCRCとは同一となる。よって、改ざん検出装置102は、受信した暗号化ブロックC1~Cnの改ざんはなく、改ざん検出装置102にてパディングpdを除去して得た平文PTは、情報処理装置101での平文PTのままであると判断する。
(改ざん検出の具体例2)
 次に、図8および図9を用いて、改ざん検出の具体例2について説明する。ここでは、情報処理装置101は、ブロック暗号のCBCモードにより暗号化をおこなう。また、改ざん検出装置102は、ブロック暗号のCBCモードにより復号をおこなう。
 図8は、情報処理装置101による平文PTの暗号化の具体例2を示す説明図である。ここで、図6と同様にして、情報処理装置101は、ブロック長blの倍数長より9[byte]長いデータ長となる平文PTを暗号化する。そして、暗号化ブロックC1~Cnを改ざん検出装置102に送信する。
 ただし、送信された暗号化ブロックC1~Cnは、送信途中で攻撃者によりキャプチャされたとする。そして、攻撃者により、暗号化ブロックCn-1が改ざんされ、暗号化ブロックCn-1’に変化したとする。
 図9は、改ざん検出装置102による改ざん検出の具体例2を示す説明図である。ここで、図8に示した暗号化ブロックC1~Cn-2,Cn-1’,Cnは、改ざん検出装置102に受信されたとする。そして、改ざん検出装置102は、受信した暗号化ブロックC1~Cn-2,Cn-1’,Cnの改ざんの有無を検出する。
 ここで、改ざん検出装置102により復号されたブロックのうち、改ざんされた暗号化ブロックCn-1’に基づいて復号されたブロックは、情報処理装置101のブロックB1~Bnとは異なるブロックとなる。すなわち、情報処理装置101の復号によりブロックBn-1,Bnが生成されるべき暗号化ブロックCn-1’Cnからは、ブロックBn-1,Bnとは異なるブロックBn-1’,Bn’が生成される。これにより、パディングpdの内容が変化することになる。
 ここで、改ざん検出装置102は、生成した最終ブロックBn’の末尾となるパディング長領域からパディング長plを抽出する。ここで、改ざん検出装置102は、末尾6を抽出し、パディング長plを6[byte]と判断する。
 改ざん検出装置102は、抽出したパディング長pl=6[byte]が正しいか否かを判断するため、パディングpdから、パディング長plに対応するコードを抽出する。パディングpdが変化したため、パディング長plに対応するコードとして「651」が抽出される。パディング長plに対応するコードは、「060」であり、抽出されたコードとは異なるため、改ざん検出装置102は、パディング長pl=6[byte]を誤りと判断する。
 これにより、改ざん検出装置102は、暗号化ブロックの改ざんにより、パディングpdが変化していると判断する。そして、改ざん検出装置102は、CRCの一致判定をおこなわずに、改ざん検出装置102にてパディングpdを除去して得た平文PTの内容は、暗号化ブロックの改ざんの影響を受けて変化していると判断する。
 なお、CRCの一致判定によっても改ざんが検出される。改ざん検出装置102は、パディングpdからCRCを抽出する。改ざん検出装置102は、パディング長plが6[byte]であるから、CRCの格納領域長は、32[bit]であると判断する。そして、改ざん検出装置102は、CRCの格納領域から、CRC’「651988243A」を抽出する。
 改ざん検出装置102は、復号したブロックBn’の末尾データ6[byte]をパディングpdと判断して除去し、平文を生成する。ブロックBn-1’,Bn’は改ざんの影響を受けているため、情報処理装置101での平文PTとは異なる平文PT’が生成される。改ざん検出装置102は、パディングpdを除去した平文PT’から32[bit]のCRC’’を生成する。
 ここで、改ざん検出装置102は、抽出したCRC’と生成したCRC’’との一致判定をおこない、改ざんの有無を検出する。改ざん検出装置102により生成された平文PT’が情報処理装置101の平文PTと同一であれば、それぞれの平文から生成されるCRCも同一となる。
 ここでは、暗号化ブロックCn-1’の改ざんの影響により、格納されたCRCが変化し、CRC’となっている。また、暗号化ブロックCn-1’の改ざんの影響により変化した平文PT’からCRC’’が生成される。すなわち、パディングpdに格納されたCRC’と改ざん検出装置102により生成されたCRC’’は異なる。よって、改ざん検出装置102は、改ざん検出装置102にてパディングpdを除去して得た平文PTの内容は、暗号化ブロックの改ざんの影響を受けて変化していると判断できる。
(改ざん検出の具体例3)
 次に、図10および図11を用いて、改ざん検出の具体例3について説明する。ここでは、情報処理装置101は、ブロック暗号のCBCモードにより暗号化をおこなう。また、改ざん検出装置102は、ブロック暗号のCBCモードにより復号をおこなう。
 図10は、情報処理装置101による平文PTの暗号化の具体例3を示す説明図である。ここで、図6と同様にして、情報処理装置101は、ブロック長blの倍数長より9[byte]長いデータ長となる平文PTを暗号化する。そして、暗号化ブロックC1~Cnを改ざん検出装置102に送信する。
 ただし、送信された暗号化ブロックC1~Cnは、送信途中で攻撃者によりキャプチャされたとする。そして、攻撃者により、暗号化ブロックC2が改ざんされ、暗号化ブロックC2’に変化したとする。
 図11は、改ざん検出装置102による改ざん検出の具体例3を示す説明図である。ここで、図10に示した暗号化ブロックC1,C2’,C3~Cn-1,Cnは、改ざん検出装置102に受信されたとする。そして、改ざん検出装置102は、受信した暗号化ブロックC1,C2’,C3~Cn-1,Cnの改ざんの有無を検出する。
 ここで、改ざん検出装置102により復号されたブロックのうち、改ざんされた暗号化ブロックC2’に基づいて復号されたブロックは、情報処理装置101のブロックB1~Bnとは異なるブロックとなる。すなわち、情報処理装置101の復号によりブロックB2,B3が生成されるべき暗号化ブロックC2’C3からは、ブロックB2,B3とは異なるブロックB2’,B3’が生成される。これにより、パディングpdの内容は変化しない。
 ここで、改ざん検出装置102は、生成した最終ブロックBnの末尾となるパディング長領域からパディング長plを抽出する。ここで、改ざん検出装置102は、末尾7を抽出し、パディング長plを7[byte]と判断する。
 改ざん検出装置102は、抽出したパディング長pl=7[byte]が正しいか否かを判断するため、パディングpdから、パディング長plに対応するコードを抽出する。パディングpdは変化していないため、パディング長plに対応するコードとして「07070」が抽出される。パディング長plに対応するコードは、「07070」であり、抽出されたコードと同一であるため、改ざん検出装置102は、パディング長pl=7[byte]を正しいと判断する。
 改ざん検出装置102は、パディングpdからCRCを抽出する。改ざん検出装置102は、パディング長plが7[byte]であるから、CRCの格納領域長は、32[bit]であると判断する。そして、改ざん検出装置102は、CRCの格納領域から、CRC「63350373」を抽出する。
 改ざん検出装置102は、復号したブロックBnの末尾データ7[byte]をパディングpdと判断して除去し、平文を生成する。ブロックB2’,B3’は改ざんの影響を受けているため、情報処理装置101での平文PTとは異なる平文PT’が生成される。改ざん検出装置102は、パディングpdを除去した平文PT’から32[bit]のCRC’を生成する。
 ここで、改ざん検出装置102は、抽出したCRCと生成したCRC’との一致判定をおこない、改ざんの有無を検出する。改ざん検出装置102により生成された平文PT’が情報処理装置101の平文PTと同一であれば、それぞれの平文から生成されるCRCも同一となる。
 ここでは、暗号化ブロックC2’の改ざんの影響により変化した平文PT’からCRC’が生成される。すなわち、パディングpdに格納されたCRCと改ざん検出装置102により生成されたCRC’は異なる。よって、改ざん検出装置102は、改ざん検出装置102にてパディングpdを除去して得た平文PTの内容は、暗号化ブロックの改ざんの影響を受けて変化していると判断できる。
(情報処理装置101がおこなうパディング連結処理の詳細)
 次に、図12を用いて、情報処理装置101がおこなうパディング連結処理の詳細について説明する。
 図12は、情報処理装置101がおこなうパディング連結処理の詳細を示すフローチャートである。まず、CPU201は、平文PTの入力があったか否か判定する(ステップS1201)。平文PTの入力がない場合(ステップS1201:No)、ステップS1201に戻り、CPU201は、平文PTの入力を待つ。一方、平文PTの入力があった場合(ステップS1201:Yes)、ステップS1202に移行する。
 次に、CPU201は、入力された平文PTに連結するパディングpdのパディング長plを算出する(ステップS1202)。そして、CPU201は、平文PTの末尾に算出したパディング長plのパディングpdを連結する(ステップS1203)。
 次に、CPU201は、算出したパディング長plに応じたCRCを算出する(ステップS1204)。そして、CPU201は、算出したCRCを、パディングpdのCRCの格納領域に格納する(ステップS1205)。
 次に、CPU201は、CRCを格納した連結文APTを、ブロック長blごとに、ブロック暗号のCBCモードにより暗号化する(ステップS1206)。そして、CPU201は、暗号化した暗号化ブロックを出力して(ステップS1207)、パディング連結処理を終了する。
 これにより、情報処理装置101は、結果として、パディング長plを示すコードを末尾に含み、平文PTから算出されるコードを格納領域に含むパディングpdを作成できる。また、情報処理装置101は、結果として、パディングpdにパディング長領域と格納領域とを除いた残余の領域がある場合、パディング長plに対応するコードを残余の領域に含むパディングpdを作成できる。そして、情報処理装置101は、入力された平文PTに作成したパディングpdを連結して、連結文APTを作成することができる。
(改ざん検出装置102がおこなう改ざん検出処理の詳細)
 次に、図13を用いて、改ざん検出装置102がおこなう改ざん検出処理の詳細について説明する。
 図13は、改ざん検出装置102がおこなう改ざん検出処理の詳細を示すフローチャートである。まず、CPU201は、暗号化ブロックの入力があったか判定する(ステップS1301)。暗号化ブロックの入力がない場合(ステップS1301:No)、ステップS1301に戻り、CPU201は、暗号化ブロックの入力を待つ。一方、暗号化ブロックの入力があった場合(ステップS1301:Yes)、ステップS1302に移行する。
 次に、CPU201は、ブロック暗号のCBCモードにより、暗号化ブロックから平文を復号する(ステップS1302)。そして、CPU201は、末尾からパディング長plを抽出し、パディング長plに基づいてCRCの格納領域長を算出する(ステップS1303)。次に、CPU201は、格納領域からCRCを抽出する(ステップS1304)。
 そして、CPU201は、パディング長plが4[byte]以下か否かを判定する(ステップS1305)。パディング長plが4[byte]以下である場合(ステップS1305:Yes)、ステップS1308に移行する。
 一方、パディング長plが4[byte]以下ではない場合(ステップS1305:No)、CPU201は、パディング長plが正しいか否か判定する(ステップS1306)。パディング長plが正しい場合(ステップS1306:Yes)、ステップS1308に移行する。
 一方、パディング長plが誤りである場合(ステップS1306:No)、CPU201は、改ざんありと判断し、判断結果を出力して(ステップS1307)、改ざん検出処理を終了する。
 ステップS1308にて、CPU201は、復号した平文からパディングpdを除去する(ステップS1308)。次に、CPU201は、パディングを除去した後の平文からCRCを算出する(ステップS1309)。
 そして、CPU201は、ステップS1304にて抽出したCRCとステップS1309にて算出したCRCとが一致するか否か判定する(ステップS1310)。一致する場合(ステップS1310:Yes)、CPU201は、改ざんされていないと判断して、復号した平文を出力し(ステップS1311)、改ざん検出処理を終了する。
 一方、一致しない場合(ステップS1310:No)、CPU201は、改ざんありと判断し、判断結果を出力して(ステップS1307)、改ざん検出処理を終了する。
 これにより、改ざん検出装置102は、パディングpdにパディング長plに対応するコードが含まれている場合、パディング長plが正しいかを判定することにより、暗号化ブロックの改ざんの影響がパディングpdに及んでいるか否か判定することができる。
 また、改ざん検出装置102は、パディングpdに含まれる情報処理装置101での平文PTから算出されたコードと改ざん検出装置102にて得られた平文から算出されたコードとの一致判定をおこなう。そのため、改ざん検出装置102は、暗号化ブロックの改ざんの影響により、改ざん検出装置102にて得られた平文が、情報処理装置101での平文PTから変化しているか否か判定することができる。
 以上説明したように、情報処理装置101は、平文PTに連結するパディングpdのパディング長plを算出してから、パディング長plの範囲内で平文PTから算出するコードの格納領域長clを算出する。これにより、平文PTから算出するコードを、パディングpd内に格納可能なデータ長で生成することができる。これにより、生成した平文PTから算出したコードをパディングpdに格納してもパディングpdのデータ長が増加することがないため、連結文APTのデータ長の増加を防止し、リソースの使用量の削減をおこなうことができる。
 また、改ざん検出装置102は、復号により得た平文から算出されたコードとパディングpdに格納された平文PTから算出されたコードとの一致判定をおこなう。これにより、暗号化ブロックの改ざんにより、平文が変化したことを検出することができる。
 また、情報処理装置101は、格納領域を算出する際に、パディングpdの末尾のパディング長領域を確保しておく。これにより、改ざん検出装置102は、末尾のパディング長領域のコードが示すデータ長に基づいて、改ざんが検出されなかった連結文APTから、パディングpdを除去して、情報処理装置101での平文PTと同一の平文PTを得ることができる。
 また、情報処理装置101は、パディング長領域長llをブロック長blを示すことができる最も短いデータ長で生成する。これにより、必要最小限のデータ長で、パディング長plを示すコードを格納できる。
 また、情報処理装置101は、平文PTを暗号化するために必要最小限のデータ長でパディングpdを生成する。これにより、パディングpdを連結することによる送信データ量の増加を最小にすることができる。
 なお、本実施の形態で説明した情報処理方法および改ざん検出方法は、予め用意されたプログラムをパーソナル・コンピュータやワークステーション等のコンピュータで実行することにより実現することができる。本情報処理プログラムおよび本改ざん検出プログラムは、ハードディスク、フレキシブルディスク、CD-ROM、MO、DVD等のコンピュータで読み取り可能な記録媒体に記録され、コンピュータによって記録媒体から読み出されることによって実行される。また本情報処理プログラムおよび本改ざん検出プログラムは、インターネット等のネットワークを介して配布してもよい。
 101 情報処理装置
 102 改ざん検出装置
 301 特定部
 302 算出部
 303 第1の生成部
 304 第2の生成部
 305 作成部
 306 連結部
 307 出力部
 308 暗号化部
 309 第3の生成部
 401 入力部
 402 復号部
 403 第1の抽出部
 404 決定部
 405 第2の抽出部
 406 第3の抽出部
 407 生成部
 408 判定部
 409 出力部
 410 第4の抽出部

Claims (19)

  1.  平文データのデータ長より長く、かつ、所定のブロック長の倍数となるデータ長を特定する特定手段と、
     前記平文データのデータ長と前記特定手段によって特定されたデータ長との差分のデータ長を算出する算出手段と、
     前記算出手段によって算出された差分のデータ長を示す第1のコードを生成する第1の生成手段と、
     前記平文データから算出される第2のコードを、前記差分のデータ長から前記第1の生成手段によって生成された第1のコードのデータ長を引いた残余のデータ長以内のデータ長で生成する第2の生成手段と、
     前記第2の生成手段によって生成された第2のコードを含み、前記第1のコードを末尾とするパディングを、前記差分のデータ長で作成する作成手段と、
     前記作成手段によって作成されたパディングを前記平文データの末尾に連結させて連結データを生成する連結手段と、
     前記連結手段によって得られた連結データを出力する出力手段と、
     を備えることを特徴とする情報処理装置。
  2.  前記連結データを、暗号化と復号に共通して使用される鍵を用いて前記所定のブロック長ごとに暗号化する暗号化手段を備え、
     前記出力手段は、
     前記暗号化手段によって前記所定のブロック長ごとに暗号化された暗号化連結データを出力することを特徴とする請求項1に記載の情報処理装置。
  3.  前記第1の生成手段は、
     前記差分のデータ長を示す第1のコードを、前記所定のブロック長を示すことができる最も短いデータ長で生成することを特徴とする請求項1または2に記載の情報処理装置。
  4.  前記特定手段は、
     前記平文データのデータ長より長く、かつ、前記所定のブロック長の倍数となるデータ長群の中において、最も短いデータ長を特定することを特徴とする請求項1~3のいずれか一つに記載の情報処理装置。
  5.  前記第2の生成手段は、
     前記平文データから算出される第2のコードを、前記差分のデータ長から前記第1のコードのデータ長を引いた残余のデータ長で生成し、
     前記作成手段は、
     前記第1のコードを末尾とし、前記第2のコードを先頭とするパディングを作成することを特徴とする請求項1~4のいずれか一つに記載の情報処理装置。
  6.  前記第2の生成手段は、
     所定のデータ長が前記差分のデータ長から前記第1のコードのデータ長を引いた残余のデータ長より短い場合、前記平文データから算出する第2のコードを、前記所定のデータ長で生成し、
     前記作成手段は、
     前記第1のコードを末尾とし、前記第2のコードを前記第1のコードの先頭と隣接させたパディングを、前記差分のデータ長で作成することを特徴とする請求項1~4のいずれか一つに記載の情報処理装置。
  7.  前記第1のコードを特定する第3のコードを、前記差分のデータ長から前記第1のコードのデータ長と前記所定のデータ長とを引いた残余のデータ長で生成する第3の生成手段を備え、
     前記作成手段は、
     前記第1のコードを末尾とし、前記第2のコードを前記第1のコードの先頭と隣接させ、前記第3のコードを前記第2のコードの先頭と隣接させたパディングを作成することを特徴とする請求項6に記載の情報処理装置。
  8.  前記第2のコードは、前記平文データから得られたハッシュ値であることを特徴とする請求項1~7のいずれか一つに記載の情報処理装置。
  9.  前記第2のコードは、前記平文データから得られたパリティ符号であることを特徴とする請求項1~7のいずれか一つに記載の情報処理装置。
  10.  平文データを所定のブロック長ごとに暗号化した暗号化データを入力する入力手段と、
     前記入力手段によって入力された前記暗号化データから、暗号化と復号に共通して使用される鍵を用いて復号した復号データを生成する復号手段と、
     パディングのデータ長を格納する前記復号データの末尾となる第1の領域から、第1のコードを抽出する第1の抽出手段と、
     前記第1の抽出手段によって抽出された第1のコードが示すデータ長に基づいて、平文データから算出されたコードを格納する前記復号データの第2の領域を決定する決定手段と、
     前記決定手段によって決定された第2の領域から第2のコードを抽出する第2の抽出手段と、
     前記第1のコードが示すデータ長となる前記復号データの末尾領域を除いた前記復号データの第3の領域から第3のコードを抽出する第3の抽出手段と、
     前記第3の抽出手段によって抽出された第3のコードから算出する第4のコードを、前記第2のコードのデータ長と同一データ長で生成する生成手段と、
     前記生成手段によって生成された第4のコードと前記第2のコードとの一致判定をおこなう判定手段と、
     前記判定手段によって判定された判定結果を出力する出力手段と、
     を備えることを特徴とする改ざん検出装置。
  11.  前記決定手段は、
     前記第1の領域の先頭に接する前記復号データ内の領域であって、前記第1のコードが示すデータ長から前記第1の領域のデータ長を引いた残余のデータ長の領域を、前記第2の領域に決定することを特徴とする請求項10に記載の改ざん検出装置。
  12.  前記決定手段は、
     所定のデータ長が前記第1のコードが示すデータ長から前記第1のコードのデータ長を引いた残余のデータ長より短い場合、前記第1の領域の先頭に接する前記復号データ内の領域であって、前記所定のデータ長の領域を、前記第2の領域に決定することを特徴とする請求項10に記載の改ざん検出装置。
  13.  前記第1のコードを特定するコードを格納する第4の領域から第5のコードを抽出する第4の抽出手段を備え、
     前記決定手段は、
     前記第2の領域の先頭に接する前記復号データ内の領域であって、前記第1のコードが示すデータ長から前記第1のコードのデータ長と前記所定のデータ長とを引いた残余のデータ長の領域を、前記第4の領域として決定し、
     前記第4の抽出手段は、
     前記決定手段によって決定された第4の領域から、前記第5のコードを抽出し、
     前記判定手段は、
     前記第4の抽出手段によって抽出された第5のコードにより特定されるコードと前記第1のコードとの一致判定をおこなうことを特徴とする請求項12に記載の改ざん検出装置。
  14.  前記第4のコードは前記第3のコードから得られたハッシュ値であることを特徴とする請求項11~13のいずれか一つに記載の改ざん検出装置。
  15.  前記第4のコードは前記第3のコードから得られたパリティ符号であることを特徴とする請求項11~13のいずれか一つに記載の改ざん検出装置。
  16.  コンピュータが、
     平文データのデータ長より長く、かつ、所定のブロック長の倍数となるデータ長を特定する特定工程と、
     前記平文データのデータ長と前記特定工程によって特定されたデータ長との差分のデータ長を算出する算出工程と、
     前記算出工程によって算出された差分のデータ長を示す第1のコードを生成する第1の生成工程と、
     前記平文データから算出される第2のコードを、前記差分のデータ長から前記第1の生成工程によって生成された第1のコードのデータ長を引いた残余のデータ長以内のデータ長で生成する第2の生成工程と、
     前記第2の生成工程によって生成された第2のコードを含み、前記第1のコードを末尾とするパディングを、前記差分のデータ長で作成する作成工程と、
     前記作成工程によって作成されたパディングを前記平文データの末尾に連結させて連結データを生成する連結工程と、
     前記連結工程によって得られた連結データを出力する出力工程と、
     を実行することを特徴とする情報処理方法。
  17.  コンピュータが、
     平文データを所定のブロック長ごとに暗号化した暗号化データを入力する入力工程と、
     前記入力工程によって入力された前記暗号化データから、暗号化と復号に共通して使用される鍵を用いて復号した復号データを生成する復号工程と、
     パディングのデータ長を格納する前記復号データの末尾となる第1の領域から、第1のコードを抽出する第1の抽出工程と、
     前記第1の抽出工程によって抽出された第1のコードが示すデータ長に基づいて、平文データから算出されたコードを格納する前記復号データの第2の領域を決定する決定工程と、
     前記決定工程によって決定された第2の領域から第2のコードを抽出する第2の抽出工程と、
     前記第1のコードが示すデータ長となる前記復号データの末尾領域を除いた前記復号データの第3の領域から第3のコードを抽出する第3の抽出工程と、
     前記第3の抽出工程によって抽出された第3のコードから算出する第4のコードを、前記第2のコードのデータ長と同一データ長で生成する生成工程と、
     前記生成工程によって生成された第4のコードと前記第2のコードとの一致判定をおこなう判定工程と、
     前記判定工程によって判定された判定結果を出力する出力工程と、
     を実行することを特徴とする改ざん検出方法。
  18.  平文データのデータ長より長く、かつ、所定のブロック長の倍数となるデータ長を特定する特定工程と、
     前記平文データのデータ長と前記特定工程によって特定されたデータ長との差分のデータ長を算出する算出工程と、
     前記算出工程によって算出された差分のデータ長を示す第1のコードを生成する第1の生成工程と、
     前記平文データから算出される第2のコードを、前記差分のデータ長から前記第1の生成工程によって生成された第1のコードのデータ長を引いた残余のデータ長以内のデータ長で生成する第2の生成工程と、
     前記第2の生成工程によって生成された第2のコードを含み、前記第1のコードを末尾とするパディングを、前記差分のデータ長で作成する作成工程と、
     前記作成工程によって作成されたパディングを前記平文データの末尾に連結させて連結データを生成する連結工程と、
     前記連結工程によって得られた連結データを出力する出力工程と、
     をコンピュータに実行させることを特徴とする情報処理プログラム。
  19.  平文データを所定のブロック長ごとに暗号化した暗号化データを入力する入力工程と、
     前記入力工程によって入力された前記暗号化データから、暗号化と復号に共通して使用される鍵を用いて復号した復号データを生成する復号工程と、
     パディングのデータ長を格納する前記復号データの末尾となる第1の領域から、第1のコードを抽出する第1の抽出工程と、
     前記第1の抽出工程によって抽出された第1のコードが示すデータ長に基づいて、平文データから算出されたコードを格納する前記復号データの第2の領域を決定する決定工程と、
     前記決定工程によって決定された第2の領域から第2のコードを抽出する第2の抽出工程と、
     前記第1のコードが示すデータ長となる前記復号データの末尾領域を除いた前記復号データの第3の領域から第3のコードを抽出する第3の抽出工程と、
     前記第3の抽出工程によって抽出された第3のコードから算出する第4のコードを、前記第2のコードのデータ長と同一データ長で生成する生成工程と、
     前記生成工程によって生成された第4のコードと前記第2のコードとの一致判定をおこなう判定工程と、
     前記判定工程によって判定された判定結果を出力する出力工程と、
     をコンピュータに実行させることを特徴とする改ざん検出プログラム。
PCT/JP2011/057480 2011-03-25 2011-03-25 情報処理装置、改ざん検出装置、情報処理方法、改ざん検出方法、情報処理プログラムおよび改ざん検出プログラム WO2012131856A1 (ja)

Priority Applications (3)

Application Number Priority Date Filing Date Title
JP2013506884A JP5641133B2 (ja) 2011-03-25 2011-03-25 情報処理装置、改ざん検出装置、情報処理方法、改ざん検出方法、情報処理プログラムおよび改ざん検出プログラム
PCT/JP2011/057480 WO2012131856A1 (ja) 2011-03-25 2011-03-25 情報処理装置、改ざん検出装置、情報処理方法、改ざん検出方法、情報処理プログラムおよび改ざん検出プログラム
US14/032,513 US9071420B2 (en) 2011-03-25 2013-09-20 Information processing apparatus, tampering detection apparatus, information processing method, tampering detection method, and computer product

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/JP2011/057480 WO2012131856A1 (ja) 2011-03-25 2011-03-25 情報処理装置、改ざん検出装置、情報処理方法、改ざん検出方法、情報処理プログラムおよび改ざん検出プログラム

Related Child Applications (1)

Application Number Title Priority Date Filing Date
US14/032,513 Continuation US9071420B2 (en) 2011-03-25 2013-09-20 Information processing apparatus, tampering detection apparatus, information processing method, tampering detection method, and computer product

Publications (1)

Publication Number Publication Date
WO2012131856A1 true WO2012131856A1 (ja) 2012-10-04

Family

ID=46929697

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/JP2011/057480 WO2012131856A1 (ja) 2011-03-25 2011-03-25 情報処理装置、改ざん検出装置、情報処理方法、改ざん検出方法、情報処理プログラムおよび改ざん検出プログラム

Country Status (3)

Country Link
US (1) US9071420B2 (ja)
JP (1) JP5641133B2 (ja)
WO (1) WO2012131856A1 (ja)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP5255154B1 (ja) * 2012-12-26 2013-08-07 株式会社エアー 部分一致検索の可能な暗号システム
KR20220063340A (ko) * 2020-11-10 2022-05-17 한국철도기술연구원 무선 통신 시스템에서 암호화 및 복호화 방법 및 장치

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10575210B2 (en) 2015-10-30 2020-02-25 Qualcomm Incorporated Cyclic redundancy check length management
US10348506B2 (en) * 2016-09-30 2019-07-09 International Business Machines Corporation Determination of state of padding operation
JP6818618B2 (ja) 2017-04-04 2021-01-20 キヤノン株式会社 情報処理装置、情報処理方法およびコンピュータプログラム
US11115184B2 (en) * 2017-05-22 2021-09-07 Micro Focus Llc Format preserving encryption with padding
CN115001758B (zh) * 2022-05-18 2024-05-07 矩阵时光数字科技有限公司 一种基于量子加密的短字节消息安全加密方法

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2001318600A (ja) * 2000-05-11 2001-11-16 Mitsubishi Heavy Ind Ltd メッセージ認証方法
JP2006220747A (ja) * 2005-02-08 2006-08-24 Toshiba Corp データ処理装置、データ記録装置、データ再生装置およびデータ格納方法
JP2008219746A (ja) * 2007-03-07 2008-09-18 Fujitsu Ltd 情報送信装置、情報送信方法、情報送信プログラムおよび該プログラムを記録した記録媒体

Family Cites Families (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH0946321A (ja) * 1995-08-01 1997-02-14 Fujitsu Ltd データ通信方法及び装置
JP3645027B2 (ja) * 1995-09-20 2005-05-11 松下電器産業株式会社 可変長データ送受信装置
EP1302022A2 (en) * 2000-03-31 2003-04-16 VDG Inc. Authentication method and schemes for data integrity protection
US20020048364A1 (en) * 2000-08-24 2002-04-25 Vdg, Inc. Parallel block encryption method and modes for data confidentiality and integrity protection
JP2003174650A (ja) * 2001-09-27 2003-06-20 Canon Inc 画像符号化装置、可変長符号化装置、制御装置およびそれらの方法
JP4183471B2 (ja) * 2002-10-08 2008-11-19 富士通株式会社 パディングが付加された伝送情報を受信する受信装置
JP5248085B2 (ja) * 2007-10-29 2013-07-31 ルネサスエレクトロニクス株式会社 データ処理方法およびデータ処理装置並びにプログラム
JP2011254440A (ja) * 2010-06-04 2011-12-15 Toshiba Corp 情報処理装置

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2001318600A (ja) * 2000-05-11 2001-11-16 Mitsubishi Heavy Ind Ltd メッセージ認証方法
JP2006220747A (ja) * 2005-02-08 2006-08-24 Toshiba Corp データ処理装置、データ記録装置、データ再生装置およびデータ格納方法
JP2008219746A (ja) * 2007-03-07 2008-09-18 Fujitsu Ltd 情報送信装置、情報送信方法、情報送信プログラムおよび該プログラムを記録した記録媒体

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP5255154B1 (ja) * 2012-12-26 2013-08-07 株式会社エアー 部分一致検索の可能な暗号システム
KR20220063340A (ko) * 2020-11-10 2022-05-17 한국철도기술연구원 무선 통신 시스템에서 암호화 및 복호화 방법 및 장치
KR102452037B1 (ko) * 2020-11-10 2022-10-11 한국철도기술연구원 무선 통신 시스템에서 암호화 및 복호화 방법 및 장치

Also Published As

Publication number Publication date
JPWO2012131856A1 (ja) 2014-07-24
US9071420B2 (en) 2015-06-30
JP5641133B2 (ja) 2014-12-17
US20140169555A1 (en) 2014-06-19

Similar Documents

Publication Publication Date Title
JP5641133B2 (ja) 情報処理装置、改ざん検出装置、情報処理方法、改ざん検出方法、情報処理プログラムおよび改ざん検出プログラム
CN103563290B (zh) 公共加密体系结构服务中组合密钥控制信息的方法和系统
JP4823904B2 (ja) データ暗号化装置及びデータ暗号化方法
KR101369748B1 (ko) 데이터 암호화 방법 및 그 장치
JP5167348B2 (ja) ソフトウェア暗号化方法およびソフトウェア暗号解読方法およびソフトウェア暗号化装置およびソフトウェア暗号解読装置
TWI642294B (zh) 具有鑑認指令之密碼訊息之電腦程式產品、系統及方法
US7499552B2 (en) Cipher method and system for verifying a decryption of an encrypted user data key
EP2352251A1 (en) Content decoding apparatus, content decoding method and integrated circuit
CN106878013B (zh) 一种文件的加密、解密方法和装置
US8467526B2 (en) Key evolution method and system of block ciphering
CN101272238A (zh) 利用单指令在多种模式中执行aes加密或解密
US9288061B2 (en) Safe communication method with card
CN107528689B (zh) 一种基于Ukey的密码修改方法
KR101117588B1 (ko) 암호화 표시정보를 갖는 기록매체
CN108199847A (zh) 数字安全处理方法、计算机设备及存储介质
EP2064830A1 (en) Method and apparatus for inserting authenication code, and method and apparatus for using data through authenication
CN107358284A (zh) 二维码的生成方法、读取方法、生成装置和读取装置
JP2004070049A (ja) データの暗号化方法及び装置、データの復号化方法及び装置、プログラム
US8494169B2 (en) Validating encrypted archive keys
JP2007334016A (ja) データ暗号化装置及びデータ暗号化方法
CN116781265A (zh) 一种数据加密的方法和装置
JP6631989B2 (ja) 暗号化装置、制御方法、及びプログラム
WO2021044465A1 (ja) 暗号化装置、復号装置、コンピュータプログラム、暗号化方法、復号方法及びデータ構造
JP4603022B2 (ja) 暗号化データ作成装置、および暗号化データ作成プログラム
JP6296589B2 (ja) 暗号処理システム

Legal Events

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

Ref document number: 11862582

Country of ref document: EP

Kind code of ref document: A1

ENP Entry into the national phase

Ref document number: 2013506884

Country of ref document: JP

Kind code of ref document: A

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 11862582

Country of ref document: EP

Kind code of ref document: A1