WO2021044465A1 - 暗号化装置、復号装置、コンピュータプログラム、暗号化方法、復号方法及びデータ構造 - Google Patents

暗号化装置、復号装置、コンピュータプログラム、暗号化方法、復号方法及びデータ構造 Download PDF

Info

Publication number
WO2021044465A1
WO2021044465A1 PCT/JP2019/034365 JP2019034365W WO2021044465A1 WO 2021044465 A1 WO2021044465 A1 WO 2021044465A1 JP 2019034365 W JP2019034365 W JP 2019034365W WO 2021044465 A1 WO2021044465 A1 WO 2021044465A1
Authority
WO
WIPO (PCT)
Prior art keywords
encryption
data
block
decryption
encrypted
Prior art date
Application number
PCT/JP2019/034365
Other languages
English (en)
French (fr)
Inventor
矢野 義博
真人 浦崎
Original Assignee
株式会社Dnpハイパーテック
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 株式会社Dnpハイパーテック filed Critical 株式会社Dnpハイパーテック
Priority to JP2021543621A priority Critical patent/JPWO2021044465A1/ja
Priority to PCT/JP2019/034365 priority patent/WO2021044465A1/ja
Publication of WO2021044465A1 publication Critical patent/WO2021044465A1/ja

Links

Images

Classifications

    • GPHYSICS
    • G09EDUCATION; CRYPTOGRAPHY; DISPLAY; ADVERTISING; SEALS
    • G09CCIPHERING OR DECIPHERING APPARATUS FOR CRYPTOGRAPHIC OR OTHER PURPOSES INVOLVING THE NEED FOR SECRECY
    • G09C1/00Apparatus or methods whereby a given sequence of signs, e.g. an intelligible text, is transformed into an unintelligible sequence of signs by transposing the signs or groups of signs or by replacing them by others according to a predetermined system
    • 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

