JP7103334B2 - Plaintext encryption / decryption method and plaintext encryption / decryption device - Google Patents

Plaintext encryption / decryption method and plaintext encryption / decryption device Download PDF

Info

Publication number
JP7103334B2
JP7103334B2 JP2019222522A JP2019222522A JP7103334B2 JP 7103334 B2 JP7103334 B2 JP 7103334B2 JP 2019222522 A JP2019222522 A JP 2019222522A JP 2019222522 A JP2019222522 A JP 2019222522A JP 7103334 B2 JP7103334 B2 JP 7103334B2
Authority
JP
Japan
Prior art keywords
value
encryption
stirring
combined
sentence
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
JP2019222522A
Other languages
Japanese (ja)
Other versions
JP2021092634A (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.)
Murata Manufacturing Co Ltd
Original Assignee
Murata Manufacturing Co Ltd
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 Murata Manufacturing Co Ltd filed Critical Murata Manufacturing Co Ltd
Priority to JP2019222522A priority Critical patent/JP7103334B2/en
Publication of JP2021092634A publication Critical patent/JP2021092634A/en
Application granted granted Critical
Publication of JP7103334B2 publication Critical patent/JP7103334B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Storage Device Security (AREA)

Description

本発明は、平文の暗号化文を撹拌テーブルによって撹拌して秘匿化する平文暗号化復号化方法および平文暗号化復号化装置に関するものである。 The present invention relates to a plaintext encryption / decryption method and a plaintext encryption / decryption apparatus for stirring and concealing a plaintext encrypted text by a stirring table.

従来、この種の平文暗号化復号化方法および装置としては、例えば、特許文献1に開示された暗号化方法および復号化方法、装置がある。 Conventionally, as a plaintext encryption / decryption method and device of this kind, for example, there are an encryption method, a decryption method, and a device disclosed in Patent Document 1.

この方法、装置では、一般化Feistel構造を有する2つのFeistel処理手段の間に拡散処理手段を配置した構成の暗号化手段が用いられる。平文はn個に分割されて1つ目のFeistel処理手段に入力される。各Feistel処理手段は、それぞれ、鍵データにて非線形変換を行う1ラウンド以上のn系列一般化Feistel構造によって構成される。1つ目のFeistel処理手段で処理されたデータは、その後、拡散処理手段に入力される。拡散処理手段は、n行n列の行列で表現される拡散テーブルを使った行列計算を行い、n個の入力データを拡散テーブルの各数値に掛け合わして拡散する。拡散されたn個の出力データは、その後、2つ目のFeistel処理手段に入力されて処理されることで、暗号文に変換される。 In this method and apparatus, an encryption means having a configuration in which a diffusion processing means is arranged between two Feistel processing means having a generalized Feistel structure is used. The plaintext is divided into n pieces and input to the first Feistel processing means. Each Feistel processing means is composed of one or more rounds of n-series generalized Feistel structure that performs non-linear conversion with key data. The data processed by the first Feistel processing means is then input to the diffusion processing means. The spreading processing means performs matrix calculation using a spreading table represented by a matrix of n rows and n columns, and multiplies n input data by each numerical value of the spreading table to spread. The spread n output data are then input to the second Feistel processing means and processed to be converted into a ciphertext.

国際公開第2009/075337号International Publication No. 2009/075337

しかしながら、特許文献1に開示されたような従来の平文暗号化および復号化方法、装置における拡散(撹拌、アフィン)処理は、上記の拡散テーブルのようなメモリに記憶されて固定されたテーブルに基づいて行われる。したがって、拡散処理の鍵となる拡散テーブルが公開されていたり、総当たりで露見したりすると、拡散処理されたデータは容易に元の拡散前のデータに戻すことができる。このため、このような固定テーブルを用いて拡散処理が行われた暗号文は、その秘匿性が十分に保たれない。また、従来の方法および装置では、固定テーブルのテーブル値をメモリに保存しておく記憶領域が必要となり、メモリの増大化につながる。 However, the conventional plaintext encryption and decryption method and the diffusion (stirring, affine) processing in the apparatus as disclosed in Patent Document 1 are based on a table stored and fixed in a memory such as the above diffusion table. Is done. Therefore, if the diffusion table, which is the key to the diffusion process, is made public or exposed by brute force, the diffusion-processed data can be easily restored to the original data before diffusion. Therefore, the confidentiality of the ciphertext that has been spread processed using such a fixed table cannot be sufficiently maintained. Further, in the conventional method and device, a storage area for storing the table value of the fixed table in the memory is required, which leads to an increase in the memory.

本発明は、このような課題を解消するためになされたもので、暗号文の秘匿性を向上させることができると共に、メモリの増大化を招くことのない平文暗号化復号化方法および平文暗号化復号化装置を提供することを目的とする。 The present invention has been made to solve such a problem, and is a plaintext encryption / decryption method and plaintext encryption that can improve the confidentiality of the ciphertext and do not cause an increase in memory. It is an object of the present invention to provide a decryption device.

このために、本発明は、識別値生成手段により、秘匿用暗号化文をメモリに保存する保存先を指定するアドレス値に平文を付加して第1結合値を生成し、第1結合値のハッシュ値を演算し、第1結合値のハッシュ値における所定位置の値から識別値を生成する識別値生成ステップと、暗号化手段により、平文を暗号化して暗号化文を生成する暗号化ステップと、第1比較手段により、乱数発生手段で発生される乱数を前記アドレス値に付加して第2結合値を生成し、第2結合値のハッシュ値を演算し、第2結合値のハッシュ値の所定位置の値と識別値とを比較し、比較結果が一致しない場合には、乱数発生手段で次に発生される乱数を前記アドレス値にさらに付加して新たな第2結合値を生成する処理、新たな第2結合値のハッシュ値を演算する処理、および、新たな第2結合値のハッシュ値における所定位置の値と識別値とを比較する処理を比較結果が一致するまで繰り返す第1比較ステップと、撹拌手段により、第1比較ステップにおける比較結果が一致したときまでに発生される乱数の数列を撹拌テーブルとして暗号化文を撹拌して撹拌暗号化文を生成する撹拌ステップと、秘匿暗号化手段により、撹拌暗号化文に前記乱数の数列を付加して秘匿用暗号化文を生成する秘匿暗号化ステップと、保存手段により、生成した秘匿用暗号化文を前記アドレス値によって指定されるアドレスのメモリに保存する保存ステップと、読出手段により、前記アドレス値によって指定されるアドレスのメモリから秘匿用暗号化文を読み出す読出ステップと、第2比較手段により、読み出した秘匿用暗号化文の所定位置の値を前記乱数の数列を構成する乱数として抽出し、抽出した当該乱数を前記アドレス値に付加して第3結合値を生成し、第3結合値のハッシュ値を演算し、第3結合値のハッシュ値における所定位置の値を識別値と比較し、比較結果が一致しない場合には、読み出した秘匿用暗号化文の所定位置の値に連続して並ぶ位置の値を前記乱数の数列を構成する次の乱数として前記アドレス値にさらに付加した新たな第3結合値を生成する処理、新たな第3結合値のハッシュ値を演算する処理、および、新たな第3結合値のハッシュ値における所定位置の値と識別値とを比較する処理を比較結果が一致するまで繰り返す第2比較ステップと、撹拌テーブル抽出手段により、第2比較ステップにおける比較結果が一致したときに得られる乱数の数列を撹拌テーブルとして抽出する撹拌テーブル抽出ステップと、撹拌暗号化文抽出手段により、抽出した撹拌テーブルを読み出した秘匿用暗号化文から取り除いた文を撹拌暗号化文として抽出する撹拌暗号化文抽出ステップと、逆変換手段により、抽出した撹拌暗号化文を抽出した撹拌テーブルに基づいて逆変換して暗号化文に戻す逆変換ステップと、復号化手段により、逆変換されて得られた暗号化文を復号化して平文を得る復号化ステップとを備える平文暗号化復号化方法を構成した。 Therefore, in the present invention, the identification value generating means generates the first combined value by adding a plain sentence to the address value that specifies the storage destination for storing the confidential encryption statement in the memory, and generates the first combined value of the first combined value. An identification value generation step that calculates a hash value and generates an identification value from a value at a predetermined position in the hash value of the first join value, and an encryption step that encrypts a plain sentence and generates an encrypted sentence by an encryption means. , The first comparison means adds the random number generated by the random number generating means to the address value to generate the second combined value, calculates the hash value of the second combined value, and the hash value of the second combined value. The value at a predetermined position is compared with the identification value, and if the comparison results do not match, the next generated random number is further added to the address value by the random number generating means to generate a new second combined value. The process of calculating the hash value of the new second combined value, and the process of comparing the value at a predetermined position in the hash value of the new second combined value with the identification value are repeated until the comparison results match . The comparison step, the stirring step of stirring the encrypted text using the number sequence of random numbers generated by the time when the comparison results in the first comparison step match by the stirring means as the stirring table to generate the stirring encrypted text, and the concealment . The secret encryption step of adding the number sequence of the random numbers to the stirring encryption text by the encryption means to generate the secret encryption text, and the secret encryption text generated by the storage means are specified by the address value. A save step of saving in the memory of the address, a read step of reading the secret encryption text from the memory of the address specified by the address value by the read means, and a secret encryption text read by the second comparison means. The value at a predetermined position of is extracted as a random number constituting the number sequence of the random numbers, the extracted random number is added to the address value to generate a third combined value, the hash value of the third combined value is calculated, and the second 3 The value at a predetermined position in the hash value of the combined value is compared with the identification value, and if the comparison results do not match, the value at the position consecutively aligned with the value at the predetermined position in the read confidential encryption statement is the random number. A process of generating a new third combined value further added to the address value as the next random number constituting the sequence of numbers, a process of calculating a hash value of the new third combined value, and a process of calculating the hash value of the new third combined value. When the second comparison step, which repeats the process of comparing the value at a predetermined position in the hash value with the identification value until the comparison results match, and the comparison result in the second comparison step match by the stirring table extraction means . Stirring table extraction step that extracts a number of random numbers obtained as a stirring table and stirring that extracts the extracted stirring table from the secret encryption text that was read out by the stirring encryption text extraction means as a stirring encryption text. Obtained by reverse conversion by the encrypted sentence extraction step, the reverse conversion step of reverse-converting the encrypted text extracted by the reverse conversion means based on the extracted stirring table and returning it to the encrypted text, and the decryption means. A plaintext encryption / decryption method including a decryption step of decrypting the encrypted text to obtain the plaintext was constructed.

