JP4658150B2 - Encryption method and decryption method - Google Patents

Encryption method and decryption method Download PDF

Info

Publication number
JP4658150B2
JP4658150B2 JP2008015416A JP2008015416A JP4658150B2 JP 4658150 B2 JP4658150 B2 JP 4658150B2 JP 2008015416 A JP2008015416 A JP 2008015416A JP 2008015416 A JP2008015416 A JP 2008015416A JP 4658150 B2 JP4658150 B2 JP 4658150B2
Authority
JP
Japan
Prior art keywords
block
encryption
ciphertext
mode
plaintext
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
JP2008015416A
Other languages
Japanese (ja)
Other versions
JP2009175544A (en
Inventor
真徳 音川
太郎 櫻井
育郎 小柳津
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
NTT Electronics Corp
Original Assignee
NTT Electronics Corp
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 NTT Electronics Corp filed Critical NTT Electronics Corp
Priority to JP2008015416A priority Critical patent/JP4658150B2/en
Publication of JP2009175544A publication Critical patent/JP2009175544A/en
Application granted granted Critical
Publication of JP4658150B2 publication Critical patent/JP4658150B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Description

本発明は、暗号化方法および復号方法に関するものである。   The present invention relates to an encryption method and a decryption method.

AES(Advanced Encryption Standard)等のブロック暗号を用いて秘密文書を暗号化する際、平文を構成するn個(ただし、n≧2)の各平文ブロックのバイト数が一定の数Nである場合は、各平文ブロックの暗号化にCBC(Cipher Block Chaining)モードを使用できる。n番目の平文ブロックのバイト数がN未満の場合、n番目の平文ブロックにパディングデータを追加して平文ブロックのバイト数をNにするパディングが行われる。例えば、パディングは、符号のない整数を「1」、「2」、「3」のように順次に平文ブロックに追加し、バイト数がNになったときに終了する。そして、得られた各平文ブロックが暗号化装置により暗号化される。こうして得られた各暗号文ブロックを復号する復号装置は、パディングの仕組みに基づいて構成されており、これにより、パディングデータを区別して平文を得ることができる。   When a secret document is encrypted using a block cipher such as AES (Advanced Encryption Standard), the number of bytes of each plaintext block constituting the plaintext (where n ≧ 2) is a fixed number N The CBC (Cipher Block Chaining) mode can be used for encryption of each plaintext block. When the number of bytes of the nth plaintext block is less than N, padding is performed by adding padding data to the nth plaintext block so that the number of bytes of the plaintext block is N. For example, padding ends when an unsigned integer is sequentially added to the plaintext block, such as “1”, “2”, and “3”, and the number of bytes becomes N. Each plaintext block obtained is encrypted by the encryption device. The decryption device for decrypting each ciphertext block obtained in this way is configured based on a padding mechanism, and thus, plaintext can be obtained by distinguishing padding data.

一方、n−1番目以下の各平文ブロックのバイト数が一定の数Nであり、n番目の平文ブロックのバイト数がN以下の任意数である場合、各平文ブロックの暗号化、復号にCFB(Cipher Feed Back)モードやOFB(Output Feed Back)モードを使用できる。   On the other hand, when the number of bytes of each of the n-1 or less plaintext blocks is a fixed number N and the number of bytes of the nth plaintext block is an arbitrary number of N or less, the CFB is used for encryption and decryption of each plaintext block (Cipher Feed Back) mode and OFB (Output Feed Back) mode can be used.

各CBCモード、CFBモード、OFBモードでの暗号化、復号には初期ベクトルが必要であり、非特許文献2のAppendix Cの規格によれば、初期ベクトルを毎回異ならせる必要がある。さらに、CBCモードおよびCFBモードでは、初期ベクトルを予測不能なものにしなければならない。このため、例えば、TCP/IP通信におけるレイヤ3フレームの暗号化規格であるIPSecでは、平文に加えて、初期ベクトルのためのフィールドを設け、暗号化における初期ベクトルの生成に用いたデータをフィールドに格納し、フィールドのデータを使用して生成した初期ベクトルで復号を行う。   An initial vector is required for encryption and decryption in each CBC mode, CFB mode, and OFB mode. According to the Appendix C standard of Non-Patent Document 2, the initial vector must be different each time. Furthermore, in CBC mode and CFB mode, the initial vector must be unpredictable. For this reason, for example, in IPSec, which is an encryption standard for layer 3 frames in TCP / IP communication, a field for an initial vector is provided in addition to plaintext, and the data used for generating the initial vector in encryption is used as a field. Store and decode with initial vector generated using field data.

しかし、この方法では、フィールドを設けるため、トータルのバイト数が多くなり、バイト数の上限が規定されているイーサネット(登録商標)フレーム(レイヤ2フレームの1つ)内の各平文ブロックの暗号化、復号には使用できない。   However, in this method, since the field is provided, the total number of bytes increases, and encryption of each plaintext block in the Ethernet (registered trademark) frame (one of the layer 2 frames) in which the upper limit of the number of bytes is defined. Cannot be used for decryption.

特許文献1には、例えば、1つの平文ブロックをECB(Electric Code Book)モードで暗号化し、得られた暗号文ブロックを初期ベクトルとして残りの各平文ブロックをOFBモードで暗号化し、その暗号文ブロックをECBモードで復号し、その暗号文ブロックを初期ベクトルとして残りの各暗号文ブロックをOFBモードで復号する方法が開示されている。   In Patent Document 1, for example, one plaintext block is encrypted in ECB (Electric Code Book) mode, and the remaining plaintext block is encrypted in OFB mode using the obtained ciphertext block as an initial vector. Is decrypted in ECB mode, and the remaining ciphertext block is decrypted in OFB mode using the ciphertext block as an initial vector.

しかし、この方法では、ECBモードによる暗号化を行うので、得られた暗号文ブロックが解読され易い。ECBモードでは、初期ベクトルを用いずに暗号化・復号を行うため、平文の統計的性質を利用した暗号解読に弱い。よって、上記のような各平文ブロックを伝達するための暗号化、復号には推奨されていない(例えば、非特許文献2の6.1参照)。
特開2001−285281号公報 S.Kent, R.Atkinson, IPSec, 'IP Encapsulating Security Payload(ESP)', RFC 2406, November 1998 NIST(National Institute of Standards and Technology) Special Publication 800-38A, 'Recommendation for Block Cipher Modes of Operation Methods and Techniques',December 2001
However, in this method, since encryption is performed in the ECB mode, the obtained ciphertext block is easily deciphered. In the ECB mode, since encryption / decryption is performed without using an initial vector, it is weak to decryption using the statistical properties of plain text. Therefore, it is not recommended for encryption and decryption for transmitting each plaintext block as described above (for example, refer to 6.1 of Non-Patent Document 2).
JP 2001-285281 A S. Kent, R. Atkinson, IPSec, 'IP Encapsulating Security Payload (ESP)', RFC 2406, November 1998 NIST (National Institute of Standards and Technology) Special Publication 800-38A, 'Recommendation for Block Cipher Modes of Operation Methods and Techniques', December 2001

本発明は、上記の課題に鑑みてなされたものであり、その目的とするところは、短く且つ解読されにくい暗号文が得られる暗号化と当該暗号文に適した復号とに関する技術を提供することにある。   The present invention has been made in view of the above-described problems, and an object of the present invention is to provide a technique related to encryption capable of obtaining a ciphertext that is short and difficult to decipher and decryption suitable for the ciphertext. It is in.

上記の課題を解決するために、請求項1の本発明は、n個(ただし、n≧2)の平文ブロックを暗号化する暗号化装置が行う暗号化方法であって、前記平文ブロックは、1から(n−1)番目の平文ブロックがそれぞれ一定の数のバイト数N(ただし、Nは正の整数)を有し、n番目の平文ブロックがバイト数M(ただし、MはM≦Nの正の整数)を有するものであり、前記暗号化装置に構成された暗号化部が、前記n番目の平文ブロックを暗号化し、前記暗号化装置に構成されたCBC(Cipher Block Chaining)モード暗号化部が、前記暗号化部により得られた暗号文を初期ベクトルとしてCBCモードで前記n−1番目以下の各平文ブロックを暗号化し、前記暗号化装置に構成されたOFB(Output Feed Back)モード暗号化部が、前記n−1番目の平文ブロックの暗号化結果を初期ベクトルとしてOFBモードで前記n番目の平文ブロックを暗号化することを特徴とする暗号化方法をもって解決手段とする。 In order to solve the above problems, the present invention of claim 1 is an encryption method performed by an encryption device that encrypts n (where n ≧ 2) plaintext blocks, wherein the plaintext blocks are: Each of the 1st to (n−1) th plaintext blocks has a certain number of bytes N (where N is a positive integer), and the nth plaintext block has a number of bytes M (where M is M ≦ N). And an encryption unit configured in the encryption device encrypts the n-th plaintext block, and a CBC (Cipher Block Chaining) mode encryption configured in the encryption device. The encrypting unit encrypts each n−1 or less plaintext block in the CBC mode using the ciphertext obtained by the encrypting unit as an initial vector, and the OFB (Output Feed Back) mode configured in the encrypting device The encryption unit is the n-1th plaintext. With an encryption method characterized by encrypting said n-th plaintext block OFB mode as an initial vector encryption result of the lock and solutions.

請求項2の本発明は、n個(ただし、n≧2)の暗号文ブロックを復号する復号装置が行う復号方法であって、前記暗号文ブロックは、1から(n−1)番目の暗号文ブロックがそれぞれ一定の数のバイト数N(ただし、Nは正の整数)を有し、n番目の暗号文ブロックがバイト数M(ただし、MはM≦Nの正の整数)を有するものであり、前記復号装置に構成されたOFB(Output Feed Back)モード復号部が、前記n−1番目の暗号文ブロックを初期ベクトルとしてOFBモードで前記n番目の暗号文ブロックを復号し、前記復号装置に構成された暗号化部が、前記n番目の暗号文ブロックから復号された平文ブロックを暗号化し、前記復号装置に構成されたCBC(Cipher Block Chaining)モード復号部が、前記暗号化部により得られた暗号文を初期ベクトルとしてCBCモードで前記n−1番目以下の各暗号文ブロックを復号することを特徴とする復号方法をもって解決手段とする。 The present invention of claim 2 is a decryption method performed by a decryption device that decrypts n (where n ≧ 2) ciphertext blocks, and the ciphertext blocks are numbered from 1 to the (n−1) th ciphertext. Each sentence block has a fixed number of bytes N (where N is a positive integer), and the nth ciphertext block has a number of bytes M (where M is a positive integer M ≦ N) , and the said OFB (Output Feed Back) mode decoding unit configured to decode device, the n-1 th ciphertext block decoding the n-th ciphertext block in OFB mode as the initial vector, the decoding An encryption unit configured in the device encrypts a plaintext block decrypted from the n-th ciphertext block, and a CBC (Cipher Block Chaining) mode decryption unit configured in the decryption device is operated by the encryption unit. The obtained ciphertext is Decoding the n-1 th or less of each ciphertext block in CBC mode and solutions with a decoding method characterized as torr.

請求項3の本発明は、n個(ただし、n≧2)の平文ブロックを暗号化する暗号化装置が行う暗号化方法であって、前記平文ブロックは、1から(n−1)番目の平文ブロックがそれぞれ一定の数のバイト数N(ただし、Nは正の整数)を有し、n番目の平文ブロックがバイト数M(ただし、MはM≦Nの正の整数)を有するものであり、前記暗号化装置に構成された暗号化部が、前記2番目からn番目の中の1つの平文ブロックを暗号化し、前記暗号化装置に構成されたCFB(Cipher Feed Back)モード暗号化部が、前記暗号化部により得られた暗号文を初期ベクトルとしてCFBモードで前記1番目からn番目の各平文ブロックを暗号化することを特徴とする暗号化方法をもって解決手段とする。 The present invention of claim 3 is an encryption method performed by an encryption device for encrypting n (where n ≧ 2) plaintext blocks, wherein the plaintext blocks are numbered from 1 to (n−1) th. Each plaintext block has a certain number of bytes N (where N is a positive integer), and the nth plaintext block has a number of bytes M (where M is a positive integer M ≦ N). And an encryption unit configured in the encryption device encrypts one plaintext block from the second to nth, and a CFB (Cipher Feed Back) mode encryption unit configured in the encryption device However, the solving means includes an encryption method characterized in that the first to nth plaintext blocks are encrypted in the CFB mode using the ciphertext obtained by the encryption unit as an initial vector.

請求項4の本発明は、n個(ただし、n≧2)の暗号文ブロックを復号する復号装置が行う復号方法であって、前記暗号文ブロックは、1から(n−1)番目の暗号文ブロックがそれぞれ一定の数のバイト数N(ただし、Nは正の整数)を有し、n番目の暗号文ブロックがバイト数M(ただし、MはM≦Nの正の整数)を有するものであり、前記復号装置に構成された第1のCFB(Cipher Feed Back)モード復号部が、前記1番目の暗号文ブロックを初期ベクトルとして前記2番目からn番目の各暗号文ブロックをCFBモードで復号し、前記復号装置に構成された暗号化部が、前記2番目からn番目の中の1つの暗号文ブロックから復号された平文ブロックを暗号化し、前記復号装置に構成された第2のCFBモード復号部が、前記暗号化部により得られた暗号文を初期ベクトルとして前記1番目の暗号文ブロックをCFBモードで復号することを特徴とする復号方法をもって解決手段とする。 The present invention of claim 4 is a decryption method performed by a decryption device that decrypts n (where n ≧ 2) ciphertext blocks, wherein the ciphertext block is the 1st to (n−1) th ciphertext. Each sentence block has a fixed number of bytes N (where N is a positive integer), and the nth ciphertext block has a number of bytes M (where M is a positive integer M ≦ N) And a first CFB (Cipher Feed Back) mode decryption unit configured in the decryption apparatus uses the first ciphertext block as an initial vector and the second to nth ciphertext blocks in the CFB mode. The encryption unit configured in the decryption device decrypts the plaintext block decrypted from one of the second to nth ciphertext blocks, and the second CFB configured in the decryption device The mode decryption unit is operated by the encryption unit. The resulting the first ciphertext block ciphertext as an initial vector with a decoding method characterized by decoding in CFB mode and solutions.

請求項5の本発明は、請求項1または3記載の暗号化方法をコンピュータで構成された暗号化装置に実行させるためのコンピュータプログラムをもって解決手段とする。   The fifth aspect of the present invention provides a solving means having a computer program for causing an encryption apparatus constituted by a computer to execute the encryption method according to the first or third aspect.

請求項6の本発明は、請求項2または4記載の復号方法をコンピュータで構成された復号装置に実行させるためのコンピュータプログラムをもって解決手段とする。   According to a sixth aspect of the present invention, there is provided a computer program for causing a decoding apparatus constituted by a computer to execute the decoding method according to the second or fourth aspect.

請求項7の本発明は、請求項5または6記載のコンピュータプログラムが記録されたコンピュータ読み取り可能な記録媒体をもって解決手段とする。   The seventh aspect of the present invention uses a computer-readable recording medium on which the computer program according to the fifth or sixth aspect is recorded as a solving means.

本発明によれば、短く且つ解読されにくい暗号文が得られる暗号化と当該暗号文に適した復号とに関する技術を提供することができる。   ADVANTAGE OF THE INVENTION According to this invention, the technique regarding the encryption from which the short and difficult-to-decipher ciphertext is obtained, and the decoding suitable for the said ciphertext can be provided.

以下、本発明の実施の形態を図面を参照して説明する。   Hereinafter, embodiments of the present invention will be described with reference to the drawings.

[第1の実施の形態]
図1は、第1の実施の形態に係る暗号化装置1の構成図である。
[First Embodiment]
FIG. 1 is a configuration diagram of an encryption device 1 according to the first embodiment.

暗号化装置1は、例えば、秘密情報等を含む文書データである平文を暗号化する暗号化装置であり、n個(ただし、n≧2)の平文ブロック101、…、10n−1、10nを、例えば、AES(Advanced Encryption Standard)を用いて暗号化する。   The encryption device 1 is, for example, an encryption device that encrypts plaintext that is document data including secret information and the like, and n (where n ≧ 2) plaintext blocks 101,. For example, encryption is performed using AES (Advanced Encryption Standard).

暗号化装置1は、n番目の平文ブロック10nを暗号化する暗号化部11と、暗号化部11により得られた暗号文を初期ベクトルとしてCBC(Cipher Block Chaining)モードでn−1番目以下の各平文ブロック101、…、10n−1を暗号化するCBCモード暗号化部12と、n−1番目の平文ブロック10n−1の暗号化結果を初期ベクトルとしてOFB(Output Feed Back)モードでn番目の平文ブロック10nを暗号化するOFBモード暗号化部13とを備える。図1では省略するが、CBCモード暗号化部12とOFBモード暗号化部13には、同一の鍵が入力される。   The encryption device 1 encrypts the n-th plaintext block 10n, and the ciphertext obtained by the encryption unit 11 is used as an initial vector in the CBC (Cipher Block Chaining) mode for n−1 or less. The CBC mode encryption unit 12 for encrypting each plaintext block 101,..., 10n-1, and the nth in OFB (Output Feed Back) mode using the encryption result of the n-1st plaintext block 10n-1 as an initial vector. And an OFB mode encryption unit 13 for encrypting the plaintext block 10n. Although not shown in FIG. 1, the same key is input to the CBC mode encryption unit 12 and the OFB mode encryption unit 13.

n−1番目以下の各平文ブロックのバイト数は一定の数N(例えば、16である。以下同様)である。一方、n番目の平文ブロックのバイト数はN以下の任意数である。これにより、平文ブロックのトータルのバイト数を任意数(Nの倍数以外の数でもよい)にすることができる。   The number of bytes of each of the n−1 and below plaintext blocks is a fixed number N (for example, 16; the same applies hereinafter). On the other hand, the number of bytes of the nth plaintext block is an arbitrary number equal to or less than N. Thereby, the total number of bytes of the plaintext block can be set to an arbitrary number (may be a number other than a multiple of N).

(暗号化方法)
次に、暗号化装置1が行う暗号化方法を説明する。
(Encryption method)
Next, an encryption method performed by the encryption device 1 will be described.

まず、暗号化部11が、平文ブロック10nを暗号化する。次に、CBCモード暗号化部12が、暗号化部11により得られた暗号文を初期ベクトルとしてCBCモードで各平文ブロック101、…、10n−1を暗号化する。これにより、n−1番目以下の各暗号文ブロック201、…、20n−1が得られる。次に、OFBモード暗号化部13が、平文ブロック10n−1の暗号化結果(暗号文ブロック20n−1)を初期ベクトルとしてOFBモードで平文ブロック10nを暗号化する。これにより、n番目の暗号文ブロック20nが得られる。   First, the encryption unit 11 encrypts the plaintext block 10n. Next, the CBC mode encryption unit 12 encrypts each plaintext block 101,..., 10n-1 in the CBC mode using the ciphertext obtained by the encryption unit 11 as an initial vector. As a result, the (n−1) th and subsequent ciphertext blocks 201,..., 20n−1 are obtained. Next, the OFB mode encryption unit 13 encrypts the plaintext block 10n in the OFB mode using the encryption result (ciphertext block 20n-1) of the plaintext block 10n-1 as an initial vector. As a result, the nth ciphertext block 20n is obtained.

図2は、CBCモード暗号化部12による上記暗号化の仕組みを示す図である。   FIG. 2 is a diagram showing the above-described encryption mechanism by the CBC mode encryption unit 12.

CBCモード暗号化部12は、まず、暗号化部11により得られた暗号文である初期ベクトル111と平文ブロック101とでXOR(排他的論理和)演算を行い、演算結果を鍵501で暗号化する。これにより、暗号文ブロック201が得られる。   The CBC mode encryption unit 12 first performs an XOR (exclusive OR) operation on the initial vector 111 which is the ciphertext obtained by the encryption unit 11 and the plaintext block 101, and encrypts the operation result with the key 501. To do. Thereby, the ciphertext block 201 is obtained.

CBCモード暗号化部12は、次に、暗号文ブロック201と平文ブロック102とでXOR演算を行い、演算結果を鍵501で暗号化する。これにより、暗号文ブロック202が得られる。   Next, the CBC mode encryption unit 12 performs an XOR operation on the ciphertext block 201 and the plaintext block 102 and encrypts the operation result with the key 501. Thereby, the ciphertext block 202 is obtained.

CBCモード暗号化部12は、同様のことを順次に行い、その最後で得られた暗号文ブロックと平文ブロック10n−1とで、先頭から平文ブロック10nを構成するバイト数だけXOR演算を行い、演算結果を鍵501で暗号化する。これにより、暗号文ブロック20n−1が得られる。   The CBC mode encryption unit 12 sequentially performs the same thing, and performs an XOR operation on the ciphertext block obtained at the end and the plaintext block 10n-1 by the number of bytes constituting the plaintext block 10n from the beginning, The calculation result is encrypted with the key 501. Thereby, the ciphertext block 20n-1 is obtained.

図3は、OFBモード暗号化部13による上記暗号化の仕組みを示す図である。   FIG. 3 is a diagram showing the above-described encryption mechanism by the OFB mode encryption unit 13.

OFBモード暗号化部13は、暗号文ブロック20n−1を鍵501で暗号化し、得られた暗号文と平文ブロック10nとで、先頭から平文ブロック10nを構成するバイト数だけXOR演算を行う。これにより、演算結果である暗号文ブロック20nが得られる。   The OFB mode encryption unit 13 encrypts the ciphertext block 20n-1 with the key 501 and performs the XOR operation on the obtained ciphertext and the plaintext block 10n by the number of bytes constituting the plaintext block 10n from the top. Thereby, the ciphertext block 20n which is a calculation result is obtained.

上記の暗号化により、n−1番目以下の各暗号文ブロックのバイト数は一定の数Nとなる。一方、n番目の暗号文ブロックのバイト数はn番目の平文ブロックのバイト数と同数でありつまりN以下の任意数である。これにより、暗号文ブロックのトータルのバイト数は平文ブロックのトータルのバイト数と同数つまり任意数(Nの倍数以外の数でもよい)になる。   As a result of the above encryption, the number of bytes in each of the (n−1) th and subsequent ciphertext blocks is a fixed number N. On the other hand, the number of bytes of the nth ciphertext block is the same as the number of bytes of the nth plaintext block, that is, an arbitrary number equal to or less than N. As a result, the total number of bytes in the ciphertext block is the same as the total number of bytes in the plaintext block, that is, an arbitrary number (may be a number other than a multiple of N).

以上説明したように、第1の実施の形態に係る暗号化装置1とその暗号化方法によれば、各CBCモード、OFBモードによる暗号化に必要な各初期ベクトルを平文ブロックから得ることで、初期ベクトルのためのフィールドが不要であり、しかも、CBCモードおよびOFBモードの初期ベクトルを毎回異ならせることができ、かつ、CBCモードの初期ベクトルを予測不能なものにすることができる。よって、得られた暗号文ブロックは、非特許文献2のAppendix Cの規格を満足でき、レイヤ2フレームの暗号に適応することができる。   As described above, according to the encryption device 1 and the encryption method according to the first embodiment, by obtaining each initial vector required for encryption in each CBC mode and OFB mode from the plaintext block, The field for the initial vector is not required, and the initial vector for the CBC mode and the OFB mode can be made different every time, and the initial vector for the CBC mode can be made unpredictable. Therefore, the obtained ciphertext block can satisfy the Appendix C standard of Non-Patent Document 2 and can be applied to the encryption of the layer 2 frame.

また、n番目の平文ブロックの暗号化にOFBモードを使用することで、n番目の平文ブロックのバイト数はN以下の任意数でよく、平文ブロックのトータルのバイト数を任意数(Nの倍数以外の数でもよい)にすることができる。また、バイト数をNにするためのパディングを不要にでき、平文ブロックのトータルのバイト数が少なくなり、イーサネット(登録商標)フレーム内の各平文ブロックの暗号化に使用できる。   Further, by using OFB mode for encryption of the nth plaintext block, the number of bytes of the nth plaintext block may be an arbitrary number equal to or less than N, and the total number of bytes of the plaintext block is an arbitrary number (a multiple of N). Any number other than. Also, padding for setting the number of bytes to N can be eliminated, the total number of bytes in the plaintext block is reduced, and the plaintext block in the Ethernet (registered trademark) frame can be used for encryption.

また、ECBモードによる暗号化を行わないことで、得られた暗号文ブロックが意図に反して第3者により解読される可能性を低減することができる。   Further, by not performing encryption in the ECB mode, the possibility that the obtained ciphertext block is decrypted by a third party against the intention can be reduced.

[第2の実施の形態]
図4は、第2の実施の形態に係る復号装置2の構成図である。
[Second Embodiment]
FIG. 4 is a configuration diagram of the decoding device 2 according to the second embodiment.

復号装置2は、第1の実施の形態の暗号化装置1により得られた平文ブロックを復号するものであり、つまり、n個(ただし、n≧2)の暗号文ブロック201、…、20n−1、20nを復号する復号装置である。   The decryption device 2 decrypts the plaintext block obtained by the encryption device 1 according to the first embodiment, that is, n (where n ≧ 2) ciphertext blocks 201,..., 20n− 1 is a decoding device for decoding 1 and 20n.

復号装置2は、n−1番目の暗号文ブロック20n−1を初期ベクトルとしてOFBモードでn番目の暗号文ブロック20nを復号するOFBモード復号部21と、n番目の暗号文ブロック20nから復号された平文ブロック10nを暗号化する暗号化部22と、暗号化部22により得られた暗号文を初期ベクトルとしてCBCモードでn−1番目以下の各暗号文ブロック201、…、20n−1を復号するCBCモード復号部23とを備える。   The decryption device 2 decrypts the n-th ciphertext block 20n by the OFB mode decryption unit 21 that decrypts the n-th ciphertext block 20n in the OFB mode with the n-1-th ciphertext block 20n-1 as an initial vector. The plaintext block 10n is encrypted, and the ciphertext blocks 201,..., 20n-1 in the CBC mode are decrypted in the CBC mode using the ciphertext obtained by the encryption unit 22 as an initial vector. A CBC mode decoding unit 23.

図4では省略するが、OFBモード復号部21とCBCモード復号部23には、同一の鍵が入力される。この鍵は、暗号化装置1で使用された鍵501と同一にする必要がある。また、暗号化部22は、暗号化装置1の暗号化部11と同一にする必要がある。   Although not shown in FIG. 4, the same key is input to the OFB mode decryption unit 21 and the CBC mode decryption unit 23. This key needs to be the same as the key 501 used in the encryption device 1. The encryption unit 22 needs to be the same as the encryption unit 11 of the encryption device 1.

n−1番目以下の各暗号文ブロックのバイト数は一定の数Nである。一方、n番目の暗号文ブロックのバイト数はn番目の平文ブロックのバイト数と同数でありつまりN以下の任意数である。つまり、暗号文ブロックのトータルのバイト数は平文ブロックのトータルのバイト数と同数つまり任意数(Nの倍数以外の数でもよい)である。   The number of bytes of each of the (n−1) th and following ciphertext blocks is a fixed number N. On the other hand, the number of bytes of the nth ciphertext block is the same as the number of bytes of the nth plaintext block, that is, an arbitrary number equal to or less than N. That is, the total number of bytes of the ciphertext block is the same as the total number of bytes of the plaintext block, that is, an arbitrary number (may be a number other than a multiple of N).

(復号方法)
次に、復号装置2が行う復号方法を説明する。
(Decryption method)
Next, a decoding method performed by the decoding device 2 will be described.

まず、OFBモード復号部21が、暗号文ブロック20n−1を初期ベクトルとして暗号文ブロック20nを復号する。これにより、n番目の平文ブロック10nが得られる。次に、暗号化部22が、暗号文ブロック20nから復号された平文ブロック10nを暗号化する。これにより得られた暗号文は、第1の実施の形態の初期ベクトル111と同じものとなる。次に、CBCモード復号部23が、暗号化部22により得られた暗号文を初期ベクトルとしてCBCモードで各暗号文ブロック201、…、20n−1を復号する。これにより、n−1番目以下の各平文ブロック101、…、10n−1が得られる。   First, the OFB mode decryption unit 21 decrypts the ciphertext block 20n using the ciphertext block 20n-1 as an initial vector. As a result, the nth plaintext block 10n is obtained. Next, the encryption unit 22 encrypts the plaintext block 10n decrypted from the ciphertext block 20n. The ciphertext obtained as a result is the same as the initial vector 111 of the first embodiment. Next, the CBC mode decryption unit 23 decrypts each ciphertext block 201,..., 20n-1 in the CBC mode using the ciphertext obtained by the encryption unit 22 as an initial vector. As a result, n−1th and subsequent plaintext blocks 101,..., 10n−1 are obtained.

図5は、OFBモード復号部21による上記復号の仕組みを示す図である。   FIG. 5 is a diagram illustrating the above-described decoding mechanism by the OFB mode decoding unit 21.

OFBモード復号部21は、暗号文ブロック20n−1を鍵501で暗号化し、得られた暗号文と暗号文ブロック20nとで、先頭から暗号文ブロック20nを構成するバイト数だけXOR演算を行う。これにより、演算結果である平文ブロック10nが得られる。   The OFB mode decryption unit 21 encrypts the ciphertext block 20n-1 with the key 501, and performs the XOR operation on the obtained ciphertext and the ciphertext block 20n by the number of bytes constituting the ciphertext block 20n from the beginning. Thereby, the plaintext block 10n which is a calculation result is obtained.

図6は、CBCモード復号部23による上記復号の仕組みを示す図である。   FIG. 6 is a diagram illustrating the above-described decoding mechanism by the CBC mode decoding unit 23.

CBCモード復号部23は、まず、暗号文ブロック201を鍵501で暗号化し、得られた暗号文と初期ベクトル111とでXOR演算を行う。これにより、演算結果である平文ブロック101が得られる。   The CBC mode decryption unit 23 first encrypts the ciphertext block 201 with the key 501 and performs an XOR operation on the obtained ciphertext and the initial vector 111. Thereby, the plaintext block 101 which is a calculation result is obtained.

CBCモード復号部23は、次に、暗号文ブロック202を鍵501で暗号化し、得られた暗号文と暗号文ブロック201とでXOR演算を行う。これにより、演算結果である平文ブロック102が得られる。   Next, the CBC mode decryption unit 23 encrypts the ciphertext block 202 with the key 501 and performs an XOR operation between the obtained ciphertext and the ciphertext block 201. As a result, a plaintext block 102 which is a calculation result is obtained.

CBCモード復号部23は、同様のことを順次に行い、最後に、暗号文ブロック20n−1を鍵501で暗号化し、得られた暗号文とn−2番目の暗号文ブロックとでXOR演算を行う。これにより、演算結果である平文ブロック10n−1が得られる。   The CBC mode decryption unit 23 sequentially performs the same thing, and finally encrypts the ciphertext block 20n-1 with the key 501 and performs an XOR operation on the obtained ciphertext and the (n-2) -th ciphertext block. Do. Thereby, the plaintext block 10n-1 which is a calculation result is obtained.

上記の復号により、n−1番目以下の各平文ブロックのバイト数は一定の数Nとなる。一方、n番目の平文ブロックのバイト数はn番目の暗号文ブロックのバイト数と同数でありつまりN以下の任意数である。これにより、平文ブロックのトータルのバイト数は暗号文ブロックのトータルのバイト数と同数つまり任意数(Nの倍数以外の数でもよい)になる。   As a result of the above decryption, the number of bytes in each of the n−1 and below plaintext blocks is a fixed number N. On the other hand, the number of bytes of the nth plaintext block is the same as the number of bytes of the nth ciphertext block, that is, an arbitrary number equal to or less than N. As a result, the total number of bytes in the plaintext block is the same as the total number of bytes in the ciphertext block, that is, an arbitrary number (may be a number other than a multiple of N).

以上説明したように、第2の実施の形態に係る復号装置2とその復号方法によれば、各CBCモード、OFBモードによる復号に必要な各初期ベクトルを暗号文ブロックから得ることで、初期ベクトルのためのフィールドが不要であり、しかも、CBCモードおよびOFBモードの初期ベクトルを毎回異ならせることができ、かつ、CBCモードの初期ベクトルを予測不能なものにすることができる。また、暗号文ブロックは、非特許文献2のAppendix Cの規格を満足でき、レイヤ2フレームの暗号に適応することができる。   As described above, according to the decryption apparatus 2 and the decryption method thereof according to the second embodiment, by obtaining each initial vector necessary for decryption in each CBC mode and OFB mode from the ciphertext block, the initial vector The initial vector for the CBC mode and the OFB mode can be made different each time, and the initial vector for the CBC mode can be made unpredictable. Also, the ciphertext block can satisfy the Appendix C standard of Non-Patent Document 2, and can be applied to layer 2 frame encryption.

[第3の実施の形態]
図7は、第3の実施の形態に係る暗号化装置3の構成図である。
[Third Embodiment]
FIG. 7 is a configuration diagram of the encryption device 3 according to the third embodiment.

暗号化装置3は、例えば、秘密情報等を含む文書データである平文を暗号化する暗号化装置であり、n個(ただし、n≧2)の平文ブロック101、…、10n−1、10nを、例えば、AES(Advanced Encryption Standard)を用いて暗号化する。   The encryption device 3 is, for example, an encryption device that encrypts plaintext that is document data including secret information and the like, and n (where n ≧ 2) plaintext blocks 101,. For example, encryption is performed using AES (Advanced Encryption Standard).

暗号化装置3は、2番目からn番目の中の1つの平文ブロックを暗号化する暗号化部31と、暗号化部31により得られた暗号文を初期ベクトルとしてCFB(Cipher Feed Back)モードで1番目からn番目の各平文ブロックを暗号化するCFBモード暗号化部32とを備える。図7では省略するが、CFBモード暗号化部32には、鍵が入力される。   The encryption device 3 encrypts one plaintext block from the 2nd to the nth, and the CFB (Cipher Feed Back) mode using the ciphertext obtained by the encryption unit 31 as an initial vector. A CFB mode encryption unit 32 for encrypting each of the first to nth plaintext blocks. Although omitted in FIG. 7, a key is input to the CFB mode encryption unit 32.

n−1番目以下の各平文ブロックのバイト数は一定の数Nである。一方、n番目の平文ブロックのバイト数はN以下の任意数である。これにより、平文ブロックのトータルのバイト数を任意数(Nの倍数以外の数でもよい)にすることができる。   The number of bytes of each of the n−1 and below plaintext blocks is a fixed number N. On the other hand, the number of bytes of the nth plaintext block is an arbitrary number equal to or less than N. Thereby, the total number of bytes of the plaintext block can be set to an arbitrary number (may be a number other than a multiple of N).

(暗号化方法)
次に、暗号化装置3が行う暗号化方法を説明する。
(Encryption method)
Next, an encryption method performed by the encryption device 3 will be described.

まず、暗号化部31が、2番目からn番目の中の1つの平文ブロックを暗号化する。ここでは、2番目の平文ブロック102が暗号化されたこととする。次に、CFBモード暗号化部32が、暗号化部31により得られた暗号文を初期ベクトルとしてCFBモードで各平文ブロック101、102、…、10nを暗号化する。これにより、1番目からn番目の各暗号文ブロック201、202、…、20nが得られる。   First, the encryption unit 31 encrypts one plaintext block from the second to the nth. Here, it is assumed that the second plaintext block 102 is encrypted. Next, the CFB mode encryption unit 32 encrypts each plaintext block 101, 102,..., 10n in the CFB mode using the ciphertext obtained by the encryption unit 31 as an initial vector. Thereby, the 1st to nth ciphertext blocks 201, 202,..., 20n are obtained.

図8は、CFBモード暗号化部32による上記暗号化の仕組みを示す図である。   FIG. 8 is a diagram showing the above-described encryption mechanism by the CFB mode encryption unit 32.

まず、CFBモード暗号化部32は、暗号化部31により得られた暗号文である初期ベクトル311を鍵601で暗号化し、得られた暗号文と平文ブロック101とでXOR演算を行う。これにより、演算結果である暗号文ブロック201が得られる。   First, the CFB mode encryption unit 32 encrypts the initial vector 311 that is the ciphertext obtained by the encryption unit 31 with the key 601, and performs an XOR operation on the obtained ciphertext and the plaintext block 101. Thereby, the ciphertext block 201 which is a calculation result is obtained.

CFBモード暗号化部32は、次に、暗号文ブロック201を鍵601で暗号化し、得られた暗号文と平文ブロック102とでXOR演算を行う。これにより、演算結果である暗号文ブロック202が得られる。   Next, the CFB mode encryption unit 32 encrypts the ciphertext block 201 with the key 601 and performs an XOR operation between the obtained ciphertext and the plaintext block 102. Thereby, the ciphertext block 202 which is a calculation result is obtained.

CFBモード暗号化部32は、同様のことを順次に行い、その最後で得られた暗号文ブロックを鍵601で暗号化し、得られた暗号文と平文ブロック10nとで、先頭から平文ブロック10nを構成するバイト数だけXOR演算を行う。これにより、演算結果である暗号文ブロック20nが得られる。   The CFB mode encryption unit 32 sequentially performs the same thing, encrypts the ciphertext block obtained at the end with the key 601, and uses the obtained ciphertext and the plaintext block 10n to convert the plaintext block 10n from the top. XOR operation is performed for the number of bytes to be configured. Thereby, the ciphertext block 20n which is a calculation result is obtained.

上記の暗号化により、n−1番目以下の各暗号文ブロックのバイト数は一定の数Nとなる。一方、n番目の暗号文ブロックのバイト数はn番目の平文ブロックのバイト数と同数でありつまりN以下の任意数である。これにより、暗号文ブロックのトータルのバイト数は平文ブロックのトータルのバイト数と同数つまり任意数(Nの倍数以外の数でもよい)になる。   As a result of the above encryption, the number of bytes in each of the (n−1) th and subsequent ciphertext blocks is a fixed number N. On the other hand, the number of bytes of the nth ciphertext block is the same as the number of bytes of the nth plaintext block, that is, an arbitrary number equal to or less than N. As a result, the total number of bytes in the ciphertext block is the same as the total number of bytes in the plaintext block, that is, an arbitrary number (may be a number other than a multiple of N).

以上説明したように、第3の実施の形態に係る暗号化装置3とその暗号化方法によれば、CFBモードによる暗号化に必要な各初期ベクトルを平文ブロックから得ることで、初期ベクトルのためのフィールドが不要であり、しかも、CFBモードの初期ベクトルを毎回異ならせることができ、かつ、CFBモードの初期ベクトルを予測不能なものにすることができる。よって、得られた暗号文ブロックは、非特許文献2のAppendix Cの規格を満足でき、レイヤ2フレームの暗号に適応することができる。   As described above, according to the encryption device 3 and the encryption method according to the third embodiment, each initial vector necessary for encryption in the CFB mode is obtained from the plaintext block, so that The CFB mode initial vector can be made different every time, and the CFB mode initial vector can be made unpredictable. Therefore, the obtained ciphertext block can satisfy the Appendix C standard of Non-Patent Document 2 and can be applied to the encryption of the layer 2 frame.

また、n番目の平文ブロックの暗号化にCFBモードを使用することで、n番目の平文ブロックのバイト数はN以下の任意数でよく、平文ブロックのトータルのバイト数を任意数(Nの倍数以外の数でもよい)にすることができる。また、バイト数をNにするためのパディングを不要にでき、平文ブロックのトータルのバイト数が少なくなり、イーサネット(登録商標)フレーム内の各平文ブロックの暗号化に使用できる。   Further, by using the CFB mode for encryption of the nth plaintext block, the number of bytes of the nth plaintext block may be an arbitrary number equal to or less than N, and the total number of bytes of the plaintext block is an arbitrary number (a multiple of N). Any number other than. Also, padding for setting the number of bytes to N can be eliminated, the total number of bytes in the plaintext block is reduced, and the plaintext block in the Ethernet (registered trademark) frame can be used for encryption.

また、ECBモードによる暗号化を行わないことで、得られた暗号文ブロックが意図に反して第3者により解読される可能性を低減することができる。   Further, by not performing encryption in the ECB mode, the possibility that the obtained ciphertext block is decrypted by a third party against the intention can be reduced.

[第4の実施の形態]
図9は、第4の実施の形態に係る復号装置4の構成図である。
[Fourth Embodiment]
FIG. 9 is a configuration diagram of the decoding device 4 according to the fourth embodiment.

復号装置4は、第3の実施の形態の暗号化装置3により得られた平文ブロックを復号するものであり、つまり、n個(ただし、n≧2)の暗号文ブロック201、202、…、20nを復号する復号装置である。   The decrypting device 4 decrypts the plaintext block obtained by the encrypting device 3 of the third embodiment, that is, n (where n ≧ 2) ciphertext blocks 201, 202,. This is a decoding device for decoding 20n.

復号装置4は、1番目の暗号文ブロック201を初期ベクトルとして2番目からn番目の各暗号文ブロック202、…、20nをCFBモードで復号する第1のCFBモード復号部41と、2番目からn番目の暗号文ブロック202、…、20nの中の1つの暗号文ブロックから復号された平文ブロックを暗号化する暗号化部42と、暗号化部42により得られた暗号文を初期ベクトルとして1番目の暗号文ブロック201をCFBモードで復号する第2のCFBモード復号部43とを備える。   The decryption device 4 includes a first CFB mode decryption unit 41 that decrypts each of the second to nth ciphertext blocks 202,..., 20n in the CFB mode using the first ciphertext block 201 as an initial vector, and the second to An encryption unit 42 for encrypting a plaintext block decrypted from one ciphertext block in the n-th ciphertext block 202,..., 20n, and 1 as an initial vector for the ciphertext obtained by the encryption unit 42 A second CFB mode decrypting unit 43 for decrypting the ciphertext block 201 in the CFB mode.

図9では省略するが、第1のCFBモード復号部41と第2のCFBモード復号部43には、同一の鍵が入力される。この鍵は、暗号化装置3で使用された鍵601と同一にする必要がある。また、暗号化部42は、暗号化装置3の暗号化部31と同一にする必要がある。   Although omitted in FIG. 9, the same key is input to the first CFB mode decryption unit 41 and the second CFB mode decryption unit 43. This key needs to be the same as the key 601 used in the encryption device 3. The encryption unit 42 needs to be the same as the encryption unit 31 of the encryption device 3.

n−1番目以下の各暗号文ブロックのバイト数は一定の数Nである。一方、n番目の暗号文ブロックのバイト数はn番目の平文ブロックのバイト数と同数でありつまりN以下の任意数である。つまり、暗号文ブロックのトータルのバイト数は平文ブロックのトータルのバイト数と同数つまり任意数(Nの倍数以外の数でもよい)である。   The number of bytes of each of the (n−1) th and following ciphertext blocks is a fixed number N. On the other hand, the number of bytes of the nth ciphertext block is the same as the number of bytes of the nth plaintext block, that is, an arbitrary number equal to or less than N. That is, the total number of bytes of the ciphertext block is the same as the total number of bytes of the plaintext block, that is, an arbitrary number (may be a number other than a multiple of N).

(復号方法)
次に、復号装置4が行う復号方法を説明する。
(Decryption method)
Next, a decoding method performed by the decoding device 4 will be described.

まず、第1のCFBモード復号部41が、暗号文ブロック201を初期ベクトルとして各暗号文ブロック202、…、20nをCFBモードで復号する。これにより、2番目からn番目の各平文ブロック102、…、10nが得られる。次に、暗号化部42が、平文ブロック102、…、10nの中の1つの暗号文ブロックから復号された平文ブロックを暗号化する。復号される暗号文ブロックは、暗号化装置3の暗号化部31により暗号化された平文ブロックがCFBモード暗号化部32により暗号化されて得られた暗号文ブロックである必要がある。ここでは、暗号化部42が、2番目の暗号文ブロック202から復号された2番目の平文ブロック102を暗号化したこととする。これにより得られた暗号文は、第3の実施の形態の初期ベクトル311と同じものとなる。   First, the first CFB mode decrypting unit 41 decrypts each ciphertext block 202,..., 20n in the CFB mode using the ciphertext block 201 as an initial vector. As a result, the second to nth plaintext blocks 102,..., 10n are obtained. Next, the encryption unit 42 encrypts the plaintext block decrypted from one ciphertext block in the plaintext blocks 102,. The decrypted ciphertext block needs to be a ciphertext block obtained by encrypting the plaintext block encrypted by the encryption unit 31 of the encryption device 3 by the CFB mode encryption unit 32. Here, it is assumed that the encryption unit 42 has encrypted the second plaintext block 102 decrypted from the second ciphertext block 202. The ciphertext thus obtained is the same as the initial vector 311 of the third embodiment.

次に、第2のCFBモード復号部43が、暗号化部42により得られた暗号文を初期ベクトルとして暗号文ブロック201をCFBモードで復号する。これにより、1番目の平文ブロック101が得られる。   Next, the second CFB mode decryption unit 43 decrypts the ciphertext block 201 in the CFB mode using the ciphertext obtained by the encryption unit 42 as an initial vector. As a result, the first plaintext block 101 is obtained.

図10は、第1のCFBモード復号部41による上記復号の仕組みを示す図である。   FIG. 10 is a diagram showing a mechanism of the decoding by the first CFB mode decoding unit 41. As shown in FIG.

第1のCFBモード復号部41は、まず、暗号文ブロック201を鍵601で暗号化し、得られた暗号文と暗号文ブロック202とでXOR演算を行う。これにより、演算結果である平文ブロック102が得られる。   The first CFB mode decryption unit 41 first encrypts the ciphertext block 201 with the key 601 and performs an XOR operation on the obtained ciphertext and the ciphertext block 202. As a result, a plaintext block 102 which is a calculation result is obtained.

第1のCFBモード復号部41は、次に、暗号文ブロック202を鍵601で暗号化し、得られた暗号文と暗号文ブロック203とでXOR演算を行う。これにより、演算結果である平文ブロック103が得られる。   Next, the first CFB mode decryption unit 41 encrypts the ciphertext block 202 with the key 601 and performs an XOR operation on the obtained ciphertext and the ciphertext block 203. As a result, a plaintext block 103 which is a calculation result is obtained.

第1のCFBモード復号部41は、同様のことを順次に行い、その最後で得られた暗号文ブロックを鍵601で暗号化し、得られた暗号文と暗号文ブロック20nとで、先頭から暗号文ブロック20nを構成するバイト数だけXOR演算を行う。これにより、演算結果である平文ブロック10nが得られる。   The first CFB mode decryption unit 41 sequentially performs the same process, encrypts the ciphertext block obtained at the end with the key 601, and encrypts the ciphertext and ciphertext block 20 n obtained from the beginning. XOR operation is performed for the number of bytes constituting the sentence block 20n. Thereby, the plaintext block 10n which is a calculation result is obtained.

図11は、第2のCFBモード復号部43による上記復号の仕組みを示す図である。   FIG. 11 is a diagram showing a mechanism of the decoding by the second CFB mode decoding unit 43. As shown in FIG.

第2のCFBモード復号部43は、初期ベクトル311を鍵601で暗号化し、得られた暗号文と暗号文ブロック201とでXOR演算を行う。これにより、演算結果である平文ブロック101が得られる。   The second CFB mode decrypting unit 43 encrypts the initial vector 311 with the key 601 and performs an XOR operation with the obtained ciphertext and the ciphertext block 201. Thereby, the plaintext block 101 which is a calculation result is obtained.

上記の復号により、n−1番目以下の各平文ブロックのバイト数は一定の数Nとなる。一方、n番目の平文ブロックのバイト数はn番目の暗号文ブロックのバイト数と同数でありつまりN以下の任意数である。これにより、平文ブロックのトータルのバイト数は暗号文ブロックのトータルのバイト数と同数つまり任意数(Nの倍数以外の数でもよい)になる。   As a result of the above decryption, the number of bytes in each of the n−1 and below plaintext blocks is a fixed number N. On the other hand, the number of bytes of the nth plaintext block is the same as the number of bytes of the nth ciphertext block, that is, an arbitrary number equal to or less than N. As a result, the total number of bytes in the plaintext block is the same as the total number of bytes in the ciphertext block, that is, an arbitrary number (may be a number other than a multiple of N).

以上説明したように、第4の実施の形態に係る復号装置4とその復号方法によれば、CFBモードによる復号に必要な各初期ベクトルを暗号文ブロックから得ることで、初期ベクトルのためのフィールドが不要であり、しかも、CFBモードの初期ベクトルを毎回異ならせることができ、かつ、CFBモードの初期ベクトルを予測不能なものにすることができる。また、暗号文ブロックは、非特許文献2のAppendix Cの規格を満足でき、レイヤ2フレームの暗号に適応することができる。   As described above, according to the decryption device 4 and the decryption method thereof according to the fourth embodiment, each initial vector necessary for decryption in the CFB mode is obtained from the ciphertext block, whereby the field for the initial vector is obtained. Is not required, and the initial vector in the CFB mode can be made different every time, and the initial vector in the CFB mode can be made unpredictable. Also, the ciphertext block can satisfy the Appendix C standard of Non-Patent Document 2, and can be applied to layer 2 frame encryption.

なお、本実施の形態の各暗号化方法、各復号方法をコンピュータで構成された暗号化装置、復号装置に実行させるためのコンピュータプログラムは、半導体メモリ、磁気ディスク、光ディスク、光磁気ディスク、磁気テープなどのコンピュータ読み取り可能な記録媒体に格納し、陳列などして流通させたり、当該コンピュータプログラムをインターネットなどの通信網を介して伝送させてもよい。   The computer program for causing the encryption method and the decryption method of the present embodiment to be executed by a computer and a computer program for causing the decryption device to execute are a semiconductor memory, a magnetic disk, an optical disk, a magneto-optical disk, and a magnetic tape. The program may be stored in a computer-readable recording medium such as a display medium and distributed, or the computer program may be transmitted via a communication network such as the Internet.

第1の実施の形態に係る暗号化装置1の構成図である。It is a block diagram of the encryption apparatus 1 which concerns on 1st Embodiment. CBCモード暗号化部12による暗号化の仕組みを示す図である。It is a figure which shows the mechanism of the encryption by the CBC mode encryption part. OFBモード暗号化部13による暗号化の仕組みを示す図である。It is a figure which shows the mechanism of the encryption by OFB mode encryption part 13. FIG. 第2の実施の形態に係る復号装置2の構成図である。It is a block diagram of the decoding apparatus 2 which concerns on 2nd Embodiment. OFBモード復号部21による復号の仕組みを示す図である。It is a figure which shows the mechanism of the decoding by OFB mode decoding part 21. FIG. CBCモード復号部23による復号の仕組みを示す図である。It is a figure which shows the mechanism of the decoding by the CBC mode decoding part 23. FIG. 第3の実施の形態に係る暗号化装置3の構成図である。It is a block diagram of the encryption apparatus 3 which concerns on 3rd Embodiment. CFBモード暗号化部32による暗号化の仕組みを示す図である。It is a figure which shows the mechanism of the encryption by the CFB mode encryption part 32. FIG. 第4の実施の形態に係る復号装置4の構成図である。It is a block diagram of the decoding apparatus 4 which concerns on 4th Embodiment. 第1のCFBモード復号部41による復号の仕組みを示す図である。It is a figure which shows the mechanism of the decoding by the 1st CFB mode decoding part 41. FIG. 第2のCFBモード復号部43による復号の仕組みを示す図である。It is a figure which shows the mechanism of the decoding by the 2nd CFB mode decoding part 43. FIG.

符号の説明Explanation of symbols

1、3…暗号化装置
2、4…復号装置
11、22、31、42…暗号化部
12…CBCモード暗号化部
13…OFBモード暗号化部
21…OFBモード復号部
23…CBCモード復号部
32…CFBモード暗号化部
41…第1のCFBモード復号部
43…第2のCFBモード復号部
DESCRIPTION OF SYMBOLS 1, 3 ... Encryption apparatus 2, 4 ... Decryption apparatus 11, 22, 31, 42 ... Encryption part 12 ... CBC mode encryption part 13 ... OFB mode encryption part 21 ... OFB mode decryption part 23 ... CBC mode decryption part 32 ... CFB mode encryption unit 41 ... first CFB mode decryption unit 43 ... second CFB mode decryption unit

Claims (7)

n個(ただし、n≧2)の平文ブロックを暗号化する暗号化装置が行う暗号化方法であって、
前記平文ブロックは、1から(n−1)番目の平文ブロックがそれぞれ一定の数のバイト数N(ただし、Nは正の整数)を有し、n番目の平文ブロックがバイト数M(ただし、MはM≦Nの正の整数)を有するものであり、
前記暗号化装置に構成された暗号化部が、前記n番目の平文ブロックを暗号化し、
前記暗号化装置に構成されたCBC(Cipher Block Chaining)モード暗号化部が、前記暗号化部により得られた暗号文を初期ベクトルとしてCBCモードで前記n−1番目以下の各平文ブロックを暗号化し、
前記暗号化装置に構成されたOFB(Output Feed Back)モード暗号化部が、前記n−1番目の平文ブロックの暗号化結果を初期ベクトルとしてOFBモードで前記n番目の平文ブロックを暗号化する
ことを特徴とする暗号化方法。
An encryption method performed by an encryption device that encrypts n (where n ≧ 2) plaintext blocks,
In the plaintext block, each of the 1st to (n-1) th plaintext blocks has a certain number of bytes N (where N is a positive integer), and the nth plaintext block has a number of bytes M (wherein M is a positive integer of M ≦ N),
An encryption unit configured in the encryption device encrypts the nth plaintext block;
A CBC (Cipher Block Chaining) mode encryption unit configured in the encryption device encrypts each of the n−1 and subsequent plaintext blocks in the CBC mode using the ciphertext obtained by the encryption unit as an initial vector. ,
An OFB (Output Feed Back) mode encryption unit configured in the encryption device encrypts the n-th plaintext block in the OFB mode using an encryption result of the n−1-th plaintext block as an initial vector; An encryption method characterized by the above.
n個(ただし、n≧2)の暗号文ブロックを復号する復号装置が行う復号方法であって、
前記暗号文ブロックは、1から(n−1)番目の暗号文ブロックがそれぞれ一定の数のバイト数N(ただし、Nは正の整数)を有し、n番目の暗号文ブロックがバイト数M(ただし、MはM≦Nの正の整数)を有するものであり、
前記復号装置に構成されたOFB(Output Feed Back)モード復号部が、前記n−1番目の暗号文ブロックを初期ベクトルとしてOFBモードで前記n番目の暗号文ブロックを復号し、
前記復号装置に構成された暗号化部が、前記n番目の暗号文ブロックから復号された平文ブロックを暗号化し、
前記復号装置に構成されたCBC(Cipher Block Chaining)モード復号部が、前記暗号化部により得られた暗号文を初期ベクトルとしてCBCモードで前記n−1番目以下の各暗号文ブロックを復号する
ことを特徴とする復号方法。
A decryption method performed by a decryption device that decrypts n (where n ≧ 2) ciphertext blocks,
In the ciphertext block, the 1st to (n-1) th ciphertext blocks each have a certain number of bytes N (where N is a positive integer), and the nth ciphertext block has a number of bytes M. Where M is a positive integer M ≦ N,
An OFB (Output Feed Back) mode decryption unit configured in the decryption device decrypts the n-th ciphertext block in the OFB mode using the n−1-th ciphertext block as an initial vector,
An encryption unit configured in the decryption device encrypts a plaintext block decrypted from the nth ciphertext block;
A CBC (Cipher Block Chaining) mode decryption unit configured in the decryption device decrypts each ciphertext block of the (n−1) th or less in the CBC mode using the ciphertext obtained by the encryption unit as an initial vector; A decoding method characterized by the above.
n個(ただし、n≧2)の平文ブロックを暗号化する暗号化装置が行う暗号化方法であって、
前記平文ブロックは、1から(n−1)番目の平文ブロックがそれぞれ一定の数のバイト数N(ただし、Nは正の整数)を有し、n番目の平文ブロックがバイト数M(ただし、MはM≦Nの正の整数)を有するものであり、
前記暗号化装置に構成された暗号化部が、前記2番目からn番目の中の1つの平文ブロックを暗号化し、
前記暗号化装置に構成されたCFB(Cipher Feed Back)モード暗号化部が、前記暗号化部により得られた暗号文を初期ベクトルとしてCFBモードで前記1番目からn番目の各平文ブロックを暗号化する
ことを特徴とする暗号化方法。
An encryption method performed by an encryption device that encrypts n (where n ≧ 2) plaintext blocks,
In the plaintext block, each of the 1st to (n-1) th plaintext blocks has a certain number of bytes N (where N is a positive integer), and the nth plaintext block has a number of bytes M (wherein M is a positive integer of M ≦ N),
An encryption unit configured in the encryption device encrypts one plaintext block from the second to the nth;
The CFB (Cipher Feed Back) mode encryption unit configured in the encryption device encrypts each of the first to nth plaintext blocks in the CFB mode using the ciphertext obtained by the encryption unit as an initial vector. An encryption method characterized by:
n個(ただし、n≧2)の暗号文ブロックを復号する復号装置が行う復号方法であって、
前記暗号文ブロックは、1から(n−1)番目の暗号文ブロックがそれぞれ一定の数のバイト数N(ただし、Nは正の整数)を有し、n番目の暗号文ブロックがバイト数M(ただし、MはM≦Nの正の整数)を有するものであり、
前記復号装置に構成された第1のCFB(Cipher Feed Back)モード復号部が、前記1番目の暗号文ブロックを初期ベクトルとして前記2番目からn番目の各暗号文ブロックをCFBモードで復号し、
前記復号装置に構成された暗号化部が、前記2番目からn番目の中の1つの暗号文ブロックから復号された平文ブロックを暗号化し、
前記復号装置に構成された第2のCFBモード復号部が、前記暗号化部により得られた暗号文を初期ベクトルとして前記1番目の暗号文ブロックをCFBモードで復号する
ことを特徴とする復号方法。
A decryption method performed by a decryption device that decrypts n (where n ≧ 2) ciphertext blocks,
In the ciphertext block, each of the 1st to (n-1) th ciphertext blocks has a certain number of bytes N (where N is a positive integer), and the nth ciphertext block has a number of bytes M. (Where M is a positive integer with M ≦ N),
A first CFB (Cipher Feed Back) mode decryption unit configured in the decryption device decrypts each of the second to nth ciphertext blocks in CFB mode using the first ciphertext block as an initial vector,
An encryption unit configured in the decryption device encrypts a plaintext block decrypted from one ciphertext block in the second to nth;
A second CFB mode decryption unit configured in the decryption device decrypts the first ciphertext block in a CFB mode using the ciphertext obtained by the encryption unit as an initial vector. .
請求項1または3記載の暗号化方法をコンピュータで構成された暗号化装置に実行させるためのコンピュータプログラム。   A computer program for causing an encryption apparatus configured by a computer to execute the encryption method according to claim 1 or 3. 請求項2または4記載の復号方法をコンピュータで構成された復号装置に実行させるためのコンピュータプログラム。   5. A computer program for causing a decoding device constituted by a computer to execute the decoding method according to claim 2 or 4. 請求項5または6記載のコンピュータプログラムが記録されたコンピュータ読み取り可能な記録媒体。   A computer-readable recording medium on which the computer program according to claim 5 is recorded.
JP2008015416A 2008-01-25 2008-01-25 Encryption method and decryption method Active JP4658150B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2008015416A JP4658150B2 (en) 2008-01-25 2008-01-25 Encryption method and decryption method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2008015416A JP4658150B2 (en) 2008-01-25 2008-01-25 Encryption method and decryption method

Publications (2)

Publication Number Publication Date
JP2009175544A JP2009175544A (en) 2009-08-06
JP4658150B2 true JP4658150B2 (en) 2011-03-23

Family

ID=41030684

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2008015416A Active JP4658150B2 (en) 2008-01-25 2008-01-25 Encryption method and decryption method

Country Status (1)

Country Link
JP (1) JP4658150B2 (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR101714108B1 (en) 2009-12-04 2017-03-08 크라이프토그라피 리서치, 인코포레이티드 Verifiable, leak-resistant encryption and decryption
JP6729119B2 (en) * 2016-07-15 2020-07-22 コニカミノルタ株式会社 Encryption device, decryption device, encryption method, computer program, data structure, and storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH0856356A (en) * 1994-08-10 1996-02-27 Fujitsu Ltd Encoding device and decoding device
JPH09233066A (en) * 1996-02-23 1997-09-05 Sony Corp Encryption/decryption method and its device
JP2001285281A (en) * 2000-04-03 2001-10-12 Nec Mobile Commun Ltd Encryption system
JP2002202719A (en) * 2000-11-06 2002-07-19 Sony Corp Device and method for enciphering, device and method for deciphering, and storage medium
JP2004325677A (en) * 2003-04-23 2004-11-18 Sony Corp Encryption processing device, encryption processing method, and computer program

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH0856356A (en) * 1994-08-10 1996-02-27 Fujitsu Ltd Encoding device and decoding device
JPH09233066A (en) * 1996-02-23 1997-09-05 Sony Corp Encryption/decryption method and its device
JP2001285281A (en) * 2000-04-03 2001-10-12 Nec Mobile Commun Ltd Encryption system
JP2002202719A (en) * 2000-11-06 2002-07-19 Sony Corp Device and method for enciphering, device and method for deciphering, and storage medium
JP2004325677A (en) * 2003-04-23 2004-11-18 Sony Corp Encryption processing device, encryption processing method, and computer program

Also Published As

Publication number Publication date
JP2009175544A (en) 2009-08-06

Similar Documents

Publication Publication Date Title
US8416947B2 (en) Block cipher using multiplication over a finite field of even characteristic
US9641331B2 (en) Method for converting a conditional access content and receiver for the implementation for said method
JP3901909B2 (en) ENCRYPTION DEVICE AND RECORDING MEDIUM CONTAINING PROGRAM
US8358781B2 (en) Nonlinear feedback mode for block ciphers
EP2096786A2 (en) Combining instructions including an instruction that performs a sequence of transformations to isolate one transformation
KR20100069610A (en) Methods and devices for a chained encryption mode
US20100111298A1 (en) Block cipher decryption apparatus and method
US20090279697A1 (en) Ciphertext key chaining
KR101815175B1 (en) Apparatus and method for data encryption, apparatus and method for data decryption
US20060023875A1 (en) Enhanced stream cipher combining function
WO2016027454A1 (en) Authentication encryption method, authentication decryption method, and information-processing device
US7925009B2 (en) Hybrid data encryption
JP2018515815A (en) Data encryption apparatus and method, and data decryption apparatus and method
JP2015158665A (en) Variable-length block encrypting device and method for form storage encryption
JP2016523391A (en) Method and apparatus for encrypting plaintext data
Andriani et al. Comparision of AES 128, 192 and 256 bit algorithm for encryption and description file
WO2016067524A1 (en) Authenticated encryption apparatus, authenticated decryption apparatus, authenticated cryptography system, authenticated encryption method, and program
US20100124328A1 (en) Extensive ciphertext feedback
US20090257583A1 (en) Cipher feedback with variable block chaining
EP2904731B1 (en) Method and device for digital data blocks encryption and decryption
US20130308775A1 (en) Block encryption device, decryption device, encrypting method, decrypting method and program
JP4658150B2 (en) Encryption method and decryption method
KR101790948B1 (en) Apparatus and method for providing drm service, apparatus and method for playing contents using drm service
KR20080072345A (en) Apparatus for encryption and method using the same
Uskov et al. Advanced Encryption Standard Analysis with Multimedia Data on Intel® AES-NI Architecture.

Legal Events

Date Code Title Description
A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20100831

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20100914

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20101111

TRDD Decision of grant or rejection written
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20101215

A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20101222

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20140107

Year of fee payment: 3

R150 Certificate of patent or registration of utility model

Ref document number: 4658150

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

S533 Written request for registration of change of name

Free format text: JAPANESE INTERMEDIATE CODE: R313533

R350 Written notification of registration of transfer

Free format text: JAPANESE INTERMEDIATE CODE: R350

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250