Definitions

  • the present disclosure relates to an encryption device, a decryption device, a computer program, an encryption method, a decryption method, and a data structure.
  • Cryptographic algorithms mainly include block ciphers and stream ciphers.
  • Stream ciphers process the flow of data sequentially.
  • the block cipher processes the target data (target file, etc.) for each block separated by a specific block length. Since the block cipher encrypts the entire target data, if the size of the entire target data is not an integral multiple of the block length, it is necessary to fill the data by padding.
  • CBC CipherBlockChaining
  • CFB CipherFeedBack
  • OFB OutputFeedBack
  • an initialization vector required for encryption is generated on the encryption side by a combination of CFB mode and OFB mode that do not require padding processing and CBC mode, and the initialization vector required for decryption is decoded.
  • the encryption method and the decryption method generated on the side are disclosed.
  • This disclosure has been made in view of such circumstances, and can improve security by generating an encryption key and an initialization vector for each data to be encrypted.
  • the present application includes a plurality of means for solving the above problems.
  • the encryption device securely and automatically generates an encryption key and an initialization vector from the target data, and the plain text block of the target data. It is provided with an encryption unit that encrypts an integral multiple, leaves the unencrypted target data as plain text, and generates encrypted data of the same size as the target data.
  • an attacker in addition to improving the security of the data to be encrypted, an attacker (also referred to as a “cracker") searches for and locates the encryption key and initialization vector in the execution code of the application. You can prevent that.
  • FIG. 1 is a block diagram showing an example of the configuration of the encryption device 50 of the present embodiment.
  • the encryption device 50 includes a control unit 51 that controls the entire device, a data acquisition unit 52, an encryption key generation unit 53, an initialization vector generation unit 54, a storage unit 55, a data output unit 56, and an encryption start / end position calculation unit. 57 and an encryption unit 58 are provided.
  • the encryption device 50 uses shared key cryptography in which the sender (encryption side) and the receiver (decryption side) of a message share a key used for encryption and decryption.
  • AES Advanced Encryption Standard
  • AES Advanced Encryption Standard
  • the control unit 51 can be composed of a CPU, ROM, RAM, and the like.
  • the data acquisition unit 52 and the data output unit 56 are input devices (for example, keyboard, mouse, touch panel, recording medium reading device, communication circuit, API (Application Programming Interface), etc.) and output devices (for example) connected to the I / O interface.
  • input devices for example, keyboard, mouse, touch panel, recording medium reading device, communication circuit, API (Application Programming Interface), etc.
  • output devices for example
  • the storage unit 55 can be composed of an HDD or a semiconductor memory.
  • the encryption key generation unit 53, the initialization vector generation unit 54, the encryption start / end position calculation unit 57, and the encryption unit 58 shall be composed of an encryption library or program that can be incorporated into an application used by the user on a computer.
  • the present invention is not limited to this, and may be configured by hardware such as FPGA (Field-Programmable Gate Arrays) or ASIC (application specific integrated circuit).
  • the data acquisition unit 52 acquires the target data, which is the data to be encrypted.
  • the target data acquired by the data acquisition unit 52 can be stored in the storage unit 55.
  • the target data includes, for example, a file whose format is open to the public (for example, image data, compressed data, etc.), a communication protocol, and a unique file generated by a specific application (for example, a file such as Word, PowerPoint, Excel, etc.). ..
  • a file whose format is open to the public will be described as an example.
  • the encryption unit 58 can encrypt an integral multiple of the plaintext block of the target data acquired by the data acquisition unit 52, leave the unencrypted target data in plaintext, and generate encrypted data of the same size as the target data. it can.
  • the encryption unit 58 can encrypt not all of the target data but a part of the target data (composed of one or a plurality of plaintext blocks). In the present embodiment, the size of the target data and the size of the encrypted data are the same. The details of encryption will be described later.
  • the encryption key generation unit 53 can generate an encryption key using unencrypted data (data or part that is not the target of encryption) that is not encrypted by the encryption unit 58 among the target data.
  • the encryption key is a common key used for encryption and decryption. Details of encryption key generation will be described later.
  • the initialization vector generation unit 54 can generate an initialization vector to be used when encrypting the first plaintext block by using the unencrypted data that is not encrypted by the encryption unit 58 among the target data.
  • the unencrypted data used by the encryption key generation unit 53 can be different from the unencrypted data used by the initialization vector generation unit 54. The details of the initialization vector generation will be described later.
  • the encryption key generation unit 53 and the initialization vector generation unit 54 are also referred to as a variable generation unit, and the encryption key and the initialization vector are also referred to as variables.
  • the encryption start / end position calculation unit 57 can calculate the encryption start position based on the encryption start position parameter.
  • the encryption start position parameter can be specified by the user, and the value can be a numerical value or a% unit, but is not limited to this. That is, the encryption start position parameter can be a numerical value indicating the actual position or a% numerical value that can be calculated and obtained from the size of the target data. Further, the encryption start / end position calculation unit 57 can calculate the encryption end position based on the encryption end position parameter.
  • the encryption end position parameter can be specified by the user, and the value can be a numerical value or a% unit, but is not limited to this.
  • the encryption end position parameter can be a numerical value indicating the actual position or a% numerical value that can be obtained by calculating the actual position from the size of the target data.
  • the encryption start / end position calculation unit 57 can calculate at least one of the encryption start position and the encryption end position. Details of the encryption start position and the encryption end position will be described later.
  • the data output unit 56 can output the target data encrypted by the encryption unit 58, that is, the encrypted data to an external device or the like.
  • the encrypted data is transmitted to the decryption device via a communication network such as the Internet.
  • FIG. 2 is a block diagram showing an example of the configuration of the decoding device 70 of the present embodiment.
  • the decoding device 70 includes a control unit 71 that controls the entire device, a data acquisition unit 72, an encryption key generation unit 73, an initialization vector generation unit 74, a storage unit 75, a data output unit 76, and a decryption start / end position calculation unit 77. And a decoding unit 78.
  • the control unit 71 can be composed of a CPU, ROM, RAM, and the like.
  • the data acquisition unit 72 and the data output unit 76 are input devices (for example, keyboard, mouse, touch panel, recording medium reading device, communication circuit, etc.) and output devices (for example, display panel, recording medium, etc.) connected to the I / O interface. It can be composed of a reading device, a communication circuit, etc.).
  • the storage unit 75 can be composed of an HDD or a semiconductor memory.
  • the encryption key generation unit 73, the initialization vector generation unit 74, the decryption start / end position calculation unit 77, and the decryption unit 78 are encryption libraries and programs (referred to as subroutines or modules) that can be incorporated into an application used by the user on a computer.
  • the present invention is not limited to this, and may be configured by hardware such as FPGA (Field-Programmable Gate Arrays) or ASIC (application specific integrated circuit).
  • the data acquisition unit 72 can acquire the target data to be encrypted and the encrypted data.
  • the target data and the encrypted data acquired by the data acquisition unit 72 can be stored in the storage unit 75.
  • the target data is, for example, a file whose format is open to the public (for example, image data, compressed data, etc.), a communication protocol, and data of a unique file (for example, a file such as Word, PowerPoint, Excel, etc.) generated by a specific application.
  • the encrypted data is data in which the target data is encrypted, and includes unencrypted unencrypted data and an encrypted ciphertext block.
  • Encrypted data is, for example, a file whose format is open to the public (for example, image data, compressed data, etc.), a communication protocol, or a unique file generated by a specific application (for example, a file such as Word, PowerPoint, Excel, etc.). Part of the data is encrypted.
  • the decryption unit 78 decrypts an integral multiple of the encrypted text block of the encrypted data acquired by the data acquisition unit 72, leaves the unencrypted data in plain text, and generates target data having the same size as the encrypted data.
  • the decryption unit 78 can decrypt not all of the encrypted data but a part of the encrypted data (composed of one or a plurality of ciphertext blocks). The details of decryption will be described later.
  • the encryption key generation unit 73 can generate an encryption key using unencrypted data.
  • the encryption key is a common key used for encryption and decryption.
  • the unencrypted data is the data of the portion of the target data before encryption that is not the target of encryption by the encryption device 50 (encryption unit 58).
  • the initialization vector generation unit 74 can generate an initialization vector to be used when decrypting the first ciphertext block by using the unencrypted data.
  • the unencrypted data is the data of the portion of the target data before encryption that is not the target of encryption by the encryption device 50 (encryption unit 58).
  • the encryption key generation unit 73 and the initialization vector generation unit 74 are also referred to as a variable generation unit, and the encryption key and the initialization vector are also referred to as variables.
  • the decoding start / end position calculation unit 77 can calculate the decoding start position based on the decoding start position parameter.
  • the decryption start position parameter is the same as the encryption start position parameter.
  • the decoding start position parameter can be specified by the user, and the value can be a numerical value or a% unit, but is not limited thereto. Further, the decoding start / end position calculation unit 77 can calculate the decoding end position based on the decoding end position parameter.
  • the decryption end position parameter is the same as the encryption end position parameter.
  • the decoding end position parameter can be specified by the user, and the value can be a numerical value or a% unit, but is not limited to this.
  • the decoding start / end position calculation unit 77 can calculate at least one of the decoding start position and the decoding end position. Details of the decoding start position and the decoding end position will be described later.
  • the data output unit 76 can output the target data decoded by the decoding unit 78 to an external device or the like.
  • the decoded target data can be transmitted to a display device and displayed.
  • FIG. 3 is a schematic diagram showing an example of the relationship between the plaintext and the ciphertext by the encryption and decryption of the present embodiment.
  • the encryption unit 58 of the present embodiment encrypts not all of the target data but a part of the target data (composed of one or a plurality of plaintext blocks).
  • the size of the target data is represented by (number of blocks x block length + size of 0 or more and block length or less).
  • the block length is also called the block size.
  • the decryption unit 78 decrypts not all of the encrypted data but a part of the encrypted data (composed of one or a plurality of ciphertext blocks).
  • FIG. 3 illustrates four cases A, B, C and D.
  • case A of the unencrypted target data (the whole is plain text), the portion of the required length from the beginning of the data is not encrypted and remains in plain text. Except for plaintext, the rest of the data up to the end is encrypted ciphertext.
  • case B the portion of the target data having the required length from the beginning of the data and the portion having the required length from the end of the data are not encrypted and remain in plain text. The rest of the text other than plaintext is encrypted ciphertext.
  • case C the portion of the target data from the end of the data to the required length is not encrypted and remains in plain text. Except for plaintext, all the rest up to the beginning of the data is encrypted ciphertext.
  • Case C is a reverse order of Case A and can be regarded as the same.
  • Case D the portion of the target data having the required length from the beginning of the data and the portion having the required length from the end of the data are encrypted ciphertexts. The rest of the text, except the ciphertext, is in plain text.
  • the ciphertexts are a continuous block, but a plurality of ciphertexts may be discretely present with a plaintext in between.
  • FIG. 4 is a schematic diagram showing an example of the configuration of the encryption unit 58.
  • the encryption unit 58 uses a block cipher algorithm and can encrypt using only one mode such as a CBC (Cipher Block Chaining) mode.
  • the CBC mode has a drawback that the file size is often larger than the original file size.
  • the block cipher mode includes an ECB (Electronic Code Book) mode, a CFB (Cipher Feedback) mode, an OFB (Output Feedback) mode, and a CTR (CounTeR) mode.
  • ECB mode and CFB mode have the disadvantage of being vulnerable to regenerative attacks. In the CFB mode and the OFB mode, padding is not required and there is no drawback that the file size becomes large.
  • any mode may be used, but preferably the CBC mode can be used.
  • the CBC mode improves security against replay attacks in which an attacker obtains both plaintext and ciphertext and repeatedly sends the same ciphertext. Since it is not necessary to combine a plurality of modes, the algorithm becomes simpler, the program size becomes smaller, the CPU power and the memory capacity can be reduced, and the processing labor is reduced as compared with the case of using a plurality of modes. Further, the CBC mode requires padding, but according to the present embodiment, padding is not required as described later. Further, it is not necessary to use the ECB mode and the CFB mode, which are introduced to eliminate the need for padding described in Patent Document 1, and which can perform a regeneration attack.
  • the portion to be encrypted (a part of the target data) of the target data is defined as plaintext blocks B1, B2, ..., Bn.
  • the previous ciphertext block is used to encrypt the next plaintext block.
  • the encryption unit 58 performs an XOR operation on the plaintext block and the previous ciphertext block, and encrypts the XOR operation result with the encryption key.
  • the initialization vector is used.
  • the plaintext block B1 and the initialization vector are XOR-operated, and the XOR operation result is encrypted with the encryption key to generate the ciphertext block E1.
  • the plaintext block B2 and the encryption block E1 are XOR-operated, and the XOR operation result is encrypted with the encryption key to generate the ciphertext block E2.
  • the plaintext block Bn and the encryption block E (n-1) are XOR-operated, and the XOR operation result is encrypted with the encryption key to generate the ciphertext block En.
  • Ciphertext blocks E1, E2, ..., En are generated by encryption, and even if the contents of the plaintext blocks are the same, the ciphertext blocks E1, E2, ..., En have different values due to a chain of randomness. Improves security against replay attacks.
  • the size (block length) of the plaintext block and the ciphertext block can be 16 bytes, 32 bytes, or the like, but in this specification, it is described as 16 bytes.
  • the block length is not limited to 16 bytes or 32 bytes, and may be another number of bytes (block size).
  • the non-encrypted data that is not the target of encryption is stored at the same position of the encrypted data.
  • FIG. 5 is a schematic diagram showing an example of the configuration of the decoding unit 78.
  • the decryption unit 78 uses a block cipher algorithm, and can decrypt using only one mode such as a CBC (Cipher Block Chaining) mode.
  • CBC Cipher Block Chaining
  • the CBC mode improves security against replay attacks in which an attacker obtains both plaintext and ciphertext and repeatedly sends the same ciphertext. Since it is not necessary to combine a plurality of modes, the algorithm becomes simpler, the program size becomes smaller, the CPU power and the memory capacity can be reduced, and the processing labor is reduced as compared with the case of using a plurality of modes.
  • the part to be decrypted (a part of the encrypted data) is the ciphertext blocks E1, E2, ..., En.
  • the previous ciphertext block is used to decrypt the next ciphertext block.
  • the decryption unit 78 decrypts the ciphertext block with the encryption key, performs an XOR operation on the decrypted result and the previous ciphertext block, and generates a plaintext block.
  • the initialization vector is used.
  • the plaintext block B1 can be generated by decrypting the ciphertext block E1 with the encryption key and XORing the decryption result and the initialization vector.
  • the plaintext block B2 can be generated by decrypting the ciphertext block E2 with the encryption key and performing an XOR operation on the decryption result and the ciphertext block E1.
  • the plaintext block Bn can be generated by decrypting the ciphertext block En with the encryption key and XORing the decryption result and the ciphertext block E (n-1).
  • the variable generator generates a secret variable for ciphertext generation required for encryption by the block cipher algorithm based on all or part of the information of the unencrypted data.
  • the variables are, for example, an encryption key and an initialization vector. A position parameter may be added when the variable is generated. In this way, since the mechanism generates variables at runtime, important variables can be kept secret in encryption and decryption. In other words, there is no need to secretly manage and share the encryption key and initialization vector, which are examples of variables, between the encryption side and the decryption side.
  • FIG. 6 is a schematic diagram showing a first example of the configuration of the encryption key generation unit 53 and the initialization vector generation unit 54.
  • the conventional common key cryptosystem it is necessary to share the encryption key and the initialization vector between the encryption side and the decryption side and manage them secretly.
  • the same parameters may be used on the encryption side and the decryption side. Even if the parameter is obtained by the attacker, the attacker cannot obtain the encryption key and the initialization vector because the parameter is not the encryption key itself or the initialization vector itself.
  • the user can specify the character string P1, the numerical value P2 for the encryption key, and the numerical value P3 for the initialization vector as parameters.
  • the in-function setting character strings (parameters) of the encryption library can be set in advance.
  • the in-function setting character string (parameter) is a parameter used for each user.
  • an identifier (parameter) uniquely assigned to a specific group including a user, a department to which the user belongs, or a company may be set in advance.
  • the identifier (parameter) is an identifier embedded in the cryptographic library provided for each user.
  • the identifier is not essential, by using the identifier, for example, if the company to which the user belongs is different, different encryption keys and initialization vectors can be generated even if the header part is the same, so that the encryption library is different. Even if it is provided to a company, it is possible to prevent the same encryption key and initialization vector from being generated.
  • Hash operation is performed by a hash function that returns the hash value as a result of performing a one-way operation (or one-way function) based on a certain value when it is received. If the received value is different, the hash value will be different, but the original value cannot be known from the hash value.
  • SHA-256 outputs a 32-byte hash value
  • the hash function is not limited to this.
  • Hash values may be used.
  • the hash function may be input only with the character string P1, but at least one or both of the in-function setting character string and the identifier may be input.
  • the hash value obtained by repeating the required number of times and the hash operation in this way is stored in the first half of the buffer having a length of 64 bytes.
  • the hash value stored in the first half is input to the hash function, and the hash value obtained by the hash operation is input to the hash function again.
  • the hash value obtained by repeating the required number of times and the hash operation in this way is stored in the latter half of the buffer having a length of 64 bytes.
  • the 32-byte binary value is extracted from the position specified by the integer value x (0 ⁇ x ⁇ 31) specified by the encryption key numerical value P2, and the encryption key Key0. Can be. Further, from the 64-byte length binary values stored in the buffer, a 32-byte binary value is extracted from the position specified by the integer value y (0 ⁇ y ⁇ 31) specified by the initialization vector numerical value P3.
  • the initialization vector IV0 can be set.
  • the method of generating the encryption key and the initialization vector is not limited to the example of FIG. 6, and other calculation methods may be used. According to this embodiment, there are many variations in the method of generating the encryption key and the initialization vector.
  • the confidentiality of the encryption key and the initialization vector can be increased, and the possibility that an attacker can illegally obtain the encryption key and the initialization vector can be extremely reduced.
  • an attacker also called a "cracker"
  • the variables generated during the execution process of the application are difficult to decipher depending on the form. (The reason is that it cannot be deciphered by static analysis. If you try to decipher it, an attacker who requires advanced technology has no choice but to perform dynamic analysis.)
  • the variable values are likely to be different.
  • the user can be involved in the generation of the encryption key and the initialization vector, but cannot be directly involved, which also contributes to the improvement of security.
  • the configuration shown in FIG. 6 can also be used to generate an encryption key and an initialization vector when decrypting encrypted data.
  • FIG. 7 is a schematic diagram showing a second example of the configuration of the encryption key generation unit 53 and the initialization vector generation unit 54.
  • the encryption key generation unit 53 generates an encryption key using unencrypted data that is not encrypted by the encryption unit 58 among the target data.
  • the initialization vector generation unit 54 generates an initialization vector using the unencrypted data that is not encrypted by the encryption unit 58 among the target data.
  • the unencrypted data is plain text S1
  • the target data is, for example, a file whose format is open to the public, all or part of the header, the header and the footer are used as the unencrypted data. Can be used in combination.
  • a predetermined operation or function can be used for encryption key generation and initialization vector generation, and the same operation or function as in the case of encryption may be used for decryption.
  • a hash operation and an XOR operation are used.
  • SHA-256 can be used as the hash function, but the hash operation is not limited to this.
  • the binary value of the plaintext S1 can be input to the hash function, the obtained hash value and the initialization vector IV0 can be XORed, and the binary value obtained as a result of the XOR operation can be used as the initialization vector IV1.
  • the binary value of the plaintext S1 can be input to the hash function, the obtained hash value and the encryption key Key0 can be XOR-operated, and the binary value obtained as a result of the XOR operation can be used as the encryption key Key1.
  • other different binary values may be used instead of the initialization vector IV0 and the encryption key Key0.
  • the hash operation may be repeated a plurality of times.
  • An attacker cannot generate a cryptographic key without knowing the unencrypted data itself used for cryptographic key generation and algorithms such as predetermined operations and functions for cryptographic key generation. Is extremely unlikely to be exposed. Further, if the unencrypted data is different for each target data, the results of the hash calculation and the XOR calculation are different, so that a different encryption key can be generated for each target data, and the security for the target data is improved.
  • an attacker cannot generate an initialization vector without knowing the unencrypted data itself used to generate the initialization vector, and algorithms such as certain operations and functions for generating the initialization vector. In fact, it is extremely unlikely that the initialization vector will be exposed. Further, if the unencrypted data is different for each target data, the results of the hash operation and the XOR operation are different, so that a different initialization vector can be generated for each target data, and the security for the target data is improved.
  • the attacker can determine the predetermined. Without knowing the parameters or predetermined identification information of, it becomes more difficult to generate the encryption key and the initialization vector, and the possibility that the encryption key and the initialization vector are exposed is further reduced.
  • the configuration of the encryption key generation unit 73 and the initialization vector generation unit 74 of the decryption device 70 can be the same as that of FIG. 7.
  • the encryption key generation unit 73 can generate an encryption key using unencrypted data that is not encrypted by the encryption unit 58 among the encrypted data.
  • the initialization vector generation unit 74 generates an initialization vector using the unencrypted data that is not encrypted by the encryption unit 58 among the encrypted data.
  • the plaintext S1 of the encrypted data is the same as the plaintext S1 of the target data.
  • the encryption key and the initialization vector can be generated by performing a relatively simple operation.
  • FIG. 8 is a schematic diagram showing an example of an encryption function for realizing the function of the encryption unit 58 in the encryption library.
  • the encryption function CRcrypt_Encryptrypt is defined in the cryptographic library and can be called from the application when the application encrypts the target data.
  • the encryption function shown in FIG. 8 is shown for convenience, and may differ from the description when actually calling it on the program.
  • the encryption function CRcript_Encrypt has, for example, four arguments (arguments 1, 2, 3, 4).
  • Argument 1 points to the area (address) where the target data is stored.
  • Argument 2 indicates the size of the target data (unit is bytes).
  • Argument 3 indicates an encryption start position parameter, and argument 4 indicates an encryption end position parameter.
  • the encryption start position parameter and the encryption end position parameter can be specified by the user, and the value can be a numerical value or a% unit, but is not limited to this. Further, the encryption start position parameter is a value smaller than the encryption end position parameter.
  • the encryption start / end position calculation unit 57 can calculate the encryption start position by multiplying the size of the target data by the encryption start position parameter. Further, the encryption start / end position calculation unit 57 can calculate the encryption end position by multiplying the size of the target data by the encryption end position parameter.
  • the encryption start position is the 66th byte. Assuming that the encryption end position parameter (argument 4) is 90 (%), the encryption end position is the 346th byte (encrypts up to the 346th byte). If the size of the target data is different, for example, if the size of the target data (argument 2) is 768 bytes and the encryption start position parameter (argument 3) is 17 (%), the encryption start position is the 131st byte. It becomes.
  • the encryption end position parameter is 90 (%)
  • the encryption end position is the 692nd byte (encrypts up to the 692th byte).
  • the encryption start position differs depending on the size of the target data. Therefore, even if an attacker illegally obtains the encryption start position parameter, the encryption start position Cannot be known exactly.
  • the encryption end position differs depending on the size of the target data. Therefore, even if an attacker illegally obtains the encryption end position parameter, the encryption end position can be set. You can't know exactly. That is, even if an attacker illegally obtains the encryption start position and the encryption end position parameters, the encryption start position and the encryption end position cannot be accurately known.
  • the encryption unit 58 encrypts the plaintext block from the encryption start position calculated by the encryption start / end position calculation unit 57. Since the possibility that the encryption start position is exposed is extremely low, the security for the target data is improved.
  • the encryption unit 58 ends the encryption of the plaintext block at the encryption end position calculated by the encryption start / end position calculation unit 57. Since the possibility that the encryption end position is exposed is extremely low, the security for the target data is improved.
  • the values of the encryption key and the initialization vector are set as the argument of the function.
  • An attacker could extract the values of the set encryption key and initialization vector from memory.
  • the user cannot explicitly specify the encryption key and the initialization vector in the encryption unit 58 (encryption function).
  • the encryption start position parameter and the encryption end position parameter are specified instead of the values of the encryption key and the initialization vector.
  • the attacker finds the value of the argument of the encryption function, it is a parameter that has nothing to do with the value of the encryption key and the initialization vector, so that the attacker has to find out the encryption key and the initialization vector. Can be made to.
  • the decryption start / end position calculation unit 77 can calculate the decryption start position by multiplying the size of the encrypted data by the decryption start position parameter.
  • the size of the target data and the size of the encrypted data do not change. For example, if the decryption start position parameter is 17 (%) and the size of the encrypted data is 384 bytes, the decryption start position is the 66th byte. Further, assuming that the size of the encrypted data is 768 bytes, the decryption start position is the 131st byte.
  • the decryption start position differs depending on the size of the encrypted data. Therefore, even if an attacker illegally obtains the decryption start position parameter, the decryption start position can be accurately obtained. I can't know.
  • the decryption start / end position calculation unit 77 can calculate the decryption end position by multiplying the size of the encrypted data by the decryption end position parameter. For example, if the decryption end position parameter is 90 (%) and the size of the encrypted data is 384 bytes, the decryption end position is the 346th byte (decrypts up to the 346th byte). Further, assuming that the size of the encrypted data is 768 bytes, the decryption end position is the 692nd byte. In this way, even if the same decryption end position parameter is specified, the decryption end position differs depending on the size of the encrypted data. Therefore, even if an attacker illegally obtains the decryption end position parameter, the decryption end position can be accurately obtained. I can't know.
  • the decryption unit 78 decrypts the ciphertext block from the decryption start position calculated by the decryption start / end position calculation unit 77. Since the possibility that the decryption start position is exposed is extremely low, the security when decrypting the ciphertext is improved.
  • the decryption unit 78 ends the decryption of the ciphertext block at the decryption end position calculated by the decryption start / end position calculation unit 77. Since the possibility that the decryption end position is exposed is extremely low, the security when decrypting the ciphertext is improved.
  • FIG. 9 is a schematic diagram showing an example of encryption when the size of the encryption target is equal to an integral multiple of the block length.
  • the block length is, for example, 16 bytes.
  • the encryption target is plaintext from the encryption start position to the encryption end position.
  • N ciphertext blocks can be generated from N plaintext blocks.
  • FIG. 10 is a schematic diagram showing an example of encryption when the size of the encryption target is not equal to an integral multiple of the block length. If the size of the encryption target is not equal to an integral multiple of 16 bytes (for example, N times), the size of the last plaintext block of the plaintext blocks to be encrypted will be less than 16 bytes and will be 16 bytes. Needs padding. However, in the present embodiment, in the encryption start / end position calculation unit 57, the difference (size difference) between the encryption start position and the encryption end position is an integral multiple of 16 bytes (for example, N times). Adjust the encryption start position so that the size of the encryption target becomes smaller.
  • the encryption unit 58 encrypts the plaintext block by adjusting the encryption start position or the encryption end position so that the data size is an integral multiple of the block length. can do.
  • the plain text block can be encrypted by adjusting the encryption start position or encryption end position so that the data size is an integral multiple of the block length. ..
  • the padding process is unnecessary, and the padding process is unnecessary even if the CFB mode or the OFB mode is not used.
  • the padding process can be eliminated even if the CBC mode, which requires the padding process, is used.
  • the size of the target data (target file) does not change before and after the encryption. That is, since the data size (file size) does not increase due to encryption, it is possible to suppress an increase in the communication amount and communication time at the time of data (file) transfer.
  • the size of the encrypted data is the same as the size of the target data. This is preferable because the amount of data after encryption does not increase.
  • the size of the encrypted data is not limited to the same as the size of the target data. This is because it is effective to increase the size of the target data with the intention of misleading the attacker by making the size of the target data larger than the size of the encrypted data.
  • a specific embodiment is to insert data of a predetermined size binary and an indefinite binary value between each encrypted block. This form allows an attacker to interpret even meaningless binary values at the time of decryption.
  • the result of XORing a predetermined binary data with respect to the data string of 1 to 15 bytes is obtained. It may be adopted. Even in such a form, not only the padding process is unnecessary, but also the effect of making it difficult for the attacker to determine the encryption start position or the encryption end position can be obtained.
  • the predetermined binary data is XORed in the excess part after adjusting the encryption start position or the encryption end position, but the target of XOR may be all or a part of the target data.
  • FIG. 11 is a schematic diagram showing an example when the encryption process of this embodiment is applied to an image file. Multiple people appear in the unencrypted image file.
  • the encrypted image file is encrypted so that no person can be identified.
  • the entire target file is not encrypted, only the information to be hidden can be encrypted without destroying the publicly available format information.
  • the target file can be encrypted without breaking the header part.
  • the target file when the target file is an image file, the image can be viewed using a tool such as a viewer.
  • the encrypted file it is possible to display the encrypted file with the viewer. If the entire image file is encrypted as in the past, the header information will also be corrupted, so the encrypted image cannot be viewed. Also, since the image is encrypted by the size specified for encryption, the original image is not displayed, and an image like a sandstorm is displayed only for the part specified for encryption. This makes it possible to provide a more resistant encryption method against cracking while achieving the purpose of encrypting and protecting the image file. Further, if the purpose of eliminating the value as an image file can be achieved, the value of the original image is lost if an image such as a sandstorm is displayed on a part of the image without the need to encrypt the entire image part. As a result, the time required for encryption can be shortened.
  • FIG. 12 is a schematic diagram showing an example of an application module incorporating a cryptographic library.
  • the encryption library includes the functions of the encryption key generation unit 53, the initialization vector generation unit 54, the encryption start / end position calculation unit 57, and the encryption unit 58, the encryption key generation unit 73, the initialization vector generation unit 74, and the decryption. It includes the functions of the start / end position calculation unit 77 and the decoding unit 78.
  • the application includes, for example, four modules. Modules 1, 2, 3 and 4 can be, for example, an initialization module, a drawing preprocessing module, an encryption processing module (main module), and an error processing module, but are not limited thereto.
  • a predetermined process is repeated, and when the process is completed, the application is terminated.
  • Module 1 specifies the character string parameter P1 and the encryption key numerical value P2 illustrated in FIG. Further, the module 2 specifies the numerical value P3 for the initialization vector.
  • the specification of the character string parameter P1, the numerical value P2 for the encryption key, and the numerical value P3 for the initialization vector is not performed by the encryption processing module that reads the function that performs encryption and decryption, but is a module different from the encryption processing module. (Module executed before the cryptographic processing module). In this way, the parameters required for encryption and decryption are not specified in the encryption processing module (or in the neighborhood where the function is read), so even if an attacker analyzes the application, it will be required for encryption and decryption. It becomes difficult to find the parameters.
  • FIG. 13 is a block diagram showing an example of another configuration of the encryption device 50 and the decryption device 70 of the present embodiment.
  • Each of the encryption device 50 and the decryption device 70 can be realized by the computer 100.
  • the computer 100 includes a CPU 101, a volatile memory 102, a communication unit 103, an operation unit 104, a non-volatile memory 105, a recording medium reading unit 106, and a display unit 107.
  • the CPU 101 can be configured by, for example, a processor or a multiprocessor equipped with a plurality of processor cores.
  • the CPU 101 may be a parallel processor, or may be configured by combining hardware such as a DSP (Digital Signal Processors) and an FPGA (Field-Programmable Gate Arrays).
  • DSP Digital Signal Processors
  • FPGA Field-Programmable Gate Arrays
  • the encryption device 50 of the present embodiment includes a CPU 101 (processor), and the CPU 101 includes an encryption key generation unit 53, an initialization vector generation unit 54, an encryption start / end position calculation unit 57, and an encryption unit 58. You can execute the processing to be performed.
  • the encryption device of the present embodiment includes a processor, which encrypts a plaintext block that is a part of target data.
  • the decryption device 70 of the present embodiment includes a CPU 101 (processor), and the CPU 101 performs processing performed by the encryption key generation unit 73, the initialization vector generation unit 74, the decryption start / end position calculation unit 77, and the decryption unit 78. Can be executed.
  • the decryption device of the present embodiment is a decryption device that decrypts encrypted data, includes a processor, and the encrypted data includes unencrypted unencrypted data and an encrypted text block. The processor decrypts the cipher block.
  • the volatile memory 102 can be composed of a RAM (RandomAccessMemory), a DRAM, a SRAM, or the like.
  • the non-volatile memory 105 can be configured by a magnetic storage device such as a ROM, a flash memory, or an HDD.
  • the communication unit 103 is provided with a communication circuit, a communication port, and the like, and can send and receive data and information to and from the server 200 via the communication network 1.
  • the operation unit 104 is provided with a keyboard, mouse, touch pad, etc., and can operate the icons displayed on the display unit 107, input characters, and the like.
  • the display unit 107 can be composed of a liquid crystal panel, an organic EL (Electro Luminescence) display, or the like.
  • the recording medium reading unit 106 reads information (computer program, data, etc.) recorded on a recording medium such as a DVD, and stores the read information in the non-volatile memory 105.
  • the information read by the recording medium reading unit 106 may be stored in the HDD.
  • the recording medium M1 records, for example, an encryption program and a decryption program.
  • the encryption program can cause the computer to execute the processes performed by each of the encryption key generation unit 53, the initialization vector generation unit 54, the encryption start / end position calculation unit 57, and the encryption unit 58.
  • the encryption program can cause a computer to perform a process as shown in FIG. 14 described later.
  • the decryption program can cause the computer to execute the processes performed by each of the encryption key generation unit 73, the initialization vector generation unit 74, the decryption start / end position calculation unit 77, and the decryption unit 78.
  • the decoding program can cause a computer to perform a process as shown in FIG. 15 described later.
  • the recording medium M2 records the encrypted data.
  • Encrypted data includes unencrypted unencrypted data and encrypted ciphertext blocks.
  • the computer 100 is generated by performing a process of generating a secret variable for plaintext generation required for decryption by the block cipher algorithm based on all or part of the information of the unencrypted data.
  • a variable can be used to decrypt a ciphertext block.
  • the encryption data decryption process decrypts not all of the encrypted data but a part of the encrypted data (consisting of one or more ciphertext blocks). Even if the attacker can obtain the ciphertext (encrypted data), since the entire encrypted data is not encrypted, the attacker must obtain the encryption processing start position of the encrypted data. That is, the attacker cannot decrypt the ciphertext without knowing which part of the encrypted data is encrypted. This makes it possible to improve the security when decrypting the ciphertext.
  • the computer 100 acquires an encryption program and a decryption program similar to the encryption program and the decryption program recorded on the recording medium M1 from the server 200 via the communication unit 103 (for example,). Can be downloaded).
  • FIG. 14 is a flowchart showing an example of the encryption processing procedure by the encryption device 50.
  • the control unit 51 acquires the target data (target file) (S11), and acquires each parameter of the character string P1, the numerical value P2 for the encryption key, and the numerical value P3 for the initialization vector (S12).
  • the control unit 51 acquires a character string (unencrypted data) at the beginning of the target data (S13).
  • the control unit 51 acquires the encryption start position parameter and the encryption end position parameter (S14).
  • the control unit 51 generates an encryption key (common key) based on the character string P1, the numerical value P2 for the encryption key, and the character string at the beginning (S15).
  • the control unit 51 generates an initialization vector based on the character string P1, the numerical value P3 for the initialization vector, and the character string at the beginning (S16).
  • the character string at the beginning of the target data can be used, but when different encryption keys and initialization vectors are not generated for each target data, , It is not necessary to use the character string at the beginning of the target data.
  • the control unit 51 calculates the encryption start position and the encryption end position of the target data based on the encryption start position parameter and the encryption end position parameter (S17), and encrypts the portion (encrypts from the encryption start position). It is determined whether or not the data size up to the end of encryption) is an integral multiple of 16 bytes (S18).
  • the control unit 51 adjusts the encryption start position so that the portion to be encrypted is an integral multiple of 16 bytes (S19), which will be described later.
  • the process of step S20 is performed.
  • the encryption end position may be adjusted according to each case shown in FIG.
  • the control unit 51 encrypts the plaintext block to be encrypted to generate a ciphertext block (S20), and outputs the encrypted data. (S21), the process is terminated.
  • FIG. 15 is a flowchart showing an example of a composite processing procedure by the decoding device 70.
  • the control unit 71 acquires the encrypted data (S31), and acquires each parameter of the character string P1, the numerical value P2 for the encryption key, and the numerical value P3 for the initialization vector (S32).
  • the control unit 71 acquires a character string (unencrypted data) at the beginning of the encrypted data (S33).
  • the control unit 71 acquires the decoding start position parameter and the decoding end position parameter (S34).
  • the control unit 71 generates an encryption key (common key) based on the character string P1, the numerical value P2 for the encryption key, and the character string at the beginning (S35).
  • the control unit 71 generates an initialization vector based on the character string P1, the numerical value P3 for the initialization vector, and the character string at the beginning (S36).
  • the control unit 71 calculates the decryption start position and the decryption end position of the encrypted data based on the decryption start position parameter and the decryption end position parameter (S37).
  • the control unit 71 decrypts the ciphertext block (S38), outputs the target data (target file) obtained by the decryption (S39), and ends the process.
  • the encryption device of the present embodiment is an encryption device that encrypts the target data by block encryption, encrypts an integral multiple of the plain text block of the target data, and leaves the unencrypted target data as plain text.
  • the encryption device of the present embodiment is an encryption device that encrypts the target data by block encryption, and includes a processor, which encrypts an integral multiple of a plain text block of the target data and does not encrypt the target data.
  • the target data is left as plain text, and based on all or part of the information of unencrypted unencrypted data, the variables to be kept secret for cryptographic text generation required by the block encryption algorithm during encryption are set. Generate.
  • the computer program of the present embodiment has a process of acquiring the target data, a process of encrypting an integral multiple of the plain text block of the acquired target data, and a process of leaving the unencrypted target data in plain text, and no encryption.
  • the block encryption algorithm executes a process of generating a secret variable for generating a cipher required for encryption.
  • the encryption method of the present embodiment is an encryption method that encrypts the target data by block encryption, encrypts an integral multiple of the plain text block of the target data, and leaves the unencrypted target data as plain text. Based on all or part of the information of unencrypted unencrypted data, the block encryption algorithm generates a secret variable for cryptographic text generation required for encryption.
  • the recording medium of the present embodiment is a non-temporary recording medium that can be read by a computer that records a computer program, and the computer program performs a process of acquiring target data on the computer and an acquired target.
  • the block encryption algorithm encrypts the data by encrypting an integral multiple of the plain text block of the data and leaving the unencrypted target data in plain text, and based on all or part of the information of the unencrypted unencrypted data.
  • the process of generating a secret variable for generating the cipher text required at that time is executed.
  • the encryption unit encrypts an integral multiple of the plaintext block of the target data and leaves the unencrypted target data in plaintext.
  • the target data is data to be encrypted, and includes, for example, a file and a communication protocol.
  • the encryption unit uses a block cipher algorithm and can encrypt using only one mode such as a CBC (Cipher Block Chaining) mode.
  • CBC Cipher Block Chaining
  • the CBC mode improves security against replay attacks in which an attacker obtains both plaintext and ciphertext and repeatedly sends the same ciphertext. Since it is not necessary to combine a plurality of modes, the algorithm becomes simpler, the program size becomes smaller, the CPU power and the memory capacity can be reduced, and the processing labor is reduced as compared with the case of using a plurality of modes. Since the plaintext block that is not encrypted is encrypted (that is, the entire target data is not encrypted), an integral multiple of the plaintext block is encrypted, so that padding at the time of encryption is unnecessary.
  • the encryption unit encrypts not all of the target data but a part of the target data (composed of one or more plaintext blocks). Even if the attacker can obtain the ciphertext (encrypted target data), the attacker must obtain the encryption processing start position of the target data because the entire target data is not encrypted. That is, the attacker cannot decrypt the ciphertext without knowing which part of the target data is encrypted. This makes it possible to improve the security of the data to be encrypted.
  • the variable generator generates a secret variable for ciphertext generation required for encryption by the block cipher algorithm based on all or part of the information of the unencrypted data.
  • the variables are, for example, an encryption key and an initialization vector.
  • the unencrypted data is in plain text, and when the target data is, for example, a file whose format is open to the public, all or part of the header or the footer can be used as the unencrypted data.
  • An attacker cannot generate a variable without knowing the unencrypted data itself used for variable generation, and algorithms such as predetermined operations and functions for variable generation, effectively exposing the variable. Very unlikely.
  • the encryption device of the present embodiment includes an encryption start position calculation unit that calculates an encryption start position based on an encryption start position parameter, and the encryption unit is calculated by the encryption start position calculation unit.
  • the plaintext block is encrypted from the encryption start position.
  • the encryption start position calculation unit calculates the encryption start position based on the encryption start position parameter.
  • the encryption start position parameter can be specified by the user, the value can be a numerical value, and the unit can be%, but the value is not limited to this.
  • the encryption start position calculation unit can calculate the encryption start position by multiplying the size of the target data by the encryption start position parameter. For example, if the encryption start position parameter is 17 (%) and the size of the target data is 384 bytes, the encryption start position is the 66th byte. Further, assuming that the size of the target data is 768 bytes, the encryption start position is the 131st byte. In this way, even if the same encryption start position parameter is specified, the encryption start position differs depending on the size of the target data. Therefore, even if an attacker illegally obtains the encryption start position parameter, the encryption start position Cannot be known exactly.
  • the encryption unit encrypts the plaintext block from the encryption start position calculated by the encryption start position calculation unit. Since the possibility that the encryption start position is exposed is extremely low, the security for the target data is improved.
  • the encryption device of the present embodiment includes an encryption end position calculation unit that calculates an encryption end position based on an encryption end position parameter, and the encryption unit is calculated by the encryption end position calculation unit. The encryption of the plaintext block is terminated at the encryption end position.
  • the encryption end position calculation unit calculates the encryption end position based on the encryption end position parameter.
  • the encryption end position parameter can be specified by the user, the value can be a numerical value, and the unit can be%, but the value is not limited to this.
  • the encryption end position calculation unit can calculate the encryption end position by multiplying the size of the target data by the encryption end position parameter. For example, if the encryption end position parameter is 90 (%) and the size of the target data is 384 bytes, the encryption end position is the 346th byte (encrypts up to the 346th byte). Further, assuming that the size of the target data is 768 bytes, the encryption end position is the 692nd byte. In this way, even if the same encryption end position parameter is specified, the encryption end position differs depending on the size of the target data. Therefore, even if an attacker illegally obtains the encryption end position parameter, the encryption end position Cannot be known exactly.
  • the encryption unit ends the encryption of the plaintext block at the encryption end position calculated by the encryption end position calculation unit. Since the possibility that the encryption end position is exposed is extremely low, the security for the target data is improved.
  • the encryption unit when the data size to be encrypted is not an integral multiple of the block length, sets the encryption start position or the encryption end so that the data size is an integral multiple of the block length. The position is adjusted to encrypt the plaintext block.
  • the data size from the encryption start position to the end of the target data when encrypting to the end
  • the data size from the encryption start position to the encryption end position the beginning of the target data (when encrypting from the beginning)
  • the data size from to the encryption end position is not an integral multiple of the block length
  • adjust the encryption start position or encryption end position so that the data size is an integral multiple of the block length to encrypt the plain text block. ..
  • the size of the target data (target file) does not change before and after the encryption. That is, since the data size (file size) does not increase due to encryption, it is possible to suppress an increase in the communication amount and communication time at the time of data (file) transfer.
  • the size of the encrypted data as a result of being encrypted by the encryption unit is the same as the size of the original target data.
  • the size of the encrypted data as a result of encryption by the encryption unit is the same as the size of the original target data. Since the data size (file size) does not increase due to encryption, it is possible to suppress an increase in the communication amount and communication time when transferring data (file).
  • the unencrypted data is continuous data or discrete data in the target data.
  • the unencrypted data may be continuous data.
  • the header portion can be used as the unencrypted data.
  • the unencrypted data may be discrete data.
  • the unencrypted data may be a portion separated by a plurality of data portions, such as a header portion and a footer portion.
  • the encryption device of the present embodiment includes an encryption key generation unit that generates an encryption key as the variable, and the encryption unit encrypts the plaintext block using the encryption key generated by the encryption key generation unit. To do.
  • the encryption key generation unit generates an encryption key as a variable using unencrypted data that is not encrypted by the encryption unit among the target data.
  • the encryption key is a common key used for encryption and decryption.
  • the unencrypted data is in plain text, and when the target data is, for example, a file whose format is open to the public, all or part of the header or the footer can be used as the unencrypted data.
  • a predetermined operation or function can be used for the encryption key generation, and the same operation or function as in the case of encryption may be used for decryption.
  • An attacker cannot generate a cryptographic key without knowing the unencrypted data itself used for cryptographic key generation and algorithms such as predetermined operations and functions for cryptographic key generation. Is extremely unlikely to be exposed. Further, if the unencrypted data is different for each target data, a different encryption key can be generated for each target data, and the security for the target data is improved.
  • the encryption unit encrypts the plaintext block using the encryption key generated by the encryption key generation unit.
  • the portion to be encrypted (a part of the target data) is defined as plaintext blocks B1, B2, ..., Bn.
  • the block cipher mode is the CBC mode
  • the previous ciphertext block is used to encrypt the next plaintext block.
  • the plaintext block and the previous ciphertext block are XOR-operated, and the XOR-calculated result is encrypted with the encryption key.
  • the initialization vector is used.
  • Ciphertext blocks E1, E2, ..., En are generated by encryption, and even if the contents of the plaintext blocks are the same, the ciphertext blocks E1, E2, ..., En have different values due to a chain of randomness. Improves security against replay attacks.
  • the encryption device of the present embodiment includes an initialization vector generation unit that generates an initialization vector used when encrypting the first plaintext block as the variable, and the encryption unit generates the initialization vector.
  • the first plaintext block is encrypted using the initialization vector generated in the part.
  • the initialization vector generation unit generates an initialization vector as a variable used when encrypting the first plaintext block using unencrypted data that is not encrypted by the encryption unit among the target data.
  • the unencrypted data is in plain text, and when the target data is, for example, a file whose format is open to the public, all or part of the header or the footer can be used as the unencrypted data.
  • a predetermined operation or function can be used for the initialization vector generation, and the same operation or function as in the case of encryption may be used for decryption. In effect, an attacker cannot generate an initialization vector without knowing the unencrypted data itself used to generate the initialization vector, and algorithms such as predetermined operations and functions for generating the initialization vector. , The initialization vector is extremely unlikely to be exposed. Further, if the unencrypted data is different for each target data, a different initialization vector can be generated for each target data, and the security for the target data is improved.
  • the encryption unit encrypts the first plaintext block using the initialization vector generated by the initialization vector generation unit. Assuming that the block encryption mode is CBC mode, the first plaintext block is E1, and the initialization vector is IV, the encryption unit performs an XOR operation on the plaintext block E1 and the initialization vector IV, and obtains the XOR operation result as an encryption key.
  • the first ciphertext block E1 can be generated by encrypting with.
  • variable generator further uses at least one of the parameters and the identification information, or both, to generate the ciphertext required by the block cipher algorithm at the time of encryption.
  • block cipher can be performed with a variable different for each target data.
  • the parameter is a parameter used for each user.
  • the variable generator when it is provided as a function of the cryptographic library, it can be a setting character string in the function of the cryptographic library.
  • the identification information is an identifier embedded in a cryptographic library provided for each user, and is unique for identifying a specific group including a user who performs encryption processing, a department to which the user belongs, a company, or the like. It can be an identifier assigned to.
  • the attacker may generate more variables if he does not know the parameters or the identification information. Becomes more difficult and the likelihood of variables being exposed is further reduced. Also, by using the identification information, for example, if the company to which the user belongs is different, different variables can be generated even if the unencrypted data is the same, so even if the cryptographic library is provided to different companies, it is the same. You can prevent variables from being generated. In addition, block ciphers can be performed by different variables for each target data.
  • the decryption device of the present embodiment is a decryption device that decrypts encrypted data based on block encryption, and the encrypted data includes a cipher sentence block and unencrypted unencrypted data, and the encryption Block encryption based on the decryption unit that decrypts an integral multiple of the encrypted text block of the encrypted data and leaves the unencrypted data as plain text, and all or part of the unencrypted data that is not decrypted by the decryption unit. It is provided with a variable generation unit that generates a secret variable for plain text generation required for decryption by the above algorithm.
  • the decryption device of the present embodiment is a decryption device that decrypts encrypted data based on block encryption, and includes a processor, and the encrypted data includes a cipher block and unencrypted unencrypted data. Including, the processor decrypts an integral multiple of the cryptographic block of the encrypted data, leaves the undecrypted encrypted data in plain text, and blocks based on all or part of the undecrypted unencrypted data. Cryptographic algorithms generate the secret variables needed for decryption to generate plain text.
  • the computer program of the present embodiment performs a process of acquiring encrypted data including an encrypted text block and unencrypted unencrypted data on a computer, and an integral multiple of the encrypted text block of the acquired encrypted data. For the process of leaving the encrypted data that is decrypted and not decrypted as plain text, and for the plain text generation that the block encryption algorithm requires at the time of decryption based on all or part of the information of the unencrypted data that is not decrypted. Execute the process of generating the variable to be kept secret.
  • the decryption method of the present embodiment is a decryption method for decrypting encrypted data based on block encryption, and the encrypted data includes a cipher sentence block and unencrypted unencrypted data, and the encryption Decrypts an integral multiple of the encrypted block of encrypted data, leaves the undecrypted encrypted data in plain text, and the block encryption algorithm is based on all or part of the undecrypted unencrypted data when decrypting. Generate a secret variable for the required plain text generation.
  • the recording medium of the present embodiment is a non-temporary recording medium that can be read by a computer for recording a computer program, and the computer program is a non-encrypted non-encrypted text block on the computer.
  • the block cryptographic algorithm executes a process of generating a secret variable for plain text generation required at the time of decryption.
  • Encrypted data includes ciphertext blocks and unencrypted unencrypted data.
  • Encrypted data includes, for example, partially encrypted data such as files and communication protocols.
  • the decryption unit decrypts an integral multiple of the ciphertext block of the encrypted data and leaves the unencrypted data in plain text.
  • Decryption uses a block cipher algorithm and can be decrypted using only one mode, for example, a CBC (Cipher Block Chaining) mode.
  • the CBC mode improves security against replay attacks in which an attacker obtains both plaintext and ciphertext and repeatedly sends the same ciphertext. Since it is not necessary to combine a plurality of modes, the algorithm becomes simpler, the program size becomes smaller, the CPU power and the memory capacity can be reduced, and the processing labor is reduced as compared with the case of using a plurality of modes.
  • the decryption unit decrypts not all of the encrypted data but a part of the encrypted data (composed of one or a plurality of ciphertext blocks). Even if the attacker can obtain the ciphertext (encrypted data), since the entire encrypted data is not encrypted, the attacker must obtain the encryption processing start position of the encrypted data. That is, the attacker cannot decrypt the ciphertext without knowing which part of the encrypted data is encrypted. This makes it possible to improve the security when decrypting the ciphertext.
  • the variable generator generates a secret variable for plaintext generation required for decryption by the block cipher algorithm based on all or part of the information of the unencrypted data.
  • the variables are, for example, an encryption key and an initialization vector.
  • the unencrypted data is in plain text, and when the target data is, for example, a file whose format is open to the public, all or part of the header or the footer can be used as the unencrypted data.
  • An attacker cannot generate a variable without knowing the unencrypted data itself used for variable generation, and algorithms such as predetermined operations and functions for variable generation, effectively exposing the variable. Very unlikely.
  • the decoding device of the present embodiment includes a decoding start position calculation unit that calculates a decoding start position based on a decoding start position parameter, and the decoding unit calculates the encryption from the decoding start position calculated by the decoding start position calculation unit. Decrypt the statement block.
  • the decoding start position calculation unit calculates the decoding start position based on the decoding start position parameter.
  • the decryption start position parameter is the same as the encryption start position parameter.
  • the decoding start position parameter can be specified by the user, the value can be a numerical value, and the unit can be%, but the decoding start position parameter is not limited to this.
  • the decryption start position calculation unit can calculate the decryption start position by multiplying the size of the encrypted data (same as the size of the target data) by the decryption start position parameter. For example, if the decryption start position parameter is 17 (%) and the size of the encrypted data is 384 bytes, the decryption start position is the 66th byte.
  • the decryption start position is the 131st byte. In this way, even if the same decryption start position parameter is specified, the decryption start position differs depending on the size of the encrypted data. Therefore, even if an attacker illegally obtains the decryption start position parameter, the decryption start position can be accurately obtained. I can't know.
  • the decryption unit decrypts the ciphertext block from the decryption start position calculated by the decryption start position calculation unit. Since the possibility that the decryption start position is exposed is extremely low, the security when decrypting the ciphertext is improved.
  • the decoding device of the present embodiment includes a decoding end position calculation unit that calculates a decoding end position based on a decoding end position parameter, and the decoding unit uses the decryption end position calculated by the decoding end position calculation unit to perform the encryption. Finish decrypting the statement block.
  • the decoding end position calculation unit calculates the decoding end position based on the decoding end position parameter.
  • the decryption end position parameter is the same as the encryption end position parameter.
  • the decoding end position parameter can be specified by the user, the value can be a numerical value, and the unit can be%, but the value is not limited to this.
  • the decryption end position calculation unit can calculate the decryption end position by multiplying the size of the encrypted data by the decryption end position parameter. For example, if the decryption end position parameter is 90 (%) and the size of the encrypted data is 384 bytes, the decryption end position is the 346th byte (decrypts up to the 346th byte).
  • the decryption end position is the 692nd byte. In this way, even if the same decryption end position parameter is specified, the decryption end position differs depending on the size of the encrypted data. Therefore, even if an attacker illegally obtains the decryption end position parameter, the decryption end position can be accurately obtained. I can't know.
  • the decryption unit finishes decrypting the ciphertext block at the decryption end position calculated by the decryption end position calculation unit. Since the possibility that the decryption end position is exposed is extremely low, the security when decrypting the ciphertext is improved.
  • the decoding unit when the data size to be decoded is not an integral multiple of the block length, the decoding unit adjusts the decoding start position or the decoding end position so that the data size is an integral multiple of the block length. To decrypt the ciphertext block.
  • the data size from the decryption start position to the end of the encrypted data when decrypting to the end
  • the data size from the decryption start position to the decryption end position and the decryption end from the beginning of the encrypted data (when decrypting from the beginning). If the data size to the position is not an integral multiple of the block length, the decryption start position or the decryption end position is adjusted so that the data size is an integral multiple of the block length to decrypt the ciphertext block.
  • the size of the target data (target file) does not change before and after the encryption. That is, since the data size (file size) does not increase due to encryption, it is possible to suppress an increase in the communication amount and communication time at the time of data (file) transfer.
  • the size of the decrypted data as a result of decoding by the decoding unit is the same as the size of the encrypted data before decryption.
  • the size of the decrypted data as a result of decryption by the decryption unit is the same as the size of the encrypted data before decryption. Since the data size (file size) does not increase due to encryption, it is possible to suppress an increase in the communication amount and communication time when transferring data (file).
  • the unencrypted data is continuous data or discrete data in the encrypted data.
  • the unencrypted data may be continuous data.
  • the header portion can be used as the unencrypted data.
  • the unencrypted data may be discrete data.
  • the unencrypted data may be a portion separated by a plurality of data portions, such as a header portion and a footer portion.
  • the decryption device of the present embodiment includes an encryption key generation unit that generates an encryption key as the variable, and the decryption unit decrypts the ciphertext block using the encryption key generated by the encryption key generation unit.
  • the encryption key generator generates an encryption key as a variable using unencrypted data.
  • the unencrypted data is the data of the portion of the target data before encryption that is not the target of encryption by the encryption device (encryption unit).
  • the unencrypted data is plain text, and when the target data is, for example, a file whose format is open to the public, the unencrypted data is all or part of the header, or unencrypted data such as a footer. is there.
  • the encryption key is a common key used for encryption and decryption. A predetermined operation or function can be used for the encryption key generation, and the same operation or function as in the case of encryption is used.
  • An attacker cannot generate a cryptographic key without knowing the unencrypted data itself used for cryptographic key generation and algorithms such as predetermined operations and functions for cryptographic key generation. Is extremely unlikely to be exposed. Further, if the unencrypted data is different for each target data, a different encryption key can be generated for each target data, and the security when decrypting the ciphertext is improved.
  • the decryption unit decrypts the ciphertext block using the encryption key generated by the encryption key generation unit.
  • the portion to be decrypted (a part of the encrypted data) is defined as ciphertext blocks E1, E2, ..., En.
  • the block cipher mode is the CBC mode
  • the previous ciphertext block is used to decrypt the next ciphertext block.
  • the ciphertext block is decrypted with the encryption key, and the decrypted result and the XOR operation of the previous ciphertext block are performed to generate the plaintext block.
  • the initialization vector is used.
  • Plaintext blocks B1, B2, ..., Bn are generated by decoding.
  • the decoding device of the present embodiment includes an initialization vector generation unit that generates an initialization vector used when decrypting the first ciphertext block as the variable, and the decoding unit is the initialization vector generation unit.
  • the first ciphertext block is decrypted using the generated initialization vector.
  • the initialization vector generation unit uses unencrypted data to generate an initialization vector as a variable used when decrypting the first ciphertext block.
  • the unencrypted data is the data of the portion of the target data before encryption that is not the target of encryption by the encryption device (encryption unit).
  • the unencrypted data is plain text, and when the target data is, for example, a file whose format is open to the public, the unencrypted data is all or part of the header, or unencrypted data such as a footer. is there.
  • a predetermined operation or function can be used for the initialization vector generation, and the same operation or function as in the case of encryption is used.
  • an attacker cannot generate an initialization vector without knowing the unencrypted data itself used to generate the initialization vector, and algorithms such as predetermined operations and functions for generating the initialization vector. , The initialization vector is extremely unlikely to be exposed. Further, if the unencrypted data is different for each target data, a different initialization vector can be generated for each target data, and the security when decrypting the ciphertext is improved.
  • the decryption unit decrypts the first ciphertext block using the initialization vector generated by the initialization vector generation unit. Assuming that the block cipher mode is CBC mode, the first ciphertext block is E1, and the initialization vector is IV, the decryption unit decrypts the ciphertext block E1 with the encryption key, and XOR of the decryption result and the initialization vector IV.
  • the first plaintext block B1 can be generated by performing an operation.
  • variable generator further uses at least one of the parameters and the identification information, or both, to conceal the plaintext generation required by the block cipher algorithm at the time of decryption. Generate variables to be used.
  • the parameter is a parameter used for each user.
  • the variable generator when it is provided as a function of the cryptographic library, it can be a setting character string in the function of the cryptographic library.
  • the identification information is an identifier embedded in a cryptographic library provided for each user, and is unique for identifying a specific group including a user who performs encryption processing, a department to which the user belongs, a company, or the like. It can be an identifier assigned to.
  • the attacker may generate more variables if he does not know the parameters or the identification information. Becomes more difficult and the likelihood of variables being exposed is further reduced. Also, by using the identification information, for example, if the company to which the user belongs is different, different variables can be generated even if the unencrypted data is the same, so even if the cryptographic library is provided to different companies, it is the same. You can prevent variables from being generated.
  • the data structure of the present embodiment is used in a computer provided with a decryption unit, and is a data structure of encrypted data based on block encryption, and the encrypted data is encrypted with unencrypted unencrypted data.
  • the recording medium of the present embodiment is a non-temporary recording medium that can be read by a computer for recording encrypted data used in the computer, and the encrypted data is unencrypted and unencrypted.
  • a secret variable for plain text generation required by a block cryptographic algorithm for decryption based on all or part of the information of the unencrypted data, including data and an encrypted cryptographic block. Is used in the process of generating the data and the process in which the decryption unit decodes an integral multiple of the cipher block and leaves the undecrypted encrypted data in plain text.
  • the data structure is a data structure of encrypted data
  • the encrypted data includes unencrypted unencrypted data and an encrypted text block.
  • the computer performs a process of generating a secret variable for plaintext generation required at the time of decryption based on all or part of the information of the unencrypted data
  • the decryption unit performs a process of generating a secret variable for plaintext generation.
  • the generated variable is used to decrypt an integral multiple of the ciphertext block, leaving the undecrypted encrypted data in plaintext.
  • the decryption unit decrypts not all of the encrypted data but a part of the encrypted data (composed of one or a plurality of ciphertext blocks). Even if the attacker can obtain the ciphertext (encrypted data), since the entire encrypted data is not encrypted, the attacker must obtain the encryption processing start position of the encrypted data. That is, the attacker cannot decrypt the ciphertext without knowing which part of the encrypted data is encrypted. This makes it possible to improve the security when decrypting the ciphertext.
  • Communication network 50 Encryption device 51 Control unit 52 Data acquisition unit 53 Encryption key generation unit 54 Initialization vector generation unit 55 Storage unit 56 Data output unit 57 Encryption start / end position calculation unit 58 Encryption unit 70 Decryption device 71 Control Unit 72 Data acquisition unit 73 Encryption key generation unit 74 Initialization vector generation unit 75 Storage unit 76 Data output unit 77 Decryption start / end position calculation unit 78 Decryption unit 100 Computer 101 CPU 102 Volatile memory 103 Communication unit 104 Operation unit 105 Non-volatile memory 106 Recording medium reader 107 Display unit 200 Server

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Storage Device Security (AREA)