また、本発明は、秘匿用暗号化文をメモリに保存する保存先を指定するアドレス値に平文を付加して第1結合値を生成し、第1結合値のハッシュ値を演算し、第1結合値のハッシュ値における所定位置の値から識別値を生成する識別値生成手段と、平文を暗号化して暗号化文を生成する暗号化手段と、乱数を発生する乱数発生手段と、乱数発生手段で発生される乱数を前記アドレス値に付加して第2結合値を生成し、第2結合値のハッシュ値を演算し、第2結合値のハッシュ値の所定位置の値と識別値とを比較し、比較結果が一致しない場合には、乱数発生手段で次に発生される乱数を前記アドレス値にさらに付加して新たな第2結合値を生成する処理、新たな第2結合値のハッシュ値を演算する処理、および、新たな第2結合値のハッシュ値における所定位置の値と識別値とを比較する処理を比較結果が一致するまで繰り返す第1比較手段と、第1比較手段における比較結果が一致したときまでに発生される乱数の数列を撹拌テーブルとして暗号化文を撹拌して撹拌暗号化文を生成する撹拌手段と、撹拌暗号化文に前記乱数の数列を付加して秘匿用暗号化文を生成する秘匿暗号化手段と、生成した秘匿用暗号化文を前記アドレス値によって指定されるアドレスのメモリに保存する保存手段と、前記アドレス値によって指定されるアドレスのメモリから秘匿用暗号化文を読み出す読出手段と、読み出した秘匿用暗号化文の所定位置の値を前記乱数の数列を構成する乱数として抽出し、抽出した当該乱数を前記アドレス値に付加して第3結合値を生成し、第3結合値のハッシュ値を演算し、第3結合値のハッシュ値における所定位置の値を識別値と比較し、比較結果が一致しない場合には、読み出した秘匿用暗号化文の所定位置の値に連続して並ぶ位置の値を前記乱数の数列を構成する次の乱数として前記アドレス値にさらに付加した新たな第3結合値を生成する処理、新たな第3結合値のハッシュ値を演算する処理、および、新たな第3結合値のハッシュ値における所定位置の値と識別値とを比較する処理を比較結果が一致するまで繰り返す第2比較手段と、第2比較手段における比較結果が一致したときに得られる乱数の数列を撹拌テーブルとして抽出する撹拌テーブル抽出手段と、抽出した撹拌テーブルを読み出した秘匿用暗号化文から取り除いた文を撹拌暗号化文として抽出する撹拌暗号化文抽出手段と、抽出した撹拌暗号化文を抽出した撹拌テーブルに基づいて逆変換して暗号化文に戻す逆変換手段と、逆変換されて得られた暗号化文を復号化して平文を得る復号化手段とを備える平文暗号化復号化装置を構成した。 Further, in the present invention, the first join value is generated by adding a plain sentence to the address value that specifies the save destination for saving the confidential encryption statement in the memory, the hash value of the first join value is calculated, and the first An identification value generation means that generates an identification value from a value at a predetermined position in a hash value of a combined value, an encryption means that encrypts a plain sentence and generates an encrypted sentence, a random number generation means that generates a random number, and a random number generation means. The random number generated in is added to the address value to generate the second combined value, the hash value of the second combined value is calculated, and the value at a predetermined position of the hash value of the second combined value and the identification value are obtained. After comparison , if the comparison results do not match, a process of further adding a random number generated next by the random number generating means to the address value to generate a new second combined value, a hash of the new second combined value. Comparison between the first comparison means and the first comparison means, in which the process of calculating the value and the process of comparing the value at a predetermined position in the hash value of the new second combined value with the identification value are repeated until the comparison results match. A stirring means for generating a stirring encryption statement by stirring the encrypted text using a number sequence of random numbers generated by the time the results match as a stirring table, and a stirring means for generating the stirring encryption statement, and adding the number sequence of the random numbers to the stirring encryption statement for concealment. A secret encryption means that generates an encrypted statement, a storage means that saves the generated secret encryption statement in the memory of the address specified by the address value, and a secret means for storing the generated secret encryption statement from the memory of the address specified by the address value. The reading means for reading the encrypted text and the value at a predetermined position of the read secret encrypted text are extracted as random numbers constituting the number sequence of the random numbers, and the extracted random numbers are added to the address value to add the third combined value. Is generated, the hash value of the third join value is calculated, the value at a predetermined position in the hash value of the third join value is compared with the identification value, and if the comparison results do not match, the read secret encryption statement is used. A process of generating a new third combined value by further adding the values of the positions arranged consecutively to the values of the predetermined positions as the next random numbers constituting the sequence of the random numbers to the address value, the new third combined value. In the second comparison means and the second comparison means, the process of calculating the hash value and the process of comparing the value at a predetermined position in the hash value of the new third combined value with the identification value are repeated until the comparison results match . A stirring table extraction means that extracts a number sequence of random numbers obtained when the comparison results match as a stirring table, and a stirring code that extracts the extracted stirring table as a stirring encryption statement after removing it from the read confidential encryption statement. Cryptographic extraction means and extracted stirring A plaintext provided with an inverse conversion means for inversely converting the stirred encrypted text based on the extracted stirring table and returning it to the encrypted text, and a decryption means for decrypting the encrypted text obtained by the reverse conversion to obtain a plaintext. An encryption / decryption device was configured.

本構成によれば、乱数発生手段で発生される各乱数が、秘匿用暗号化文を保存するメモリのアドレス値に順に付加されていくことで、第2結合値が生成される。生成された第2結合値はそのハッシュ値が演算され、演算されたハッシュ値の所定位置の値と識別値とが比較される。撹拌テーブルは、その比較結果、第2結合値のハッシュ値の所定位置の値と識別値とが一致したときまでに発生される乱数の数列として、その時々に応じて動的に生成される。暗号化文の撹拌は、このように動的に生成される撹拌テーブルを用いて、行われる。 According to this configuration, the second combined value is generated by sequentially adding each random number generated by the random number generating means to the address value of the memory for storing the confidential encryption statement. The hash value of the generated second combined value is calculated, and the value at a predetermined position of the calculated hash value is compared with the identification value. The stirring table is dynamically generated as a sequence of random numbers generated by the time when the value at a predetermined position of the hash value of the second binding value and the identification value match as a result of the comparison. The agitation of the encrypted text is performed using the agitation table dynamically generated in this way.

したがって、メモリに固定して記憶された撹拌テーブルを用いてデータの撹拌が行われる従来の平文暗号化復号化方法および装置とは異なり、撹拌処理の鍵となる撹拌テーブルが公開されたり、総当たりで露見したりする事態は生じない。このため、撹拌処理されたデータを容易に元の撹拌前のデータに戻すことが困難になり、暗号文の秘匿性は向上する。また、従来のように、固定テーブルのテーブル値をメモリに保存しておく記憶領域が必要とされないため、メモリが増大化することもない。 Therefore, unlike the conventional plaintext encryption / decryption method and device in which data is agitated using a agitation table fixed in a memory and stored, the agitation table that is the key to the agitation process is open to the public or round-robin. There is no such thing as being exposed. Therefore, it becomes difficult to easily return the agitated data to the original data before agitation, and the confidentiality of the ciphertext is improved. Further, unlike the conventional case, a storage area for storing the table value of the fixed table in the memory is not required, so that the memory does not increase.

このため、本発明によれば、暗号文の秘匿性を向上させることができると共に、メモリの増大化を招くことのない平文暗号化復号化方法および平文暗号化復号化装置を提供することができる。 Therefore, according to the present invention, it is possible to provide a plaintext encryption / decryption method and a plaintext encryption / decryption apparatus that can improve the confidentiality of the ciphertext and do not cause an increase in memory. ..

本発明の一実施形態による平文暗号化復号化装置を構成するホストの機能構成を示すブロック図である。It is a block diagram which shows the functional structure of the host which comprises the plaintext encryption / decryption apparatus by one Embodiment of this invention. 本発明の一実施形態による平文暗号化復号化方法によって行われる平文の暗号化処理を示すフローチャートである。It is a flowchart which shows the plaintext encryption processing performed by the plaintext encryption decryption method by one Embodiment of this invention. 図2に示す平文の暗号化処理において行われる暗号化文の撹拌処理を説明するためのテーブルである。It is a table for demonstrating the stirring process of the encrypted sentence performed in the plaintext encryption process shown in FIG. 本発明の一実施形態による平文暗号化復号化方法によって行われる平文の復号化処理を示すフローチャートである。It is a flowchart which shows the plaintext decryption processing performed by the plaintext encryption decryption method by one Embodiment of this invention.

次に、本発明による平文暗号化復号化方法および平文暗号化復号化装置を実施するための形態について、説明する。 Next, a mode for implementing the plaintext encryption / decryption method and the plaintext encryption / decryption apparatus according to the present invention will be described.

図1は、本発明の一実施形態による平文暗号化復号化装置を構成するホスト(HOST)1の機能構成を示すブロック図である。 FIG. 1 is a block diagram showing a functional configuration of a host (HOST) 1 constituting a plaintext encryption / decryption apparatus according to an embodiment of the present invention.

HOST1はパーソナルコンピュータ(PC)やマイクロコンピュータ(通称マイコン)などであり、EEPROM(Electrically Erasable Programmable Read-Only Memory)である外部メモリ2と、HSM(Hardware Security Module)3に接続されている。外部メモリ2は、EEPROMに限られることはなく、DDR(Double Data Rate)やNAND FLASH(NAND Fash Memory)などでもよい。この外部メモリ2は乱数で初期化されている。また、HSM3は、暗号鍵を保護するために特別に設計された暗号プロセッサである。 The HOST 1 is a personal computer (PC), a microcomputer (commonly known as a microcomputer), or the like, and is connected to an external memory 2 which is an EEPROM (Electrically Erasable Programmable Read-Only Memory) and an HSM (Hardware Security Module) 3. The external memory 2 is not limited to EEPROM, and may be DDR (Double Data Rate), NAND FLASH (NAND Fash Memory), or the like. The external memory 2 is initialized with a random number. The HSM3 is also a cryptographic processor specially designed to protect cryptographic keys.

HOST1は、内部メモリ1a、識別値生成手段1b、暗号化手段1c、乱数発生手段1d、第1比較手段1e、撹拌手段1f、秘匿暗号化手段1g、保存手段1h、読出手段1i、第2比較手段1j、撹拌テーブル抽出手段1k、撹拌暗号化文抽出手段1l、逆変換手段1m、復号化手段1n、第3比較手段1o、および、改ざん判定手段1pを機能ブロックとして備える。 The HOST 1 includes an internal memory 1a, an identification value generation means 1b, an encryption means 1c, a random number generation means 1d, a first comparison means 1e, a stirring means 1f, a secret encryption means 1g, a storage means 1h, a reading means 1i, and a second comparison. The means 1j, the stirring table extraction means 1k, the stirring encrypted sentence extraction means 1l, the inverse conversion means 1m, the decoding means 1n, the third comparison means 1o, and the tampering determination means 1p are provided as functional blocks.

HOST1は、図示しないCPU(中央演算処理装置)、および、内部メモリ1aであるROM(読み出し専用メモリ)やRAM(読み書き可能メモリ)を備えるICモジュールとして構成されている。 The HOST 1 is configured as an IC module including a CPU (central processing unit) (not shown) and a ROM (read-only memory) and RAM (readable / writable memory) which are internal memories 1a.

