JP6729119B2 - Encryption device, decryption device, encryption method, computer program, data structure, and storage medium - Google Patents
Encryption device, decryption device, encryption method, computer program, data structure, and storage medium Download PDFInfo
- Publication number
- JP6729119B2 JP6729119B2 JP2016140471A JP2016140471A JP6729119B2 JP 6729119 B2 JP6729119 B2 JP 6729119B2 JP 2016140471 A JP2016140471 A JP 2016140471A JP 2016140471 A JP2016140471 A JP 2016140471A JP 6729119 B2 JP6729119 B2 JP 6729119B2
- Authority
- JP
- Japan
- Prior art keywords
- block
- plaintext
- key
- cipher
- cipher block
- 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
Links
Images
Description
本発明は、ブロック暗号の技術に関する。 The present invention relates to block cipher technology.
従来、ブロック暗号の技術が普及している。この技術は、平文のデータを所定のサイズのブロック(平文ブロック)に分割し、ブロックごとに暗号化するものである(非特許文献1)。また、ブロック暗号のモード(暗号利用モード)として、次のようなモードが提案されている。 Conventionally, block cipher technology has been widespread. This technique divides plaintext data into blocks of a predetermined size (plaintext blocks) and encrypts each block (Non-Patent Document 1). The following modes have been proposed as block cipher modes (cipher use modes).
ECB(Electronic Codebook)モードは、各平文ブロックを、他のいずれの平文ブロックにも関連させることなく暗号化するモードである。つまり、各平文ブロックを独立的に暗号化するモードである。 The ECB (Electronic Codebook) mode is a mode in which each plaintext block is encrypted without being associated with any other plaintext block. That is, this is a mode in which each plaintext block is independently encrypted.
しかし、ECBモードによると、すべての平文ブロックに共通の暗号鍵を用いて暗号化すると、次のような欠点が生じる。 However, according to the ECB mode, if encryption is performed using a common encryption key for all plaintext blocks, the following drawbacks occur.
ECBモードで複数の暗号化されたブロック(暗号ブロック)のうちの特定の暗号ブロックに対応する平文が分かると、この暗号ブロックに一致する他の暗号ブロックも解読されたことになる。この性質を用いて暗号を解読する方法は、「暗号文一致攻撃」と呼ばれる。 When the plaintext corresponding to a specific cipher block among a plurality of encrypted blocks (cipher blocks) is known in the ECB mode, it means that another cipher block matching this cipher block has also been decrypted. The method of deciphering the cipher using this property is called "ciphertext match attack".
また、暗号ブロックの順番を入れ換えても復号することができる。よって、例えば、銀行の送金の処理の暗号データの中の送金先の口座番号の暗号ブロックと送金元の口座番号の暗号ブロックとを入れ換えても、銀行において送金の処理が行われ得る。すると、本来の目的に反する処理がなされてしまう。この性質を用いて不正を行う方法は、「暗号文改ざん攻撃」と呼ばれる。 Moreover, the decryption can be performed even if the order of the cipher blocks is changed. Therefore, for example, even if the cryptographic block of the account number of the remittance destination and the cryptographic block of the account number of the remittance source in the encrypted data of the remittance process of the bank are replaced, the remittance process can be performed in the bank. Then, a process contrary to the original purpose is performed. A method of making a fraud using this property is called a “ciphertext alteration attack”.
また、ECBモードで暗号化すると、データに何らかのパターンが残留してしまうことがある。例えば、ビットマップの画像を暗号化すると、同一のパターンを表わす複数の平文ブロックは、ともに、同一の暗号ブロックになる。よって、暗号化しても、画像の輪郭などが残留してしまう。 Further, if the encryption is performed in the ECB mode, some pattern may remain in the data. For example, when a bitmap image is encrypted, a plurality of plaintext blocks representing the same pattern become the same cipher block. Therefore, even if encrypted, the contour of the image remains.
ECBモードの欠点を解消するための暗号利用モードとして、CBC(Cipher Block Chaining)モードが提案され、普及している。 A CBC (Cipher Block Chaining) mode has been proposed and widely used as a cipher use mode for solving the drawbacks of the ECB mode.
CBCモードは、平文ブロックと1つ前の暗号ブロックとの排他的論理和(exclusive OR)を算出し、この排他的論理和を暗号化することによって、この平文ブロックの暗号ブロックを生成する。ただし、最初の平文ブロックには、1つ前の暗号ブロックが存在しないので、その代わりに初期化ベクトルが用いられる。初期化ベクトルは、ランダムな値である。 In the CBC mode, an exclusive OR of the plaintext block and the immediately preceding cipher block is calculated, and the cipher block of the plaintext block is generated by encrypting the exclusive OR. However, since there is no previous cipher block in the first plaintext block, the initialization vector is used instead. The initialization vector is a random value.
CBCモードによると、ECBモードの欠点を解消することができる。しかし、暗号されたデータに初期化ベクトルを付加しなければならない。よって、ECBモードで暗号化した場合よりも、データのサイズが大きくなってしまう。 According to the CBC mode, the drawbacks of the ECB mode can be solved. However, an initialization vector must be added to the encrypted data. Therefore, the size of the data becomes larger than that in the case of encryption in the ECB mode.
本発明は、このような問題点に鑑み、ECBモードの欠点を解消しつつ、初期化ベクトルを付加することなく平文を暗号化することを、目的とする。 In view of such problems, an object of the present invention is to eliminate the drawbacks of the ECB mode and to encrypt plaintext without adding an initialization vector.
本発明の一形態に係る暗号化装置は、所定のサイズの平文のブロックであるn個の平文ブロックのそれぞれを暗号化する暗号化装置であって、前記n個の平文ブロックのうちの1番目ないし(n−1)番目の平文ブロックのすべてまたは一部を用いて所定の方法によってハッシュ値を算出するハッシュ値算出手段と、前記n個の平文ブロックのうちのn番目の平文ブロックに対応するn番目の暗号ブロックを、前記ハッシュ値と公開鍵暗号方式の一対の第一の鍵および第二の鍵のうちのいずれか一方とを用いて生成する、第一の暗号化手段と、前記1番目ないし(n−1)番目の平文ブロックのうちの1番目の平文ブロックに対応する1番目の暗号ブロックを、前記n番目の暗号ブロックと前記第一の鍵および前記第二の鍵のうちの前記第一の暗号化手段が使用した鍵とを用いて生成し、p(ただし、2≦p≦(n−1))番目の平文ブロックに対応するp番目の暗号ブロックを、(p−1)番目の暗号ブロックと前記第一の鍵および前記第二の鍵のうちの前記第一の暗号化手段が使用した鍵とを用いて生成する、第二の暗号化手段と、前記1番目の暗号ブロックから、前記n番目の暗号ブロックと前記第一の鍵および前記第二の鍵のうちの前記第一の暗号化手段が使用していない鍵とを用いて前記1番目の平文ブロックを生成し、前記p番目の暗号ブロックから、前記(p−1)番目の暗号ブロックと前記第一の鍵および前記第二の鍵のうちの前記第一の暗号化手段が使用していない鍵とを用いて前記p番目の平文ブロックを生成する、第一の復号手段と、前記第一の復号手段によって得られた前記1番目ないし(n−1)番目の平文ブロックのすべてまたは一部を用いて前記所定の方法によって前記ハッシュ値を算出する第二のハッシュ値算出手段と、前記n番目の暗号ブロックから、前記第二のハッシュ値算出手段によって生成された前記ハッシュ値と前記第一の鍵および前記第二の鍵のうちの前記第一の暗号化手段が使用していない鍵とを用いて前記n番目の平文ブロックを生成する、第二の復号手段と、を有する。
An encryption device according to an aspect of the present invention is an encryption device that encrypts each of n plaintext blocks that are plaintext blocks of a predetermined size, and is the first of the n plaintext blocks. To hash value calculation means for calculating a hash value by a predetermined method using all or part of the (n-1)th plaintext block, and the nth plaintext block of the n plaintext blocks. a first encryption unit that generates an n-th cipher block using the hash value and one of a pair of first key and second key of the public key cryptosystem; The 1st cipher block corresponding to the 1st plaintext block of the nth to (n-1)th plaintext blocks is set to the nth cipher block , the first key, and the second key. The p-th cipher block corresponding to the p (where 2≦p≦(n−1)) plaintext block is generated by using the key used by the first encryption means and is (p−1 ) th generated using a key which the the first encryption means using one of the encryption block first key and the second key, the second encryption means, said first From the cipher block, generate the first plaintext block using the n-th cipher block and one of the first key and the second key that is not used by the first encryption means. Then, from the p-th cipher block, the (p-1)-th cipher block and a key of the first key and the second key that is not used by the first encryption means are extracted. Using the first decoding means for generating the p-th plaintext block using all or part of the first to (n-1)th plaintext block obtained by the first decoding means Second hash value calculating means for calculating the hash value by the predetermined method, the hash value generated by the second hash value calculating means from the nth cipher block, and the first key, and Second decryption means for generating the n-th plaintext block using a key of the second keys that is not used by the first encryption means .
好ましくは、前記第一の暗号化手段は、前記n番目の平文ブロックと前記ハッシュ値との排他的論理和を算出し、当該排他的論理和を暗号化することによって、前記n番目の暗号ブロックを生成し、前記第二の暗号化手段は、前記1番目の平文ブロックと前記n番目の暗号ブロックとの排他的論理和を算出し、当該排他的論理和を暗号化することによって、前記1番目の暗号ブロックを生成し、前記p番目の平文ブロックと前記(p−1)番目の暗号ブロックとの排他的論理和を算出し、当該排他的論理和のそれぞれを暗号化することによって、前記p番目の暗号ブロックを生成する。 Preferably, the first encryption means calculates an exclusive OR of the nth plaintext block and the hash value, and encrypts the exclusive OR to obtain the nth cipher block. And the second encryption means calculates an exclusive OR of the first plaintext block and the nth cipher block, and encrypts the exclusive OR to obtain the 1 Generating the th cipher block, calculating the exclusive OR of the p th plaintext block and the (p−1) th cipher block, and encrypting each of the exclusive OR, Generate the pth cipher block.
または、前記第一の復号手段は、前記1番目の暗号ブロックを復号して前記n番目の暗号ブロックとの排他的論理和を算出することによって、前記1番目の平文ブロックを生成し、前記p番目の暗号ブロックを復号し前記(p−1)番目の暗号ブロックそれぞれとの排他的論理和を算出することによって、前記p番目の平文ブロックを生成し、前記第二の復号手段は、前記n番目の暗号ブロックを復号し前記ハッシュ値との排他的論理和を算出することによって前記n番目の平文ブロックを生成する。 Alternatively, the first decryption means generates the first plaintext block by decrypting the first cipher block and calculating the exclusive OR with the nth cipher block, and the p The p-th plaintext block is generated by decrypting the th cipher block and calculating the exclusive OR with each of the (p-1) th cipher blocks, and the second decryption means is configured to generate the n-th plaintext block. The nth plaintext block is generated by decrypting the th cipher block and calculating the exclusive OR with the hash value.
本発明によると、ECBモードの欠点を解消しつつ、初期化ベクトルを付加することなく平文を暗号化することができる。 According to the present invention, the plaintext can be encrypted without adding an initialization vector while eliminating the drawbacks of the ECB mode.
図1は、機密データ処理装置1を含むシステムの全体の構成の例を示す図である。図2は、機密データ処理装置1のハードウェア構成の例を示す図である。図3は、機密データ処理装置1の機能的構成の例を示す図である。
FIG. 1 is a diagram showing an example of the overall configuration of a system including the confidential
機密データ処理装置1は、機密にすべきデータを暗号化して出力する。また、暗号化されたデータを復号する。
The confidential
機密データ処理装置1は、図1に示すように、通信回線3を介して複合機2などと接続される。
As shown in FIG. 1, the confidential
機密データ処理装置1として、パーソナルコンピュータまたはいわゆるサーバ機などが用いられる。以下、機密データ処理装置1としてパーソナルコンピュータが用いられる場合を例に説明する。
As the confidential
機密データ処理装置1は、図2に示すように、CPU(Central Processing Unit)10a、RAM(Random Access Memory)10b、ROM(Read Only Memory)10c、補助記憶装置10d、液晶ディスプレイ10e、NIC(Network Interface Card)10f、キーボード10g、およびポインティングデバイス10hなどによって構成される。
As shown in FIG. 2, the confidential
液晶ディスプレイ10eは、ユーザに対するメッセージを示す画面、ユーザがコマンドまたは情報を入力するための画面、およびCPU10aが実行した処理の結果を示す画面などを表示する。
The
NIC10fは、TCP/IPなどのプロトコルによって複合機2などと通信回線3を介して通信を行う。
The NIC 10f communicates with the multifunction peripheral 2 and the like via the
キーボード10gおよびポインティングデバイス10hは、ユーザがコマンドまたは情報を入力するために用いられる。
The
ROM10cまたは補助記憶装置10dには、オペレーティングシステムのほか、暗号化復号プログラム10Pが記憶されている。これらのプログラムは、RAM10bにロードされ、CPU10aによって実行される。補助記憶装置10dとして、ハードディスクまたはSSD(Solid State Drive)などが用いられる。
The
複合機2は、コピー、ネットワークプリント、ファックス、およびスキャンなどの機能を集約した装置である。「MFP(Multi Function Peripherals)」または「画像形成装置」などと呼ばれることがある。 The multi-function peripheral 2 is a device in which functions such as copy, network print, fax, and scan are integrated. It may be called “MFP (Multi Function Peripherals)” or “image forming apparatus”.
暗号化復号プログラム10Pによると、データを暗号化したり暗号化されたデータを復号したりすることができる。特に、初期化ベクトルを付加することなくECB(Electronic Codebook)モードよりも機密性の高い暗号化を実現することができる。以下、この仕組みについて説明する。初期化ベクトルは、「IV(initialization vector)」と呼ばれることがある。 According to the encryption/decryption program 10P, it is possible to encrypt data or decrypt encrypted data. In particular, it is possible to realize encryption with higher confidentiality than the ECB (Electronic Codebook) mode without adding an initialization vector. Hereinafter, this mechanism will be described. The initialization vector is sometimes called "IV (initialization vector)".
暗号化復号プログラム10Pによると、図3に示す平文データ分割部101、第一のハッシュ値演算部102、第一の排他的論理和演算部103、第一の暗号化処理部104、第二の排他的論理和演算部105、第二の暗号化処理部106、暗号ブロック結合部107、印刷処理部108、暗号データ分割部121、第一の復号処理部122、第三の排他的論理和演算部123、第二のハッシュ値演算部124、第二の復号処理部125、第四の排他的論理和演算部126、および平文ブロック結合部127などの機能が実現される。以下、図3に示す各部の処理を、暗号化の処理および復号の処理に大別して説明する。
According to the encryption/decryption program 10P, the plaintext
〔暗号化〕
図4は、平文データ5Aの分割およびハッシュ値Haの算出の例を説明するための図である。図5は、平文データ5Aの暗号化の処理の例を説明するための図である。
〔encryption〕
FIG. 4 is a diagram for explaining an example of dividing the plaintext data 5A and calculating the hash value Ha. FIG. 5 is a diagram for explaining an example of a process of encrypting the plaintext data 5A.
ユーザは、暗号化する対象のデータを機密データ処理装置1に用意する。このデータは、平文のデータである。以下、このデータを「平文データ5A」と記載する。
The user prepares the data to be encrypted in the confidential
例えば、平文データ5Aとして、契約書などのドキュメントのハッシュ値および契約者のサインの画像のデータを用意する。 For example, as the plaintext data 5A, data of a hash value of a document such as a contract and an image of the signature of the contractor is prepared.
そして、ユーザは、暗号化復号プログラム10Pを機密データ処理装置1に起動させ、平文データ5Aを指定する。
Then, the user activates the encryption/decryption program 10P in the confidential
すると、平文データ分割部101ないし暗号ブロック結合部107は、図4および図5に示す手順で処理を実行する。
Then, the plaintext
平文データ分割部101は、平文データ5Aを所定のサイズ(例えば、256バイト)
の平文ブロックLaに分割する(図4の#701)。平文ブロックLaは、ビット列のデータとして取り扱われる。
The plaintext
Is divided into plaintext blocks La (#701 in FIG. 4). The plaintext block La is handled as bit string data.
以下、平文データ分割部101によって平文データ5Aがn個の平文ブロックLaに分割された場合を例に説明する。1番目の平文ブロックLa、2番目の平文ブロックLa、…、n番目の平文ブロックLaをそれぞれ「平文ブロックLa_1」、「平文ブロックLa_2」、…、「平文ブロックLa_n」と区別して記載することがある。
Hereinafter, a case where the plaintext
第一のハッシュ値演算部102は、1番目から(n−1)番目までのそれぞれの平文ブロックLa_の排他的論理和を、平文データ5Aの、平文ブロックLa_nを除いた部分のハッシュ値Haとして算出する(#702)。すなわち、次の(1)式によってハッシュ値Haを算出する。ハッシュ値Haのサイズは、平文ブロックLaのサイズに等しい。
Ha=La_1 xor La_2 xor … xor La_(n−1) (1)
第一の排他的論理和演算部103は、n番目の平文ブロックLaとハッシュ値Haとの排他的論理和Lb_nを算出する(図5の#703)。
The first hash
Ha=La_1 xor La_2 xor... xor La_(n-1) (1)
The first exclusive OR
第一の暗号化処理部104は、第一の排他的論理和演算部103によって算出された排他的論理和Lb_nを公開鍵暗号方式で暗号化することによって、n番目の暗号ブロックLcを生成する(#704)。暗号ブロックLcのサイズは、平文ブロックLaのサイズに等しい。この際に、暗号鍵として、1対の公開鍵5Pおよび秘密鍵5Qのうちの一方が用いられる。以下、公開鍵5Pが用いられる場合を例に説明する。
The first
第二の排他的論理和演算部105および第二の暗号化処理部106は、1番目から(n−1)番目までのそれぞれの暗号ブロックLcを生成する(#705、#706、…)。
The second exclusive OR
ここで、k番目の暗号ブロックLcを生成する場合の、第二の排他的論理和演算部105および第二の暗号化処理部106の処理を説明する。
Here, the processing of the second exclusive OR
第二の排他的論理和演算部105は、k番目の排他的論理和Lb(つまり、排他的論理和Lb_k)として、k番目の平文ブロックLaと(k−1)番目の暗号ブロックLcとの排他的論理和を算出する。ただし、k=1の場合は、1番目の平文ブロックLaとn番目の暗号ブロックLcとの排他的論理和を算出する。
The second exclusive OR
第二の暗号化処理部106は、第二の排他的論理和演算部105によって算出されたk番目の排他的論理和(すなわち、排他的論理和Lb_k)を公開鍵暗号方式で暗号化することによって、k番目の暗号ブロックLcを生成する。この際に、第一の暗号化処理部104で用いられた暗号鍵が用いられる。つまり、本実施形態では、公開鍵5Pが用いられる。
The second
以上の処理によって、1番目からn番目までのそれぞれの暗号ブロックLcが得られる。以下、1番目、2番目、…、n番目それぞれの暗号ブロックLcを「暗号ブロックLc_1」、「暗号ブロックLc_2」、…、「暗号ブロックLc_n」と区別して記載することがある。 Through the above processing, each of the first to nth cipher blocks Lc is obtained. Hereinafter, the first, second,..., Nth cipher blocks Lc may be described separately as “cipher block Lc_1”, “cipher block Lc_2”,..., “Cipher block Lc_n”.
具体的には、第二の排他的論理和演算部105は、平文ブロックLa_1と暗号ブロックLc_nとの排他的論理和を算出することによって、排他的論理和Lb_1を算出する(#705)。そして、第二の暗号化処理部106は、排他的論理和Lb_1を公開鍵暗号方式で暗号化することによって、暗号ブロックLc_1を生成する(#706)。
Specifically, the second exclusive OR
同様に、平文ブロックLa_2および暗号ブロックLc_1から排他的論理和Lb_2が算出され(#707)、排他的論理和Lb_2を公開鍵暗号方式で暗号化することによって暗号ブロックLc_2が生成される(#708)。平文ブロックLa_3および暗号ブロックLc_2から排他的論理和Lb_3が算出され(#709)、排他的論理和Lb_3を公開鍵暗号方式で暗号化することによって暗号ブロックLc_3が生成される(#710)。以下、同様に処理が行われる。 Similarly, the exclusive OR Lb_2 is calculated from the plaintext block La_2 and the cipher block Lc_1 (#707), and the cipher block Lc_2 is generated by encrypting the exclusive OR Lb_2 by the public key cryptosystem (#708). ). The exclusive OR Lb_3 is calculated from the plaintext block La_3 and the cipher block Lc_2 (#709), and the exclusive OR Lb_3 is encrypted by the public key cryptosystem to generate the cipher block Lc_3 (#710). Thereafter, the same processing is performed.
そして、最後に、平文ブロックLa_(n−1)および暗号ブロックLc(n−2)から排他的論理和Lb_(n−1)が算出され(#71x)、排他的論理和Lb_(n−1)を公開鍵暗号方式で暗号化することによって暗号ブロックLc_(n−1)が生成される(#71y)。 Then, finally, the exclusive OR Lb_(n-1) is calculated from the plaintext block La_(n-1) and the cipher block Lc(n-2) (#71x), and the exclusive OR Lb_(n-1). ) Is encrypted by the public key cryptosystem to generate a cipher block Lc_(n-1) (#71y).
暗号ブロック結合部107は、1番目からn番目までのそれぞれの暗号ブロックLc(Lc_1、Lc_2、…、Lc_n)を1つのデータに結合することによって、暗号データ5Bを生成する。
The cipher
暗号データ5Bは、ユーザが指定した記録媒体またはフォルダなどに保存されまたはユーザが指定した装置へ送信される。印刷処理部108によって次のように使用される。
The
印刷処理部108は、暗号データ5Bを表わす二次元バーコードを生成し、二次元バーコードを印刷するための印刷データ5Dを生成する。そして、二次元バーコードを印刷するように複合機2へ指令する。この際に、印刷データ5Dを複合機2へ送信する。印刷データ5Dは、複合機2に対応したPDL(Page Description Language)で記述すればよい。
The
複合機2は、指令および印刷データ5Dを機密データ処理装置1から受信すると、これらに基づいて二次元バーコードを用紙に印刷する。
When the
〔復号〕
図6は、暗号データ5Bを復号する処理の例を説明するための図である。
[Decryption]
FIG. 6 is a diagram for explaining an example of a process of decrypting the
次に、暗号データ5Bを復号する際の機密データ処理装置1の各部の処理およびユーザの操作を、図6を参照しながら説明する。
Next, the process of each unit of the confidential
ユーザは、暗号化復号プログラム10Pを予め起動しておく。そして、復号する対象のデータとして暗号データ5Bを指定する。
The user activates the encryption/decryption program 10P in advance. Then, the
または、ユーザは、二次元バーコードが印刷された用紙を複合機2にセットし、二次元バーコードを複合機2に読み取らせる。複合機2から機密データ処理装置1へ二次元バーコードの画像データを送信させる。そして、二次元バーコードを機密データ処理装置1に解析させることによって、暗号データ5Bを機密データ処理装置1に用意する。二次元バーコードの解析は、複合機2に行わせてもよい。
Alternatively, the user sets the paper on which the two-dimensional barcode is printed on the
すると、暗号データ分割部121は、暗号データ5Bを所定のサイズ(例えば、256バイト)に分割する。これにより、暗号データ5Bが複数の暗号ブロックLdに分割される。
Then, the encrypted
暗号ブロックLdは、平文ブロックLa、排他的論理和Lb、および暗号ブロックLcと同様に、ビット列のデータとして取り扱われる。 The cipher block Ld is treated as bit string data, like the plaintext block La, the exclusive OR Lb, and the cipher block Lc.
暗号データ5Bが改ざんされていなければ、暗号データ5Bを分割することによって、n個の暗号ブロックLdが得られる。以下、1番目、2番目、…、n番目のそれぞれの暗号ブロックLdを「暗号ブロックLd_1」、「暗号ブロックLd_2」、…、「暗号ブロックLd_n」と区別して記載することがある。
If the
また、暗号データ5Bが改ざんされていなければ、暗号ブロックLd_1、Ld_2、…、Ld_nは、それぞれ、暗号ブロックLc_1、Lc_2、…、Lc_nと一致する。
If the
第一の復号処理部122および第三の排他的論理和演算部123は、1番目から(n−1)番目までのそれぞれの平文ブロックLfを次のように生成する。
The first
ここで、j番目の平文ブロックLfを生成する場合の、第一の復号処理部122および第三の排他的論理和演算部123の処理を説明する。
Here, the processing of the first
第一の復号処理部122は、j番目の暗号ブロックLdを公開鍵暗号方式によって復号する。この際に、公開鍵5Pおよび秘密鍵5Qのうち、第一の暗号化処理部104によって暗号鍵として使用された鍵とは異なるほうが復号鍵として用いられる。したがって、本実施形態では、暗号ブロックLdを復号するために秘密鍵5Qが用いられる。
The first
以下、暗号ブロックLdを復号することによって得られた平文のブロックを「平文ブロックLe」と記載する。また、1番目、2番目、…、n番目の平文ブロックLeをそれぞれ「平文ブロックLe_1」、「平文ブロックLe_2」、…、「平文ブロックLe_n」と区別して記載することがある。 Hereinafter, a plaintext block obtained by decrypting the cipher block Ld is referred to as a “plaintext block Le”. Also, the first, second,..., Nth plaintext block Le may be described separately as “plaintext block Le_1”, “plaintext block Le_2”,..., “Plaintext block Le_n”.
第三の排他的論理和演算部123は、j番目の平文ブロックLe(つまり、平文ブロックLe_j)と(j−1)番目の暗号ブロックLd(つまり、暗号ブロックLd_(j−1))との排他的論理和を算出する。この排他的論理和が、j番目の平文ブロックLfである。ただし、j=1の場合は、1番目の平文ブロックLeとn番目の暗号ブロックLdとの排他的論理和を算出する。
The third exclusive OR
以下、1番目、2番目、…、n番目の平文ブロックLfをそれぞれ「平文ブロックLf_1」、「平文ブロックLf_2」、…、「平文ブロックLf_n」と区別して記載することがある。 Hereinafter, the first, second,..., Nth plaintext block Lf may be referred to as “plaintext block Lf_1”, “plaintext block Lf_2”,..., “Plaintext block Lf_n”, respectively.
具体的には、まず、第一の復号処理部122は、暗号ブロックLd_2を復号する(図6の#721)。これにより、平文ブロックLe_2が生成される。第三の排他的論理和演算部123は、平文ブロックLe_1と暗号ブロックLd_nとの排他的論理和を平文ブロックLf_1として算出する(#722)。
Specifically, first, the first
さらに、第一の復号処理部122は、暗号ブロックLd_2を復号することによって、平文ブロックLe_2を生成する(#723)。第三の排他的論理和演算部123は、平文ブロックLe_2と暗号ブロックLd_1との排他的論理和を平文ブロックLf_2として算出する(#724)。
Further, the first
以下、同様に、適宜、各ブロックが1つずつシフトしながら、暗号ブロックLd_jが復号されて平文ブロックLe_jが生成され、平文ブロックLe_jと暗号ブロックLd_(j−1)との排他的論理和が平文ブロックLf_jとして算出される。 Similarly, the cipher block Ld_j is decrypted to generate the plaintext block Le_j while shifting each block by one, and the exclusive OR of the plaintext block Le_j and the cipher block Ld_(j−1) is performed. It is calculated as a plaintext block Lf_j.
そして、最後に、暗号ブロックLd_nが復号されて平文ブロックLe_(n−1)が生成され(#72x)、平文ブロックLe_(n−1)と暗号ブロックLd_(n−2)との排他的論理和が平文ブロックLf_(n−1)として算出される(#72y)。 Finally, the cipher block Ld_n is decrypted to generate the plaintext block Le_(n-1) (#72x), and the exclusive logic of the plaintext block Le_(n-1) and the cipher block Ld_(n-2) is obtained. The sum is calculated as a plaintext block Lf_(n-1) (#72y).
なお、暗号データ5Bが改ざんされていなければ、平文ブロックLf_1、Lf_2、…、Lf_(n−1)は、それぞれ、図5に示した平文ブロックLa_1、La_2、…、La_(n−1)と一致する。
If the
第二のハッシュ値演算部124は、第三の排他的論理和演算部123によって算出された1番目から(n−1)番目までのそれぞれの平文ブロックLf(Lf_1、Lf_2、…、Lf_(n−1))の排他的論理和を、ハッシュ値Hbとして算出する(#731)。
The second hash
暗号データ5Bが改ざんされていなければ、ハッシュ値Hbは、ハッシュ値Haと一致する。
If the
第二の復号処理部125は、ステップ#731の処理と並行してまたは前後して、第一の復号処理部122で用いられた復号鍵(本実施形態では、秘密鍵5Q)を用いて公開鍵暗号方式によって暗号ブロックLd_nを復号する(#732)。これにより、平文ブロックLe_nが生成される。
The second
第四の排他的論理和演算部126は、第二のハッシュ値演算部124によって得られたハッシュ値Hbと第二の復号処理部125によって得られた平文ブロックLe_nとの排他的論理和を、平文ブロックLf_nとして算出する(#733)。
The fourth exclusive OR
暗号データ5Bが改ざんされていなければ、平文ブロックLf_nは、平文ブロックLa_nと一致する。
If the
そして、平文ブロック結合部127は、1番目からn番目までの平文ブロックLf(Lf_1、Lf_2、…、Lf_n)を1つのデータに結合することによって、平文データ5Cを生成する。
Then, the plaintext
以上の処理によって、暗号データ5Bが復号される。暗号データ5Bが改ざんされていなければ、平文データ5Cは、平文データ5Aと一致する。
By the above processing, the
平文データ5Cは、ユーザが指定したフォルダに保存されまたはユーザが指定した装置へ送信される。 The plaintext data 5C is stored in a folder designated by the user or transmitted to the device designated by the user.
図7は、暗号化復号プログラム10Pによる全体的な処理の流れの例を説明するフローチャートである。図8は、暗号化処理の流れの例を説明するフローチャートである。図9は、復号処理の流れの例を説明するフローチャートである。 FIG. 7 is a flowchart illustrating an example of the overall processing flow of the encryption/decryption program 10P. FIG. 8 is a flowchart illustrating an example of the flow of encryption processing. FIG. 9 is a flowchart illustrating an example of the flow of decoding processing.
次に、図7〜図9のフローチャートを参照しながら、機密データ処理装置1の全体的な処理の流れを説明する。
Next, an overall processing flow of the confidential
機密データ処理装置1は、図7に示す処理を暗号化復号プログラム10Pに基づいて実行する。
The confidential
機密データ処理装置1は、暗号化する対象のデータとして平文データ5Aが指定されると(図7の#11)、平文データ5Aを取得し(#12)、平文データ5Aを暗号化する処理を実行する(#13)。暗号化の処理の手順は、図8に示す通りである。
When the plaintext data 5A is designated as the data to be encrypted (#11 in FIG. 7), the confidential
図8において、機密データ処理装置1は、平文データ5Aを所定のサイズの複数の平文ブロックLaに分割する(#741)。以下、n個の平文ブロックLa(La_1、La_2、…、La_n)に分割された場合を例に説明する。最後の平文ブロックLaを除く平文ブロックLa(つまり、平文ブロックLa_1〜La_(n−1))のハッシュ値Haを生成する(#742)。
In FIG. 8, the confidential
機密データ処理装置1は、ハッシュ値Haと平文ブロックLa_nとの排他的論理和Lb_nを算出し(#743)、排他的論理和Lb_nを公開鍵5Pで暗号化することによって暗号ブロックLc_nを生成する(#744)。
The confidential
さらに、機密データ処理装置1は、1番目から(n−1)番目までのそれぞれの暗号ブロックLc(Lc_1〜Lc_(n−1))を次のように生成する(#746〜#749)。
Further, the confidential
機密データ処理装置1は、平文ブロックLa_kと暗号ブロックLc_(k−1)の排他的論理和Lc_kを算出する(#746)。ただし、k=1、の場合は、暗号ブロックLc_nが用いられる。そして、排他的論理和Lc_kを公開鍵5Pで暗号化することによって暗号ブロックLd_kを生成する(#747)。kは、2、3、…、(n−1)と、1ずつインクリメントされる。
The confidential
暗号ブロックLc_1〜Lc_nが生成されたら、機密データ処理装置1は、これらを結合することによって暗号データ5Bを生成する(#750)。
When the cipher blocks Lc_1 to Lc_n are generated, the confidential
このように#741〜#750の処理によって、平文データ5Aが暗号化され、暗号データ5Bが得られる。
In this way, the plaintext data 5A is encrypted and the
図7に戻って、機密データ処理装置1は、暗号データ5Bを、ユーザが指定したフォルダに保存し、ユーザが指定した装置へ送信し、または、暗号データ5Bを表わす二次元バーコードを生成し、複合機2に印刷させる(#14)。
Returning to FIG. 7, the confidential
または、機密データ処理装置1は、復号する対象として暗号データ5Bが指定されると(#15でYes)、暗号データ5Bを取得し(#16)、暗号データ5Bを復号する処理を実行する(#17)。復号の処理の手順は、図9に示す通りである。
Alternatively, when the
図9において、機密データ処理装置1は、暗号データ5Bを所定のサイズの複数の暗号ブロックLdに分割する(#761)。以下、n個の暗号ブロックLd(Ld_1〜Ld_n)に分割された場合を例に説明する。
In FIG. 9, the confidential
機密データ処理装置1は、1番目から(n−1)番目までの平文ブロックLf(Lf_1〜Lf_(n−1))を次のように生成する(#762〜#766)。
The confidential
機密データ処理装置1は、暗号ブロックLd_jを秘密鍵5Qで復号することによって平文ブロックLe_jを生成し(#763)、平文ブロックLe_jと暗号ブロックLd_(j−1)との排他的論理和を平文ブロックLf_jとして算出する(#764)。ただし、j=1、の場合は、暗号ブロックLd_nが用いられる。jは、1、2、…、(n−1)と、1つずつインクリメントされる。
The confidential
さらに、機密データ処理装置1は、平文ブロックLf_1〜Lf_(n−1)のハッシュ値Hbを算出するとともに(#767)、暗号ブロックLd_nを秘密鍵5Qで復号することによって平文ブロックLe_nを生成する(#768)。
Further, the confidential
そして、機密データ処理装置1は、ハッシュ値Hbと暗号ブロックLe_nとの排他的論理和を平文ブロックLf_nとして算出する(#769)。
Then, the confidential
平文ブロックLf_1〜Lf_nが生成されたら、機密データ処理装置1は、これらを結合することによって平文データ5Cを生成する(#770)。
When the plaintext blocks Lf_1 to Lf_n are generated, the confidential
図7に戻って、機密データ処理装置1は、平文データ5Cを、ユーザが指定したフォルダに保存し、または、ユーザが指定した装置へ送信する(#18)。
Returning to FIG. 7, the confidential
本実施形態によると、ECBモードの欠点を解消しつつ、初期化ベクトルを付加することなく平文データ5Aを暗号化することができる。これにより、ECBモードの欠点を解消する従来の暗号利用モードよりも、暗号データ5Bのサイズを小さくすることができる。
According to the present embodiment, the plaintext data 5A can be encrypted without adding the initialization vector while eliminating the drawbacks of the ECB mode. As a result, the size of the
よって、暗号データ5Bを表わす二次元バーコードのサイズを、従来の暗号利用モードよりも小さくすることができる。
Therefore, the size of the two-dimensional bar code representing the
図10は、PCBCモードを変形した暗号化の処理の例を説明するための図である。図11は、PCBCモードを変形した復号の処理の例を説明するための図である。図12は、CFBモードを変形した暗号化の処理の例を説明するための図である。図13は、CFBモードを変形した復号の処理の例を説明するための図である。図14は、OFBモードを変形した暗号化の処理の例を説明するための図である。図15は、OFBモードを変形した復号の処理の例を説明するための図である。図16は、CTRモードを変形した暗号化の処理の例を説明するための図である。図17は、CTRモードを変形した復号の処理の例を説明するための図である。 FIG. 10 is a diagram for explaining an example of encryption processing in which the PCBC mode is modified. FIG. 11 is a diagram for explaining an example of a decoding process in which the PCBC mode is modified. FIG. 12 is a diagram for explaining an example of encryption processing in which the CFB mode is modified. FIG. 13 is a diagram for explaining an example of decoding processing in which the CFB mode is modified. FIG. 14 is a diagram for explaining an example of encryption processing in which the OFB mode is modified. FIG. 15 is a diagram for explaining an example of a decoding process in which the OFB mode is modified. FIG. 16 is a diagram for explaining an example of encryption processing in which the CTR mode is modified. FIG. 17 is a diagram for explaining an example of a decoding process in which the CTR mode is modified.
本実施形態では、機密データ処理装置1は、ハッシュ値Haおよびハッシュ値Hbを(n−1)個のブロックの排他的論理和を算出することによって生成したが、他の方法によって生成してもよい。例えば、SHA−3(Secure Hashing Algorithm 3)のSHAKE256によって算出してもよい。または、(n−1)個未満の特定のブロックの排他的論理和を算出することによって生成してもよい。または、特定のブロック(平文ブロックLa)をハッシュ値Haとして使用し、特定のブロック(その平文ブロックLaに対応する平文ブロックLf)をハッシュ値Hbとして使用してもよい。
In the present embodiment, the confidential
本実施形態では、機密データ処理装置1は、CBC(Cipher Block Chaining)モードを次のように変形して、暗号化および復号を行った。
In the present embodiment, the confidential
(A1) 暗号化の際に、CBCモードでは、平文ブロックLa_nと暗号ブロックLc_(n−1))との排他的論理和を算出する。しかし、本実施形態では、図5のステップ#703〜#704に示した通り、暗号ブロックLc_(n−1)の代わりにハッシュ値Haを用いて排他的論理和を算出する。 (A1) At the time of encryption, in the CBC mode, the exclusive OR of the plaintext block La_n and the cipher block Lc_(n-1)) is calculated. However, in the present embodiment, as shown in steps #703 to #704 of FIG. 5, the hash value Ha is used instead of the cipher block Lc_(n−1) to calculate the exclusive OR.
(A2) 暗号化の際に、CBCモードでは、初期化ベクトルを用意し、平文ブロックLa_1と初期化ベクトルとの排他的論理和を算出する。しかし、本実施形態では、ステップ#705に示した通り、初期化ベクトルの代わりに暗号ブロックLc_nを用いて排他的論理和を算出する。
(A2) At the time of encryption, in the CBC mode, an initialization vector is prepared and the exclusive OR of the plaintext block La_1 and the initialization vector is calculated. However, in the present embodiment, as shown in
(A3) 復号の際に、CBCモードでは、暗号ブロックLd_1と暗号データに含まれる初期化ベクトルとの排他的論理和を算出する。しかし、本実施形態では、初期化ベクトルの代わりに暗号ブロックLd_nを用いて排他的論理和を算出する。 (A3) At the time of decryption, in the CBC mode, the exclusive OR of the cipher block Ld_1 and the initialization vector included in the cipher data is calculated. However, in the present embodiment, the exclusive OR is calculated using the cipher block Ld_n instead of the initialization vector.
(A4) 復号の際に、CBCモードでは、暗号ブロックLd_nを復号したもの(つまり、平文ブロックLe_n)と暗号ブロックLd_(n−1)との排他的論理和を算出する。しかし、本実施形態では、暗号ブロックLd_(n−1)の代わりにハッシュ値Hbを用いて排他的論理和を算出する。 (A4) At the time of decryption, in the CBC mode, the exclusive OR of the decrypted cipher block Ld_n (that is, the plaintext block Le_n) and the cipher block Ld_(n-1) is calculated. However, in the present embodiment, the exclusive OR is calculated using the hash value Hb instead of the cipher block Ld_(n-1).
上記の(A1)〜(A4)は、CBCモード以外の暗号利用モードを変形する際にも適用することができる。 The above (A1) to (A4) can also be applied when transforming the encryption use mode other than the CBC mode.
例えば、PCBC(Propagating Cipher Block Chaining)モードを変形し、図10に示すように暗号化を行い、図11に示すように復号を行ってもよい。 For example, the PCB (Propagating Cipher Block Chaining) mode may be modified to perform encryption as shown in FIG. 10 and decryption as shown in FIG.
つまり、第一の排他的論理和演算部103および第一の暗号化処理部104の代わりに、第一の暗号化処理部は、図10に示すように、平文ブロックLa_nとハッシュ値Haとの排他的論理和を算出し、この排他的論理和を暗号化することによって、暗号ブロックLc’_nを生成する。
That is, instead of the first exclusive-
さらに、第二の排他的論理和演算部105および第二の暗号化処理部106の代わりに、第二の暗号化処理部は、平文ブロックLa_1と暗号ブロックLc’_nとの排他的論理和を算出し、この排他的論理和を暗号化することによって、1番目の暗号ブロックLc’_1を生成する。平文ブロックLa_(p−1)と暗号ブロックLc’_(p−1)との第一の排他的論理を算出し、この第一の排他的論理和と平文ブロックLa_pとの第二の排他的論理和を算出し、この第二の排他的論理和を暗号化することによって、暗号ブロックLc’_pを生成する。ただし、2≦p≦(n−1)、である。以下、同様である。
Further, instead of the second exclusive OR
そして、暗号ブロックLc'_1、Lc'_2、…、Lc'_nを結合することによって、暗号データが生成される。図12、図14、および図16においても、同様である。 Then, cipher data is generated by combining the cipher blocks Lc′_1, Lc′_2,..., Lc′_n. The same applies to FIGS. 12, 14, and 16.
第一の復号処理部122および第三の排他的論理和演算部123の代わりに、第一の復号処理部は、図11に示すように、暗号ブロックLd’_1を復号して暗号ブロックLd’_nとの排他的論理和を算出することによって、平文ブロックLf_1を生成する。暗号ブロックLd’_(p−1)と平文ブロックLf_(p−1)との第一の排他的論理和を算出し、この第一の排他的論理和と暗号ブロックLd’_pを復号したものとの第二の排他的論理和を算出することによって、平文ブロックLf_pを生成する。
Instead of the first
さらに、第二の復号処理部125および第四の排他的論理和演算部126の代わりに第二の復号処理部は、暗号ブロックLd’_nを復号しハッシュ値Hbとの排他的論理和を算出することによって平文ブロックLf_nを生成する。
Further, instead of the second
暗号データが改ざんされていなければ、暗号ブロックLd’_1、Ld’_2、…、Ld'_nは、それぞれ、暗号ブロックLc’_1、Lc’_2、…、Lc'_nと一致する。そして、平文ブロックLa_1、La_2、…、La_nは、それぞれ、平文ブロックLf_1、Lf_2、…、Lf_nと一致する。図12〜図17においても、同様である。 If the encrypted data has not been tampered with, the cipher blocks Ld'_1, Ld'_2,..., Ld'_n match the cipher blocks Lc'_1, Lc'_2,..., Lc'_n, respectively. The plaintext blocks La_1, La_2,..., La_n match the plaintext blocks Lf_1, Lf_2,..., Lf_n, respectively. The same applies to FIGS. 12 to 17.
または、CFB(Cipher Feedback)モードを変形し、図12に示すように暗号化を行い、図13に示すように復号を行ってもよい。 Alternatively, the CFB (Cipher Feedback) mode may be modified, encryption may be performed as shown in FIG. 12, and decryption may be performed as shown in FIG.
第一の暗号化処理部は、図12に示すように、ハッシュ値Haを暗号化して平文ブロックLa_nとの排他的論理和を算出することによって、暗号ブロックLc’_nを生成する。 As shown in FIG. 12, the first encryption processing unit encrypts the hash value Ha and calculates the exclusive OR with the plaintext block La_n to generate the cipher block Lc'_n.
第二の暗号化処理部は、暗号ブロックLc’_nを暗号化して平文ブロックLa_1との排他的論理和を算出することによって暗号ブロックLc’_1を生成し、暗号ブロックLc’_(p−1)を暗号化して平文ブロックLa_pとの排他的論理和を算出することによって、暗号ブロックLc’_pを生成する。 The second encryption processing unit encrypts the cipher block Lc'_n and calculates the exclusive OR with the plaintext block La_1 to generate the cipher block Lc'_1, and the cipher block Lc'_(p-1 ) Is encrypted and the exclusive OR with the plaintext block La_p is calculated to generate the cipher block Lc′_p.
第一の復号処理部は、図13に示すように、暗号ブロックLd’_nを復号して暗号ブロックLd’_1との排他的論理和を算出することによって、平文ブロックLf_1を生成し、暗号ブロックLd’_(p−1)を復号して暗号ブロックLd’_pとの排他的論理和を算出することによって、平文ブロックLf_pを生成する。 As shown in FIG. 13, the first decryption processing unit decrypts the cipher block Ld′_n and calculates the exclusive OR with the cipher block Ld′_1 to generate the plaintext block Lf_1, thereby generating the plaintext block Lf_1. The plaintext block Lf_p is generated by decrypting Ld′_(p−1) and calculating the exclusive OR with the cipher block Ld′_p.
第二の復号処理部は、ハッシュ値Hbを復号し暗号ブロックLd’_nとの排他的論理和を算出することによって平文ブロックLf_nを生成する、
または、OFB(Output Feedback)モードを変形し、図14に示すように暗号化を行い、図15に示すように復号を行ってもよい。
The second decryption processing unit decrypts the hash value Hb and calculates the exclusive OR with the cipher block Ld′_n to generate the plaintext block Lf_n,
Alternatively, the OFB (Output Feedback) mode may be modified, encryption may be performed as shown in FIG. 14, and decryption may be performed as shown in FIG.
第一の暗号化処理部は、図14に示すように、ハッシュ値Haを暗号化して平文ブロックLa_nとの排他的論理和を算出することによって、暗号ブロックLc’_nを生成する。 As shown in FIG. 14, the first encryption processing unit encrypts the hash value Ha and calculates the exclusive OR with the plaintext block La_n to generate the cipher block Lc'_n.
第二の暗号化処理部は、暗号ブロックLc’_nを暗号化して平文ブロックLa_1との排他的論理和を算出することによって暗号ブロックLc’_1を生成し、暗号ブロックLc’_nをp回暗号化したものと平文ブロックLa_pとの排他的論理和を算出することによって、暗号ブロックLc’_pを生成する。 The second encryption processing unit encrypts the cipher block Lc′_n and calculates the exclusive OR with the plaintext block La_1 to generate the cipher block Lc′_1, and encrypts the cipher block Lc′_n p times. The cipher block Lc′_p is generated by calculating the exclusive OR of the encrypted one and the plaintext block La_p.
第一の復号処理部は、図15に示すように、暗号ブロックLd’_nを復号して暗号ブロックLd’_1との排他的論理和を算出することによって平文ブロックLf_1を生成する。暗号ブロックLd’_nをp回復号したものと暗号ブロックLd’_pとの排他的論理和を算出することによって、平文ブロックLf_pを生成する。 As shown in FIG. 15, the first decryption processing unit decrypts the cipher block Ld'_n and calculates the exclusive OR with the cipher block Ld'_1 to generate the plaintext block Lf_1. The plaintext block Lf_p is generated by calculating the exclusive OR of the cipher block Ld'_n decrypted p times and the cipher block Ld'_p.
第二の復号処理部は、ハッシュ値Hbを復号し暗号ブロックLd’_nとの排他的論理和を算出することによって平文ブロックLf_nを生成する。 The second decryption processing unit produces the plaintext block Lf_n by decrypting the hash value Hb and calculating the exclusive OR with the cipher block Ld'_n.
または、CTR(Counter)モードを、Nonceを使用することなく暗号化および復号を行えるように次のように変形してもよい。 Alternatively, the CTR (Counter) mode may be modified as follows so that encryption and decryption can be performed without using Nonce.
(B1) 暗号化の際に、CTRモードでは、Nonceと平文ブロックLa_nに対応するカウンタCr_nとを組み合わせることによって、カウンタブロックCk_nを生成する。以下、排他的論理和を算出することによって両者を組み合わせる場合を例に説明する。しかし、機密データ処理装置1は、図16に示すように、NONCEの代わりにハッシュ値Haを用いてカウンタブロックCk_nを生成する。
(B1) At the time of encryption, in the CTR mode, the Nonce and the counter Cr_n corresponding to the plaintext block La_n are combined to generate the counter block Ck_n. Hereinafter, a case where the two are combined by calculating the exclusive OR will be described as an example. However, as shown in FIG. 16, the confidential
(B2) 暗号化の際に、CTRモードでは、1〜(n−1)番目のカウンタブロックCk(つまり、カウンタブロックCk_1〜Ck_(n−1))を、Nonceと1〜(n−1)番目それぞれのカウンタCr(つまり、カウンタCr_1〜Cr_(n−1))とを組み合わせることによって、生成する。しかし、機密データ処理装置1は、図16に示すように、Nonceの代わりに暗号ブロックLc’_nを用いて生成する。
(B2) At the time of encryption, in the CTR mode, the 1st to (n-1)th counter blocks Ck (that is, the counter blocks Ck_1 to Ck_(n-1)) are set to Nonce and 1 to (n-1). It is generated by combining each of the second counters Cr (that is, the counters Cr_1 to Cr_(n-1)). However, the confidential
(B3) 復号の際に、B2同様に、CTRモードでは、カウンタブロックCk_1〜Ck_(n−1)を、NonceとカウンタCr_1〜Cr_(n−1)とを組み合わせることによって、生成する。しかし、機密データ処理装置1は、図17に示すように、Nonceの代わりに暗号ブロックLd’_nを用いて生成する。
(B3) At the time of decoding, similarly to B2, in the CTR mode, counter blocks Ck_1 to Ck_(n-1) are generated by combining Nonce and counters Cr_1 to Cr_(n-1). However, as shown in FIG. 17, the confidential
(B4) 復号の際に、CTRモードでは、Nonceと平文ブロックLf_nに対応するカウンタCr_nとを組み合わせることによって、カウンタブロックCk_nを生成する。しかし、機密データ処理装置1は、Nonceの代わりにハッシュ値Hbを組み合わせることによって生成する。
(B4) At the time of decryption, in the CTR mode, the counter block Ck_n is generated by combining Nonce and the counter Cr_n corresponding to the plaintext block Lf_n. However, the confidential
つまり、第一の暗号化処理部は、図16に示すように、カウンタCr_nとハッシュ値Haとの排他的論理和を算出することによって、カウンタブロックCk_nを生成する。カウンタブロックCk_nを暗号化して平文ブロックLa_nとの排他的論理和を算出することによって、暗号ブロックLc’_nを生成する。 That is, as shown in FIG. 16, the first encryption processing unit generates the counter block Ck_n by calculating the exclusive OR of the counter Cr_n and the hash value Ha. The cipher block Lc'_n is generated by encrypting the counter block Ck_n and calculating the exclusive OR with the plaintext block La_n.
第二の暗号化処理部は、カウンタCr_mと暗号ブロックLc’_nとの排他的論理和を算出することによってカウンタブロックCk_mを生成し、カウンタブロックCk_mをを暗号化して平文ブロックLa_mとの排他的論理和を算出することによって、暗号ブロックLc’_mを生成する。ただし、1≦m≦(n−1)、である。 The second encryption processing unit generates a counter block Ck_m by calculating the exclusive OR of the counter Cr_m and the cipher block Lc′_n, encrypts the counter block Ck_m, and performs exclusive exclusion with the plaintext block La_m. The cipher block Lc′_m is generated by calculating the logical sum. However, 1≦m≦(n−1).
第一の復号処理部は、図17に示すように、カウンタCr_mと暗号ブロックLd’_mとの排他的論理和を算出することによってカウンタブロックCk_mを生成し、カウンタブロックCk_mを復号して暗号ブロックLd’_mとの排他的論理和を算出することによって、平文ブロックLf_mを生成する。 As shown in FIG. 17, the first decryption processing unit generates a counter block Ck_m by calculating the exclusive OR of the counter Cr_m and the cipher block Ld′_m, and decrypts the counter block Ck_m to decrypt the cipher block. A plaintext block Lf_m is generated by calculating an exclusive OR with Ld′_m.
第二の復号処理部は、カウンタCr_nとハッシュ値Hbとの排他的論理和を算出することによってカウンタブロックCk_nを生成し、カウンタブロックCk_nを復号して暗号ブロックLd’_nとの排他的論理和を算出することによって、平文ブロックLf_nを生成する。 The second decryption processing unit generates a counter block Ck_n by calculating the exclusive OR of the counter Cr_n and the hash value Hb, decrypts the counter block Ck_n, and the exclusive OR of the cipher block Ld′_n. To calculate a plaintext block Lf_n.
本実施形態では、暗号化の処理および復号の処理を、暗号化復号プログラム10PをCPU10aで実行することによって実現したが、ASIC(Application Specific Integrated Circuit)またはFPGA(Field Programmable Gate Array)などの回路によって実現してもよい。
In the present embodiment, the encryption process and the decryption process are realized by executing the encryption/decryption program 10P by the
本実施形態では、公開鍵暗号方式によって暗号化および復号を行ったが、共通鍵暗号方式によって暗号化および復号を行ってもよい。 In this embodiment, the public key cryptosystem is used for encryption and decryption, but the common key cryptosystem may be used for encryption and decryption.
本実施形態では、平文データ5Aとして、契約書などのドキュメントのハッシュ値および契約者のサインの画像のデータを用いたが、他のデータを用いてもよい。例えば、契約書などのドキュメントのハッシュ値および契約者の印鑑(印影)のデータを用いてもよい。または、機密資料のデータを用いてもよい。 In the present embodiment, as the plaintext data 5A, the hash value of the document such as the contract and the image of the image of the signature of the contractor are used, but other data may be used. For example, the hash value of a document such as a contract and the data of the seal (imprint) of the contractor may be used. Alternatively, data of confidential material may be used.
その他、機密データ処理装置1の全体または各部の構成、処理の内容、処理の順序などは、本発明の趣旨に沿って適宜変更することができる。
In addition, the configuration of the entire confidential
1 機密データ処理装置(暗号化装置、復号装置)
101 平文データ分割部(分割手段)
102 第一のハッシュ値演算部(ハッシュ値算出手段)
103 第一の排他的論理和演算部(第一の暗号化手段)
104 第一の暗号化処理部(第一の暗号化手段)
105 第二の排他的論理和演算部(第二の暗号化手段)
106 第二の暗号化処理部(第二の暗号化手段)
108 印刷処理部(印刷処理手段)
121 暗号データ分割部(分割手段)
122 第一の復号処理部(第一の復号手段)
123 第三の排他的論理和演算部(第一の復号手段)
124 第二のハッシュ値演算部(第二のハッシュ値算出手段)
125 第二の復号処理部(第二の復号手段)
126 第四の排他的論理和演算部(第二の復号手段)
2 複合機(印刷装置)
5A 平文データ
5C 平文データ
5P 公開鍵(第一の鍵)
5Q 秘密鍵(第二の鍵)
La 平文ブロック
Lb 排他的論理和
Lc 暗号ブロック
Ld 暗号ブロック
Lf 平文ブロック
Ha ハッシュ値
Hb ハッシュ値
1 Confidential data processing device (encryption device, decryption device)
101 plaintext data dividing unit (dividing means)
102 First hash value calculation unit (hash value calculation means)
103 First Exclusive-OR Operation Unit (First Encryption Means)
104 First encryption processing unit (first encryption means)
105 Second Exclusive-OR Operation Unit (Second Encryption Means)
106 second encryption processing unit (second encryption means)
108 print processing unit (print processing means)
121 Encrypted data dividing unit (dividing means)
122 First Decoding Processing Unit (First Decoding Means)
123 Third Exclusive-OR Operation Unit (First Decoding Means)
124 Second Hash Value Calculation Unit (Second Hash Value Calculation Means)
125 Second Decoding Processing Unit (Second Decoding Means)
126 Fourth Exclusive-Or Operation Unit (Second Decoding Means)
2 Multi-function machine (printing device)
5A plaintext data 5C
5Q private key (second key)
La plaintext block Lb exclusive OR Lc cipher block Ld cipher block Lf plaintext block Ha hash value Hb hash value
Claims (28)
前記n個の平文ブロックのうちの1番目ないし(n−1)番目の平文ブロックのすべてまたは一部を用いて所定の方法によってハッシュ値を算出するハッシュ値算出手段と、
前記n個の平文ブロックのうちのn番目の平文ブロックに対応するn番目の暗号ブロックを、前記ハッシュ値と公開鍵暗号方式の一対の第一の鍵および第二の鍵のうちのいずれか一方とを用いて生成する、第一の暗号化手段と、
前記1番目ないし(n−1)番目の平文ブロックのうちの1番目の平文ブロックに対応する1番目の暗号ブロックを、前記n番目の暗号ブロックと前記第一の鍵および前記第二の鍵のうちの前記第一の暗号化手段が使用した鍵とを用いて生成し、p(ただし、2≦p≦(n−1))番目の平文ブロックに対応するp番目の暗号ブロックを、(p−1)番目の暗号ブロックと前記第一の鍵および前記第二の鍵のうちの前記第一の暗号化手段が使用した鍵とを用いて生成する、第二の暗号化手段と、
前記1番目の暗号ブロックから、前記n番目の暗号ブロックと前記第一の鍵および前記第二の鍵のうちの前記第一の暗号化手段が使用していない鍵とを用いて前記1番目の平文ブロックを生成し、前記p番目の暗号ブロックから、前記(p−1)番目の暗号ブロックと前記第一の鍵および前記第二の鍵のうちの前記第一の暗号化手段が使用していない鍵とを用いて前記p番目の平文ブロックを生成する、第一の復号手段と、
前記第一の復号手段によって得られた前記1番目ないし(n−1)番目の平文ブロックのすべてまたは一部を用いて前記所定の方法によって前記ハッシュ値を算出する第二のハッシュ値算出手段と、
前記n番目の暗号ブロックから、前記第二のハッシュ値算出手段によって生成された前記ハッシュ値と前記第一の鍵および前記第二の鍵のうちの前記第一の暗号化手段が使用していない鍵とを用いて前記n番目の平文ブロックを生成する、第二の復号手段と、
を有することを特徴とする暗号化装置。 An encryption device for encrypting each of n plaintext blocks, which are plaintext blocks of a predetermined size,
Hash value calculation means for calculating a hash value by a predetermined method using all or part of the first to (n-1)th plaintext blocks of the n plaintext blocks;
The n-th cipher block corresponding to the n-th plaintext block of the n plaintext blocks is defined as one of the hash value and the pair of first key and second key of the public key cryptosystem. A first encryption means generated by using
The 1st cipher block corresponding to the 1st plaintext block among the 1st to (n-1)th plaintext blocks is converted into the nth cipher block , the 1st key and the 2nd key. Of the keys used by the first encryption means among them, and the p-th cipher block corresponding to the p (where 2≦p≦(n−1))-th plaintext block is (p -1) second encryption means generated using the first cipher block and the key used by the first encryption means of the first key and the second key ;
From the first cipher block, the n-th cipher block and the first key and the second key, which are not used by the first encryption means, are used for the first cipher block. A plaintext block is generated and used from the p-th cipher block by the first encryption means of the (p-1)-th cipher block and the first key and the second key. First decryption means for generating the p-th plaintext block using a non-key
Second hash value calculation means for calculating the hash value by the predetermined method using all or part of the first to (n-1)th plaintext blocks obtained by the first decryption means; ,
The hash value generated by the second hash value calculation means from the nth cipher block and the first encryption means of the first key and the second key are not used. Second decryption means for generating the n-th plaintext block using a key;
An encryption device comprising:
前記第二の暗号化手段は、前記1番目の平文ブロックと前記n番目の暗号ブロックとの排他的論理和を算出し、当該排他的論理和を暗号化することによって、前記1番目の暗号ブロックを生成し、前記p番目の平文ブロックと前記(p−1)番目の暗号ブロックとの排他的論理和を算出し、当該排他的論理和のそれぞれを暗号化することによって、前記p番目の暗号ブロックを生成する、
請求項1に記載の暗号化装置。 The first encryption unit calculates the exclusive OR of the nth plaintext block and the hash value, and encrypts the exclusive OR to generate the nth encrypted block. ,
The second encryption means calculates an exclusive OR of the first plaintext block and the nth cipher block, and encrypts the exclusive OR to obtain the first cipher block. To calculate the exclusive OR of the p-th plaintext block and the (p-1)-th cipher block, and encrypt each of the exclusive ORs to obtain the p-th cipher Generate blocks,
The encryption device according to claim 1 .
前記第二の復号手段は、前記n番目の暗号ブロックを復号し前記ハッシュ値との排他的論理和を算出することによって前記n番目の平文ブロックを生成する、
請求項2に記載の暗号化装置。 The first decryption unit generates the first plaintext block by decrypting the first cipher block and calculating an exclusive OR with the nth cipher block, and the first plaintext block is generated. Generate the p-th plaintext block by decrypting the cipher block and calculating the exclusive OR with each of the (p-1)-th cipher block
The second decryption unit decrypts the nth cipher block and calculates an exclusive OR with the hash value to generate the nth plaintext block.
The encryption device according to claim 2 .
前記第二の暗号化手段は、前記1番目の平文ブロックと前記n番目の暗号ブロックとの排他的論理和を算出し、当該排他的論理和を暗号化することによって、前記1番目の暗号ブロックを生成し、前記(p−1)番目の平文ブロックと前記(p−1)番目の暗号ブロックとの排他的論理を算出し、当該排他的論理和と前記p番目の平文ブロックとの排他的論理和を算出して暗号化することによって、前記p番目の暗号ブロックを生成する、
請求項1に記載の暗号化装置。 The first encryption unit calculates the exclusive OR of the nth plaintext block and the hash value, and encrypts the exclusive OR to generate the nth encrypted block. ,
The second encryption means calculates an exclusive OR of the first plaintext block and the nth cipher block, and encrypts the exclusive OR to obtain the first cipher block. To calculate an exclusive logic between the (p-1)th plaintext block and the (p-1)th ciphertext block, and calculate an exclusive OR between the exclusive OR and the pth plaintext block. Generating the p-th cipher block by calculating the logical sum and encrypting
The encryption device according to claim 1 .
前記第二の復号手段は、前記n番目の暗号ブロックを復号し前記ハッシュ値との排他的論理和を算出することによって前記n番目の平文ブロックを生成する、
請求項4に記載の暗号化装置。 The first decryption unit decrypts the first cipher block and calculates an exclusive OR with the nth cipher block to generate the first plaintext block, and the (p- 1) The first exclusive OR of the cipher block and the (p-1)th plaintext block is calculated, and the first exclusive OR and the pth cipher block are decrypted. Generate the p-th plaintext block by computing the second exclusive OR of
The second decryption unit decrypts the nth cipher block and calculates an exclusive OR with the hash value to generate the nth plaintext block.
The encryption device according to claim 4 .
前記第二の暗号化手段は、前記n番目の暗号ブロックを暗号化して前記1番目の平文ブロックとの排他的論理和を算出することによって前記1番目の暗号ブロックを生成し、前記(p−1)番目の暗号ブロックを暗号化して前記p番目の平文ブロックとの排他的論理和を算出することによって、前記p番目の暗号ブロックを生成する、
請求項1に記載の暗号化装置。 The first encryption means generates the n-th cipher block by encrypting the hash value and calculating an exclusive OR with the n-th plaintext block,
The second encryption means generates the first cipher block by encrypting the n-th cipher block and calculating an exclusive OR with the first plaintext block, and the (p- 1) The p-th cipher block is generated by encrypting the p-th cipher block and calculating the exclusive OR with the p-th plaintext block,
The encryption device according to claim 1 .
前記第二の復号手段は、前記ハッシュ値を復号し前記n番目の暗号ブロックとの排他的論理和を算出することによって前記n番目の平文ブロックを生成する、
請求項6に記載の暗号化装置。 The first decryption unit generates the first plaintext block by decrypting the n-th cipher block and calculating an exclusive OR with the first cipher block, and the (p- 1) generate the p-th plaintext block by decrypting the 1st-th cipher block and calculating the exclusive OR with the p-th cipher block
The second decryption unit decrypts the hash value and calculates an exclusive OR with the nth cipher block to generate the nth plaintext block.
The encryption device according to claim 6 .
前記第二の暗号化手段は、前記n番目の暗号ブロックを暗号化して前記1番目の平文ブロックとの排他的論理和を算出することによって前記1番目の暗号ブロックを生成し、前記n番目の暗号ブロックをp回暗号化したものと前記p番目の平文ブロックとの排他的論理和を算出することによって、前記p番目の暗号ブロックを生成する、
請求項1に記載の暗号化装置。 The first encryption means generates the n-th cipher block by encrypting the hash value and calculating an exclusive OR with the n-th plaintext block,
The second encryption means generates the first cipher block by encrypting the n-th cipher block and calculating the exclusive OR with the first plaintext block, and the n-th cipher block is generated. The p-th cipher block is generated by calculating the exclusive OR of the cipher block encrypted p times and the p-th plaintext block.
The encryption device according to claim 1 .
前記第二の復号手段は、前記ハッシュ値を復号し前記n番目の暗号ブロックとの排他的論理和を算出することによって前記n番目の平文ブロックを生成する、
請求項8に記載の暗号化装置。 The first decryption unit generates the first plaintext block by decrypting the n-th cipher block and calculating the exclusive OR with the first cipher block, and the n-th cipher block is generated. Generating the p-th plaintext block by calculating the exclusive OR of the block decrypted p times and the p-th cipher block,
The second decryption unit decrypts the hash value and calculates an exclusive OR with the nth cipher block to generate the nth plaintext block.
The encryption device according to claim 8 .
前記第二の暗号化手段は、m(ただし、1≦m≦(n−1))番目のカウンタと前記n番目の暗号ブロックとを用いてm番目のカウンタブロックを生成し、当該m番目のカウンタブロックを暗号化して前記m番目の平文ブロックとの排他的論理和を算出することによって、前記m番目の暗号ブロックを生成する、
請求項1に記載の暗号化装置。 The first encryption means generates an n-th counter block using the n-th counter and the hash value, encrypts the n-th counter block, and performs exclusive access to the n-th plaintext block. Generate the nth cipher block by calculating the logical sum,
The second encryption means generates an m-th counter block using the m-th (where 1≦m≦(n−1))-th counter and the n-th cipher block, and the m-th counter block is generated. The m-th cipher block is generated by encrypting the counter block and calculating the exclusive OR with the m-th plaintext block.
The encryption device according to claim 1 .
前記第二の復号手段は、前記n番目のカウンタと前記ハッシュ値とを用いて前記n番目のカウンタブロックを生成し、当該n番目のカウンタブロックを復号して前記n番目の暗号ブロックとの排他的論理和を算出することによって、前記n番目の平文ブロックを生成する、
請求項10に記載の暗号化装置。 The first decryption unit generates the m-th counter block using the m-th counter and the n-th cipher block, decrypts the m-th counter block, and then the m-th cipher block. Generate an m-th plaintext block by calculating an exclusive OR with
The second decryption means generates the n-th counter block using the n-th counter and the hash value, decrypts the n-th counter block, and excludes the n-th cipher block. Generate the n-th plaintext block by calculating the logical OR
The encryption device according to claim 10 .
請求項1ないし請求項11のいずれかに記載の暗号化装置。 The hash value calculation means calculates the hash value by calculating an exclusive OR of the first to (n-1)th plaintext blocks.
The encryption device according to any one of claims 1 to 11 .
請求項1ないし請求項12に記載の暗号化装置。 The second hash value calculation means calculates the hash value by calculating an exclusive OR of the first to (n-1)th plaintext blocks.
Encryption device according to claims 1 to 12.
を有する、
請求項1ないし請求項13のいずれかに記載の暗号化装置。 A printing device is provided with a process for printing a two-dimensional code representing the n-th cipher block generated by the first encryption means and the p-th cipher block generated by the second encryption means on a sheet. Print processing means to be executed,
Has,
The encryption device according to any one of claims 1 to 13 .
請求項1ないし請求項14のいずれかに記載の暗号化装置。 The n plaintext blocks are obtained by dividing the hash value of the document and the plaintext data indicating the information indicating the identity of the person.
The encryption device according to any one of claims 1 to 14 .
請求項15に記載の暗号化装置。 The information is an image of a signature,
The encryption device according to claim 15 .
請求項1ないし請求項16のいずれかに記載の暗号化装置。 The hash value calculation means, the first encryption means, and the second encryption means are realized by executing a computer program loaded in a RAM (Random Access Memory) by a CPU (Central Processing Unit). The
The encryption device according to any one of claims 1 to 16 .
請求項1ないし請求項17のいずれかに記載の暗号化装置。 The first decryption unit, the second hash value calculation unit, and the second decryption unit are realized by executing the computer program loaded in the RAM by the CPU.
Encryption device according to any one of claims 1 to 17.
前記n個の平文ブロックのうちの1番目ないし(n−1)番目の平文ブロックのすべてまたは一部を用いて所定の方法によってハッシュ値を算出するハッシュ値算出手段と、
前記n個の平文ブロックのうちのn番目の平文ブロックに対応するn番目の暗号ブロックを、前記ハッシュ値と公開鍵暗号方式の一対の第一の鍵および第二の鍵のうちのいずれか一方とを用いて生成する、第一の暗号化手段と、
前記1番目ないし(n−1)番目の平文ブロックのうちの1番目の平文ブロックに対応する1番目の暗号ブロックを、前記n番目の暗号ブロックと公開鍵暗号方式の一対の第一の鍵および第二の鍵のうちのいずれか一方とを用いて生成し、p(ただし、2≦p≦(n−1))番目の平文ブロックに対応するp番目の暗号ブロックを、(p−1)番目の暗号ブロックと前記第一の鍵および前記第二の鍵のうちの前記第一の暗号化手段が使用した鍵とを用いて生成する、第二の暗号化手段と、
前記第一の暗号化手段または前記第二の暗号化手段によって生成された前記1番目ないしn番目の暗号ブロックを出力する出力手段と、
を有することを特徴とする暗号化装置。 An encryption device for encrypting each of n plaintext blocks, which are plaintext blocks of a predetermined size,
Hash value calculation means for calculating a hash value by a predetermined method using all or part of the first to (n-1)th plaintext blocks of the n plaintext blocks;
The n-th cipher block corresponding to the n-th plaintext block of the n plaintext blocks is defined as one of the hash value and the pair of first key and second key of the public key cryptosystem. A first encryption means generated by using
The 1st cipher block corresponding to the 1st plaintext block among the 1st to (n-1)th plaintext blocks is the nth cipher block and a pair of first keys of the public key cryptosystem and A p-th cipher block corresponding to a p (where 2≦p≦(n−1)) plaintext block is generated by using one of the second keys and (p−1) Second encryption means generated using a second cipher block and a key used by the first encryption means of the first key and the second key ;
Output means for outputting the first to nth cipher blocks generated by the first encryption means or the second encryption means;
An encryption device comprising:
前記1番目の暗号ブロックから、前記n番目の暗号ブロックを用いて前記1番目の平文ブロックを生成し、前記p番目の暗号ブロックから、前記(p−1)番目の暗号ブロックと前記第一の鍵および前記第二の鍵のうちの前記暗号化装置の第一の暗号化手段が使用していない鍵とを用いて前記p番目の平文ブロックを生成する、第一の復号手段と、
前記第一の復号手段によって得られた前記1番目ないし(n−1)番目の平文ブロックのすべてまたは一部を用いて前記暗号化装置のハッシュ値算出手段で使用された所定の方法によって前記ハッシュ値を算出する第二のハッシュ値算出手段と、
前記n番目の暗号ブロックから、前記第二のハッシュ値算出手段によって生成された前記ハッシュ値と前記第一の鍵および前記第二の鍵のうちの前記第一の暗号化手段が使用していない鍵とを用いて前記n番目の平文ブロックを生成する、第二の復号手段と、
を有することを特徴とする復号装置。 A decryption device for decrypting the first to nth cipher blocks generated by the encryption device according to claim 19 .
Before Symbol first cipher block, using the n-th cipher block to generates the first plaintext block, from the p-th cipher block, the said (p-1) th cipher block the generating the p-th plaintext block using a key one key and the second first encryption means of the encryption device of the key is not used, the first decoding means,
The hash by the predetermined method used by the hash value calculation means of the encryption device by using all or part of the first to (n-1)th plaintext blocks obtained by the first decryption means A second hash value calculating means for calculating a value,
The hash value generated by the second hash value calculation means from the nth cipher block and the first encryption means of the first key and the second key are not used. generating the n th plaintext block using a key, a second decoding means,
Decoding device comprising a Turkey which have a.
請求項20に記載の復号装置。 The first decryption unit, the hash value calculation unit, and the second decryption unit are realized by executing a computer program loaded in a RAM with a CPU.
The decoding device according to claim 20 .
暗号化装置が、
前記n個の平文ブロックのうちの1番目ないし(n−1)番目の平文ブロックのすべてまたは一部を用いて所定の方法によってハッシュ値を算出するハッシュ値算出処理を実行し、
前記n個の平文ブロックのうちのn番目の平文ブロックに対応するn番目の暗号ブロックを、前記ハッシュ値と公開鍵暗号方式の一対の第一の鍵および第二の鍵のうちのいずれか一方とを用いて生成する第一の暗号化処理を実行し、
前記1番目ないし(n−1)番目の平文ブロックのうちの1番目の平文ブロックに対応する1番目の暗号ブロックを、前記n番目の暗号ブロックと前記第一の鍵および前記第二の鍵のうちの前記第一の暗号化処理で使用した鍵とを用いて生成し、p(ただし、2≦p≦(n−1))番目の平文ブロックに対応するp番目の暗号ブロックを、(p−1)番目の暗号ブロックと前記第一の鍵および前記第二の鍵のうちの前記第一の暗号化処理で使用した鍵とを用いて生成する第二の暗号化処理を実行し、
復号装置が、
前記1番目の暗号ブロックから、前記n番目の暗号ブロックと前記第一の鍵および前記第二の鍵のうちの前記第一の暗号化処理で使用していない鍵とを用いて前記1番目の平文ブロックを生成し、前記p番目の暗号ブロックから、前記(p−1)番目の暗号ブロックと前記第一の鍵および前記第二の鍵のうちの前記第一の暗号化処理で使用していない鍵とを用いて前記p番目の平文ブロックを生成する第一の復号処理を実行し、
前記第一の復号処理によって得られた前記1番目ないし(n−1)番目の平文ブロックのすべてまたは一部を用いて前記所定の方法によって前記ハッシュ値を算出する第二のハッシュ値算出処理を実行し、
前記n番目の暗号ブロックから、前記第二のハッシュ値算出処理によって生成された前記ハッシュ値と前記第一の鍵および前記第二の鍵のうちの前記第一の暗号化処理で使用していない鍵とを用いて前記n番目の平文ブロックを生成する第二の復号処理を実行する、
ことを特徴とする暗号化方法。 An encryption method for encrypting each of n plaintext blocks which are plaintext blocks of a predetermined size,
The encryption device
A hash value calculation process for calculating a hash value by a predetermined method using all or part of the first to (n-1)th plaintext blocks of the n plaintext blocks,
The n-th cipher block corresponding to the n-th plaintext block of the n plaintext blocks is defined as one of the hash value and the pair of first key and second key of the public key cryptosystem. run the first encryption process for generating with bets,
The 1st cipher block corresponding to the 1st plaintext block among the 1st to (n-1)th plaintext blocks is converted into the nth cipher block , the 1st key and the 2nd key. Generated using the key used in the first encryption process, and the p-th cipher block corresponding to the p (where 2≦p≦(n−1))-th plaintext block is (p -1) performing a second encryption process that is generated using the first cipher block and the key used in the first encryption process among the first key and the second key ,
The decryption device
From the first cipher block, the n-th cipher block and the first key and the second key, which are not used in the first encryption process, are used for the first cipher block. A plaintext block is generated and used from the p-th cipher block in the (p-1)-th cipher block and the first encryption process of the first key and the second key. Performing a first decryption process for generating the p-th plaintext block using a non-key
A second hash value calculation process for calculating the hash value by the predetermined method using all or part of the first to (n-1)th plaintext blocks obtained by the first decryption process. Run and
The hash value generated by the second hash value calculation process from the nth cipher block and the first key and the second key that are not used in the first encryption process Performing a second decryption process for generating the n-th plaintext block using the key,
An encryption method characterized by the following.
前記コンピュータに、
前記n個の平文ブロックのうちの1番目ないし(n−1)番目の平文ブロックのすべてまたは一部を用いて所定の方法によってハッシュ値を算出する第一の処理を実行させ、
前記n個の平文ブロックのうちのn番目の平文ブロックに対応するn番目の暗号ブロックを、前記ハッシュ値と公開鍵暗号方式の一対の第一の鍵および第二の鍵のうちのいずれか一方とを用いて生成する第二の処理を実行させ、
前記1番目ないし(n−1)番目の平文ブロックのうちの1番目の平文ブロックに対応する1番目の暗号ブロックを、前記n番目の暗号ブロックと前記第一の鍵および前記第二の鍵のうちの前記第二の処理で使用した鍵とを用いて生成し、p(ただし、2≦p≦(n−1))番目の平文ブロックに対応するp番目の暗号ブロックを、(p−1)番目の暗号ブロックと前記第一の鍵および前記第二の鍵のうちの前記第二の処理で使用した鍵とを用いて生成する第三の処理を実行させ、
前記1番目の暗号ブロックから、前記n番目の暗号ブロックと前記第一の鍵および前記第二の鍵のうちの前記第二の処理で使用していない鍵とを用いて前記1番目の平文ブロックを生成し、前記p番目の暗号ブロックから、前記(p−1)番目の暗号ブロックと前記第一の鍵および前記第二の鍵のうちの前記第二の処理で使用していない鍵とを用いて前記p番目の平文ブロックを生成する第四の処理を実行させ、
前記第四の処理によって得られた前記1番目ないし(n−1)番目の平文ブロックのすべてまたは一部を用いて前記所定の方法によって前記ハッシュ値を算出する第五の処理を実行させ、
前記n番目の暗号ブロックから、前記第五の処理によって生成された前記ハッシュ値と前記第一の鍵および前記第二の鍵のうちの前記第二の処理で使用していない鍵とを用いて前記n番目の平文ブロックを生成する第六の処理を実行させる、
ことを特徴とするコンピュータプログラム。 A computer program used in a computer for encrypting each of n plaintext blocks, which are plaintext blocks of a predetermined size, comprising:
On the computer,
Executing a first process of calculating a hash value by a predetermined method using all or part of the first to (n-1)th plaintext blocks of the n plaintext blocks;
The n-th cipher block corresponding to the n-th plaintext block of the n plaintext blocks is defined as one of the hash value and the pair of first key and second key of the public key cryptosystem. preparative to execute the second process of generating with,
The 1st cipher block corresponding to the 1st plaintext block among the 1st to (n-1)th plaintext blocks is converted into the nth cipher block , the 1st key and the 2nd key. Of the keys used in the second process, and the p-th cipher block corresponding to the p (where 2≦p≦(n−1))-th plaintext block is (p−1 ) A third cipher block and the third key to be generated using the first key and the key used in the second process of the second key ,
From the first cipher block, the n-th cipher block and the first plaintext block using the first key and the second key that are not used in the second processing. From the p-th cipher block, the (p-1)-th cipher block and the key not used in the second process among the first key and the second key are generated. And executing a fourth process for generating the p-th plaintext block using
Executing a fifth process of calculating the hash value by the predetermined method using all or part of the first to (n-1)th plaintext blocks obtained by the fourth process,
From the n-th cipher block, using the hash value generated by the fifth process and a key of the first key and the second key that is not used in the second process. Execute a sixth process of generating the n-th plaintext block,
A computer program characterized by the above.
請求項23に記載のコンピュータプログラム。 Causing the computer to execute a seventh process of storing the first to n-th cipher blocks generated by the third process as one file in a recording medium,
The computer program according to claim 23 .
前記コンピュータに、
前記n個の平文ブロックのうちの1番目ないし(n−1)番目の平文ブロックのすべてまたは一部を用いて所定の方法によってハッシュ値を算出する第一の処理を実行させ、
前記n個の平文ブロックのうちのn番目の平文ブロックに対応するn番目の暗号ブロックを、前記ハッシュ値と公開鍵暗号方式の一対の第一の鍵および第二の鍵のうちのいずれか一方とを用いて生成する第二の処理を実行させ、
前記1番目ないし(n−1)番目の平文ブロックのうちの1番目の平文ブロックに対応する1番目の暗号ブロックを、前記n番目の暗号ブロックと前記第一の鍵および前記第二の鍵のうちの前記第二の処理で使用した鍵とを用いて生成し、p(ただし、2≦p≦(n−1))番目の平文ブロックに対応するp番目の暗号ブロックを、(p−1)番目の暗号ブロックと前記第一の鍵および前記第二の鍵のうちの前記第二の処理で使用した鍵とを用いて生成する第三の処理を実行させ、
前記第二の処理または前記第三の処理によって生成された前記1番目ないしn番目の暗号ブロックを出力する第四の処理を実行させる、
ことを特徴とするコンピュータプログラム。 A computer program used in a computer for encrypting each of n plaintext blocks, which are plaintext blocks of a predetermined size, comprising:
On the computer,
Executing a first process of calculating a hash value by a predetermined method using all or part of the first to (n-1)th plaintext blocks of the n plaintext blocks;
The n-th cipher block corresponding to the n-th plaintext block of the n plaintext blocks is defined as one of the hash value and the pair of first key and second key of the public key cryptosystem. preparative to execute the second process of generating with,
The 1st cipher block corresponding to the 1st plaintext block among the 1st to (n-1)th plaintext blocks is converted into the nth cipher block , the 1st key and the 2nd key. Of the keys used in the second process, and the p-th cipher block corresponding to the p (where 2≦p≦(n−1))-th plaintext block is (p−1 ) A third cipher block and a key used in the second process of the first key and the second key to perform a third process to generate ,
Executing a fourth process for outputting the first to n-th cipher blocks generated by the second process or the third process,
A computer program characterized by the above.
前記コンピュータに、
前記1番目の暗号ブロックから、前記n番目の暗号ブロックを用いて前記1番目の平文ブロックを生成し、前記p番目の暗号ブロックから、前記(p−1)番目の暗号ブロックと前記第一の鍵および前記第二の鍵のうちの前記暗号化装置の第一の暗号化手段が使用していない鍵とを用いて前記p番目の平文ブロックを生成する第一の復号処理を実行させ、
前記第一の復号処理によって得られた前記1番目ないし(n−1)番目の平文ブロックのすべてまたは一部を用いて前記暗号化装置のハッシュ値算出手段で使用された所定の方法によって前記ハッシュ値を算出するハッシュ値算出処理を実行させ、
前記n番目の暗号ブロックから、前記ハッシュ値算出処理によって生成された前記ハッシュ値と前記第一の鍵および前記第二の鍵のうちの前記第一の暗号化手段が使用していない鍵とを用いて前記n番目の平文ブロックを生成する、第二の復号処理を実行させる、
ことを特徴とするコンピュータプログラム。 A computer program used in a computer for decrypting the first to n-th cipher blocks generated by the encryption device according to claim 19.
On the computer,
The first plaintext block is generated from the first cipher block using the nth cipher block, and the (p-1)th cipher block and the first cipher block are generated from the pth cipher block. Executing a first decryption process for generating the p-th plaintext block using a key and a key of the second keys that is not used by the first encryption means of the encryption device,
The hash by the predetermined method used by the hash value calculation means of the encryption device by using all or part of the first to (n-1)th plaintext blocks obtained by the first decryption process. Execute the hash value calculation process to calculate the value,
From the n-th cipher block, the hash value generated by the hash value calculation process and the key of the first key and the second key that is not used by the first encryption means are obtained. Generate the n-th plaintext block by using the second decryption process,
A computer program characterized by the above.
前記n個の平文ブロックのうちの1番目の平文ブロックと前記n番目の暗号ブロックと前記第一の鍵とによって生成された1番目の暗号ブロックと、
前記n個の平文ブロックのうちのp(ただし、2≦p≦(n−1))番目の平文ブロックと(p−1)番目の暗号ブロックと前記第一の鍵とによって生成されたp番目の暗号ブロックと、
によって構成され、
復号装置が、
前記1番目の暗号ブロックから、前記n番目の暗号ブロックと前記第二の鍵とを用いて前記1番目の平文ブロックを生成し、前記p番目の暗号ブロックから、前記(p−1)番目の暗号ブロックと前記第二の鍵とを用いて前記p番目の平文ブロックを生成する第一の復号処理と、
前記第一の復号処理によって得られた前記1番目ないし(n−1)番目の平文ブロックのすべてまたは一部を用いて前記所定の方法によって前記ハッシュ値を算出するハッシュ値算出処理と、
前記n番目の暗号ブロックから、前記ハッシュ値算出処理によって生成された前記ハッシュ値と前記第二の鍵とを用いて前記n番目の平文ブロックを生成する第二の復号処理と、
を実行するために用いられることを特徴とするデータ構造。 First through (n-1) -th hash value generated in a predetermined way, all or part have based Dzu plaintext block and n-th plaintext block of the n plaintext blocks of a predetermined size of the plaintext And an n-th cipher block generated by a pair of first and second keys of the public key cryptosystem ,
A first plaintext block of the n plaintext blocks, a first cipher block generated by the nth cipher block, and the first key ;
Of the n plaintext blocks, the p (where 2≦p≦(n−1)) plaintext block, the (p−1)th cipher block, and the pth generated by the first key. Cipher block of
It is constituted by,
The decryption device
The first plaintext block is generated from the first cipher block using the nth cipher block and the second key, and the (p−1)th cipher block is generated from the pth cipher block. A first decryption process for generating the p-th plaintext block using a cipher block and the second key;
A hash value calculation process for calculating the hash value by the predetermined method using all or part of the first to (n-1)th plaintext blocks obtained by the first decryption process;
A second decryption process for generating the nth plaintext block from the nth cipher block using the hash value generated by the hash value calculation process and the second key;
A data structure that is used to implement .
ことを特徴とする記憶媒体。 Data of the data structure according to 請 Motomeko 27 is stored,
A storage medium characterized by the above.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2016140471A JP6729119B2 (en) | 2016-07-15 | 2016-07-15 | Encryption device, decryption device, encryption method, computer program, data structure, and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2016140471A JP6729119B2 (en) | 2016-07-15 | 2016-07-15 | Encryption device, decryption device, encryption method, computer program, data structure, and storage medium |
Publications (2)
Publication Number | Publication Date |
---|---|
JP2018010237A JP2018010237A (en) | 2018-01-18 |
JP6729119B2 true JP6729119B2 (en) | 2020-07-22 |
Family
ID=60995624
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2016140471A Active JP6729119B2 (en) | 2016-07-15 | 2016-07-15 | Encryption device, decryption device, encryption method, computer program, data structure, and storage medium |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP6729119B2 (en) |
Families Citing this family (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111325545B (en) * | 2018-12-13 | 2023-05-02 | 北京沃东天骏信息技术有限公司 | Key management method, device and equipment based on blockchain |
CN115277974B (en) * | 2022-08-01 | 2024-02-02 | 南京交通职业技术学院 | Management system and encryption method for intelligent traffic monitoring video based on Internet of things |
CN117035778A (en) * | 2023-08-28 | 2023-11-10 | 北京星汉博纳医药科技有限公司 | Payment information processing method, system and computing device |
Family Cites Families (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JPH07140896A (en) * | 1993-11-19 | 1995-06-02 | Hitachi Ltd | File ciphering method and its device |
JP2004325677A (en) * | 2003-04-23 | 2004-11-18 | Sony Corp | Encryption processing device, encryption processing method, and computer program |
JP4748479B2 (en) * | 2006-01-18 | 2011-08-17 | 株式会社リコー | Multi-function input / output device and input / output method |
JP4658150B2 (en) * | 2008-01-25 | 2011-03-23 | Nttエレクトロニクス株式会社 | Encryption method and decryption method |
JP5396852B2 (en) * | 2008-12-24 | 2014-01-22 | 富士ゼロックス株式会社 | Signature system, signature device, signature verification device, and program |
JP6167721B2 (en) * | 2013-07-23 | 2017-07-26 | 凸版印刷株式会社 | ENCRYPTION DEVICE, DECRYPTION DEVICE, ENCRYPTION METHOD, DECRYPTION METHOD, AND PROGRAM |
-
2016
- 2016-07-15 JP JP2016140471A patent/JP6729119B2/en active Active
Also Published As
Publication number | Publication date |
---|---|
JP2018010237A (en) | 2018-01-18 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
JP6035459B2 (en) | ENCRYPTION DEVICE, DECRYPTION DEVICE, AND PROGRAM | |
Abusukhon et al. | A hybrid network security algorithm based on Diffie Hellman and Text-to-Image Encryption algorithm | |
US10305689B2 (en) | Encryption apparatus, decryption apparatus, cryptography processing system, encryption method, decryption method, encryption program, and decryption program | |
US9825761B2 (en) | Systems and methods improving cryptosystems with biometrics | |
WO2014007296A1 (en) | Order-preserving encryption system, encryption device, decryption device, encryption method, decryption method, and programs thereof | |
JP6729119B2 (en) | Encryption device, decryption device, encryption method, computer program, data structure, and storage medium | |
Raj et al. | Enhancement of security mechanism for confidential data using AES-128, 192 and 256bit encryption in cloud | |
CN110720194A (en) | Re-encryption key generation device, re-encryption device, re-encrypted ciphertext decryption device and encryption system | |
Ahmad Abusukhon et al. | A novel network security algorithm based on encrypting text into a white-page image | |
Singh | A new approach to enhance avalanche effect in aes to improve computer security | |
Agarwal et al. | Estimation of various parameters for AES, DES, and RSA | |
US8494169B2 (en) | Validating encrypted archive keys | |
JP6631989B2 (en) | Encryption device, control method, and program | |
Banerjee et al. | A New three dimensional based key generation technique in AVK | |
CN110474967B (en) | Block chain experiment system and method | |
CN110611674B (en) | Protocol interaction method, system and storage medium between different computer systems | |
Santhi et al. | Study of symmetric-key cryptosystems and implementing a secure cryptosystem with des | |
Kim et al. | A modified exhaustive search on a password system using SHA-1 | |
Yadav et al. | Hybrid cryptography approach to secure the data in computing environment | |
Usha et al. | Performance Analysis of Encryption Algorithms with Pat-Fish for Cloud Storage Security | |
Jhawar et al. | Modeling, hardware architecture, and performance analyses of an AEAD-based lightweight cipher | |
KR101618247B1 (en) | Password search apparatus using asic chip | |
US11438136B2 (en) | Encryption apparatus and method for encrypting encryption target data in data based on homomorphic encryption algorithm | |
JP2013205437A (en) | Method and apparatus for calculating nonlinear function s-box | |
Verma et al. | Design and Development of Robust Algorithm for Cryptography using Improved AES Technique |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
A621 | Written request for application examination |
Free format text: JAPANESE INTERMEDIATE CODE: A621 Effective date: 20190416 |
|
A977 | Report on retrieval |
Free format text: JAPANESE INTERMEDIATE CODE: A971007 Effective date: 20200228 |
|
A131 | Notification of reasons for refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A131 Effective date: 20200310 |
|
A521 | Written amendment |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20200424 |
|
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: 20200602 |
|
A61 | First payment of annual fees (during grant procedure) |
Free format text: JAPANESE INTERMEDIATE CODE: A61 Effective date: 20200615 |
|
R150 | Certificate of patent or registration of utility model |
Ref document number: 6729119 Country of ref document: JP Free format text: JAPANESE INTERMEDIATE CODE: R150 |