Abstract

暗号化装置は、対象データをブロック暗号により暗号化する暗号化装置であって、前記対象データの平文ブロックの整数倍を暗号化し、暗号化しない対象データは平文のまま残す暗号化部と、前記暗号化部で暗号化しない非暗号化データの全部又は一部の情報、もしくはこの情報に位置パラメータを加えた情報を用いて、ブロック暗号のアルゴリズムが暗号化の際に必要とする暗号文生成のための秘匿すべき変数を生成する変数生成部とを備える。

Description

暗号化装置、復号装置、コンピュータプログラム、暗号化方法、復号方法及びデータ構造
 本開示は、暗号化装置、復号装置、コンピュータプログラム、暗号化方法、復号方法及びデータ構造に関する。
 暗号アルゴリズムには、主にブロック暗号とストリーム暗号がある。ストリーム暗号はデータの流れを順次処理する。ブロック暗号は対象データ(対象ファイルなどを)を特定のブロック長で区切ったブロック毎に処理する。ブロック暗号は対象データ全体を暗号化するので、対象データ全体のサイズが、ブロック長の整数倍でない場合、パディングによってデータを埋める必要がある。また、CBC(Cipher Block Chaining)モード、CFB(Cipher Feed Back)モード、OFB(Output Feed Back)モードなどの各モードでは、暗号化及び復号に初期化ベクトルが必要である。このため、従来のブロック暗号では、暗号鍵(共通鍵)及び初期化ベクトルを暗号化側と復号側とで秘匿する必要がある。
 特許文献1には、パディング処理が不要なCFBモードやOFBモードとともにCBCモードを組み合わせた処理によって、暗号化に必要な初期化ベクトルを暗号化側で生成し、復号に必要な初期化ベクトルを復号側で生成する暗号化方法及び復号方法が開示されている。