CPUは、ROMに記憶されたコンピュータプログラムにしたがって各部の制御を行う。上記の各手段1b~1pは、このCPUのコンピュータプログラムにしたがったソフトウエア制御によって実現される。しかし、これらはCPUのソフトウエア制御に代えて、電子回路によるハードウエアによって実現するように、構成してもよい。ROMには、コンピュータプログラムの他、演算パラメータや各種のテーブルなどが格納される。RAMには、CPUの制御処理などで使用されるパラメータなどが一時的に記憶され、一時記憶作業領域として使用される。 The CPU controls each part according to the computer program stored in the ROM. Each of the above means 1b to 1p is realized by software control according to the computer program of the CPU. However, these may be configured to be realized by hardware by an electronic circuit instead of software control of the CPU. In addition to computer programs, operation parameters and various tables are stored in the ROM. Parameters and the like used in CPU control processing and the like are temporarily stored in the RAM, and are used as a temporary storage work area.

HOST1は、内部メモリ1aに記憶されたまたは外部から入力された平文Hを暗号化し、内部メモリ1aに記憶されたまたは外部から入力されたアドレス値Aによって指定される外部メモリ2に、暗号化された後述する秘匿暗号化文Zを保存する。図2に示すフローチャートは、この際にCPUによって行われる平文Hの暗号化処理、図4に示すフローチャートは、外部メモリ2から読み出した秘匿暗号化文ZをCPUによって平文Hに復号化する復号化処理を表わす。以下の説明では、オリジナルデータである平文Hは、5バイトの16進数により“15 5d 39 c0 7d”と表わされ、4バイトの16進数により表わされるアドレス値A=“df 94 f5 2c”で指定されるアドレスの外部メモリ2に保存されるものとする。 HOST 1 encrypts plain text H stored in the internal memory 1a or input from the outside, and is encrypted to the external memory 2 stored in the internal memory 1a or specified by the address value A input from the outside. The secret encrypted text Z, which will be described later, is saved. The flowchart shown in FIG. 2 is the plaintext H encryption process performed by the CPU at this time, and the flowchart shown in FIG. 4 is the decryption process in which the secret encrypted text Z read from the external memory 2 is decrypted into the plaintext H by the CPU. Represents processing. In the following explanation, the plaintext H, which is the original data, is expressed as "15 5d 39 c0 7d" by the hexadecimal number of 5 bytes, and the address value A = "df 94 f5 2c" expressed by the hexadecimal number of 4 bytes. It is assumed that the data is saved in the external memory 2 at the specified address.

平文の暗号化処理においては、まず、図2、ステップ(以下、Sと記す)101の識別値生成ステップにおいて、識別値生成手段1bにより、アドレス値Aの末尾に平文Hが付加されて第1結合値{アドレス値・平文}=“df 94 f5 2c 15 5d 39 c0 7d”が生成され、その第1結合値のハッシュ値HASH1=“55 89 94 9d 02 d5 55 1c 2c 94 20 0f 22 da a0 20 8d 01 d8 a2 51 bb e9 27 61 22 aa ac 96 1f af ad”がハッシュ関数によって演算される。本実施形態では、ハッシュ関数にSHA-256を使っているが、SHA-512やMD5などをつかってもよい。識別値生成手段1bは、演算したハッシュ値HASH1における所定位置の値、本実施形態ではHASH1の末尾の下2桁にある値“ad”を識別値として生成し、秘匿情報であるHASH-IDとしてHSM3等に保存する。 In the plaintext encryption process, first, in the identification value generation step of FIG. 2, step 101 (hereinafter referred to as S) 101, the plaintext H is added to the end of the address value A by the identification value generation means 1b, and the first is the first. Join value {address value / plaintext} = "df 94 f5 2c 15 5d 39 c0 7d" is generated, and the hash value of the first join value HASH1 = "55 89 94 9d 02 d5 55 1c 2c 94 20 0f 22 da a0" 20 8d 01 d8 a2 51 bb e9 27 61 22 aa ac 96 1f af ad ”is calculated by the hash function. In this embodiment, SHA-256 is used as the hash function, but SHA-512, MD5, or the like may be used. The identification value generating means 1b generates a value at a predetermined position in the calculated hash value HASH1, a value "ad" in the last two digits of the end of HASH1 in the present embodiment as an identification value, and uses it as HASH-ID which is confidential information. Save in HSM3 or the like.

次に、S102の暗号化ステップにおいて、暗号化手段1cにより、平文Hが暗号化されて8バイトの所定長の暗号化文X=“02 a3 f9 76 21 d3 4a c9”が生成される。 Next, in the encryption step of S102, the plaintext H is encrypted by the encryption means 1c, and an encrypted sentence X = "02 a3 f9 76 21 d3 4a c9" having a predetermined length of 8 bytes is generated.

次に、第1比較ステップを構成するS103において、第1比較手段1eにより、乱数発生手段1dで発生される各乱数値Rによって乱数列B=“4a”、“fc 4a”…が順に生成される。そして、第1比較ステップを構成するS104において、乱数発生手段1dで発生される乱数値Rが第1比較手段1eによりアドレス値Aの末尾に順に付加されていって、第2結合値{アドレス値・乱数列}=“df 94 f5 2c 4a”、“df 94 f5 2c fc 4a”…が順に生成される。生成される各第2結合値は、第1比較手段1eにより、ハッシュ関数によってハッシュ化されて、ハッシュ値HASH2が生成される。例えば、S103において乱数列B=“fc 4a”が生成されたときには、S104において第2結合値=“df 94 f5 2c fc 4a”からHASH2=“0d 49 21 78 0a f7 65 2b 9a 02 8e d6 22 ac 1c 95 43 2e c3 ee 02 74 56 68 e1 9f 86 c1 b1 3e 03 93”が生成される。 Next, in S103 constituting the first comparison step, the first comparison means 1e generates random number sequences B = “4a”, “fc 4a” ... In order by each random number value R generated by the random number generation means 1d. Random numbers. Then, in S104 constituting the first comparison step, the random number value R generated by the random number generating means 1d is sequentially added to the end of the address value A by the first comparing means 1e, and the second combined value {address value -Random number sequence} = "df 94 f5 2c 4a", "df 94 f5 2c fc 4a" ... are generated in order. Each of the generated second combined values is hashed by the hash function by the first comparison means 1e to generate the hash value HASH2. For example, when the random number sequence B = "fc 4a" is generated in S103, HASH2 = "0d 49 21 78 0a f7 65 2b 9a 02 8e d6 22" from the second coupling value = "df 94 f5 2c fc 4a" in S104. ac 1c 95 43 2e c3 ee 02 74 56 68 e1 9f 86 c1 b1 3e 03 93 ”is generated.

次に、S103およびS104と共に第1比較ステップを構成するS105において、乱数値Rがアドレス値Aの末尾に付加して得られる第2結合値のHASH2における末尾の下2桁の値と、S101で生成されたHASH1における末尾の下2桁の値であるHASH-IDとが、第1比較手段1eによって比較される。その比較結果がNoで一致しない場合には、処理はS103に戻り、乱数発生手段1dで次に新たに発生される乱数値Rが乱数列Bの先頭に加えられる。そして、S104において、新たな乱数列Bがアドレス値Aの末尾に付加されて、言い換えれば、新たに発生された乱数値Rがアドレス値Aの末尾にさらに付加されて、新たな第2結合値が生成され、新たな第2結合値のHASH2が演算される。そして、S105において、再度、新たなHASH2における末尾の下2桁の値とHASH-IDとが比較される。 Next, in S105 which constitutes the first comparison step together with S103 and S104, the value of the last two digits of the last two digits in HASH2 of the second binding value obtained by adding the random number value R to the end of the address value A and S101. The HASH-ID, which is the last two digits of the value in the generated HASH1, is compared with the first comparison means 1e. If the comparison results are No and do not match, the process returns to S103, and the random number value R newly generated next by the random number generating means 1d is added to the head of the random number sequence B. Then, in S104, a new random number sequence B is added to the end of the address value A, in other words, a newly generated random number value R is further added to the end of the address value A, and a new second coupling value is added. Is generated, and the new second binding value, HASH2, is calculated. Then, in S105, the last two digits of the value in the new HASH2 and the HASH-ID are compared again.

S103~S105の処理は、HASH2における末尾の下2桁の値とHASH-IDとが一致されるまで、繰り返される。しかし、HASH2のデータ長が、設定で上限に決められていたサイズを超える場合、一時記憶領域として使用される内部メモリ1aのメモリ容量を超えないように、乱数列Bがリセットされて、S103~S105の処理が再実施される。 The processing of S103 to S105 is repeated until the last two digits of the value in HASH2 and HASH-ID match. However, when the data length of HASH2 exceeds the size set as the upper limit in the setting, the random number sequence B is reset so as not to exceed the memory capacity of the internal memory 1a used as the temporary storage area, and S103 to S103 to The process of S105 is re-executed.

S103で例えば乱数列B=“81 94 0a e6 9b 76 cb 66 fc 4a”が生成され、S104で演算されるHASH2が“4b.....................d 27 22 ad”と演算されると、HASH2における末尾の下2桁の値とHASH-IDとが“ad”で一致して、S105における比較結果がYesとなる。この場合、撹拌ステップを構成するS106において、S105における比較結果が一致したときまでに乱数発生手段1dによって発生されて、アドレス値Aの末尾に付加された乱数値Rの数列B=“81 94 0a e6 9b 76 cb 66 fc 4a”が比較手段1eから撹拌手段1fに入力され、その数列Bが撹拌手段1fによって撹拌テーブルとされる。そして、撹拌ステップをS106と共に構成するS107において、撹拌手段1fによって暗号化文Xが撹拌されて、撹拌暗号化文Yが生成される。 For example, a random number sequence B = "81 94 0a e6 9b 76 cb 66 fc 4a" is generated in S103, and HASH2 calculated in S104 is "4b ..... When calculated as "... d 27 22 ad", the last two digits of the value in HASH2 and HASH-ID match with "ad", and the comparison result in S105 is Yes. In this case, in S106 constituting the stirring step, the sequence B = "81 94 0a" of the random number value R generated by the random number generating means 1d and added to the end of the address value A by the time the comparison results in S105 match. "e6 9b 76 cb 66 fc 4a" is input from the comparison means 1e to the stirring means 1f, and the sequence B thereof is set as the stirring table by the stirring means 1f. Then, in S107 in which the stirring step is configured together with S106, the encrypted sentence X is stirred by the stirring means 1f, and the stirring encrypted sentence Y is generated.

この撹拌処理は、本実施形態では、撹拌テーブルを構成する各乱数値Rを暗号化文Xの長さである8で除した剰余値に基づいて、暗号化文Xにおける各値の位置が交換されて行われる。すなわち、まず、撹拌テーブルを構成する各乱数値R(=16進数)81, 94, 0a, e6, 9b, 76, cb, 66, fc, 4aが暗号化文Xの長さ8でモジュロ演算され、撹拌テーブルは、演算式81 mod 8 = 1, 94 mod 8 = 4, 0a mod 8 = 2, e6 mod 8 = 6, 9b mod 8 = 5, 76 mod 8 = 6, cb mod 8 = 5, 66 mod 8 = 6, fc mod 8 = 4, 4a mod 8 = 2から求まる数列C=“1 4 2 6 5 6 5 6 4 2”に変換される。この変換により、数列Cを構成する各値は、暗号化文Xの長さ8未満の値になる。 In this stirring process, in the present embodiment, the positions of the respective values in the encrypted sentence X are exchanged based on the residual value obtained by dividing each random value R constituting the stirring table by 8 which is the length of the encrypted sentence X. It is done. That is, first, each random value R (= hexadecimal number) 81, 94, 0a, e6, 9b, 76, cb, 66, fc, 4a constituting the stirring table is modularly calculated with the length 8 of the encrypted statement X. , Stirring table, formula 81 mod 8 = 1, 94 mod 8 = 4, 0a mod 8 = 2, e6 mod 8 = 6, 9b mod 8 = 5, 76 mod 8 = 6, cb mod 8 = 5, 66 It is converted to the sequence C = "1 4 2 6 5 6 5 6 4 2" obtained from mod 8 = 6, fc mod 8 = 4, 4a mod 8 = 2. By this conversion, each value constituting the sequence C becomes a value having a length of less than 8 of the encrypted statement X.

暗号化文X=“02 a3 f9 76 21 d3 4a c9”は、この数列C=“1 4 2 6 5 6 5 6 4 2”に基づいて、図3のテーブルに示すように、各値の位置が交換されて、撹拌される。つまり、数列Cの各値は、暗号化文Xの各値の0~7の位置を表わすインデックスとして扱われ、数列Cの先頭から2つの値“1 4”により、暗号化文Xのインデックス1の位置にある値“a3”と、インデックス4の位置にある値“21”とが交換され、暗号化文Xは暗号化文X1=“02 21 f9 76 a3 d3 4a c9”に変換される。次に、数列Cの値“1 4”に続く2つの値“2 6”により、暗号化文X1のインデックス2の位置にある値“f9”と、インデックス6の位置にある値“4a”とが交換され、暗号化文X1は暗号化文X2=“02 21 4a 76 a3 d3 f9 c9”に変換される。 The encrypted statement X = “02 a3 f9 76 21 d3 4a c9” is based on this sequence C = “1 4 2 6 5 6 5 6 4 2”, as shown in the table of FIG. Is replaced and agitated. That is, each value of the sequence C is treated as an index representing the position of 0 to 7 of each value of the encryption statement X, and the index 1 of the encryption statement X is based on the two values "1 4" from the beginning of the sequence C. The value "a3" at the position of is exchanged with the value "21" at the position of the index 4, and the encrypted statement X is converted into the encrypted statement X1 = "02 21 f9 76 a3 d3 4a c9". Next, the value "f9" at the index 2 position of the encrypted statement X1 and the value "4a" at the index 6 position are obtained by the two values "2 6" following the value "1 4" in the sequence C. Is exchanged, and the encrypted statement X1 is converted into the encrypted statement X2 = "02 21 4a 76 a3 d3 f9 c9".

次に、数列Cの値“2 6”に続く2つの値“5 6”により、暗号化文X2のインデックス5の位置にある値“d3”と、インデックス6の位置にある値“f9”とが交換され、暗号化文X2は暗号化文X3=“02 21 4a 76 a3 f9 d3 c9”に変換される。次に、数列Cの値“5 6”に続く2つの値“5 6”により、暗号化文X3のインデックス5の位置にある値“f9”と、インデックス6の位置にある値“d3”とが交換され、暗号化文X3は暗号化文X4=“02 21 4a 76 a3 d3 f9 c9”に変換される。次に、数列Cの値“5 6”に続く2つの値“4 2”により、暗号化文X4のインデックス4の位置にある値“a3”と、インデックス2の位置にある値“4a”とが交換され、暗号化文X4は暗号化文X5=“02 21 a3 76 4a d3 f9 c9”に変換される。撹拌手段1fは、この暗号化文X5=“02 21 a3 76 4a d3 f9 c9”を撹拌暗号化文Yとし、秘匿暗号化手段1gへ出力する。 Next, the value "d3" at the index 5 position of the encrypted statement X2 and the value "f9" at the index 6 position are obtained by the two values "5 6" following the value "2 6" in the sequence C. Is exchanged, and the encrypted statement X2 is converted into the encrypted statement X3 = "02 21 4a 76 a3 f9 d3 c9". Next, the value "f9" at the index 5 position of the encrypted statement X3 and the value "d3" at the index 6 position are obtained by the two values "5 6" following the value "5 6" in the sequence C. Is exchanged, and the encrypted statement X3 is converted into the encrypted statement X4 = "02 21 4a 76 a3 d3 f9 c9". Next, the value "a3" at the index 4 position of the encrypted statement X4 and the value "4a" at the index 2 position are obtained by the two values "4 2" following the value "5 6" in the sequence C. Is exchanged, and the encrypted sentence X4 is converted into the encrypted sentence X5 = "02 21 a3 76 4a d3 f9 c9". The stirring means 1f sets this encryption sentence X5 = “02 21 a3 76 4a d3 f9 c9” as the stirring encryption sentence Y and outputs it to the secret encryption means 1g.

次に、秘匿暗号化ステップおよび保存ステップを構成する図2のS108において、秘匿暗号化手段1gにより、撹拌暗号化文Y=“02 21 a3 76 4a d3 f9 c9”の末尾に、撹拌テーブルのテーブル値を構成する数列B=“81 94 0a e6 9b 76 cb 66 fc 4a”が付加されて、秘匿用暗号化文Z=“02 21 a3 76 4a d3 f9 c9 81 94 0a e6 9b 76 cb 66 fc 4a”が生成される。生成されたこの秘匿用暗号化文Zは、保存手段1hにより、アドレス値A=“df 94 f5 2c”によって指定されるアドレスの外部メモリ2に保存される。 Next, in S108 of FIG. 2, which constitutes the secret encryption step and the storage step, the stirring encryption statement Y = “02 21 a3 76 4a d3 f9 c9” is added to the stirring table by the secret encryption means 1g. The sequence B = "81 94 0a e6 9b 76 cb 66 fc 4a" that composes the value is added, and the confidential encryption statement Z = "02 21 a3 76 4a d3 f9 c9 81 94 0a e6 9b 76 cb 66 fc 4a" Is generated. The generated secret encryption statement Z is stored in the external memory 2 at the address specified by the address value A = "df 94 f5 2c" by the storage means 1h.

秘匿暗号化文Zの復号化処理においては、まず、図4,S201の読出ステップにおいて、読出手段1iにより、アドレス値Aによって指定されるアドレスの外部メモリ2から秘匿用暗号化文Zが読み出される。次に、第2比較ステップを構成するS202において、第2比較手段1jにより、読み出された秘匿用暗号化文Zの所定位置の値に、その所定位置の値に連続して並ぶ各位置の値が順に付加されていって、乱数値Rの数列Bが再生される。本実施形態では、秘匿用暗号化文Zの末尾の下2桁の値“4a”に、その値“4a”に遡って連続して並ぶ各位置の値“fc”、“66”、“cb”…が順に加えられていって、乱数値Rの数列B=“…cb 66 fc 4a”が再生される。そして、その数列Bがアドレス値A=“df 94 f5 2c”の末尾に付加されて、第3結合値{アドレス値・乱数列}=“df 94 f5 2c 4a”、“df 94 f5 2c fc 4a”…が順に生成される。生成される各第3結合値は、第2比較手段1jにより、ハッシュ関数でハッシュ化されて、ハッシュ値HASH3が生成される。 In the decryption process of the secret encrypted text Z, first, in the read step of FIGS. 4 and S201, the secret encrypted text Z is read from the external memory 2 of the address specified by the address value A by the reading means 1i. .. Next, in S202 constituting the second comparison step, the values at the predetermined positions of the confidential encryption sentence Z read by the second comparison means 1j are arranged consecutively with the values at the predetermined positions. The values are added in order, and the sequence B of the random value R is reproduced. In the present embodiment, the values "fc", "66", and "cb" of the last two digits of the confidential encryption statement Z are arranged consecutively back to the value "4a". "..." is added in order, and the sequence B = "... cb 66 fc 4a" of the random number value R is reproduced. Then, the sequence B is added to the end of the address value A = "df 94 f5 2c", and the third coupling value {address value / random number sequence} = "df 94 f5 2c 4a", "df 94 f5 2c fc 4a". "..." are generated in order. Each of the generated third combined values is hashed by the second comparison means 1j with a hash function, and the hash value HASH3 is generated.

次に、第2比較ステップをS202と共に構成するS203において、第3結合値のハッシュ値HASH3における所定位置の値、本実施形態では末尾の下2桁の値が、第2比較手段1jによってHASH-IDと比較される。その比較結果がNoで一致しない場合には、処理はS202に戻り、読み出された秘匿用暗号化文Zの末尾から遡る値がアドレス値Aの末尾にさらに付加されて、新たな第3結合値が生成される。そして、新たな第3結合値のハッシュ値HASH3が演算されて、S203において、再度、HASH3における末尾の下2桁の値とHASH-IDとが比較される。 Next, in S203 in which the second comparison step is configured together with S202, the value at a predetermined position in the hash value HASH3 of the third coupling value, in the present embodiment, the value of the last two digits at the end is HASH- by the second comparison means 1j. Compared to ID. If the comparison results do not match with No, the process returns to S202, and a value traced back from the end of the read confidential encryption statement Z is further added to the end of the address value A, and a new third combination is added. A value is generated. Then, the hash value HASH3 of the new third binding value is calculated, and in S203, the last two digits of the value in HASH3 and the HASH-ID are compared again.

S203において、HASH3における末尾の下2桁の値とHASH-IDとが“ad”で一致して、比較結果がYesになると、次に、S204の撹拌テーブル抽出ステップが行われる。このとき、秘匿用暗号化文Zの末尾から遡る全ての値がアドレス値Aの末尾に付加されて生成された第3結合値についてのHASH3における末尾の下2桁の値が、HASH-IDと一致しない場合には、秘匿用暗号化文Zが改ざんされていると、見なすことができる。 In S203, when the last two digits of the value in HASH3 and HASH-ID match with "ad" and the comparison result is Yes, then the stirring table extraction step of S204 is performed. At this time, the last two digits of the HASH3 for the third combined value generated by adding all the values tracing from the end of the confidential encryption statement Z to the end of the address value A are HASH-ID. If they do not match, it can be considered that the confidential encryption statement Z has been tampered with.