特開2009-175544号公報
 特許文献1の方法にあっては、暗号化側と復号側との間で初期化ベクトルのやり取りは不要である。しかし、暗号化側と復号側との間で暗号鍵のやり取りは必要であるため、攻撃者に暗号鍵が不正に取得され対象データが漏洩するという脆弱性がある。また、特許文献1の方法にあっては、複数のモードを組み合わせているので、暗号化及び復号のアルゴリズムが複雑になりプログラムのサイズが大きくなり、処理労力が増大する。
 本開示は、斯かる事情に鑑みてなされたものであり、暗号化の対象データ毎に、暗号鍵と初期化ベクトルを生成させることによりセキュリティを向上できる暗号化装置、復号装置、コンピュータプログラム、暗号化方法、復号方法及びデータ構造を明らかにする。
 本願は上記課題を解決する手段を複数含んでいるが、その一例を挙げるならば、暗号化装置は、対象データから、暗号鍵と初期化ベクトルをセキュアに自動生成させ、対象データの平文ブロックの整数倍を暗号化し、暗号化しない対象データを平文のまま残し、対象データと同じサイズの暗号化データを生成する暗号化部を備える。
 本開示によれば、暗号化の対象データに対するセキュリティを向上させるのみでなく、攻撃者(「クラッカー」ともいう))が、暗号鍵と初期化ベクトルを、アプリケーションの実行コードの中から探索し突き止めることを防ぐことができる。