ステップS204では、第2比較手段1jにおける比較結果が一致したときにアドレス値Aの末尾に並んで得られる乱数値Rの数列B=“81 94 0a e6 9b 76 cb 66 fc 4a”が、撹拌テーブル抽出手段1kによって撹拌テーブルとして抽出される。次に、S205の撹拌暗号化文抽出ステップにおいて、S204で抽出された撹拌テーブルが、撹拌暗号化文抽出手段1lにより、S201で読み出された秘匿用暗号化文Zから取り除かれ、撹拌テーブルと秘匿用暗号化文Zとが分離される。そして、撹拌テーブルが取り除かれた文が、撹拌暗号化文抽出手段1lによって撹拌暗号化文Y=“02 21 a3 76 4a d3 f9 c9”として抽出される。 In step S204, the sequence B = "81 94 0a e6 9b 76 cb 66 fc 4a" of the random number values R obtained side by side at the end of the address value A when the comparison results in the second comparison means 1j match is the stirring table. It is extracted as a stirring table by the extraction means 1k. Next, in the stirring encrypted sentence extraction step of S205, the stirring table extracted in S204 is removed from the confidential encryption sentence Z read in S201 by the stirring encrypted sentence extracting means 1l, and the stirring table and the stirring table are used. It is separated from the confidential encryption statement Z. Then, the sentence from which the stirring table has been removed is extracted by the stirring encrypted sentence extracting means 1l as the stirring encrypted sentence Y = "02 21 a3 76 4a d3 f9 c9".

次に、S206の逆変換ステップにおいて、S205で抽出された撹拌暗号化文Yが、逆変換手段1mにより、S204で抽出された撹拌テーブルに基づいて逆変換されて、暗号化文Xに戻される。すなわち、撹拌テーブルを構成する各乱数値R81, 94, 0a, e6, 9b, 76, cb, 66, fc, 4aが暗号化文Xの長さ8でモジュロ演算され、撹拌テーブルを構成する各値が、上述した各モジュロ演算式によって数列C=“1 4 2 6 5 6 5 6 4 2”に変換される。そして、この数列C=“1 4 2 6 5 6 5 6 4 2”に基づいて、図3のテーブルに示すように、撹拌暗号化文Y=“02 21 a3 76 4a d3 f9 c9”の各値の位置が、暗号化文X5~X1へ向かって逆に元に戻されて、暗号化文X=“02 a3 f9 76 21 d3 4a c9”に逆変換される。 Next, in the inverse conversion step of S206, the stirring encrypted sentence Y extracted in S205 is inversely converted by the inverse conversion means 1m based on the stirring table extracted in S204, and returned to the encrypted sentence X. .. That is, each random value R81, 94, 0a, e6, 9b, 76, cb, 66, fc, 4a constituting the stirring table is modulo-operated with the length 8 of the encrypted statement X, and each value constituting the stirring table is calculated. However, it is converted into the sequence C = "1 4 2 6 5 6 5 6 4 2" by each of the above-mentioned modulo arithmetic expressions. Then, based on this sequence C = "1 4 2 6 5 6 5 6 4 2", as shown in the table of FIG. 3, each value of the stirring encryption statement Y = "02 21 a3 76 4a d3 f9 c9". The position of is returned to the original position toward the encrypted sentences X5 to X1, and is converted back to the encrypted sentence X = "02 a3 f9 76 21 d3 4a c9".

次に、S207の復号化ステップにおいて、逆変換されて得られた暗号化文Xが復号化手段1nによって復号化されて、元の平文H=“15 5d 39 c0 7d”に変換される。次に、第3比較ステップを構成するS208において、第3比較手段1oにより、復号化手段1nで復号化された平文H=“15 5d 39 c0 7d”がアドレス値A=“df 94 f5 2c”の末尾に付加されて、第4結合値{アドレス値・平文}=“df 94 f5 2c 15 5d 39 c0 7d”が生成される。そして、その第4結合値のハッシュ値HASH4=“55 89 94 9d 02 d5 55 1c 2c 94 20 0f 22 da a0 20 8d 01 d8 a2 51 bb e9 27 61 22 aa ac 96 1f af ad”がハッシュ関数によって演算され、そのHASH4における所定位置の値である末尾の下2桁の値が、第3比較手段1oによってHASH-IDと比較される。 Next, in the decryption step of S207, the encrypted sentence X obtained by the inverse conversion is decrypted by the decryption means 1n and converted into the original plaintext H = "15 5d 39 c0 7d". Next, in S208 constituting the third comparison step, the plaintext H = “15 5d 39 c0 7d” decoded by the decoding means 1n by the third comparison means 1o has the address value A = “df 94 f5 2c”. The fourth join value {address value / plaintext} = "df 94 f5 2c 15 5d 39 c0 7d" is added to the end of. Then, the hash value HASH4 of the fourth bond value = "55 89 94 9d 02 d5 55 1c 2c 94 20 0f 22 da a0 20 8d 01 d8 a2 51 bb e9 27 61 22 aa ac 96 1f af ad" is calculated by the hash function. The calculated value of the last two digits, which is the value at a predetermined position in the HASH4, is compared with the HASH-ID by the third comparison means 1o.

次に、第3比較ステップと共に改ざん判定ステップを構成するS208において、改ざん判定手段1pにより、第3比較手段1oの比較結果から、秘匿用暗号化文Zに対する改ざんの有無が判定される。 Next, in S208, which constitutes the tampering determination step together with the third comparison step, the tampering determination means 1p determines whether or not the confidential encryption sentence Z has been tampered with from the comparison result of the third comparison means 1o.

このような本実施形態の平文暗号化復号化方法および平文暗号化復号化装置によれば、乱数発生手段1dで発生される各乱数値Rが、秘匿用暗号化文Zを保存する外部メモリ2のアドレス値Aに図2,S104で順に付加されていくことで、第2結合値=“df 94 f5 2c 4a”、“df 94 f5 2c fc 4a”…が生成される。生成された第2結合値はそのハッシュ値HASH2が演算され、演算されたハッシュ値HASH2の末尾の下2桁の値とHASH-IDとが図2,S105で比較される。撹拌テーブルは、その比較結果、第2結合値のハッシュ値HASH2の末尾の下2桁の値とHASH-IDとが一致したときまでに発生される乱数の数列Bとして、S106でその時々に応じて動的に生成される。暗号化文Xの撹拌は、このように動的に生成される撹拌テーブルを用いて、図3に示すように行われる。 According to the plaintext encryption / decryption method and the plaintext encryption / decryption apparatus of the present embodiment, each random number value R generated by the random number generating means 1d is an external memory 2 that stores the confidential encryption sentence Z. The second coupling value = "df 94 f5 2c 4a", "df 94 f5 2c fc 4a" ... Is generated by sequentially adding to the address value A in FIGS. 2 and S104. The hash value HASH2 is calculated for the generated second combined value, and the last two digits of the calculated hash value HASH2 and the HASH-ID are compared in FIGS. 2 and S105. As a result of the comparison, the stirring table is set in S106 as a sequence B of random numbers generated by the time when the last two digits of the hash value HASH2 of the second binding value and the HASH-ID match. Is dynamically generated. The stirring of the encrypted sentence X is performed as shown in FIG. 3 using the stirring table dynamically generated in this way.

したがって、本実施形態によれば、メモリに固定して記憶された撹拌テーブルを用いてデータの撹拌が行われる従来の平文暗号化復号化方法および装置とは異なり、撹拌処理の鍵となる撹拌テーブルが公開されたり、総当たりで露見したりする事態は生じない。このため、撹拌処理されたデータを容易に元の撹拌前のデータに戻すことが困難になり、秘匿暗号化文Zの秘匿性は向上する。また、従来のように、固定テーブルのテーブル値をメモリに保存しておく記憶領域が必要とされないため、内部メモリ1aや外部メモリ2が増大化することもない。 Therefore, according to the present embodiment, unlike the conventional plaintext encryption / decryption method and apparatus in which data is agitated using a agitation table fixed in a memory and stored, the agitation table is the key to the agitation process. Will not be made public or exposed in a round-robin manner. Therefore, it becomes difficult to easily return the agitated data to the original data before agitation, and the confidentiality of the confidential encrypted sentence Z is improved. Further, unlike the conventional case, the storage area for storing the table value of the fixed table in the memory is not required, so that the internal memory 1a and the external memory 2 do not increase.

このため、本実施形態の平文暗号化復号化方法および平文暗号化復号化装置によれば、暗号文の秘匿性を向上させることができると共に、メモリの増大化を招くことのない平文暗号化復号化方法および平文暗号化復号化装置を提供することができる。 Therefore, according to the plaintext encryption / decryption method and the plaintext encryption / decryption apparatus of the present embodiment, the confidentiality of the ciphertext can be improved and the plaintext encryption / decryption that does not increase the memory is not caused. An encryption method and a plaintext encryption / decryption apparatus can be provided.

また、従来の平文暗号化復号化方法および装置では、例えば、秘匿用暗号化文Zが記憶された外部メモリ2に別のメモリのデータが上書きされて書き換えられても、改ざんが行われたか否かは分からない。また、秘匿用暗号化文Zが記憶された外部メモリ2の一部のデータが書き換えられても、復号化したデータが化けたと判断できるデータ構造でない限り、改ざんは判明しない。しかし、本実施形態の平文暗号化復号化方法および平文暗号化復号化装置では、図4,S207において復号化手段1nで復号化された平文Hが、S208において、秘匿用暗号化文Zを保存する外部メモリ2のアドレス値Aに付加されることで第4結合値=“df 94 f5 2c 15 5d 39 c0 7d”が生成され、第4結合値のハッシュ値HASH4における末尾の下2桁の値がHASH-ID=“ad”と比較される。 Further, in the conventional plaintext encryption / decryption method and device, for example, even if the data in another memory is overwritten and rewritten in the external memory 2 in which the confidential encryption sentence Z is stored, whether or not the data has been tampered with. I don't know. Further, even if a part of the data in the external memory 2 in which the confidential encryption sentence Z is stored is rewritten, the tampering is not found unless the data structure can be determined that the decrypted data is garbled. However, in the plaintext encryption / decryption method and the plaintext encryption / decryption apparatus of the present embodiment, the plaintext H decrypted by the decryption means 1n in FIGS. 4 and S207 stores the confidential encryption sentence Z in S208. The fourth join value = "df 94 f5 2c 15 5d 39 c0 7d" is generated by being added to the address value A of the external memory 2 to be used, and the last two digits of the hash value HASH4 of the fourth join value. Is compared with HASH-ID = "ad".

HASH-IDは、アドレス値Aに元の平文Hが付加されることで図2,S101で生成される第1結合値のハッシュ値HASH1における末尾の下2桁の値から生成されている。したがって、第4結合値のハッシュ値HASH4における末尾の下2桁の値は、秘匿用暗号化文Zに対する改ざんが無ければ、第1結合値のハッシュ値HASH1における末尾の下2桁の値、つまり、HASH-IDに一致するはずである。このため、本実施形態の平文暗号化復号化方法および平文暗号化復号化装置によれば、第4結合値のハッシュ値HASH4における末尾の下2桁の値をHASH-IDと比較することで、秘匿用暗号化文Zに対する改ざんの有無を判定することができる。 The HASH-ID is generated from the last two digits of the hash value HASH1 of the first binding value generated in FIGS. 2 and S101 by adding the original plaintext H to the address value A. Therefore, the last two digits of the hash value HASH4 of the fourth combined value are the last two digits of the last two digits of the hash value HASH1 of the first combined value unless the confidential encryption statement Z is tampered with. , Should match HASH-ID. Therefore, according to the plaintext encryption / decryption method and the plaintext encryption / decryption apparatus of the present embodiment, the last two digits of the hash value HASH4 of the fourth binding value are compared with the HASH-ID. It is possible to determine whether or not the confidential encryption text Z has been tampered with.

また、改ざんを行うためには平文Hを知らなくてはならず、平文Hを知らないままで改ざんを行うしかなくなる。しかし、秘匿用暗号化文Zに対する改ざんを行うことによって、秘匿暗号化文Zにおける撹拌暗号化文Yの値や各値の位置が変わってしまい、撹拌暗号化文Yから戻される平文Hの値や各値の位置が変わってしまって、秘匿用暗号化文Zから元の平文Hに戻らなくなる。したがって、秘匿用暗号化文Zに対する改ざんが行われた場合、第4結合値のハッシュ値HASH4における末尾の下2桁の値とHASH-IDとが合致する可能性はかなり低くなる。このため、秘匿用暗号化文Zに対する改ざんを検出することが可能となり、改ざんを防止することが可能となる。 In addition, in order to falsify, it is necessary to know the plaintext H, and there is no choice but to falsify without knowing the plaintext H. However, by tampering with the confidential encryption statement Z, the value of the stirring encryption statement Y and the position of each value in the confidential encryption statement Z change, and the value of the plaintext H returned from the stirring encryption statement Y changes. And the position of each value changes, and it is not possible to return from the confidential encryption sentence Z to the original plaintext H. Therefore, when the confidential encryption statement Z is tampered with, the possibility that the last two digits of the hash value HASH4 of the fourth binding value and the HASH-ID match is considerably low. Therefore, it is possible to detect falsification of the confidential encrypted text Z, and it is possible to prevent falsification.

また、本実施形態では、撹拌テーブルを上記のように第1結合値のハッシュ値HASH1や第2結合値のハッシュ値HASH2と関連付けて、図2,S106で動的に撹拌テーブルを生成することにより、撹拌テーブルの大きさを抑制しながら改ざん防止性を高めることができている。その結果、平文Hの暗号化復号化の処理を簡単にしつつ、改ざん困難性を実現することができている。 Further, in the present embodiment, the stirring table is associated with the hash value HASH1 of the first binding value and the hash value HASH2 of the second binding value as described above, and the stirring table is dynamically generated in FIGS. 2 and S106. It is possible to improve the tamper-proof property while suppressing the size of the stirring table. As a result, it is possible to realize the difficulty of falsification while simplifying the process of encrypting and decrypting the plaintext H.

また、本実施形態では、第3結合値のハッシュ値HASH3における末尾の下2桁の値をHASH-IDと比較する図4,S203での比較結果が一致したときに、撹拌テーブルが抽出できるように構成すると共に、第4結合値のハッシュ値HASH4における末尾の下2桁の値とHASH-IDとの一致をS208で確認するように構成し、2回にわたるハッシュ値の合致確認をとる構成を採用することで、改ざんをより困難にさせている。 Further, in the present embodiment, the stirring table can be extracted when the comparison results in FIGS. 4 and S203 for comparing the last two digits of the hash value HASH3 of the third binding value with the HASH-ID match. In addition to the configuration in which the match between the last two digits of the hash value HASH4 of the fourth join value and the HASH-ID is confirmed in S208, the hash value match confirmation is performed twice. By adopting it, it makes tampering more difficult.

また、本実施形態の平文暗号化復号化方法および平文暗号化復号化装置によれば、撹拌暗号化文Yを元の暗号化文Xに図4,S206で逆変換する際、暗号化文Xの長さが分からないと、S201で読み出した秘匿用暗号化文Zの末尾の値に、その末尾の値に連続して遡って並ぶ各位置の値をどこまで順に加えていって、乱数の数列Bを再生すればよいか分からない。したがって、乱数の数列Bとして得られる撹拌テーブルを抽出することができず、外部メモリ2から読み出した秘匿用暗号化文Zから撹拌テーブルを取り除いて、撹拌暗号化文Yを得ることは容易にできない。平文Hは、撹拌暗号化文Yを秘匿用暗号化文Zから抽出する解読と、撹拌暗号化文Yを暗号化文Xに逆変換する解読と、暗号化文Xを平文Hに戻す暗号解読とがセットで行われなければ、解読できない。このため、撹拌テーブルがたとえ短い乱数の数列から構成される場合にも、秘匿用暗号化文Zから撹拌暗号化文Yを経由して暗号化文Xに正しく戻せたかを知り得るまでに相当な時間がかかり、ハッカーによる攻撃に強い平文Hの暗号化および復号化を行える。 Further, according to the plaintext encryption / decryption method and the plaintext encryption / decryption apparatus of the present embodiment, when the stirring encryption statement Y is back-converted to the original encryption statement X in FIGS. 4 and S206, the encryption statement X is used. If you do not know the length of, add the value of each position that is continuously traced back to the last value to the last value of the secret encryption statement Z read in S201, and add the value of each position to the sequence of random numbers. I don't know if I should play B. Therefore, it is not possible to extract the stirring table obtained as the sequence B of random numbers, and it is not easy to obtain the stirring encryption statement Y by removing the stirring table from the confidential encryption statement Z read from the external memory 2. .. The plain sentence H is a decryption that extracts the stirring encryption sentence Y from the confidential encryption sentence Z, a decryption that reversely converts the stirring encryption sentence Y into the encryption sentence X, and a cryptanalysis that returns the encryption sentence X to the plain sentence H. If and is not done as a set, it cannot be decrypted. Therefore, even if the stirring table is composed of a short sequence of random numbers, it is sufficient to know whether the secret encryption statement Z can be correctly returned to the encryption statement X via the stirring encryption statement Y. It takes time and can encrypt and decrypt plaintext H, which is resistant to attacks by hackers.

また、本実施形態の平文暗号化復号化方法および平文暗号化復号化装置によれば、外部メモリ2が乱数で初期化されているため、外部メモリ2中の記憶数値の並びにおいて、秘匿暗号化文Zの前後関係と、そのブロック長とが不明になる。したがって、外部メモリ2の記憶数値を読み出した者は、読み出した数値が外部メモリ2の初期値なのか、秘匿暗号化文Zの値なのかを判別できず、どこからどこまでが秘匿暗号化文Zのブロックであるか分からない。このため、外部メモリ2中の記憶数値の並びにおける秘匿暗号化文Zの記憶位置を特定することが困難になり、外部メモリ2中の記憶数値から秘匿暗号化文Zを特定して読み出すことができなくなる。 Further, according to the plaintext encryption / decryption method and the plaintext encryption / decryption apparatus of the present embodiment, since the external memory 2 is initialized with a random number, secret encryption is performed in the arrangement of the stored numerical values in the external memory 2. The context of sentence Z and its block length become unknown. Therefore, the person who reads the stored numerical value of the external memory 2 cannot determine whether the read numerical value is the initial value of the external memory 2 or the value of the secret encrypted statement Z, and from where to where is the secret encrypted statement Z. I don't know if it's a block. For this reason, it becomes difficult to specify the storage position of the secret encrypted sentence Z in the arrangement of the stored numerical values in the external memory 2, and it is possible to specify and read the secret encrypted sentence Z from the stored numerical values in the external memory 2. become unable.

なお、上記実施形態において、図2,S107の撹拌ステップにおける暗号化文Xの撹拌は、撹拌テーブルを構成する各乱数値Rを暗号化文Xの長さ8で除した剰余値に基づいて、暗号化文Xにおける各値の位置を図3に示すように交換して行うことで行われた。しかし、暗号化文Xの撹拌は、撹拌テーブルを構成する各乱数値Rを暗号化文Xの全ての各値に作用させる行列計算による線形変換(線形写像)処理を使って行い、図4,S206の逆変換ステップにおける逆変換は、その行列計算の逆行列計算による線形変換処理を使って行うように、構成してもよい。 In the above embodiment, the stirring of the encrypted sentence X in the stirring step of FIGS. 2 and S107 is based on the remainder value obtained by dividing each random number value R constituting the stirring table by the length 8 of the encrypted sentence X. This was done by exchanging the positions of the respective values in the encrypted statement X as shown in FIG. However, the stirring of the encrypted sentence X is performed by using a linear transformation (linear mapping) process by matrix calculation in which each random value R constituting the stirring table is applied to all the values of the encrypted sentence X, and FIG. The inverse transformation in the inverse transformation step of S206 may be configured to be performed by using the linear transformation processing by the inverse matrix calculation of the matrix calculation.

このような構成によれば、暗号化文Xを構成する全ての値が行列計算による線形変換処理によって撹拌される。このため、撹拌テーブルを構成する各乱数値Rを暗号化文Xの長さ8で除した剰余値に基づいて、暗号化文Xにおける各値の位置を交換して行う本実施形態における撹拌処理に比較して、ハッカーによる攻撃により強い平文Hの暗号化および復号化を行える。 According to such a configuration, all the values constituting the encrypted statement X are agitated by the linear conversion process by matrix calculation. Therefore, the stirring process in the present embodiment is performed by exchanging the positions of the respective values in the encrypted sentence X based on the residual value obtained by dividing each random number value R constituting the stirring table by the length 8 of the encrypted sentence X. Compared to, it is possible to encrypt and decrypt plaintext H that is stronger than the attack by a hacker.

また、上記実施形態においては、第1結合値のハッシュ値HASH1における末尾の下2桁の値からHASH-IDを構成し、このHASH-IDを各ハッシュ値HASH2,3,4の末尾の下2桁の値と比較するように構成した。しかし、HASH-IDを構成する値の桁数は、多いほど乱数列Bを生成する時間やその他の処理時間がかかるが、多ければ多いほど改ざん耐性を上げることができる。 Further, in the above embodiment, the HASH-ID is configured from the last two digits of the hash value HASH1 of the first binding value, and this HASH-ID is used as the last 2 at the end of each hash value HASH2,3,4. It is configured to be compared with the digit value. However, the larger the number of digits of the value constituting the HASH-ID, the longer it takes to generate the random number sequence B and other processing time, but the larger the number, the higher the tamper resistance.