本実施の形態の暗号化装置の構成の一例を示すブロック図である。 本実施の形態の復号装置の構成の一例を示すブロック図である。 本実施の形態の暗号化及び復号による平文と暗号文との関係の一例を示す模式図である。 暗号化部の構成の一例を示す模式図である。 復号部の構成の一例を示す模式図である。 暗号鍵生成部及び初期化ベクトル生成部の構成の第1例を示す模式図である。 暗号鍵生成部及び初期化ベクトル生成部の構成の第2例を示す模式図である。 暗号ライブラリで暗号化部の機能を実現するための暗号化関数の一例を示す模式図である。 暗号化対象のサイズがブロック長の整数倍に等しい場合の暗号化の一例を示す模式図である。 暗号化対象のサイズがブロック長の整数倍に等しくない場合の暗号化の一例を示す模式図である。 本実施の形態の暗号化処理を画像ファイルに適用した場合の一例を示す模式図である。 暗号ライブラリを組み込んだアプリケーションのモジュールの一例を示す模式図である。 本実施の形態の暗号化装置及び復号装置の他の構成の一例を示すブロック図である。 暗号化装置による暗号化の処理手順の一例を示すフローチャートである。 復号装置による複合の処理手順の一例を示すフローチャートである。
 以下、本開示の実施の形態を説明する。図1は本実施の形態の暗号化装置50の構成の一例を示すブロック図である。暗号化装置50は、装置全体を制御する制御部51、データ取得部52、暗号鍵生成部53、初期化ベクトル生成部54、記憶部55、データ出力部56、暗号化開始・終了位置算出部57、及び暗号化部58を備える。暗号化装置50は、メッセージの送信者(暗号化側)と受信者(復号側)が、暗号化及び復号で使用する鍵を共有する共有鍵暗号を用いる。暗号アルゴリズムとしては、AES(Advanced Encryption Standard)を用いることができるが、これに限定されない。
 制御部51は、CPU、ROM、RAMなどで構成することができる。データ取得部52及びデータ出力部56は、I/Oインタフェースに接続される入力デバイス(例えば、キーボード、マウス、タッチパネル、記録媒体読取デバイス、通信回路、API(Application Programming Interface)など)や出力デバイス(例えば、表示パネル、記録媒体書込みデバイス、通信回路など)で構成することができる。記憶部55は、HDDや半導体メモリで構成することができる。暗号鍵生成部53、初期化ベクトル生成部54、暗号化開始・終了位置算出部57、及び暗号化部58は、ユーザがコンピュータ上で使用するアプリケーションに組み込み可能な暗号ライブラリやプログラムで構成することができるが、これに限定されるものではなく、FPGA(Field-Programmable Gate Arrays)やASIC(application specific integrated circuit)などのハードウェアによって構成してもよい。
 データ取得部52は、暗号化の対象となるデータである対象データを取得する。データ取得部52で取得した対象データは、記憶部55に記憶することができる。対象データは、例えば、フォーマットが公開されているファイル(例えば、画像データ、圧縮データなど)、通信プロトコル、特定のアプリケーションが生成する独自のファイル(例えば、ワード、パワーポイント、エクセルなどのファイル)を含む。本明細書では、対象データとして、フォーマットが公開されているファイルを例として説明する。
 暗号化部58は、データ取得部52で取得した対象データの平文ブロックの整数倍を暗号化し、暗号化しない対象データを平文のまま残し、対象データと同じサイズの暗号化データを生成することができる。暗号化部58は、対象データの全部ではなく、対象データの一部(1又は複数の平文ブロックで構成される)を暗号化することができる。本実施の形態では、対象データのサイズと暗号化データのサイズは同じになる。暗号化の詳細は後述する。
 暗号鍵生成部53は、対象データのうち暗号化部58で暗号化しない非暗号化データ(暗号化の対象になっていないデータ又は部分)を用いて暗号鍵を生成することができる。暗号鍵は暗号化及び復号で使用する共通鍵である。暗号鍵生成の詳細は後述する。
 初期化ベクトル生成部54は、対象データのうち暗号化部58で暗号化しない非暗号化データを用いて、最初の平文ブロックを暗号化する際に使用する初期化ベクトルを生成することができる。なお、暗号鍵生成部53が使用する非暗号化データは、初期化ベクトル生成部54が使用する非暗号化データと異なるようにできる。初期化ベクトル生成の詳細は後述する。本開示では、暗号鍵生成部53及び初期化ベクトル生成部54を変数生成部とも称し、暗号鍵及び初期化ベクトルを変数とも称する。
 暗号化開始・終了位置算出部57は、暗号化開始位置パラメータに基づいて暗号化開始位置を算出することができる。暗号化開始位置パラメータは、ユーザが指定でき、値は数値、もしくは%単位とすることができるが、これに限定されない。すなわち、暗号化開始位置パラメータは、実位置を示す数値、もしくは対象データのサイズから実位置が計算でき求めることができる%数値とすることができる。また、暗号化開始・終了位置算出部57は、暗号化終了位置パラメータに基づいて暗号化終了位置を算出することができる。暗号化終了位置パラメータは、ユーザが指定でき、値は数値、もしくは%単位とすることができるが、これに限定されない。すなわち、暗号化終了位置パラメータは、実位置を示す数値、もしくは対象データのサイズから実位置が計算でき求めることができる%数値とすることができる。暗号化開始・終了位置算出部57は、暗号化開始位置及び暗号化終了位置の少なくとも一方を算出できる。暗号化開始位置及び暗号化終了位置の詳細は後述する。
 データ出力部56は、暗号化部58で暗号化した対象データ、すなわち暗号化データを外部の装置などへ出力することができる。例えば、暗号化データは、インターネットなどの通信ネットワークを介して復号装置へ送信される。
 図2は本実施の形態の復号装置70の構成の一例を示すブロック図である。復号装置70は、装置全体を制御する制御部71、データ取得部72、暗号鍵生成部73、初期化ベクトル生成部74、記憶部75、データ出力部76、復号開始・終了位置算出部77、及び復号部78を備える。
 制御部71は、CPU、ROM、RAMなどで構成することができる。データ取得部72及びデータ出力部76は、I/Oインタフェースに接続される入力デバイス(例えば、キーボード、マウス、タッチパネル、記録媒体読取デバイス、通信回路など)や出力デバイス(例えば、表示パネル、記録媒体読取デバイス、通信回路など)で構成することができる。記憶部75は、HDDや半導体メモリで構成することができる。暗号鍵生成部73、初期化ベクトル生成部74、復号開始・終了位置算出部77、及び復号部78は、ユーザがコンピュータ上で使用するアプリケーションに組み込み可能な暗号ライブラリやプログラム(サブルーチン又はモジュールと称される)で構成することができるが、これに限定されるものではなく、FPGA(Field-Programmable Gate Arrays)やASIC(application specific integrated circuit)などのハードウェアによって構成してもよい。
 データ取得部72は、暗号化する対象データおよび暗号化データを取得することができる。データ取得部72で取得した対象データおよび暗号化データは、記憶部75に記憶することができる。対象データは、例えば、フォーマットが公開されているファイル(例えば、画像データ、圧縮データなど)、通信プロトコル、特定のアプリケーションが生成する独自のファイル(例えば、ワード、パワーポイント、エクセルなどのファイル)のデータであるがこれに限定されない。暗号化データは、対象データが暗号化されたものであり、暗号化されていない非暗号化データと暗号化された暗号文ブロックとを含む。暗号化データは、例えば、フォーマットが公開されているファイル(例えば、画像データ、圧縮データなど)、通信プロトコル、特定のアプリケーションが生成する独自のファイル(例えば、ワード、パワーポイント、エクセルなどのファイル)の一部が暗号化されたデータである。
 復号部78は、データ取得部72で取得した暗号化データの暗号文ブロックの整数倍を復号し、非暗号化データを平文のまま残し、暗号化データと同じサイズの対象データを生成する。復号部78は、暗号化データの全部ではなく、暗号化データの一部(1又は複数の暗号文ブロックで構成される)を復号することができる。復号の詳細は後述する。
 暗号鍵生成部73は、非暗号化データを用いて暗号鍵を生成することができる。暗号鍵は暗号化及び復号で使用する共通鍵である。非暗号化データは、暗号化前の対象データのうち、暗号化装置50(暗号化部58)で暗号化の対象となっていない部分のデータである。
 初期化ベクトル生成部74は、非暗号化データを用いて、最初の暗号文ブロックを復号する際に使用する初期化ベクトルを生成することができる。非暗号化データは、暗号化前の対象データのうち、暗号化装置50(暗号化部58)で暗号化の対象となっていない部分のデータである。本開示では、暗号鍵生成部73及び初期化ベクトル生成部74を変数生成部とも称し、暗号鍵及び初期化ベクトルを変数とも称する。
 復号開始・終了位置算出部77は、復号開始位置パラメータに基づいて復号開始位置を算出することができる。復号開始位置パラメータは、暗号化開始位置パラメータと同一である。復号開始位置パラメータは、ユーザが指定でき、値は数値、もしくは%単位とすることができるが、これに限定されない。また、復号開始・終了位置算出部77は、復号終了位置パラメータに基づいて復号終了位置を算出することができる。復号終了位置パラメータは、暗号化終了位置パラメータと同一である。復号終了位置パラメータは、ユーザが指定でき、値は数値、もしくは%単位とすることができるが、これに限定されない。復号開始・終了位置算出部77は、復号開始位置及び復号終了位置の少なくとも一方を算出できる。復号開始位置及び復号終了位置の詳細は後述する。
 データ出力部76は、復号部78で復号した対象データを外部の装置などへ出力することができる。例えば、復号した対象データは、表示装置へ送信され、表示することができる。
 次に、暗号化及び復号の詳細について説明する。
 図3は本実施の形態の暗号化及び復号による平文と暗号文との関係の一例を示す模式図である。前述のとおり、本実施の形態の暗号化部58は、対象データの全部ではなく、対象データの一部(1又は複数の平文ブロックで構成される)を暗号化する。対象データのサイズは、(ブロック数×ブロック長+0以上ブロック長以下のサイズ)で表される。ブロック長はブロックサイズともいう。また、復号部78は、暗号化データの全部ではなく、暗号化データの一部(1又は複数の暗号文ブロックで構成される)を復号する。図3では、ケースA、B、C及びDの4つのケースを図示している。ケースAでは、暗号化されていない対象データ(全体が平文)のうち、データの先頭から所要長の部分は暗号化されておらず、平文のままである。平文以外の、データの末尾までの残り全部は暗号化された暗号文となっている。ケースBでは、対象データのうち、データの先頭から所要長の部分、及びデータの末尾から所要長の部分は暗号化されておらず、平文のままである。平文以外の残りの部分は暗号化された暗号文となっている。ケースCでは、対象データのうち、データの末尾から所要長の部分は暗号化されておらず、平文のままである。平文以外の、データの先頭までの残り全部は暗号化された暗号文となっている。本開示では、ケースCは、ケースAを逆順にしたものなので、同一とみなすことができる。ケースDでは、対象データのうち、データの先頭から所要長の部分、及びデータの末尾から所要長の部分は暗号化された暗号文である。暗号文以外の残りの部分は平文となっている。なお、ケースAからDにおいて、暗号文は連続した一塊となっているが、平文を間にして暗号文が離散して複数存在してもよい。
 攻撃者が、暗号文を入手できたとしても、対象データ全体が暗号化されていないので、攻撃者は、対象データの暗号処理開始位置を求めなくてはならない。すなわち、攻撃者は、対象データのどの部分が暗号化されているのかを知らない限り、暗号文を復号できない。これにより、対象データに対するセキュリティを向上させることができるので、暗号文を復号する際のセキュリティを向上させることができる。また、図3のケースA、Bのように、対象データの先頭(例えば、フォーマットが公開されているファイルのヘッダー部分など)から暗号化しないので、攻撃者は、従来の全数探索攻撃などの攻撃手法を用いることができないので、暗号文に対するセキュリティを向上させることができる。すなわち、暗号文に対する改ざん耐性を強くすることができる。なお、本明細書では、ケースAの場合を用いて説明する。
 図4は暗号化部58の構成の一例を示す模式図である。暗号化部58は、ブロック暗号アルゴリズムを使用し、例えば、CBC(Cipher Block Chaining)モードなどの一つのモードだけを使用して暗号化できる。しかし、CBCモードは、ファイルサイズが、元のファイルサイズより大きくなる場合が多いという欠点がある。ブロック暗号のモードには、CBCモードの他に、ECB(Electronic Code Book)モード、CFB(Cipher Feed Back)モード、OFB(Output Feed Back)モード、CTR(CounTeR)モードなどがある。ECBモード及びCFBモードは再生攻撃に弱いという欠点がある。CFBモード及びOFBモードでは、パディングが不要であり、ファイルサイズが大きくなるという欠点がない。
 本実施の形態では、いずれのモードを用いてもよいが、好ましくはCBCモードを用いることができる。CBCモードであれば、攻撃者が平文と暗号文の両方を取得して同じ暗号文を繰り返し送信するような再生攻撃に対するセキュリティが向上する。複数のモードを組み合わせる必要もないので、複数のモードを用いる場合に比べて、アルゴリズムが簡単になりプログラムのサイズも小さくなり、CPUパワーやメモリ容量も少なくすることができ処理労力が軽減する。また、CBCモードはパディングが必要となるが、本実施の形態によれば、後述のように、パディングは不要となる。さらに、特許文献1に記載のパディング不要にするために導入した、再生攻撃が可能なECBモード及びCFBモードを使用しなくてよい。
 以下、CBCモードとして説明する。図4に示すように、対象データのうち、暗号化する部分(対象データの一部)を、平文ブロックB1、B2、…、Bnとする。CBCモードの場合、1つ前の暗号文ブロックを次の平文ブロックの暗号化に使用する。具体的には、暗号化部58は、平文ブロックと1つ前の暗号文ブロックのXOR演算を行い、XOR演算結果を暗号鍵で暗号化する。このとき、最初の平文ブロックには「1つ前の暗号文ブロック」が存在しないので、初期化ベクトルを用いる。
 図4に示すように、平文ブロックB1と初期化ベクトルをXOR演算し、XOR演算結果を暗号鍵で暗号化することにより、暗号文ブロックE1を生成する。次に、平文ブロックB2と暗号化ブロックE1をXOR演算し、XOR演算結果を暗号鍵で暗号化することにより、暗号文ブロックE2を生成する。同様にして、平文ブロックBnと暗号化ブロックE(n-1)をXOR演算し、XOR演算結果を暗号鍵で暗号化することにより、暗号文ブロックEnを生成する。暗号化によって、暗号文ブロックE1、E2、…、Enが生成され、仮に平文ブロックの内容が同じでも、暗号文ブロックE1、E2、…、Enは、ランダム性が連鎖し、それぞれ異なる値となり、再生攻撃に対するセキュリティが向上する。平文ブロック及び暗号文ブロックのサイズ(ブロック長)は、16バイト、32バイトなどとすることができるが、本明細書では、16バイトとして説明する。なお、ブロック長は、16バイトや32バイドに限定されず、他のバイト数(ブロックサイズ)であってもよい。
 また、図4に示すように、対象データのうち、暗号化の対象ではない非暗号データは、暗号化データの同じ位置に格納されている。
 図5は復号部78の構成の一例を示す模式図である。復号部78は、暗号化部58と同様、ブロック暗号アルゴリズムを使用し、例えば、CBC(Cipher Block Chaining)モードなどの一つのモードだけを使用して復号できる。CBCモードであれば、攻撃者が平文と暗号文の両方を取得して同じ暗号文を繰り返し送信するような再生攻撃に対するセキュリティが向上する。複数のモードを組み合わせる必要もないので、複数のモードを用いる場合に比べて、アルゴリズムが簡単になりプログラムのサイズも小さくなり、CPUパワーやメモリ容量も少なくすることができ処理労力が軽減する。
 暗号化データのうち、復号する部分(暗号化データの一部)を、暗号文ブロックE1、E2、…、Enとする。CBCモードの場合、1つ前の暗号文ブロックを次の暗号文ブロックの復号に使用する。具体的には、復号部78は、暗号文ブロックを暗号鍵で復号し、復号した結果と1つ前の暗号文ブロックのXOR演算を行って平文ブロックを生成する。このとき、最初の暗号文ブロックには「1つ前の暗号文ブロック」が存在しないので、初期化ベクトルを用いる。
 図5に示すように、暗号文ブロックE1を暗号鍵で復号し、復号結果と初期化ベクトルをXOR演算することにより平文ブロックB1を生成できる。次に、暗号文ブロックE2を暗号鍵で復号し、復号結果と暗号文ブロックE1をXOR演算することにより平文ブロックB2を生成できる。以下、同様にして、暗号文ブロックEnを暗号鍵で復号し、復号結果と暗号文ブロックE(n-1)をXOR演算することにより平文ブロックBnを生成できる。
 次に、暗号鍵(共通鍵)及び初期化ベクトルの生成方法について説明する。
 変数生成部は、非暗号化データの全部又は一部の情報に基づいて、ブロック暗号のアルゴリズムが暗号化の際に必要とする暗号文生成のための秘匿すべき変数を生成する。変数は、例えば、暗号鍵、初期化ベクトルである。なお、変数を生成する際に、位置パラメータを加えてもよい。このように、実行時に変数を生成する仕組みなので、暗号化および復号において、重要な変数を秘匿しておくことができる。別言すると、変数の一例である暗号鍵や初期化ベクトルを暗号側と復号側で秘密に管理し共有しておく必要がない。
 図6は暗号鍵生成部53及び初期化ベクトル生成部54の構成の第1例を示す模式図である。従来の共通鍵暗号手法では、暗号鍵及び初期化ベクトルを暗号化側と復号側とで共有するとともに秘密管理しておく必要がある。本実施の形態では、変数としての暗号鍵及び初期化ベクトルを暗号化側と復号側とで秘密管理する必要はない。暗号鍵及び初期化ベクトルを生成する際に、暗号化側と復号側とで同一のパラメータを使用すればよい。仮に、当該パラメータが攻撃者に入手されても、当該パラメータは、暗号鍵そのもの、あるいは初期化ベクトルそのものではないないので、攻撃者は暗号鍵及び初期化ベクトルを取得できない。
 暗号化側及び復号側で、ユーザは、パラメータとして、文字列P1、暗号鍵用数値P2、初期化ベクトル用数値P3を指定することができる。暗号鍵生成部53及び初期化ベクトル生成部54を暗号ライブラリの機能として提供する場合、暗号ライブラリの関数内設定文字列(パラメータ)を予め設定することができる。関数内設定文字列(パラメータ)は、ユーザ毎に使用するパラメータである。また、ユーザを含む特定のグループ、ユーザが所属する部署、あるいは企業に対して固有に割り当てられた識別子(パラメータ)を予め設定してもよい。識別子(パラメータ)は、ユーザ毎に提供する暗号ライブラリに埋め込まれた識別子である。なお、識別子は必須ではないが、識別子を用いることにより、例えば、ユーザが属する企業が異なれば、たとえヘッダー部が同一であっても異なる暗号鍵及び初期化ベクトルを生成できるので、暗号ライブラリを異なる企業に提供しても、同じ暗号鍵及び初期化ベクトルが生成されることを防止できる。
 ハッシュ演算は、ある値を受け取ると、その値をもとに一方向性演算(もしくは一方向性関数)を実施した結果のハッシュ値を返すハッシュ関数による演算を行う。受け取る値が異なるとハッシュ値も異なるが、ハッシュ値から元の値を知ることはできない。ハッシュ関数としては、例えば、SHA-256(32バイトのハッシュ値を出力)を用いることができるが、これに限定されない。
 文字列P1、ユーザ入力によるパラメータとしての関数内設定文字列及び識別情報としての識別子を連結させたものをハッシュ関数に入力し、ハッシュ演算により得られたハッシュ値を再度ハッシュ関数に入力した後のハッシュ値を使用してもよい。なお、ハッシュ関数の入力としては、文字列P1だけでもよいが、関数内設定文字列及び識別子の少なくとも一方、または両方を入力するようにしてもよい。このようにして所要回数、ハッシュ演算を繰り返して得られたハッシュ値を64バイト長のバッファの前半部に格納する。次に、前半部に格納したハッシュ値をハッシュ関数に入力し、ハッシュ演算により得られたハッシュ値を再度ハッシュ関数に入力する。このようにして所要回数、ハッシュ演算を繰り返して得られたハッシュ値を64バイト長のバッファの後半部に格納する。
 バッファに格納された64バイト長のバイナリ値のうち、暗号鍵用数値P2で指定される整数値x(0<x<31)で指定される位置から32バイトのバイナリ値を取り出し、暗号鍵Key0とすることができる。また、バッファに格納された64バイト長のバイナリ値のうち、初期化ベクトル用数値P3で指定される整数値y(0<y<31)で指定される位置から32バイトのバイナリ値を取り出し、初期化ベクトルIV0とすることができる。
 なお、暗号鍵及び初期化ベクトルの生成方法は、図6の例に限定されるものではなく、他の演算方法を用いてもよい。本実施の形態によれば、暗号鍵及び初期化ベクトルの生成方法のバリエーションを豊富にできる。
 上述のように、本実施の形態によれば、暗号鍵及び初期化ベクトルの秘匿性を高めて、攻撃者が暗号鍵及び初期化ベクトルを不正に入手できる可能性を極めて低くすることができる。理由は、攻撃者(「クラッカー」ともいう)は、アプリケーションの中に書き込まれている定数やサブルーチンにセットする引数(例:暗号鍵、初期化ベクトルなど)は探索解読しやすいが、本実施の形態によって、アプリケーションの実行過程で生成される変数は解読しにくいからである。(理由は、静的解析では解読できないから。解読しようとすると高度な技術を要した攻撃者が、動的解析を実施するしかないから)さらに本実施の形態は、対象データ毎に、これらの変数値が異なる可能性が高いからである。また、ユーザは、暗号鍵及び初期化ベクトルの生成に関与できるが、直接的な関与はできないという点もセキュリティの向上に寄与している。
 図6に示す構成は、暗号化データを復号時の暗号鍵及び初期化ベクトルの生成にも用いることができる。
 図7は暗号鍵生成部53及び初期化ベクトル生成部54の構成の第2例を示す模式図である。暗号鍵生成部53は、対象データのうち暗号化部58で暗号化しない非暗号化データを用いて暗号鍵を生成する。また、初期化ベクトル生成部54は、対象データのうち暗号化部58で暗号化しない非暗号化データを用いて初期化ベクトルを生成する。図7に示すように、非暗号化データは、平文S1であり、対象データが、例えば、フォーマットが公開されているファイルの場合、非暗号化データとして、ヘッダーの全部又は一部、ヘッダーとフッターの組み合わせなど使用できる。
 暗号鍵生成及び初期化ベクトル生成は、所定の演算や関数を用いることができ、復号の際も暗号化の場合と同じ演算や関数を用いればよい。図7の例では、ハッシュ演算及びXOR演算を用いている。ハッシュ演算は、ハッシュ関数としては、例えば、SHA-256を用いることができるが、これに限定されない。平文S1のバイナリ値をハッシュ関数に入力し、得られたハッシュ値と初期化ベクトルIV0をXOR演算し、XOR演算の結果得られたバイナリ値を初期化ベクトルIV1とすることができる。同様に、平文S1のバイナリ値をハッシュ関数に入力し、得られたハッシュ値と暗号鍵Key0をXOR演算し、XOR演算の結果得られたバイナリ値を暗号鍵Key1とすることができる。なお、初期化ベクトルIV0及び暗号鍵Key0に代えて、他の異なるバイナリ値を用いてもよい。また、ハッシュ演算は複数回繰り返してもよい。
 攻撃者は、暗号鍵生成に使用する非暗号化データ自身、暗号鍵生成のための所定の演算や関数などのアルゴリズムを知らない限り、暗号鍵を生成することができないので、事実上、暗号鍵が暴露される可能性は極めて低い。また、対象データ毎に非暗号化データが異なれば、ハッシュ演算及びXOR演算の結果が異なるので、対象データ毎に異なる暗号鍵を生成することができ、対象データに対するセキュリティが向上する。
 同様に、攻撃者は、初期化ベクトル生成に使用する非暗号化データ自身、初期化ベクトル生成のための所定の演算や関数などのアルゴリズムを知らない限り、初期化ベクトルを生成することができないので、事実上、初期化ベクトルが暴露される可能性は極めて低い。また、対象データ毎に非暗号化データが異なれば、ハッシュ演算及びXOR演算の結果が異なるので、対象データ毎に異なる初期化ベクトルを生成することができ、対象データに対するセキュリティが向上する。
 また、非暗号化データの情報の他に、ユーザ入力による所定のパラメータ及び所定の識別情報の少なくとも1つ、または両方を用いて暗号鍵及び初期化ベクトルを生成することにより、攻撃者は、所定のパラメータ又は所定の識別情報を知らないと、さらに暗号鍵及び初期化ベクトルを生成することが困難となり、暗号鍵及び初期化ベクトルが暴露される可能性はさらに低下する。
 復号装置70の暗号鍵生成部73及び初期化ベクトル生成部74の構成も図7と同様の構成とすることができる。暗号鍵生成部73は、暗号化データのうち暗号化部58で暗号化しない非暗号化データを用いて暗号鍵を生成することができる。また、初期化ベクトル生成部74は、暗号化データのうち暗号化部58で暗号化しない非暗号化データを用いて初期化ベクトルを生成する。図7の例では、暗号化データのうち、平文S1は、対象データの平文S1と同じである。
 図6又は図7に示すように、比較的簡単な演算を行うことにより、暗号鍵及び初期化ベクトルを生成することができる。このように、例えば、初期化ベクトルを生成するために、複数のモードを組み合わせた複雑な処理を行う必要がないので、アルゴリズムが簡単になりプログラムのサイズも小さくなり、CPUパワーやメモリ容量も少なくすることができ処理労力が軽減する。
 次に、暗号化開始位置及び暗号化終了位置の決定方法について説明する。
 図8は暗号ライブラリで暗号化部58の機能を実現するための暗号化関数の一例を示す模式図である。暗号化関数CRcrypt_Encryptは、暗号ライブラリ内で定義され、アプリケーションが対象データの暗号化を行う際に、アプリケーションから呼び出すことができる。図8に示す暗号化関数は便宜的に示すものであり、実際にプログラム上で呼び出す際の記載とは異なる場合がある。暗号化関数CRcrypt_Encryptは、例えば、4つの引数(引数1、2、3、4)を有する。引数1は対象データが格納されている領域(アドレス)を指し示す。引数2は対象データのサイズ(単位はバイト)を示す。引数3は暗号化開始位置パラメータを示し、引数4は暗号化終了位置パラメータを示す。
 暗号化開始位置パラメータ及び暗号化終了位置パラメータは、ユーザが指定でき、値は数値、もしくは%単位とすることができるが、これに限定されない。また、暗号化開始位置パラメータは暗号化終了位置パラメータより小さい値である。
 暗号化開始・終了位置算出部57は、対象データのサイズに暗号化開始位置パラメータを乗算して、暗号化開始位置を算出することができる。また、暗号化開始・終了位置算出部57は、対象データのサイズに暗号化終了位置パラメータを乗算して、暗号化終了位置を算出することができる。
 図8に示すように、対象データのサイズ(引数2)を384バイトとし、暗号化開始位置パラメータ(引数3)を17(%)とすると、暗号化開始位置は66バイト目となる。暗号化終了位置パラメータ(引数4)を90(%)とすると、暗号化終了位置は346バイト目となる(346バイト目まで暗号化する)。また、対象データのサイズが異なる場合、例えば、対象データのサイズ(引数2)を768バイトとし、暗号化開始位置パラメータ(引数3)を17(%)とすると、暗号化開始位置は131バイト目となる。暗号化終了位置パラメータを90(%)とすると、暗号化終了位置は692バイト目となる(692バイト目まで暗号化する)。このように、同じ暗号化開始位置パラメータを指定しても、対象データのサイズによって暗号化開始位置が異なるので、仮に攻撃者が暗号化開始位置パラメータを不正に入手しても、暗号化開始位置を正確に知ることはできない。同様に、同じ暗号化終了位置パラメータを指定しても、対象データのサイズによって暗号化終了位置が異なるので、仮に攻撃者が暗号化終了位置パラメータを不正に入手しても、暗号化終了位置を正確に知ることはできない。すなわち、仮に攻撃者が暗号化開始位置及び暗号化終了位置パラメータを不正に入手しても、暗号化開始位置及び暗号化終了位置を正確に知ることはできない。
 暗号化部58は、暗号化開始・終了位置算出部57で算出した暗号化開始位置から平文ブロックを暗号化する。暗号化開始位置が暴露される可能性は極めて低いので、対象データに対するセキュリティが向上する。暗号化部58は、暗号化開始・終了位置算出部57で算出した暗号化終了位置で平文ブロックの暗号化を終了する。暗号化終了位置が暴露される可能性は極めて低いので、対象データに対するセキュリティが向上する。
 また、従来、一般的には、アプリケーションから暗号化のための関数を呼び出す際に、暗号鍵及び初期化ベクトルの値を関数の引数としてセットする。攻撃者は、セットされた暗号鍵及び初期化ベクトルの値をメモリから抜き出す可能性がある。しかし、本実施の形態では、暗号化部58(暗号化関数)では、ユーザは明示的に暗号鍵及び初期化ベクトルを指定することができない。具体的には、暗号化関数の引数として、暗号鍵及び初期化ベクトルの値ではなく、暗号化開始位置パラメータ及び暗号化終了位置パラメータを指定するようにしている。これにより、攻撃者が、暗号化関数の引数の値を見つけ出しても、暗号鍵及び初期化ベクトルの値と全く関係ないパラメータであるため、攻撃者が暗号鍵及び初期化ベクトルを探り出す手間を増大させることができる。
 復号の場合も暗号化の場合と同様である。復号開始・終了位置算出部77は、暗号化データのサイズに復号開始位置パラメータを乗算して、復号開始位置を算出することができる。なお、本実施の形態では、パディングが不要であるので、対象データのサイズと暗号化データのサイズは変わらない。例えば、復号開始位置パラメータを17(%)とし、暗号化データのサイズを384バイトとすると、復号開始位置は66バイト目となる。また、暗号化データのサイズを768バイトとすると、復号開始位置は131バイト目となる。このように、同じ復号開始位置パラメータを指定しても、暗号化データのサイズによって復号開始位置が異なるので、仮に攻撃者が復号開始位置パラメータを不正に入手しても、復号開始位置を正確に知ることはできない。
 復号開始・終了位置算出部77は、暗号化データのサイズに復号終了位置パラメータを乗算して、復号終了位置を算出することができる。例えば、復号終了位置パラメータを90(%)とし、暗号化データのサイズを384バイトとすると、復号終了位置は346バイト目となる(346バイト目まで復号する)。また、暗号化データのサイズを768バイトとすると、復号終了位置は692バイト目となる。このように、同じ復号終了位置パラメータを指定しても、暗号化データのサイズによって復号終了位置が異なるので、仮に攻撃者が復号終了位置パラメータを不正に入手しても、復号終了位置を正確に知ることはできない。
 復号部78は、復号開始・終了位置算出部77で算出した復号開始位置から暗号文ブロックを復号する。復号開始位置が暴露される可能性は極めて低いので、暗号文を復号する際のセキュリティが向上する。復号部78は、復号開始・終了位置算出部77で算出した復号終了位置で暗号文ブロックの復号を終了する。復号終了位置が暴露される可能性は極めて低いので、暗号文を復号する際のセキュリティが向上する。
 次に、本実施の形態ではパディングが不要であることについて説明する。
 図9は暗号化対象のサイズがブロック長の整数倍に等しい場合の暗号化の一例を示す模式図である。ブロック長を、例えば、16バイトとする。暗号化対象は、暗号化開始位置から暗号化終了位置までの平文である。暗号化対象のサイズが16バイトの整数倍(例えば、N倍)に等しい場合には、N個の平文ブロックからN個の暗号文ブロックを生成できる。
 図10は暗号化対象のサイズがブロック長の整数倍に等しくない場合の暗号化の一例を示す模式図である。暗号化対象のサイズが16バイトの整数倍(例えば、N倍)に等しくない場合には、暗号化対象の平文ブロックのうち、最後の平文ブロックのサイズは16バイト未満となり、16バイトになるようにパディングが必要となる。しかし、本実施の形態では、暗号化開始・終了位置算出部57は、暗号化開始位置と暗号化終了位置との差(サイズの差)が、16バイトの整数倍(例えば、N倍)となるように暗号化開始位置を(暗号化対象のサイズが小さくなる方向に)調整する。
 暗号化部58は、暗号化するデータサイズがブロック長の整数倍でない場合、データサイズがブロック長の整数倍になるように暗号化開始位置又は暗号化終了位置を調整して平文ブロックを暗号化することができる。
 例えば、暗号化開始位置から対象データの最後(最後まで暗号化する場合)までのデータサイズ、暗号化開始位置から暗号化終了位置までのデータサイズ、対象データの最初(最初から暗号化する場合)から暗号化終了位置までのデータサイズが、ブロック長の整数倍でない場合、データサイズがブロック長の整数倍になるように暗号化開始位置又は暗号化終了位置を調整して平文ブロックを暗号化できる。
 上述のように、本実施の形態では、パディング処理が不要である、CFBモードやOFBモードを使用しなくてもパディング処理が不要である。別言すれば、パディング処理が必要であるCBCモードを使用してもパディング処理を不要にすることができる。また、パディング処理が不要なため、暗号化の前後において、対象データ(対象ファイル)のサイズが変わらない。すなわち、データサイズ(ファイルサイズ)が暗号化によって増加しないので、データ(ファイル)の転送時の通信量や通信時間が増大することを抑制できる。
 本実施の形態では、暗号化データのサイズが対象データのサイズと同じとなる。これにより、暗号化後のデータ量が大きくならないため、好ましい。ただし、暗号化データのサイズが対象データのサイズと同じになることに限定するものではない。暗号化データのサイズより対象データのサイズをより大きくすることにより、攻撃者を惑わせるという意図で、増大させることが有効となるからである。具体的な実施の形態は、暗号済み各ブロックの間に、所定サイズのバイナリで、不定のバイナリ値のデータを差し込むものである。この形態により、攻撃者は復号時において、意味のないバイナリ値まで含んで、解釈することになるからである。
 また、暗号化開始位置又は暗号化終了位置を調整した後に、この1バイトから15バイト(ブロックサイズが16バイトの時の例)のデータ列に対して、ある所定のバイナリデータをXORした結果を採用してもよい。このような形態でも、パディング処理が不要であるばかりでなく、暗号化開始位置又は暗号化終了位置を、攻撃者に判別させにくくするという効果が得られる。
 上述では、暗号化開始位置又は暗号化終了位置を調整した後のあまり部分に、所定のバイナリデータをXORしたが、XORの対象は、対象データの全部でも一部でもよい。
 図11は本実施の形態の暗号化処理を画像ファイルに適用した場合の一例を示す模式図である。暗号化前の画像ファイルには、複数の人物が写っている。暗号化後の画像ファイルには、人物が特定できないように暗号化されている。本実施の形態では、対象ファイル全体を暗号化しないので、公開されているフォーマット情報を壊すことなく隠したい情報だけを暗号化できる。例えば、対象ファイルの先頭位置から暗号化開始位置までの非暗号化データにファイルのヘッダーが含まれている場合、ヘッダー部分を壊すことなく対象ファイルを暗号化できる。この結果、図11に示すように、対象ファイルが画像ファイルの場合、ビューワーなどのツールを用いて画像を見ることができる。
 すなわち、ビューワーで暗号化済みファイルを表示することが可能となる。従来のように画像ファイル全体を暗号化するとヘッダー情報も壊れてしまうので暗号化済の画像を見ることはできない。また、暗号指示したサイズ分だけ画像が暗号化されるため、元通りの画像は表示されず、暗号指示した部分だけ砂嵐のような画像が表示される。これにより、暗号化して画像ファイルを守りたいという目的を達成しつつクラッキング行為に対して、より高耐性の暗号化方法を提供できる。また、画像ファイルとしての価値をなくす目的を達成できればよい場合は、画像部分全体を暗号する必要なく、画像の一部に砂嵐のような画像を表示すれば元の画像の価値は喪失する。これにより、暗号化に要する時間を短縮できる。
 図12は暗号ライブラリを組み込んだアプリケーションのモジュールの一例を示す模式図である。暗号ライブラリは、暗号鍵生成部53、初期化ベクトル生成部54、暗号化開始・終了位置算出部57、及び暗号化部58それぞれの機能、暗号鍵生成部73、初期化ベクトル生成部74、復号開始・終了位置算出部77、及び復号部78それぞれの機能を含む。図12に示すように、アプリケーション(プログラム)は、例えば、4つのモジュールを含む。モジュール1、2、3、4それぞれは、例えば、初期化モジュール、描画前処理モジュール、暗号処理モジュール(メインモジュール)、エラー処理モジュールとすることができるが、これに限定されない。暗号処理モジュールでは、所定の処理が繰り返され、処理が終了するとアプリケーションは終了する。
 図6で例示した、文字列パラメータP1及び暗号鍵用数値P2の指定をモジュール1で行う。また、初期化ベクトル用数値P3の指定をモジュール2で行う。このように、文字列パラメータP1、暗号鍵用数値P2及び初期化ベクトル用数値P3の指定を暗号化および復号を行う関数を読み出す暗号処理モジュールで行うのではなく、暗号処理モジュールとは別のモジュール(暗号処理モジュールよりも前に実行されるモジュール)で行う。このように、暗号化や復号に必要となるパラメータが暗号処理モジュール(あるいは、関数を読み出す近傍)で指定されていないため、攻撃者がアプリケーションを解析しても、暗号化や復号に必要となるパラメータを探し出すことが困難となる。
 図13は本実施の形態の暗号化装置50及び復号装置70の他の構成の一例を示すブロック図である。暗号化装置50及び復号装置70それぞれは、コンピュータ100で実現することができる。コンピュータ100は、CPU101、揮発性メモリ102、通信部103、操作部104、不揮発性メモリ105、記録媒体読取部106、及び表示部107を備える。
 CPU101は、例えば、プロセッサ、あるいは複数のプロセッサコアを実装したマルチ・プロセッサなどで構成することができる。CPU101は、並列プロッセサでもよく、DSP(Digital Signal Processors)、FPGA(Field-Programmable Gate Arrays)などのハードウェアを組み合わせることによって構成してもよい。
 本実施の形態の暗号化装置50は、CPU101(プロセッサ)を備え、CPU101は、暗号鍵生成部53、初期化ベクトル生成部54、暗号化開始・終了位置算出部57、及び暗号化部58が行う処理を実行できる。例えば、本実施の形態の暗号化装置は、プロセッサを備え、当該プロセッサは、対象データの一部である平文ブロックを暗号化する。
 本実施の形態の復号装置70は、CPU101(プロセッサ)を備え、CPU101は、暗号鍵生成部73、初期化ベクトル生成部74、復号開始・終了位置算出部77、及び復号部78が行う処理を実行できる。例えば、本実施の形態の復号装置は、暗号化データを復号する復号装置であって、プロセッサを備え、暗号化データは、暗号化されていない非暗号化データと暗号化された暗号文ブロックとを含み、当該プロセッサは、暗号文ブロックを復号する。
 揮発性メモリ102は、RAM(Random Access Memory)、DRAM、SRAMなどで構成することができる。
 不揮発性メモリ105は、ROM、フラッシュメモリ、HDDなどの磁気記憶装置などで構成することができる。
 通信部103は、通信回路、通信ポートなどを備え、通信ネットワーク1を介してサーバ200との間でデータや情報の送受信を行うことができる。
 操作部104は、キーボード、マウス、タッチパッドなどを備え、表示部107に表示されたアイコンなどの操作、文字等の入力などを行うことができる。
 表示部107は、液晶パネル又は有機EL(Electro Luminescence)ディスプレイ等で構成することができる。
 記録媒体読取部106は、DVDなどの記録媒体に記録された情報(コンピュータプログラム、データなど)を読み取り、読み取った情報を不揮発性メモリ105に格納する。なお、記録媒体読取部106で読み取った情報をHDDに格納してもよい。
 記録媒体M1は、例えば、暗号化プログラム、復号プログラムを記録している。暗号化プログラムは、暗号鍵生成部53、初期化ベクトル生成部54、暗号化開始・終了位置算出部57、及び暗号化部58それぞれが行う処理をコンピュータに実行させることができる。暗号化プログラムは、後述の図14に示すような処理をコンピュータに実行させることができる。復号プログラムは、暗号鍵生成部73、初期化ベクトル生成部74、復号開始・終了位置算出部77、及び復号部78それぞれが行う処理をコンピュータに実行させることができる。復号プログラムは、後述の図15に示すような処理をコンピュータに実行させることができる。
 記録媒体M2は、暗号化データを記録している。暗号化データは、暗号化されていない非暗号化データと暗号化された暗号文ブロックとを含む。コンピュータ100は、非暗号化データの全部又は一部の情報に基づいて、ブロック暗号のアルゴリズムが復号の際に必要とする平文生成のための秘匿すべき変数を生成する処理を行い、生成された変数を用いて、暗号文ブロックを復号することができる。
 暗号化データの復号処理は、暗号化データの全部ではなく、暗号化データの一部(1又は複数の暗号文ブロックで構成される)を復号する。攻撃者が、暗号文(暗号化データ)を入手できたとしても、暗号化データ全体が暗号化されていないので、攻撃者は、暗号化データの暗号処理開始位置を求めなくてはならない。すなわち、攻撃者は、暗号化データのどの部分が暗号化されているのかを知らない限り、暗号文を復号できない。これにより、暗号文を復号する際のセキュリティを向上させることができる。
 また、図13に示すように、コンピュータ100は、記録媒体M1に記録された暗号化プログラム及び復号プログラムと同様の暗号化プログラム及び復号プログラムを、通信部103を介してサーバ200から取得(例えば、ダウンロード)することができる。
 図14は暗号化装置50による暗号化の処理手順の一例を示すフローチャートである。以下では、便宜上、処理の主体を制御部51として説明する。制御部51は、対象データ(対象ファイル)を取得し(S11)、文字列P1、暗号鍵用数値P2、初期化ベクトル用数値P3の各パラメータを取得する(S12)。制御部51は、対象データの先頭部分の文字列(非暗号化データ)を取得する(S13)。
 制御部51は、暗号化開始位置パラメータ、暗号化終了位置パラメータを取得する(S14)。制御部51は、文字列P1、暗号鍵用数値P2、先頭部分の文字列に基づいて暗号鍵(共通鍵)を生成する(S15)。制御部51は、文字列P1、初期化ベクトル用数値P3、先頭部分の文字列に基づいて初期化ベクトルを生成する(S16)。対象データ毎に異なる暗号鍵及び初期化ベクトルを生成する場合には、対象データの先頭部分の文字列を用いることができるが、対象データ毎に異なる暗号鍵及び初期化ベクトルを生成しない場合には、対象データの先頭部分の文字列を用いなくてもよい。
 制御部51は、暗号化開始位置パラメータ、暗号化終了位置パラメータに基づいて、対象データの暗号化開始位置、暗号化終了位置を算出し(S17)、暗号化する部分(暗号化開始位置から暗号化終了位置までのデータサイズ)が16バイトの整数倍であるか否かを判定する(S18)。
 暗号化する部分が16バイトの整数倍でない場合(S18でNO)、制御部51は、暗号化する部分が16バイトの整数倍になるように、暗号開始位置を調整し(S19)、後述のステップS20の処理を行う。なお、図3に示す各ケースに応じて暗号化終了位置を調整してもよい。暗号化する部分が16バイトの整数倍である場合(S18でYES)、制御部51は、暗号化対象の平文ブロックを暗号化して暗号文ブロックを生成し(S20)、暗号化データを出力し(S21)、処理を終了する。
 図15は復号装置70による複合の処理手順の一例を示すフローチャートである。以下では、便宜上、処理の主体を制御部71として説明する。制御部71は、暗号化データを取得し(S31)、文字列P1、暗号鍵用数値P2、初期化ベクトル用数値P3の各パラメータを取得する(S32)。制御部71は、暗号化データの先頭部分の文字列(非暗号化データ)を取得する(S33)。
 制御部71は、復号開始位置パラメータ、復号終了位置パラメータを取得する(S34)。制御部71は、文字列P1、暗号鍵用数値P2、先頭部分の文字列に基づいて暗号鍵(共通鍵)を生成する(S35)。制御部71は、文字列P1、初期化ベクトル用数値P3、先頭部分の文字列に基づいて初期化ベクトルを生成する(S36)。
 制御部71は、復号開始位置パラメータ、復号終了位置パラメータに基づいて、暗号化データの復号開始位置、復号終了位置を算出する(S37)。制御部71は、暗号文ブロックを復号し(S38)、復号して得られた対象データ(対象ファイル)を出力し(S39)、処理を終了する。
 本実施の形態の暗号化装置は、対象データをブロック暗号により暗号化する暗号化装置であって、前記対象データの平文ブロックの整数倍を暗号化し、暗号化しない対象データは平文のまま残す暗号化部と、前記暗号化部で暗号化しない非暗号化データの全部又は一部の情報に基づいて、ブロック暗号のアルゴリズムが暗号化の際に必要とする暗号文生成のための秘匿すべき変数を生成する変数生成部とを備える。
 本実施の形態の暗号化装置は、対象データをブロック暗号により暗号化する暗号化装置であって、プロセッサを備え、前記プロセッサは、前記対象データの平文ブロックの整数倍を暗号化し、暗号化しない対象データは平文のまま残し、暗号化しない非暗号化データの全部又は一部の情報に基づいて、ブロック暗号のアルゴリズムが暗号化の際に必要とする暗号文生成のための秘匿すべき変数を生成する。
 本実施の形態のコンピュータプログラムは、コンピュータに、対象データを取得する処理と、取得した対象データの平文ブロックの整数倍を暗号化し、暗号化しない対象データを平文のまま残す処理と、暗号化しない非暗号化データの全部又は一部の情報に基づいて、ブロック暗号のアルゴリズムが暗号化の際に必要とする暗号文生成のための秘匿すべき変数を生成する処理とを実行させる。
 本実施の形態の暗号化方法は、対象データをブロック暗号により暗号化する暗号化方法であって、前記対象データの平文ブロックの整数倍を暗号化し、暗号化しない対象データを平文のまま残し、暗号化しない非暗号化データの全部又は一部の情報に基づいて、ブロック暗号のアルゴリズムが暗号化の際に必要とする暗号文生成のための秘匿すべき変数を生成する。
 本実施の形態の記録媒体は、コンピュータプログラムを記録するコンピュータでの読み取りが可能な非一時的な記録媒体であって、前記コンピュータプログラムは、コンピュータに、対象データを取得する処理と、取得した対象データの平文ブロックの整数倍を暗号化し、暗号化しない対象データを平文のまま残す処理と、暗号化しない非暗号化データの全部又は一部の情報に基づいて、ブロック暗号のアルゴリズムが暗号化の際に必要とする暗号文生成のための秘匿すべき変数を生成する処理とを実行させる。
 暗号化部は、対象データの平文ブロックの整数倍を暗号化し、暗号化しない対象データを平文のまま残す。対象データは、暗号化の対象となるデータであり、例えば、ファイルや通信プロトコルなどを含む。暗号化部は、ブロック暗号アルゴリズムを使用し、例えば、CBC(Cipher Block Chaining)モードなどの一つのモードだけを使用して暗号化できる。CBCモードであれば、攻撃者が平文と暗号文の両方を取得して同じ暗号文を繰り返し送信するような再生攻撃に対するセキュリティが向上する。複数のモードを組み合わせる必要もないので、複数のモードを用いる場合に比べて、アルゴリズムが簡単になりプログラムのサイズも小さくなり、CPUパワーやメモリ容量も少なくすることができ処理労力が軽減する。暗号化しない平文を残した状態(すなわち、対象データの全体を暗号化しない)で平文ブロックの整数倍を暗号化するので、暗号化の際のパディングは不要となる。
 暗号化部は、対象データの全部ではなく、対象データの一部(1又は複数の平文ブロックで構成される)を暗号化する。攻撃者が、暗号文(暗号化後の対象データ)を入手できたとしても、対象データ全体が暗号化されていないので、攻撃者は、対象データの暗号処理開始位置を求めなくてはならない。すなわち、攻撃者は、対象データのどの部分が暗号化されているのかを知らない限り、暗号文を復号できない。これにより、暗号化の対象データに対するセキュリティを向上させることができる。
 変数生成部は、非暗号化データの全部又は一部の情報に基づいて、ブロック暗号のアルゴリズムが暗号化の際に必要とする暗号文生成のための秘匿すべき変数を生成する。変数は、例えば、暗号鍵、初期化ベクトルである。非暗号化データは、平文であり、対象データが、例えば、フォーマットが公開されているファイルの場合、非暗号化データとして、ヘッダーの全部又は一部、あるいはフッターなど使用できる。攻撃者は、変数生成に使用する非暗号化データ自身、変数生成のための所定の演算や関数などのアルゴリズムを知らない限り、変数を生成することができないので、事実上、変数が暴露される可能性は極めて低い。
 本実施の形態の暗号化装置は、暗号化開始位置パラメータに基づいて暗号化開始位置を算出する暗号化開始位置算出部を備え、前記暗号化部は、前記暗号化開始位置算出部で算出した暗号化開始位置から前記平文ブロックを暗号化する。
 暗号化開始位置算出部は、暗号化開始位置パラメータに基づいて暗号化開始位置を算出する。暗号化開始位置パラメータは、ユーザが指定でき、値は数値、単位は%とすることができるが、これに限定されない。暗号化開始位置算出部は、対象データのサイズに暗号化開始位置パラメータを乗算して、暗号化開始位置を算出することができる。例えば、暗号化開始位置パラメータを17(%)とし、対象データのサイズを384バイトとすると、暗号化開始位置は66バイト目となる。また、対象データのサイズを768バイトとすると、暗号化開始位置は131バイト目となる。このように、同じ暗号化開始位置パラメータを指定しても、対象データのサイズによって暗号化開始位置が異なるので、仮に攻撃者が暗号化開始位置パラメータを不正に入手しても、暗号化開始位置を正確に知ることはできない。
 暗号化部は、暗号化開始位置算出部で算出した暗号化開始位置から平文ブロックを暗号化する。暗号化開始位置が暴露される可能性は極めて低いので、対象データに対するセキュリティが向上する。
 本実施の形態の暗号化装置は、暗号化終了位置パラメータに基づいて暗号化終了位置を算出する暗号化終了位置算出部を備え、前記暗号化部は、前記暗号化終了位置算出部で算出した暗号化終了位置で前記平文ブロックの暗号化を終了する。
 暗号化終了位置算出部は、暗号化終了位置パラメータに基づいて暗号化終了位置を算出する。暗号化終了位置パラメータは、ユーザが指定でき、値は数値、単位は%とすることができるが、これに限定されない。暗号化終了位置算出部は、対象データのサイズに暗号化終了位置パラメータを乗算して、暗号化終了位置を算出することができる。例えば、暗号化終了位置パラメータを90(%)とし、対象データのサイズを384バイトとすると、暗号化終了位置は346バイト目となる(346バイト目まで暗号化する)。また、対象データのサイズを768バイトとすると、暗号化終了位置は692バイト目となる。このように、同じ暗号化終了位置パラメータを指定しても、対象データのサイズによって暗号化終了位置が異なるので、仮に攻撃者が暗号化終了位置パラメータを不正に入手しても、暗号化終了位置を正確に知ることはできない。
 暗号化部は、暗号化終了位置算出部で算出した暗号化終了位置で平文ブロックの暗号化を終了する。暗号化終了位置が暴露される可能性は極めて低いので、対象データに対するセキュリティが向上する。
 本実施の形態の暗号化装置において、暗号化部は、暗号化するデータサイズがブロック長の整数倍でない場合、前記データサイズがブロック長の整数倍になるように暗号化開始位置又は暗号化終了位置を調整して前記平文ブロックを暗号化する。
 例えば、暗号化開始位置から対象データの最後(最後まで暗号化する場合)までのデータサイズ、暗号化開始位置から暗号化終了位置までのデータサイズ、対象データの最初(最初から暗号化する場合)から暗号化終了位置までのデータサイズが、ブロック長の整数倍でない場合、データサイズがブロック長の整数倍になるように暗号化開始位置又は暗号化終了位置を調整して平文ブロックを暗号化する。
 これにより、パディング処理が不要となる。また、パディング処理が不要なため、暗号化の前後において、対象データ(対象ファイル)のサイズが変わらない。すなわち、データサイズ(ファイルサイズ)が暗号化によって増加しないので、データ(ファイル)の転送時の通信量や通信時間が増大することを抑制できる。
 本実施の形態の暗号化装置は、前記暗号化部で暗号化した結果の暗号化データのサイズが、元の対象データのサイズと変わらない。
 暗号化部で暗号化した結果の暗号化データのサイズが、元の対象データのサイズと変わらない。データサイズ(ファイルサイズ)が暗号化によって増加しないので、データ(ファイル)の転送時の通信量や通信時間が増大することを抑制できる。
 本実施の形態の暗号化装置において、非暗号化データは、対象データ内で連続したデータ又は離散したデータである。
 非暗号化データは、連続したデータでもよい。例えば、対象データが、フォーマットが公開されているファイルの場合、非暗号化データとして、ヘッダー部分を用いることができる。また、非暗号化データは、離散したデータでもよい。例えば、非暗号化データは、ヘッダー部分とフッター部分のように、データ部分で複数分離された部分でもよい。
 本実施の形態の暗号化装置は、前記変数として暗号鍵を生成する暗号鍵生成部を備え、前記暗号化部は、前記暗号鍵生成部で生成した暗号鍵を用いて前記平文ブロックを暗号化する。
 暗号鍵生成部は、対象データのうち暗号化部で暗号化しない非暗号化データを用いて変数としての暗号鍵を生成する。暗号鍵は暗号化及び復号で使用する共通鍵である。非暗号化データは、平文であり、対象データが、例えば、フォーマットが公開されているファイルの場合、非暗号化データとして、ヘッダーの全部又は一部、あるいはフッターなど使用できる。暗号鍵生成は、所定の演算や関数を用いることができ、復号の際も暗号化の場合と同じ演算や関数を用いればよい。攻撃者は、暗号鍵生成に使用する非暗号化データ自身、暗号鍵生成のための所定の演算や関数などのアルゴリズムを知らない限り、暗号鍵を生成することができないので、事実上、暗号鍵が暴露される可能性は極めて低い。また、対象データ毎に非暗号化データが異なれば、対象データ毎に異なる暗号鍵を生成することができ、対象データに対するセキュリティが向上する。
 暗号化部は、暗号鍵生成部で生成した暗号鍵を用いて平文ブロックを暗号化する。対象データのうち、暗号化する部分(対象データの一部)を、平文ブロックB1、B2、…、Bnとする。ブロック暗号のモードが、CBCモードの場合、1つ前の暗号文ブロックを次の平文ブロックの暗号化に使用する。具体的には、平文ブロックと1つ前の暗号文ブロックのXOR演算を行い、XOR演算結果を暗号鍵で暗号化する。このとき、最初の平文ブロックには「1つ前の暗号文ブロック」が存在しないので、初期化ベクトルを用いる。暗号化によって、暗号文ブロックE1、E2、…、Enが生成され、仮に平文ブロックの内容が同じでも、暗号文ブロックE1、E2、…、Enは、ランダム性が連鎖し、それぞれ異なる値となり、再生攻撃に対するセキュリティが向上する。
 本実施の形態の暗号化装置は、前記変数として最初の平文ブロックを暗号化する際に使用する初期化ベクトルを生成する初期化ベクトル生成部を備え、前記暗号化部は、前記初期化ベクトル生成部で生成した初期化ベクトルを用いて前記最初の平文ブロックを暗号化する。
 初期化ベクトル生成部は、対象データのうち暗号化部で暗号化しない非暗号化データを用いて、最初の平文ブロックを暗号化する際に使用する変数としての初期化ベクトルを生成する。非暗号化データは、平文であり、対象データが、例えば、フォーマットが公開されているファイルの場合、非暗号化データとして、ヘッダーの全部又は一部、あるいはフッターなど使用できる。初期化ベクトル生成は、所定の演算や関数を用いることができ、復号の際も暗号化の場合と同じ演算や関数を用いればよい。攻撃者は、初期化ベクトル生成に使用する非暗号化データ自身、初期化ベクトル生成のための所定の演算や関数などのアルゴリズムを知らない限り、初期化ベクトルを生成することができないので、事実上、初期化ベクトルが暴露される可能性は極めて低い。また、対象データ毎に非暗号化データが異なれば、対象データ毎に異なる初期化ベクトルを生成することができ、対象データに対するセキュリティが向上する。
 暗号化部は、初期化ベクトル生成部で生成した初期化ベクトルを用いて最初の平文ブロックを暗号化する。ブロック暗号のモードをCBCモードとし、最初の平文ブロックをE1とし、初期化ベクトルをIVとすると、暗号化部は、平文ブロックE1と初期化ベクトルIVのXOR演算を行い、XOR演算結果を暗号鍵で暗号化して最初の暗号文ブロックE1を生成することができる。
 本実施の形態の暗号化装置において、前記変数生成部は、さらに、パラメータ及び識別情報の少なくとも1つ、または両方を用いて、ブロック暗号のアルゴリズムが暗号化の際に必要とする暗号文生成のための秘匿すべき変数を生成することにより、対象データ毎に異なる変数によりブロック暗号が可能となる。
 パラメータは、ユーサ毎に使用するパラメータであり、例えば、変数生成部を暗号ライブラリの機能として提供する場合、暗号ライブラリの関数内設定文字列とすることができる。また、識別情報は、ユーザ毎に提供する暗号ライブラリに埋め込まれた識別子であり、例えば、暗号化処理を行うユーザを含む特定のグループ、ユーザが所属する部署、あるいは企業などを識別するために固有に割り当てられた識別子とすることができる。
 非暗号化データの情報の他に、パラメータ及び識別情報の少なくとも1つ、または両方を用いて変数を生成することにより、攻撃者は、パラメータ又は識別情報を知らないと、さらに変数を生成することが困難となり、変数が暴露される可能性はさらに低下する。また、識別情報を用いることにより、例えば、ユーザが属する企業が異なれば、たとえ非暗号化データが同一であっても、異なる変数を生成できるので、暗号ライブラリを異なる企業に提供しても、同じ変数が生成されることを防止できる。また、対象データ毎に異なる変数によりブロック暗号が可能となる。
 本実施の形態の復号装置は、ブロック暗号に基づく暗号化データを復号する復号装置であって、前記暗号化データは、暗号文ブロックと暗号化されていない非暗号化データとを含み、前記暗号化データの暗号文ブロックの整数倍を復号し、前記非暗号化データを平文のまま残す復号部と、前記復号部で復号しない非暗号化データの全部又は一部の情報に基づいて、ブロック暗号のアルゴリズムが復号の際に必要とする平文生成のための秘匿すべき変数を生成する変数生成部とを備える。
 本実施の形態の復号装置は、ブロック暗号に基づく暗号化データを復号する復号装置であって、プロセッサを備え、前記暗号化データは、暗号文ブロックと暗号化されていない非暗号化データとを含み、前記プロセッサは、前記暗号化データの暗号文ブロックの整数倍を復号し、復号しない暗号化データを平文のまま残し、復号しない非暗号化データの全部又は一部の情報に基づいて、ブロック暗号のアルゴリズムが復号の際に必要とする平文生成のための秘匿すべき変数を生成する。
 本実施の形態のコンピュータプログラムは、コンピュータに、暗号文ブロックと暗号化されていない非暗号化データとを含む暗号化データを取得する処理と、取得した暗号化データの暗号文ブロックの整数倍を復号し、復号しない暗号化データを平文のまま残す処理と、復号しない非暗号化データの全部又は一部の情報に基づいて、ブロック暗号のアルゴリズムが復号の際に必要とする平文生成のための秘匿すべき変数を生成する処理とを実行させる。
 本実施の形態の復号方法は、ブロック暗号に基づく暗号化データを復号する復号方法であって、前記暗号化データは、暗号文ブロックと暗号化されていない非暗号化データとを含み、前記暗号化データの暗号文ブロックの整数倍を復号し、復号しない暗号化データを平文のまま残し、復号しない非暗号化データの全部又は一部の情報に基づいて、ブロック暗号のアルゴリズムが復号の際に必要とする平文生成のための秘匿すべき変数を生成する。
 本実施の形態の記録媒体は、コンピュータプログラムを記録するコンピュータでの読み取りが可能な非一時的な記録媒体であって、前記コンピュータプログラムは、コンピュータに、暗号文ブロックと暗号化されていない非暗号化データとを含む暗号化データを取得する処理と、取得した暗号化データの暗号文ブロックの整数倍を復号し、復号しない暗号化データを平文のまま残す処理と、復号しない非暗号化データの全部又は一部の情報に基づいて、ブロック暗号のアルゴリズムが復号の際に必要とする平文生成のための秘匿すべき変数を生成する処理とを実行させる。
 暗号化データは、暗号文ブロックと暗号化されていない非暗号化データとを含む。暗号化データは、例えば、ファイルや通信プロトコルなどの一部が暗号化されたデータを含む。
 復号部は、暗号化データの暗号文ブロックの整数倍を復号し、非暗号化データを平文のまま残す。復号は、ブロック暗号アルゴリズムを使用し、例えば、CBC(Cipher Block Chaining)モードなどの一つのモードだけを使用して復号できる。CBCモードであれば、攻撃者が平文と暗号文の両方を取得して同じ暗号文を繰り返し送信するような再生攻撃に対するセキュリティが向上する。複数のモードを組み合わせる必要もないので、複数のモードを用いる場合に比べて、アルゴリズムが簡単になりプログラムのサイズも小さくなり、CPUパワーやメモリ容量も少なくすることができ処理労力が軽減する。
 復号部は、暗号化データの全部ではなく、暗号化データの一部(1又は複数の暗号文ブロックで構成される)を復号する。攻撃者が、暗号文(暗号化データ)を入手できたとしても、暗号化データ全体が暗号化されていないので、攻撃者は、暗号化データの暗号処理開始位置を求めなくてはならない。すなわち、攻撃者は、暗号化データのどの部分が暗号化されているのかを知らない限り、暗号文を復号できない。これにより、暗号文を復号する際のセキュリティを向上させることができる。
 変数生成部は、非暗号化データの全部又は一部の情報に基づいて、ブロック暗号のアルゴリズムが復号の際に必要とする平文生成のための秘匿すべき変数を生成する。変数は、例えば、暗号鍵、初期化ベクトルである。非暗号化データは、平文であり、対象データが、例えば、フォーマットが公開されているファイルの場合、非暗号化データとして、ヘッダーの全部又は一部、あるいはフッターなど使用できる。攻撃者は、変数生成に使用する非暗号化データ自身、変数生成のための所定の演算や関数などのアルゴリズムを知らない限り、変数を生成することができないので、事実上、変数が暴露される可能性は極めて低い。
 本実施の形態の復号装置は、復号開始位置パラメータに基づいて復号開始位置を算出する復号開始位置算出部を備え、前記復号部は、前記復号開始位置算出部で算出した復号開始位置から前記暗号文ブロックを復号する。
 復号開始位置算出部は、復号開始位置パラメータに基づいて復号開始位置を算出する。復号開始位置パラメータは、暗号化開始位置パラメータと同一である。復号開始位置パラメータは、ユーザが指定でき、値は数値、単位は%とすることができるが、これに限定されない。復号開始位置算出部は、暗号化データのサイズ(対象データのサイズと同じ)に復号開始位置パラメータを乗算して、復号開始位置を算出することができる。例えば、復号開始位置パラメータを17(%)とし、暗号化データのサイズを384バイトとすると、復号開始位置は66バイト目となる。また、暗号化データのサイズを768バイトとすると、復号開始位置は131バイト目となる。このように、同じ復号開始位置パラメータを指定しても、暗号化データのサイズによって復号開始位置が異なるので、仮に攻撃者が復号開始位置パラメータを不正に入手しても、復号開始位置を正確に知ることはできない。
 復号部は、復号開始位置算出部で算出した復号開始位置から暗号文ブロックを復号する。復号開始位置が暴露される可能性は極めて低いので、暗号文を復号する際のセキュリティが向上する。
 本実施の形態の復号装置は、復号終了位置パラメータに基づいて復号終了位置を算出する復号終了位置算出部を備え、前記復号部は、前記復号終了位置算出部で算出した復号終了位置で前記暗号文ブロックの復号を終了する。
 復号終了位置算出部は、復号終了位置パラメータに基づいて復号終了位置を算出する。復号終了位置パラメータは、暗号化終了位置パラメータと同一である。復号終了位置パラメータは、ユーザが指定でき、値は数値、単位は%とすることができるが、これに限定されない。復号終了位置算出部は、暗号化データのサイズに復号終了位置パラメータを乗算して、復号終了位置を算出することができる。例えば、復号終了位置パラメータを90(%)とし、暗号化データのサイズを384バイトとすると、復号終了位置は346バイト目となる(346バイト目まで復号する)。また、暗号化データのサイズを768バイトとすると、復号終了位置は692バイト目となる。このように、同じ復号終了位置パラメータを指定しても、暗号化データのサイズによって復号終了位置が異なるので、仮に攻撃者が復号終了位置パラメータを不正に入手しても、復号終了位置を正確に知ることはできない。
 復号部は、復号終了位置算出部で算出した復号終了位置で暗号文ブロックの復号を終了する。復号終了位置が暴露される可能性は極めて低いので、暗号文を復号する際のセキュリティが向上する。
 本実施の形態の復号装置において、前記復号部は、復号するデータサイズがブロック長の整数倍でない場合、前記データサイズがブロック長の整数倍になるように復号開始位置又は復号終了位置を調整して前記暗号文ブロックを復号する。
 例えば、復号開始位置から暗号化データの最後(最後まで復号する場合)までのデータサイズ、復号開始位置から復号終了位置までのデータサイズ、暗号化データの最初(最初から復号する場合)から復号終了位置までのデータサイズが、ブロック長の整数倍でない場合、データサイズがブロック長の整数倍になるように復号開始位置又は復号終了位置を調整して暗号文ブロックを復号する。
 これにより、パディング処理が不要となる。また、パディング処理が不要なため、暗号化の前後において、対象データ(対象ファイル)のサイズが変わらない。すなわち、データサイズ(ファイルサイズ)が暗号化によって増加しないので、データ(ファイル)の転送時の通信量や通信時間が増大することを抑制できる。
 本実施の形態の復号装置は、前記復号部で復号した結果の復号後のデータのサイズが、復号前の暗号化データのサイズと変わらない。
 復号部で復号した結果の復号後のデータのサイズが、復号前の暗号化データのサイズと変わらない。データサイズ(ファイルサイズ)が暗号化によって増加しないので、データ(ファイル)の転送時の通信量や通信時間が増大することを抑制できる。
 本実施の形態の復号装置において、前記非暗号化データは、前記暗号化データ内で連続したデータ又は離散したデータである。
 非暗号化データは、連続したデータでもよい。例えば、対象データが、フォーマットが公開されているファイルの場合、非暗号化データとして、ヘッダー部分を用いることができる。また、非暗号化データは、離散したデータでもよい。例えば、非暗号化データは、ヘッダー部分とフッター部分のように、データ部分で複数分離された部分でもよい。
 本実施の形態の復号装置は、前記変数として暗号鍵を生成する暗号鍵生成部を備え、前記復号部は、前記暗号鍵生成部で生成した暗号鍵を用いて前記暗号文ブロックを復号する。
 暗号鍵生成部は、非暗号化データを用いて変数としての暗号鍵を生成する。非暗号化データは、暗号化前の対象データのうち、暗号化装置(暗号化部)で暗号化の対象となっていない部分のデータである。非暗号化データは、平文であり、対象データが、例えば、フォーマットが公開されているファイルの場合、非暗号化データは、ヘッダーの全部又は一部、あるいはフッターなどの暗号化されていないデータである。暗号鍵は暗号化及び復号で使用する共通鍵である。暗号鍵生成は、所定の演算や関数を用いることができ、暗号化の場合と同じ演算や関数を用いる。攻撃者は、暗号鍵生成に使用する非暗号化データ自身、暗号鍵生成のための所定の演算や関数などのアルゴリズムを知らない限り、暗号鍵を生成することができないので、事実上、暗号鍵が暴露される可能性は極めて低い。また、対象データ毎に非暗号化データが異なれば、対象データ毎に異なる暗号鍵を生成することができ、暗号文を復号する際のセキュリティが向上する。
 復号部は、暗号鍵生成部で生成した暗号鍵を用いて暗号文ブロックを復号する。暗号化データのうち、復号する部分(暗号化データの一部)を、暗号文ブロックE1、E2、…、Enとする。ブロック暗号のモードが、CBCモードの場合、1つ前の暗号文ブロックを次の暗号文ブロックの復号に使用する。具体的には、暗号文ブロックを暗号鍵で復号し、復号した結果と1つ前の暗号文ブロックのXOR演算を行って平文ブロックを生成する。このとき、最初の暗号文ブロックには「1つ前の暗号文ブロック」が存在しないので、初期化ベクトルを用いる。復号によって、平文ブロックB1、B2、…、Bnが生成される。
 本実施の形態の復号装置は、前記変数として最初の暗号文ブロックを復号する際に使用する初期化ベクトルを生成する初期化ベクトル生成部を備え、前記復号部は、前記初期化ベクトル生成部で生成した初期化ベクトルを用いて前記最初の暗号文ブロックを復号する。
 初期化ベクトル生成部は、非暗号化データを用いて、最初の暗号文ブロックを復号する際に使用する変数としての初期化ベクトルを生成する。非暗号化データは、暗号化前の対象データのうち、暗号化装置(暗号化部)で暗号化の対象となっていない部分のデータである。非暗号化データは、平文であり、対象データが、例えば、フォーマットが公開されているファイルの場合、非暗号化データは、ヘッダーの全部又は一部、あるいはフッターなどの暗号化されていないデータである。初期化ベクトル生成は、所定の演算や関数を用いることができ、暗号化の場合と同じ演算や関数を用いる。攻撃者は、初期化ベクトル生成に使用する非暗号化データ自身、初期化ベクトル生成のための所定の演算や関数などのアルゴリズムを知らない限り、初期化ベクトルを生成することができないので、事実上、初期化ベクトルが暴露される可能性は極めて低い。また、対象データ毎に非暗号化データが異なれば、対象データ毎に異なる初期化ベクトルを生成することができ、暗号文を復号する際のセキュリティが向上する。
 復号部は、初期化ベクトル生成部で生成した初期化ベクトルを用いて最初の暗号文ブロックを復号する。ブロック暗号のモードをCBCモードとし、最初の暗号文ブロックをE1とし、初期化ベクトルをIVとすると、復号部は、暗号文ブロックE1を暗号鍵で復号し、復号結果と初期化ベクトルIVのXOR演算を行って最初の平文ブロックB1を生成することができる。
 本実施の形態の復号装置において、前記変数生成部は、さらに、パラメータ及び識別情報の少なくとも1つ、または両方を用いて、ブロック暗号のアルゴリズムが復号の際に必要とする平文生成のための秘匿すべき変数を生成する。
 パラメータは、ユーザ毎に使用するパラメータであり、例えば、変数生成部を暗号ライブラリの機能として提供する場合、暗号ライブラリの関数内設定文字列とすることができる。また、識別情報は、ユーザ毎に提供する暗号ライブラリに埋め込まれた識別子であり、例えば、暗号化処理を行うユーザを含む特定のグループ、ユーザが所属する部署、あるいは企業などを識別するために固有に割り当てられた識別子とすることができる。
 非暗号化データの情報の他に、パラメータ及び識別情報の少なくとも1つ、または両方を用いて変数を生成することにより、攻撃者は、パラメータ又は識別情報を知らないと、さらに変数を生成することが困難となり、変数が暴露される可能性はさらに低下する。また、識別情報を用いることにより、例えば、ユーザが属する企業が異なれば、たとえ非暗号化データが同一であっても、異なる変数を生成できるので、暗号ライブラリを異なる企業に提供しても、同じ変数が生成されることを防止できる。
 本実施の形態のデータ構造は、復号部を備えるコンピュータに用いられ、ブロック暗号に基づく暗号化データのデータ構造であって、前記暗号化データは、暗号化されていない非暗号化データと暗号化された暗号文ブロックとを含み、前記非暗号化データの全部又は一部の情報に基づいて、ブロック暗号のアルゴリズムが復号の際に必要とする平文生成のための秘匿すべき変数を生成する処理と、生成された変数を用いて、前記復号部が前記暗号文ブロックの整数倍を復号し、復号しない暗号化データを平文のまま残す処理とに用いられる。
 本実施の形態の記録媒体は、コンピュータに用いられる暗号化データを記録するコンピュータでの読み取りが可能な非一時的な記録媒体であって、前記暗号化データは、暗号化されていない非暗号化データと暗号化された暗号文ブロックとを含み、前記非暗号化データの全部又は一部の情報に基づいて、ブロック暗号のアルゴリズムが復号の際に必要とする平文生成のための秘匿すべき変数を生成する処理と、生成された変数を用いて、前記復号部が前記暗号文ブロックの整数倍を復号し、復号しない暗号化データを平文のまま残す処理とに用いられる。
 データ構造は、暗号化データのデータ構造であり、暗号化データは、暗号化されていない非暗号化データと暗号化された暗号文ブロックとを含む。コンピュータは、非暗号化データの全部又は一部の情報に基づいて、ブロック暗号のアルゴリズムが復号の際に必要とする平文生成のための秘匿すべき変数を生成する処理を行い、復号部は、生成された変数を用いて、暗号文ブロックの整数倍を復号し、復号しない暗号化データを平文のまま残す。
 復号部は、暗号化データの全部ではなく、暗号化データの一部(1又は複数の暗号文ブロックで構成される)を復号する。攻撃者が、暗号文(暗号化データ)を入手できたとしても、暗号化データ全体が暗号化されていないので、攻撃者は、暗号化データの暗号処理開始位置を求めなくてはならない。すなわち、攻撃者は、暗号化データのどの部分が暗号化されているのかを知らない限り、暗号文を復号できない。これにより、暗号文を復号する際のセキュリティを向上させることができる。
 1 通信ネットワーク
 50 暗号化装置
 51 制御部
 52 データ取得部
 53 暗号鍵生成部
 54 初期化ベクトル生成部
 55 記憶部
 56 データ出力部
 57 暗号化開始・終了位置算出部
 58 暗号化部
 70 復号装置
 71 制御部
 72 データ取得部
 73 暗号鍵生成部
 74 初期化ベクトル生成部
 75 記憶部
 76 データ出力部
 77 復号開始・終了位置算出部
 78 復号部
 100 コンピュータ
 101 CPU
 102 揮発性メモリ
 103 通信部
 104 操作部
 105 不揮発性メモリ
 106 記録媒体読取部
 107 表示部
 200 サーバ
 