1…ホスト(HOST)
2…外部メモリ
3…HSM(ハードウエアセキュリティーモジュール)
1 ... Host (HOST)
2 ... External memory 3 ... HSM (Hardware Security Module)

Claims (9)

識別値生成手段により、秘匿用暗号化文をメモリに保存する保存先を指定するアドレス値に平文を付加して第1結合値を生成し、前記第1結合値のハッシュ値を演算し、前記第1結合値のハッシュ値における所定位置の値から識別値を生成する識別値生成ステップと、暗号化手段により、前記平文を暗号化して暗号化文を生成する暗号化ステップと、第1比較手段により、乱数発生手段で発生される乱数を前記アドレス値に付加して第2結合値を生成し、前記第2結合値のハッシュ値を演算し、前記第2結合値のハッシュ値の所定位置の値と前記識別値とを比較し、比較結果が一致しない場合には、前記乱数発生手段で次に発生される乱数を前記アドレス値にさらに付加して新たな前記第2結合値を生成する処理、新たな前記第2結合値のハッシュ値を演算する処理、および、新たな前記第2結合値のハッシュ値における所定位置の値と前記識別値とを比較する処理を比較結果が一致するまで繰り返す第1比較ステップと、撹拌手段により、前記第1比較ステップにおける比較結果が一致したときまでに発生される前記乱数の数列を撹拌テーブルとして前記暗号化文を撹拌して撹拌暗号化文を生成する撹拌ステップと、秘匿暗号化手段により、前記撹拌暗号化文に前記乱数の数列を付加して前記秘匿用暗号化文を生成する秘匿暗号化ステップと、保存手段により、生成した前記秘匿用暗号化文を前記アドレス値によって指定されるアドレスの前記メモリに保存する保存ステップと、読出手段により、前記アドレス値によって指定されるアドレスの前記メモリから前記秘匿用暗号化文を読み出す読出ステップと、第2比較手段により、読み出した前記秘匿用暗号化文の所定位置の値を前記乱数の数列を構成する乱数として抽出し、抽出した当該乱数を前記アドレス値に付加して第3結合値を生成し、前記第3結合値のハッシュ値を演算し、前記第3結合値のハッシュ値における所定位置の値を前記識別値と比較し、比較結果が一致しない場合には、読み出した前記秘匿用暗号化文の所定位置の値に連続して並ぶ位置の値を前記乱数の数列を構成する次の乱数として前記アドレス値にさらに付加した新たな前記第3結合値を生成する処理、新たな前記第3結合値のハッシュ値を演算する処理、および、新たな前記第3結合値のハッシュ値における所定位置の値と前記識別値とを比較する処理を比較結果が一致するまで繰り返す第2比較ステップと、撹拌テーブル抽出手段により、前記第2比較ステップにおける比較結果が一致したときに得られる前記乱数の数列を前記撹拌テーブルとして抽出する撹拌テーブル抽出ステップと、撹拌暗号化文抽出手段により、抽出した前記撹拌テーブルを読み出した前記秘匿用暗号化文から取り除いた文を前記撹拌暗号化文として抽出する撹拌暗号化文抽出ステップと、逆変換手段により、抽出した前記撹拌暗号化文を抽出した前記撹拌テーブルに基づいて逆変換して前記暗号化文に戻す逆変換ステップと、復号化手段により、逆変換されて得られた前記暗号化文を復号化して前記平文を得る復号化ステップとを備える平文暗号化復号化方法。 The identification value generation means adds a plain sentence to the address value that specifies the save destination for storing the confidential encryption statement in the memory to generate the first combined value, calculates the hash value of the first combined value, and then calculates the said. An identification value generation step that generates an identification value from a value at a predetermined position in the hash value of the first join value, an encryption step that encrypts the plain sentence by an encryption means to generate an encrypted sentence, and a first comparison means. A random number generated by the random number generating means is added to the address value to generate a second combined value, the hash value of the second combined value is calculated, and a predetermined position of the hash value of the second combined value is calculated. If the comparison result does not match, the random number generated next by the random number generating means is further added to the address value to generate a new second combined value. The process, the process of calculating the new hash value of the second combined value, and the process of comparing the value at a predetermined position in the new hash value of the second combined value with the identified value until the comparison results match. Using the repeating first comparison step and the stirring means as a stirring table using the number sequence of the random numbers generated by the time when the comparison results in the first comparison step match, the encrypted text is stirred to generate a stirred encrypted text. The secret encryption step of adding a number sequence of the random numbers to the stirring encryption sentence by the stirring step, and the secret encryption step of generating the secret encryption sentence by the stirring encryption means, and the secret encryption generated by the storage means. A save step of storing the encrypted text in the memory of the address specified by the address value, a read step of reading the confidential encrypted text from the memory of the address specified by the address value by the reading means, and the first step. 2 The value at a predetermined position of the confidential encryption text read out is extracted as a random number constituting the number sequence of the random numbers by the comparison means, and the extracted random number is added to the address value to generate a third combined value. , The hash value of the third combined value is calculated, the value at a predetermined position in the hash value of the third combined value is compared with the identification value, and if the comparison results do not match, the read-out secret encryption is performed. A process of generating a new third combined value by further adding the values at positions consecutively arranged in a predetermined position of the statement to the address value as the next random number constituting the sequence of the random numbers, the new third The process of calculating the hash value of the combined value and the process of comparing the value at a predetermined position in the new hash value of the third combined value with the identified value are repeated until the comparison results match . 2 By the comparison step and the stirring table extraction means, the stirring table extraction step of extracting the number sequence of the random numbers obtained when the comparison results in the second comparison step match as the stirring table, and the stirring encrypted sentence extraction means . The agitation encryption sentence extraction step of extracting the sentence removed from the concealment encryption sentence obtained by reading the extracted agitation table as the agitation encryption sentence and the agitation encryption sentence extracted by the inverse conversion means are extracted. A reverse conversion step of reverse conversion based on the stirring table and returning to the encrypted text, and a decryption step of decrypting the encrypted text obtained by reverse conversion by a decryption means to obtain the plaintext. Plaintext encryption / decryption method. 第3比較手段により、前記復号化ステップで復号化された前記平文を前記アドレス値に付加して第4結合値を生成し、前記第4結合値のハッシュ値を演算し、前記第4結合値のハッシュ値における所定位置の値を前記識別値と比較する第3比較ステップと、改ざん判定手段により、前記第3比較ステップの比較結果から前記秘匿用暗号化文に対する改ざんの有無を判定する改ざん判定ステップとを備えることを特徴とする請求項1に記載の平文暗号化復号化方法。 By the third comparison means, the plaintext decoded in the decoding step is added to the address value to generate a fourth combined value, the hash value of the fourth combined value is calculated, and the fourth combined value is calculated. The third comparison step of comparing the value at a predetermined position in the hash value of the above with the identification value, and the tampering determination means for determining whether or not the confidential encryption text has been tampered with from the comparison result of the third comparison step. The plaintext encryption / decryption method according to claim 1, further comprising a step. 前記暗号化ステップにおける暗号化は前記平文を所定長の前記暗号化文に変換することで行われ、
前記撹拌ステップにおける撹拌は、前記撹拌テーブルを構成する各乱数値を前記所定長で除した剰余値に基づいて、前記暗号化文における各値の位置を交換して行うことで行われ、
前記逆変換ステップにおける逆変換は、抽出した前記撹拌テーブルを構成する各乱数値を前記所定長で除した剰余値に基づいて、前記撹拌暗号化文における各値の位置を元の位置に戻して行うことを特徴とする請求項1または請求項2に記載の平文暗号化復号化方法。
The encryption in the encryption step is performed by converting the plaintext into the encrypted sentence having a predetermined length.
The stirring in the stirring step is performed by exchanging the positions of the respective values in the encrypted text based on the residual value obtained by dividing each random value constituting the stirring table by the predetermined length.
In the inverse conversion in the inverse conversion step, the position of each value in the stirring encryption statement is returned to the original position based on the remainder value obtained by dividing each random value constituting the extracted stirring table by the predetermined length. The plaintext encryption / decryption method according to claim 1 or 2, wherein the method is performed.
前記撹拌ステップにおける撹拌は、前記撹拌テーブルを構成する各乱数値を前記暗号化文の全ての各値に作用させる行列計算による線形変換処理を使って行われ、
前記逆変換ステップにおける逆変換は、前記行列計算の逆行列計算による線形変換処理を使って行われることを特徴とする請求項1または請求項2に記載の平文暗号化復号化方法。
The stirring in the stirring step is performed by using a linear conversion process by matrix calculation in which each random value constituting the stirring table is applied to all the values of the encrypted statement.
The plaintext encryption / decryption method according to claim 1 or 2, wherein the inverse transformation in the inverse transformation step is performed by using a linear transformation process based on the inverse matrix calculation of the matrix calculation.
前記メモリは乱数で初期化されていることを特徴とする請求項1から請求項4のいずれか1項に記載の平文暗号化復号化方法。 The plaintext encryption / decryption method according to any one of claims 1 to 4, wherein the memory is initialized with a random number. 前記識別値生成ステップは、前記アドレス値の末尾に前記平文を付加した前記第1結合値のハッシュ値における末尾の値から前記識別値を生成し、
前記第1比較ステップは、前記乱数発生手段で発生される乱数を前記アドレス値の末尾に付加して得られる前記第2結合値のハッシュ値における末尾の値と前記識別値とを比較し、比較結果が一致しない場合には、前記乱数発生手段で次に発生される乱数を前記アドレス値の末尾にさらに付加して得られる新たな前記第2結合値のハッシュ値における末尾の値と前記識別値とを比較することで行われ、
前記撹拌ステップは、前記第2結合値のハッシュ値における末尾の値と前記識別値とが一致するときまでに前記アドレス値の末尾に付加された前記乱数の数列を前記撹拌テーブルとすることで行われ、
前記第2比較ステップは、読み出した前記秘匿用暗号化文の末尾の値を前記アドレス値の末尾に付加した前記第3結合値のハッシュ値における末尾の値を前記識別値とを比較し、比較結果が一致しない場合には、読み出した前記秘匿用暗号化文の末尾から遡る値を前記アドレス値の末尾にさらに付加した新たな前記第3結合値のハッシュ値における末尾の値と前記識別値とを比較することで行われ、
前記撹拌テーブル抽出ステップは、前記第3結合値のハッシュ値における末尾の値と前記識別値とが一致したときに前記アドレス値の末尾に並ぶ値の数列を前記撹拌テーブルとすることで行われること特徴とする請求項1から請求項5のいずれか1項に記載の平文暗号化復号化方法。
The identification value generation step generates the identification value from the last value in the hash value of the first combined value in which the plaintext is added to the end of the address value.
In the first comparison step, the last value in the hash value of the second combined value obtained by adding the random number generated by the random number generating means to the end of the address value is compared with the identification value and compared. If the results do not match, the end value in the hash value of the new second combined value obtained by further adding the random number generated next by the random number generation means to the end of the address value and the identification value. Made by comparing with
The stirring step is performed by using the sequence of random numbers added to the end of the address value as the stirring table by the time the last value in the hash value of the second binding value and the identification value match. I,
In the second comparison step, the last value in the hash value of the third combined value in which the last value of the read confidential encryption statement is added to the last of the address value is compared with the identification value and compared. If the results do not match, the value at the end of the hash value of the new third combined value, in which the value traced back from the end of the read confidential encryption statement is further added to the end of the address value, and the identification value are used. Made by comparing
The stirring table extraction step is performed by using the sequence of values arranged at the end of the address value as the stirring table when the last value in the hash value of the third binding value and the identification value match. The plaintext encryption / decryption method according to any one of claims 1 to 5, which is characterized.
前記第3比較ステップは、前記復号化ステップで復号化された前記平文を前記アドレス値の末尾に付加した前記第4結合値のハッシュ値における末尾の値を前記識別値と比較することで行われることを特徴とする請求項2を引用する請求項6に記載の平文暗号化復号化方法。 The third comparison step is performed by comparing the last value in the hash value of the fourth combined value with the plaintext decoded in the decoding step added to the end of the address value with the identification value. The plaintext encryption / decryption method according to claim 6, which cites claim 2. 秘匿用暗号化文をメモリに保存する保存先を指定するアドレス値に平文を付加して第1結合値を生成し、前記第1結合値のハッシュ値を演算し、前記第1結合値のハッシュ値における所定位置の値から識別値を生成する識別値生成手段と、前記平文を暗号化して暗号化文を生成する暗号化手段と、乱数を発生する乱数発生手段と、前記乱数発生手段で発生される乱数を前記アドレス値に付加して第2結合値を生成し、前記第2結合値のハッシュ値を演算し、前記第2結合値のハッシュ値の所定位置の値と前記識別値とを比較し、比較結果が一致しない場合には、前記乱数発生手段で次に発生される乱数を前記アドレス値にさらに付加して新たな前記第2結合値を生成する処理、新たな前記第2結合値のハッシュ値を演算する処理、および、新たな前記第2結合値のハッシュ値における所定位置の値と前記識別値とを比較する処理を比較結果が一致するまで繰り返す第1比較手段と、前記第1比較手段における比較結果が一致したときまでに発生される前記乱数の数列を撹拌テーブルとして前記暗号化文を撹拌して撹拌暗号化文を生成する撹拌手段と、前記撹拌暗号化文に前記乱数の数列を付加して前記秘匿用暗号化文を生成する秘匿暗号化手段と、生成した前記秘匿用暗号化文を前記アドレス値によって指定されるアドレスの前記メモリに保存する保存手段と、前記アドレス値によって指定されるアドレスの前記メモリから前記秘匿用暗号化文を読み出す読出手段と、読み出した前記秘匿用暗号化文の所定位置の値を前記乱数の数列を構成する乱数として抽出し、抽出した当該乱数を前記アドレス値に付加して第3結合値を生成し、前記第3結合値のハッシュ値を演算し、前記第3結合値のハッシュ値における所定位置の値を前記識別値と比較し、比較結果が一致しない場合には、読み出した前記秘匿用暗号化文の所定位置の値に連続して並ぶ位置の値を前記乱数の数列を構成する次の乱数として前記アドレス値にさらに付加した新たな前記第3結合値を生成する処理、新たな前記第3結合値のハッシュ値を演算する処理、および、新たな前記第3結合値のハッシュ値における所定位置の値と前記識別値とを比較する処理を比較結果が一致するまで繰り返す第2比較手段と、前記第2比較手段における比較結果が一致したときに得られる前記乱数の数列を前記撹拌テーブルとして抽出する撹拌テーブル抽出手段と、抽出した前記撹拌テーブルを読み出した前記秘匿用暗号化文から取り除いた文を前記撹拌暗号化文として抽出する撹拌暗号化文抽出手段と、抽出した前記撹拌暗号化文を抽出した前記撹拌テーブルに基づいて逆変換して前記暗号化文に戻す逆変換手段と、逆変換されて得られた前記暗号化文を復号化して前記平文を得る復号化手段とを備える平文暗号化復号化装置。 The first join value is generated by adding a plain sentence to the address value that specifies the save destination for saving the secret encryption statement in the memory, the hash value of the first join value is calculated, and the hash of the first join value is calculated. An identification value generation means that generates an identification value from a value at a predetermined position in a value, an encryption means that encrypts the plain sentence and generates an encrypted sentence, a random number generation means that generates a random number, and the random number generation means. The random number to be used is added to the address value to generate a second join value, the hash value of the second join value is calculated, and the value at a predetermined position of the hash value of the second join value and the identification value are used. If the comparison results do not match, a process of further adding a random number generated next by the random number generating means to the address value to generate a new second combined value, a new second combined value. A first comparison means that repeats a process of calculating the hash value of the combined value and a process of comparing the value at a predetermined position in the new hash value of the second combined value with the identification value until the comparison results match . The stirring means for generating the stirring encryption sentence by stirring the encryption sentence using the number sequence of the random numbers generated by the time when the comparison results in the first comparison means match as the stirring table, and the stirring encryption sentence. A secret encryption means that adds a sequence of random numbers to generate the secret encryption statement, and a storage means that stores the generated secret encryption statement in the memory at an address specified by the address value. A reading means for reading the secret encryption text from the memory of the address specified by the address value and a value at a predetermined position of the read secret encryption text are extracted as random numbers constituting the sequence of random numbers. The extracted random number is added to the address value to generate a third combined value, the hash value of the third combined value is calculated, and the value at a predetermined position in the hash value of the third combined value is used as the identification value. If the comparison results do not match, the value at the position consecutively arranged in the value at the predetermined position of the read confidential encryption statement is further added to the address value as the next random number constituting the random number sequence. The process of generating the added new third combined value, the process of calculating the new hash value of the third combined value, and the value at a predetermined position and the identification value in the new hash value of the third combined value. A second comparison means that repeats the process of comparing the above until the comparison results match, and a stirring table extraction means that extracts the number sequence of the random numbers obtained when the comparison results in the second comparison means match as the stirring table. ,Extracted Inverse based on the stirring encryption sentence extraction means for extracting the sentence removed from the concealment encryption sentence from which the stirring table is read out as the stirring encryption sentence, and the stirring table from which the extracted stirring encryption sentence is extracted. A plaintext encryption / decryption apparatus including a reverse conversion means for converting and returning to the encrypted text, and a decryption means for decrypting the encrypted text obtained by reverse conversion to obtain the plaintext. 前記復号化手段で復号化された前記平文を前記アドレス値に付加して第4結合値を生成し、前記第4結合値のハッシュ値を演算し、前記第4結合値のハッシュ値における所定位置の値を前記識別値と比較する第3比較手段と、前記第3比較手段の比較結果から前記秘匿用暗号化文に対する改ざんの有無を判定する改ざん判定手段とを備えることを特徴とする請求項8に記載の平文暗号化復号化装置。 The plaintext decoded by the decoding means is added to the address value to generate a fourth combined value, the hash value of the fourth combined value is calculated, and a predetermined position in the hash value of the fourth combined value is calculated. The claim is characterized by comprising a third comparison means for comparing the value of 8. The plaintext encryption / decryption device according to 8.
JP2019222522A 2019-12-09 2019-12-09 Plaintext encryption / decryption method and plaintext encryption / decryption device Active JP7103334B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2019222522A JP7103334B2 (en) 2019-12-09 2019-12-09 Plaintext encryption / decryption method and plaintext encryption / decryption device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2019222522A JP7103334B2 (en) 2019-12-09 2019-12-09 Plaintext encryption / decryption method and plaintext encryption / decryption device