Claims (25)

  1.  対象データをブロック暗号により暗号化する暗号化装置であって、
     前記対象データの平文ブロックの整数倍を暗号化し、暗号化しない対象データは平文のまま残す暗号化部と、
     前記暗号化部で暗号化しない非暗号化データの全部又は一部の情報に基づいて、ブロック暗号のアルゴリズムが暗号化の際に必要とする暗号文生成のための秘匿すべき変数を生成する変数生成部と
     を備える暗号化装置。
  2.  暗号化開始位置パラメータに基づいて暗号化開始位置を算出する暗号化開始位置算出部を備え、
     前記暗号化部は、
     前記暗号化開始位置算出部で算出した暗号化開始位置から前記平文ブロックを暗号化する請求項1に記載の暗号化装置。
  3.  暗号化終了位置パラメータに基づいて暗号化終了位置を算出する暗号化終了位置算出部を備え、
     前記暗号化部は、
     前記暗号化終了位置算出部で算出した暗号化終了位置で前記平文ブロックの暗号化を終了する請求項1又は請求項2に記載の暗号化装置。
  4.  前記暗号化部は、
     暗号化するデータサイズがブロック長の整数倍でない場合、前記データサイズがブロック長の整数倍になるように暗号化開始位置又は暗号化終了位置を調整して前記平文ブロックを暗号化する請求項2又は請求項3に記載の暗号化装置。
  5.  前記暗号化部で暗号化した結果の暗号化データのサイズが、元の対象データのサイズと変わらない請求項1から請求項4のいずれか一項に記載の暗号化装置。
  6.  前記非暗号化データは、前記対象データ内で連続したデータ又は離散したデータである請求項1から請求項5のいずれか一項に記載の暗号化装置。
  7.  前記変数として暗号鍵を生成する暗号鍵生成部を備え、
     前記暗号化部は、
     前記暗号鍵生成部で生成した暗号鍵を用いて前記平文ブロックを暗号化する請求項1から請求項6のいずれか一項に記載の暗号化装置。
  8.  前記変数として最初の平文ブロックを暗号化する際に使用する初期化ベクトルを生成する初期化ベクトル生成部を備え、
     前記暗号化部は、
     前記初期化ベクトル生成部で生成した初期化ベクトルを用いて前記最初の平文ブロックを暗号化する請求項1から請求項7のいずれか一項に記載の暗号化装置。
  9.  前記変数生成部は、
     さらに、パラメータ及び識別情報の少なくとも1つ、または両方を用いて、ブロック暗号のアルゴリズムが暗号化の際に必要とする暗号文生成のための秘匿すべき変数を生成することにより、対象データ毎に異なる変数によりブロック暗号が可能となる請求項1から請求項8のいずれか一項に記載の暗号化装置。
  10.  ブロック暗号に基づく暗号化データを復号する復号装置であって、
     前記暗号化データは、暗号文ブロックと暗号化されていない非暗号化データとを含み、
     前記暗号化データの暗号文ブロックの整数倍を復号し、前記非暗号化データを平文のまま残す復号部と、
     前記復号部で復号しない非暗号化データの全部又は一部の情報に基づいて、ブロック暗号のアルゴリズムが復号の際に必要とする平文生成のための秘匿すべき変数を生成する変数生成部と
     を備える復号装置。
  11.  復号開始位置パラメータに基づいて復号開始位置を算出する復号開始位置算出部を備え、
     前記復号部は、
     前記復号開始位置算出部で算出した復号開始位置から前記暗号文ブロックを復号する請求項10に記載の復号装置。
  12.  復号終了位置パラメータに基づいて復号終了位置を算出する復号終了位置算出部を備え、
     前記復号部は、
     前記復号終了位置算出部で算出した復号終了位置で前記暗号文ブロックの復号を終了する10又は請求項11に記載の復号装置。
  13.  前記復号部は、
     復号するデータサイズがブロック長の整数倍でない場合、前記データサイズがブロック長の整数倍になるように復号開始位置又は復号終了位置を調整して前記暗号文ブロックを復号する請求項11又は請求項12に記載の復号装置。
  14.  前記復号部で復号した結果の復号後のデータのサイズが、復号前の暗号化データのサイズと変わらない請求項10から請求項13のいずれか一項に記載の復号装置。
  15.  前記非暗号化データは、前記暗号化データ内で連続したデータ又は離散したデータである請求項10から請求項14のいずれか一項に記載の復号装置。
  16.  前記変数として暗号鍵を生成する暗号鍵生成部を備え、
     前記復号部は、
     前記暗号鍵生成部で生成した暗号鍵を用いて前記暗号文ブロックを復号する請求項10から請求項15のいずれか一項に記載の復号装置。
  17.  前記変数として最初の暗号文ブロックを復号する際に使用する初期化ベクトルを生成する初期化ベクトル生成部を備え、
     前記復号部は、
     前記初期化ベクトル生成部で生成した初期化ベクトルを用いて前記最初の暗号文ブロックを復号する請求項10から請求項16のいずれか一項に記載の復号装置。
  18.  前記変数生成部は、
     さらに、パラメータ及び識別情報の少なくとも1つ、または両方を用いて、ブロック暗号のアルゴリズムが復号の際に必要とする平文生成のための秘匿すべき変数を生成する請求項10から請求項17のいずれか一項に記載の復号装置。
  19.  対象データをブロック暗号により暗号化する暗号化装置であって、
     プロセッサを備え、
     前記プロセッサは、
     前記対象データの平文ブロックの整数倍を暗号化し、暗号化しない対象データは平文のまま残し、
     暗号化しない非暗号化データの全部又は一部の情報に基づいて、ブロック暗号のアルゴリズムが暗号化の際に必要とする暗号文生成のための秘匿すべき変数を生成する暗号化装置。
  20.  ブロック暗号に基づく暗号化データを復号する復号装置であって、
     プロセッサを備え、
     前記暗号化データは、暗号文ブロックと暗号化されていない非暗号化データとを含み、
     前記プロセッサは、
     前記暗号化データの暗号文ブロックの整数倍を復号し、復号しない暗号化データを平文のまま残し、
     復号しない非暗号化データの全部又は一部の情報に基づいて、ブロック暗号のアルゴリズムが復号の際に必要とする平文生成のための秘匿すべき変数を生成する復号装置。
  21.  コンピュータに、
     対象データを取得する処理と、
     取得した対象データの平文ブロックの整数倍を暗号化し、暗号化しない対象データを平文のまま残す処理と、
     暗号化しない非暗号化データの全部又は一部の情報に基づいて、ブロック暗号のアルゴリズムが暗号化の際に必要とする暗号文生成のための秘匿すべき変数を生成する処理と
     を実行させるコンピュータプログラム。
  22.  コンピュータに、
     暗号文ブロックと暗号化されていない非暗号化データとを含む暗号化データを取得する処理と、
     取得した暗号化データの暗号文ブロックの整数倍を復号し、復号しない暗号化データを平文のまま残す処理と、
     復号しない非暗号化データの全部又は一部の情報に基づいて、ブロック暗号のアルゴリズムが復号の際に必要とする平文生成のための秘匿すべき変数を生成する処理と
     を実行させるコンピュータプログラム。
  23.  対象データをブロック暗号により暗号化する暗号化方法であって、
     前記対象データの平文ブロックの整数倍を暗号化し、暗号化しない対象データを平文のまま残し、
     暗号化しない非暗号化データの全部又は一部の情報に基づいて、ブロック暗号のアルゴリズムが暗号化の際に必要とする暗号文生成のための秘匿すべき変数を生成する暗号化方法。
  24.  ブロック暗号に基づく暗号化データを復号する復号方法であって、
     前記暗号化データは、暗号文ブロックと暗号化されていない非暗号化データとを含み、
     前記暗号化データの暗号文ブロックの整数倍を復号し、復号しない暗号化データを平文のまま残し、
     復号しない非暗号化データの全部又は一部の情報に基づいて、ブロック暗号のアルゴリズムが復号の際に必要とする平文生成のための秘匿すべき変数を生成する復号方法。
  25.  復号部を備えるコンピュータに用いられ、ブロック暗号に基づく暗号化データのデータ構造であって、
     前記暗号化データは、
     暗号化されていない非暗号化データと暗号化された暗号文ブロックとを含み、
     前記非暗号化データの全部又は一部の情報に基づいて、ブロック暗号のアルゴリズムが復号の際に必要とする平文生成のための秘匿すべき変数を生成する処理と、
     生成された変数を用いて、前記復号部が前記暗号文ブロックの整数倍を復号し、復号しない暗号化データを平文のまま残す処理と
     に用いられるデータ構造。
     