Publications (2)

Publication Number Publication Date
JP2021092634A JP2021092634A (en) 2021-06-17
JP7103334B2 true JP7103334B2 (en) 2022-07-20

Family

ID=76312610

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2019222522A Active JP7103334B2 (en) 2019-12-09 2019-12-09 Plaintext encryption / decryption method and plaintext encryption / decryption device

Country Status (1)

Country Link
JP (1) JP7103334B2 (en)

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2008122804A (en) 2006-11-14 2008-05-29 Toshiba Information Systems (Japan) Corp Information communication system, information transmitting device, information receiving device and information transceiving device

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP3029381B2 (en) * 1994-01-10 2000-04-04 富士通株式会社 Data converter

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2008122804A (en) 2006-11-14 2008-05-29 Toshiba Information Systems (Japan) Corp Information communication system, information transmitting device, information receiving device and information transceiving device

Also Published As

Publication number Publication date
JP2021092634A (en) 2021-06-17

Similar Documents

Publication Publication Date Title
AU2011363942B2 (en) Method and system for protecting execution of cryptographic hash functions
Benvenuto Galois field in cryptography
AU2011292312B2 (en) Apparatus and method for block cipher process for insecure environments
CN106487497B (en) DPA protection for RIJNDAEL algorithm
US20070263859A1 (en) Protection of the execution of a DES algorithm
TW201044334A (en) Encryption device, encryption method, and computer program
US10873448B2 (en) Technique to generate symmetric encryption algorithms
US7809130B1 (en) Password recovery system and method
US20090168994A1 (en) Method for providing stronger encryption using conventional ciphers
JP4153665B2 (en) Method for protecting one or more electronic devices using the same secret key encryption algorithm, use of the method and electronic device
JP7103334B2 (en) Plaintext encryption / decryption method and plaintext encryption / decryption device
JPWO2006118101A1 (en) CONFIDENTIAL INFORMATION PROCESSING HOST DEVICE AND CONFIDENTIAL INFORMATION PROCESSING METHOD
CN102622561A (en) Enciphering and deciphering method for invoking data in software
EP1606685B1 (en) Security process for an electronic unit including a cryptoprocessor
CN101043334B (en) Method and device of encryption and data certification and decryption and data authenticity validating
JP6631989B2 (en) Encryption device, control method, and program
JP4321837B2 (en) Portable recording medium with encryption processing function
EP3439225A1 (en) Method to secure a software code performing accesses to look-up tables
EP3975470A1 (en) Method for securing an execution of an algorithm of a cryptographic process
KR20110100454A (en) Side channel attack resistant key management method based on the key encryption and shuffling method
CN112749402A (en) Electronic data processing method and device, electronic equipment and storage medium
Patil et al. The Design and Implementation of Password Management System using Blowfish Algorithm
Weir Data At Rest Innovation with Turnstile
CN115622745A (en) Encryption method, device, terminal equipment and computer readable storage medium
Yenikapati et al. Message Encryption Using Deceptive Text and Randomized Hashing

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20210713

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20220331

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20220405

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20220524

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

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20220620

R150 Certificate of patent or registration of utility model

Ref document number: 7103334

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150