PCT/JP2019/034365 2019-09-02 2019-09-02 暗号化装置、復号装置、コンピュータプログラム、暗号化方法、復号方法及びデータ構造 WO2021044465A1 (ja)

Priority Applications (2)

Application Number Priority Date Filing Date Title
JP2021543621A JPWO2021044465A1 (ja) 2019-09-02 2019-09-02
PCT/JP2019/034365 WO2021044465A1 (ja) 2019-09-02 2019-09-02 暗号化装置、復号装置、コンピュータプログラム、暗号化方法、復号方法及びデータ構造

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/JP2019/034365 WO2021044465A1 (ja) 2019-09-02 2019-09-02 暗号化装置、復号装置、コンピュータプログラム、暗号化方法、復号方法及びデータ構造

Publications (1)

Publication Number Publication Date
WO2021044465A1 true WO2021044465A1 (ja) 2021-03-11

Family

ID=74852292

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/JP2019/034365 WO2021044465A1 (ja) 2019-09-02 2019-09-02 暗号化装置、復号装置、コンピュータプログラム、暗号化方法、復号方法及びデータ構造

Country Status (2)

Country Link
JP (1) JPWO2021044465A1 (ja)
WO (1) WO2021044465A1 (ja)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114301718A (zh) * 2022-03-10 2022-04-08 北京微芯感知科技有限公司 一种采用单密钥进行链式加密的文件传输方法

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2004007533A (ja) * 2002-03-29 2004-01-08 Toshiba Corp マルチメディア・ファイル・フォーマットのデータ構造、その暗号化方法並びに装置及びその暗号の復号化方法及び装置
JP2005148894A (ja) * 2003-11-12 2005-06-09 Sony Corp データ処理方法およびデータ処理装置
JP2009253563A (ja) * 2008-04-03 2009-10-29 Nec Corp コンテンツ暗号化配信システム、コンテンツ暗号化配信方法およびコンテンツ暗号化配信用プログラム
JP2011091494A (ja) * 2009-10-20 2011-05-06 Nippon Hoso Kyokai <Nhk> データ配信装置、データ受信装置、データ配信プログラム、及び、データ受信プログラム

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH07111645A (ja) * 1993-10-12 1995-04-25 Matsushita Electric Ind Co Ltd スクランブル装置およびデスクランブル装置
WO2016181976A1 (ja) * 2015-05-12 2016-11-17 株式会社テイエルブイ 情報送信装置

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2004007533A (ja) * 2002-03-29 2004-01-08 Toshiba Corp マルチメディア・ファイル・フォーマットのデータ構造、その暗号化方法並びに装置及びその暗号の復号化方法及び装置
JP2005148894A (ja) * 2003-11-12 2005-06-09 Sony Corp データ処理方法およびデータ処理装置
JP2009253563A (ja) * 2008-04-03 2009-10-29 Nec Corp コンテンツ暗号化配信システム、コンテンツ暗号化配信方法およびコンテンツ暗号化配信用プログラム
JP2011091494A (ja) * 2009-10-20 2011-05-06 Nippon Hoso Kyokai <Nhk> データ配信装置、データ受信装置、データ配信プログラム、及び、データ受信プログラム

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114301718A (zh) * 2022-03-10 2022-04-08 北京微芯感知科技有限公司 一种采用单密钥进行链式加密的文件传输方法

Also Published As

Publication number Publication date
JPWO2021044465A1 (ja) 2021-03-11

Similar Documents

Publication Publication Date Title
US11818262B2 (en) Method and system for one-to-many symmetric cryptography and a network employing the same
JP3747520B2 (ja) 情報処理装置及び情報処理方法
EP1440535B1 (en) Memory encrytion system and method
US6628786B1 (en) Distributed state random number generator and method for utilizing same
US20080084996A1 (en) Authenticated encryption method and apparatus
WO2018104412A1 (en) Method of rsa signature or decryption protected using a homomorphic encryption
JP2001324925A (ja) 共通鍵暗号方法及び装置
CA3056814A1 (en) Symmetric cryptographic method and system and applications thereof
US20090010433A1 (en) Schryption method and device
WO2021044465A1 (ja) 暗号化装置、復号装置、コンピュータプログラム、暗号化方法、復号方法及びデータ構造
Bastanta et al. Image data encryption using DES method
JP5113630B2 (ja) 秘密分散方法、プログラム、及び装置
CN102622561A (zh) 一种软件中调用数据的加密及解密方法
Saudagar et al. Image encryption based on advanced encryption standard (aes)
CN114036541A (zh) 一种复合加密存储用户私密内容的应用方法
JP6631989B2 (ja) 暗号化装置、制御方法、及びプログラム
Mahalakshmi et al. “Security-as-a-Service” for files in cloud computing—A novel application model
Tripathi et al. Survey on performance comparison of various symmetric encryption algorithms
CN118489130A (zh) 加密装置、解密装置、可解密验证装置、密码系统、加密方法和加密程序
Daswani et al. Symmetric Key Cryptography
Lee et al. Implementation of a SW-Based Secure Storage for License Protection
Ali Cryptographic for Security Application
JP2005269587A (ja) 鍵共有システム、暗号システム、ファイル認証システム
JP2004147270A (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: 19944151

Country of ref document: EP

Kind code of ref document: A1

ENP Entry into the national phase

Ref document number: 2021543621

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

Country of ref document: EP

Kind code of ref document: A1