JP5268011B2 - Encryption system and decryption system - Google Patents

Encryption system and decryption system Download PDF

Info

Publication number
JP5268011B2
JP5268011B2 JP2011061812A JP2011061812A JP5268011B2 JP 5268011 B2 JP5268011 B2 JP 5268011B2 JP 2011061812 A JP2011061812 A JP 2011061812A JP 2011061812 A JP2011061812 A JP 2011061812A JP 5268011 B2 JP5268011 B2 JP 5268011B2
Authority
JP
Japan
Prior art keywords
function
random number
pseudo
number sequence
document
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.)
Expired - Fee Related
Application number
JP2011061812A
Other languages
Japanese (ja)
Other versions
JP2011145698A (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.)
OCHANOMIZU UNIVERSITY
Hiroshima University NUC
Original Assignee
OCHANOMIZU UNIVERSITY
Hiroshima University NUC
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 OCHANOMIZU UNIVERSITY, Hiroshima University NUC filed Critical OCHANOMIZU UNIVERSITY
Priority to JP2011061812A priority Critical patent/JP5268011B2/en
Publication of JP2011145698A publication Critical patent/JP2011145698A/en
Application granted granted Critical
Publication of JP5268011B2 publication Critical patent/JP5268011B2/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Abstract

<P>PROBLEM TO BE SOLVED: To provide an encryption system and a decryption system performing high speed processing safely. <P>SOLUTION: A function selection means, for each block unit of a document from a document storage means, selects a function sequentially by pseudo-random numbers. A function execution means, using a block of the pseudo-random number sequence as a parameter in the selected function, converts the document to encrypt it. In the decryption system, an inverse function selection means, for each block unit of the encrypted document from the encrypted document storage means, selects an inverse function by pseudo-random numbers. An inverse function execution means, using a block of the pseudo-random number sequence as a parameter in the selected inverse function, converts the encrypted document to decrypt it. Since the respective functions are basic high-speed functions, the combined overall conversion is also carried out at high speed. Since both of the combination of the functions and the number of iteration can be changed, specification reinforcement in the future is facilitated. The execution order of the functions cannot be known, and consequently high safety is ensured. <P>COPYRIGHT: (C)2011,JPO&amp;INPIT

Description

本発明は、共有鍵を用いたブロックサイファ及びストリームサイファにおける擬似乱数発生システムを利用した暗号化システム及び復号化システムである。   The present invention is an encryption system and a decryption system using a pseudo random number generation system in a block cipher and a stream cipher using a shared key.

第三者に見られては困る文書を電子データとして保存する時には、データは暗号化され、パスワードを知らなければ解読できないように変換される。ここで利用される暗号技術として、現在広く使用されているのは、データを固定サイズのブロックに区切り、それぞれのブロックを秘密鍵に依存した特定の関数で暗号化する、ブロックサイファと呼ばれる暗号化方式と、データの位置によって異なる関数で暗号化されるストリームサイファと呼ばれる暗号化方式である。ストリームサイファではデータと暗号乱数列の排他的論理和を求めることが多い。
また、インターネットを用いて電子商取引を行なう際にも、第三者に知られることなく、安全に2点A,B間で通信を行なうために、データは暗号化して伝送されている。その時に利用される暗号技術として、現在広く利用されているのは、DESやTriple DES,AESに代表される共有鍵暗号方式である。これは、通信を行なうA,B間でのみ共有している共有暗号鍵をもとに、送信するデータを第三者に分からないデータに変換する方法である。
When a document that is difficult to be viewed by a third party is stored as electronic data, the data is encrypted and converted so that it cannot be decrypted without knowing the password. The encryption technology used here is widely used as an encryption called block cipher, where data is divided into fixed-size blocks and each block is encrypted with a specific function that depends on the secret key. It is an encryption method called a stream cipher that is encrypted with a method and a function that differs depending on the position of data. Stream cipher often obtains an exclusive OR of data and a cryptographic random number sequence.
Also, when performing electronic commerce using the Internet, data is encrypted and transmitted in order to securely communicate between the two points A and B without being known by a third party. As encryption techniques used at that time, widely used are shared key cryptosystems represented by DES, Triple DES, and AES. This is a method of converting data to be transmitted into data that cannot be understood by a third party, based on a shared encryption key shared only between A and B that perform communication.

DES(Data Encryption Standard)は、これまでアメリカ合衆国政府の国立標準研究所(NIST)が、データ暗号の標準として推奨してきた共有鍵暗号方式である。Triple DESはDESを3回繰り返すことで、その安全性を高めた暗号方式である。AES(Advanced Encryption Standard)は、DESに代わるデータ暗号の標準としてNISTが公募し、数学者J.Daemen,V.Rijmenによって開発されたRijindaelと呼ばれる暗号化方式である。これらはすべて、共有鍵を利用して、固定サイズのブロックに区切られたデータを高速に暗号化する共有鍵暗号方式であり、ブロックサイファである。この変換に必要な計算量は大変小さく、実用性が高い。
ストリームサイファでは、平方剰余により擬似乱数を生成するBlum−Blum−Shub(BBS)法により暗号乱数列を生成し、文書との排他的論理和を暗号文とする方法が知られている。BBS法は、暗号鍵kを次々に二乗して、秘密の2つの素数の積Nでの剰余を作り、その最下位ビットを並べて作った列を暗号乱数列とする方針である。このNが十分大きければ、この列が暗号的に大変優れたもの、すなわち連続するいくつものデータを集めても、次のビットをランダムより良い確率で予測することが難しい、という性質をもつ擬似乱数列になっていることは、文献「L. Blum, M. Blum, M. Shub: “A Simple Unpredictable Psudo-Random Number Generator”, SIAM J. Comput. Vol15, No.2, May 1986」で示されている。よって、これを用いれば、たくさんの文字を推定しても、法則を見つけることは大変に難しく、他の部分列を推定するには、全数チェック相当の計算が必要となると考えられている。
DES (Data Encryption Standard) is a shared key cryptosystem that has been recommended by the National Institute for Standardization (NIST) of the United States government as a standard for data encryption. Triple DES is an encryption method that increases its security by repeating DES three times. AES (Advanced Encryption Standard) is an encryption method called Rijindael developed by the mathematicians J. Daemen and V. Rijmen, which NIST publicly solicited as a data encryption standard to replace DES. These are all block ciphers, which are shared key cryptosystems that use a shared key to encrypt data divided into fixed-size blocks at high speed. The amount of calculation required for this conversion is very small and practical.
In the stream cipher, a method is known in which an encrypted random number sequence is generated by a Blum-Blum-Shub (BBS) method for generating a pseudo-random number using a quadratic remainder and an exclusive OR with a document is used as a ciphertext. The BBS method is a policy in which the encryption key k is squared one after another to create a remainder in the product N of two secret prime numbers, and a sequence formed by arranging the least significant bits is used as an encryption random number sequence. If this N is sufficiently large, this sequence is very good cryptographically, that is, it is difficult to predict the next bit with a better probability than random, even if it collects a lot of continuous data. This is shown in the literature “L. Blum, M. Blum, M. Shub:“ A Simple Unpredictable Psudo-Random Number Generator ”, SIAM J. Comput. Vol15, No.2, May 1986”. ing. Therefore, if this is used, it is considered that it is very difficult to find the law even if many characters are estimated, and calculation equivalent to exhaustive check is required to estimate other subsequences.

しかしながら、従来の共有鍵暗号方式のブロックサイファでは、鍵情報から一つの複雑な暗号化関数を作り、これを用いて平文を変換するため、高速な暗号システムは作られる関数に偏りがあり、暗号解読のための情報を得られやすいという問題がある。たとえば暗号を解読しようとする際には、差分解読法や、線形解読法などの、既知の平文を暗号化させることによる攻撃がよく用いられている。すなわち攻撃する人物が、任意の文書を暗号化させられる状況では、解読に用いるデータを採取され、鍵の全数検索よりも簡単に暗号が破られるという問題があった。また、共有鍵暗号方式のストリームサイファでも、例えば上記のBBS法では大きな数の自乗と、その値の大きな数Nでの剰余を計算するため低速であるように、十分な安全性を持つ暗号乱数列を生成するための計算量は大きく低速になり、高速に生成できる擬似乱数は暗号的に安全でないという問題がある。
また、これまでに知られているストリームサイファ用暗号乱数列は周期が短く長く使い続けることができないという問題があった。
However, in the conventional shared key cryptosystem block cipher, a single complex encryption function is created from the key information, and plaintext is converted using this function. There is a problem that it is easy to obtain information for decoding. For example, when trying to decrypt a cipher, an attack by encrypting a known plaintext, such as differential cryptanalysis or linear cryptanalysis, is often used. In other words, in a situation where an attacking person can encrypt an arbitrary document, there is a problem that data used for decryption is collected and the encryption is broken more easily than a full key search. Also, even in a shared-key cryptosystem stream cipher, for example, in the BBS method described above, a cryptographic random number having sufficient security so as to be slow because it calculates a square of a large number and a remainder with a large number N of the value. There is a problem that the amount of calculation for generating a sequence is large and slow, and pseudo-random numbers that can be generated at high speed are not cryptographically secure.
Further, the known cipher random number sequence for stream ciphers has a short cycle and cannot be used for a long time.

これらの問題に対処する方法として、例えば特許文献1〜特許文献5がある。特許文献1および特許文献2では、複数の暗号化関数を用意し、鍵情報や外部からのデータにより、どの暗号化関数で暗号化するかを選択することで、平文によって異なる暗号化関数で暗号化し、これにより情報の漏洩を防いだり、認証効果を得たりしている。また、特許文献3〜特許文献5では、性質の良い暗号乱数列の作り方を与えている。特に特許文献3では、平文列を有限状態オートマトンで書き換えて暗号乱数列を生成していて、本発明と関係が深い。線形フィードバックシフトレジスタ(linear feedback shift register (LFSR))にもとづいた擬似乱数生成装置であるが、ソフトウェア実装した場合の処理速度が充分ではないという問題がある。また、LFSRにもとづいた擬似乱数生成装置についての従来技術としては、たとえば、文献「B. Schneier, "Applied Cryptography," John Wiley & Sons, Inc., 1996.pp. 369〜428」に開示されている。   As methods for dealing with these problems, for example, there are Patent Documents 1 to 5. In Patent Document 1 and Patent Document 2, a plurality of encryption functions are prepared, and by selecting which encryption function to encrypt with key information or external data, encryption is performed with different encryption functions depending on plaintext. This prevents information leakage and obtains an authentication effect. Patent Documents 3 to 5 give how to create a cryptographic random number sequence with good properties. In particular, Patent Document 3 generates a cryptographic random number sequence by rewriting a plain text sequence with a finite state automaton, which is closely related to the present invention. Although it is a pseudo-random number generator based on a linear feedback shift register (LFSR), there is a problem that the processing speed when implemented in software is not sufficient. Further, as a conventional technique for a pseudorandom number generator based on LFSR, for example, it is disclosed in a document “B. Schneier,“ Applied Cryptography, ”John Wiley & Sons, Inc., 1996.pp. 369-428”. Yes.

特許公開平11−15940号公報Japanese Patent Publication No. 11-15940 特許公開平11−265146号公報Japanese Patent Publication No. 11-265146 特許公開平11−500849号公報Japanese Patent Publication No. 11-500849 特許公開2003−37482号公報Japanese Patent Publication No. 2003-37482 特許公開2004−38020号公報Japanese Patent Publication No. 2004-38020

しかしながら、上記の特許文献1および特許文献2の方法を用いて十分な効果を得るには、なるべく多くの暗号化関数を用意しなくてはならないが、複数の暗号化関数を保存するには、その個数倍のメモリや関数作成のための計算量が必要となるという問題がある。
また、特許文献3〜特許文献5の方法を用いて暗号乱数列を作っても、十分に長い周期を得ることはできず、速さまたは安全性に問題が生じる。
本発明の課題は、計算量を増やさずに安全性を高め、これらの問題を解決することである。
However, in order to obtain a sufficient effect using the methods of Patent Document 1 and Patent Document 2 described above, it is necessary to prepare as many encryption functions as possible. To save a plurality of encryption functions, There is a problem that the amount of memory and the amount of calculation for creating a function are required.
Moreover, even if an encryption random number sequence is created using the methods of Patent Documents 3 to 5, a sufficiently long period cannot be obtained, which causes a problem in speed or security.
An object of the present invention is to improve safety without increasing the amount of calculation and solve these problems.

本発明は、あらかじめ与えられた共有鍵で文書を暗号化する暗号化システムであって、前記文書を記憶している文書記憶手段と、あらかじめ定めたビット数をワードとして、あらかじめ定めたワード数のブロック単位に、複数種類の関数を実行する関数実行手段と、前記共有鍵から擬似乱数列を生成する擬似乱数生成手段と、前記関数実行手段の関数の種類を重複を許して選択する関数選択手段と、あらかじめ初期値を設定した、あらかじめ定めたビット数(ワード)の記憶手段とを備えており、前記擬似乱数生成手段は、前記共有鍵から擬似乱数列を生成した後に、該生成した擬似乱数列をワードに切り出して最下位ビットを1にし、前記記憶手段に前記切り出したワードを2のワード長乗を法として繰り返し乗算した結果のビット列の一部または全体を前記擬似乱数列とし、前記関数選択手段は、前記文書記憶手段からの文書の前記ブロック単位ごとに、前記擬似乱数列により関数を順次選択し、前記関数実行手段は、前記選択された関数で、前記擬似乱数列のブロックをパラメータとして用いて、前記文書を変換して暗号化することを特徴とする暗号化システムである。
また、本発明は、あらかじめ与えられた共有鍵で暗号化文書を復号する復号化システムであって、前記暗号化文書を記憶する暗号化文書記憶手段と、あらかじめ定めたビット数をワードとして、あらかじめ定めたワード数のブロック単位に、暗号化に用いる複数種類の関数に対応する複数種類の逆関数を実行する逆関数実行手段と、前記共有鍵から擬似乱数列を生成する擬似乱数生成手段と、前記逆関数実行手段の逆関数の種類を重複を許して選択する逆関数選択手段と、あらかじめ初期値を設定した、あらかじめ定めたビット数(ワード)の記憶手段とを備えており、前記擬似乱数生成手段は、前記共有鍵から擬似乱数列を生成した後に、該生成した擬似乱数列をワードに切り出して最下位ビットを1にし、前記記憶手段に前記切り出したワードを2のワード長乗を法として繰り返し乗算した結果のビット列の一部または全体を前記擬似乱数列とし、前記逆関数選択手段は、前記暗号化文書記憶手段からの暗号化文書の前記ブロック単位ごとに、前記擬似乱数列により逆関数を選択し、前記逆関数実行手段は、前記選択された逆関数で、前記擬似乱数列のブロックをパラメータとして用いて、前記暗号化文書を変換して復号することを特徴とする復号化システムである。
The present invention is an encryption system for encrypting a document with a pre-assigned shared key, the document storing means storing the document, and a predetermined number of bits as a word, and a predetermined number of words Function execution means for executing a plurality of types of functions in block units, pseudo-random number generation means for generating a pseudo-random number sequence from the shared key, and function selection means for selecting the function types of the function execution means with duplication allowed And a predetermined number of bits (word) storage means in which an initial value is set in advance , and the pseudo random number generation means generates the pseudo random number sequence from the shared key and then generates the generated pseudo random number. A column is cut out into words, the least significant bit is set to 1, and a bit string obtained as a result of repeatedly multiplying the cut-out word into the storage means using a word length power of 2 as a modulus. Or whole as the pseudo-random number sequence, the function selection means, for each of the blocks of a document from the document storage means, said sequentially select a function by the pseudo random sequence, wherein the function executing means has said selected The encryption system is characterized in that the document is converted and encrypted using a block of the pseudo-random number sequence as a parameter.
The present invention also provides a decryption system for decrypting an encrypted document with a pre-assigned shared key, wherein the encrypted document storage means for storing the encrypted document, and a predetermined number of bits as a word in advance. An inverse function executing means for executing a plurality of types of inverse functions corresponding to a plurality of types of functions used for encryption, and a pseudo random number generating means for generating a pseudo random number sequence from the shared key; and the inverse function selecting means for selecting forgive duplicate the type of inverse function of the inverse function executing means, to set in advance an initial value, and a storage means with predetermined number of bits (words), the pseudo-random number The generation unit generates a pseudo random number sequence from the shared key, then cuts the generated pseudo random number sequence into words, sets the least significant bit to 1, and cuts the pseudo random number sequence into the storage unit A part or whole of the bit string of repeated multiplication result of the over-de modulo multiplication word length of 2 and the pseudo-random number sequence, the inverse function selecting means, said block of ciphertext from the encrypted document storage means For each unit, an inverse function is selected from the pseudo random number sequence , and the inverse function executing means converts the encrypted document using the pseudo inverse sequence block as a parameter with the selected inverse function. A decoding system characterized by decoding.

前記暗号化システムにおいて、前記擬似乱数生成手段は、線形次状態関数を用いて擬似乱数列を生成してもよい。
また、前記関数選択手段及び前記関数実行手段は、前記ブロックごとに、あらかじめ定めた回数選択・変換を繰り返して、前記文書を暗号化してもよい
また、前記関数実行手段は、複数ワードに対するワード間関数を含み、該ワード間関数は、文書を暗号化するごとに、該複数ワードの間隔を変化してもよい。
In the encryption system, before Symbol pseudorandom number generating means may generate a pseudo-random number sequence using a linear next state function.
The function selection unit and the function execution unit may encrypt the document by repeating selection / conversion a predetermined number of times for each block .
The function execution means may include an interword function for a plurality of words, and the interword function may change the interval of the plurality of words each time a document is encrypted.

前記復号化システムにおいて、前記擬似乱数生成手段は、線形次状態関数を用いて擬似乱数列を生成してもよい。
また、前記逆関数選択手段及び前記逆関数実行手段は、前記ブロックごとに、あらかじめ定めた回数選択・変換を繰り返して、前記暗号化文書を復号してもよい
また、前記逆関数実行手段は、複数ワードに対するワード間逆関数を含み、該ワード間逆関数は、暗号化文書を復号するごとに、該複数ワードの間隔を変化してもよい。
In the decoding system, before Symbol pseudorandom number generating means may generate a pseudo-random number sequence using a linear next state function.
Further, the inverse function selection means and the inverse function execution means may repeat the selection / conversion for a predetermined number of times for each block to decrypt the encrypted document .
The inverse function executing means may include an inverse function between words for a plurality of words, and the inverse function between words may change the interval of the plurality of words every time the encrypted document is decrypted.

上記のいずれかに記載の暗号化システム及び復号化システムの機能をコンピュータ・システムに構築させるプログラムも、本発明である。   A program for causing a computer system to construct the functions of the encryption system and the decryption system described above is also the present invention.

本発明の実施形態2〜5の擬似乱数発生システム、暗号化システム及び復号化システムでは、鍵情報から一つの解読されにくい大きな暗号化関数を生成するのではなく、高速な異なるタイプの変換を複数個用意し、それらを鍵情報によって決まる組合せで複数回変換に用いることで暗号化する。それぞれの変換が基本的で高速なので、組み合わせた全体の変換も大変に高速である。また、関数の組み合わせ方も反復数も変えられるので、将来の仕様強化が容易である。関数属のうち、どれがどのような順番で施されたかわからないため安全性が高い。このため、従来の特許文献1および特許文献2のように複数の大掛かりな暗号化関数を用意するほどの負担をかけずに、鍵により使われる関数の種類が異なり解読の困難なシステムを実現できるようになった。
また、実施形態6に示すように、実施形態2〜5に実施形態1の方法を加えることで、より解読が難しいシステムを実現することができる。
このように、本発明によれば従来の方式に比べて暗号の安全性を高めることができる。
In the pseudo random number generation system, the encryption system, and the decryption system according to the second to fifth embodiments of the present invention, a plurality of high-speed different types of transformations are generated instead of generating a single large decryption function that is difficult to decrypt from the key information. Encrypt them by preparing them and using them for conversion multiple times in a combination determined by the key information. Since each conversion is basic and fast, the combined conversion is also very fast. In addition, the combination of functions and the number of iterations can be changed, so future specification enhancement is easy. Since it is not known which function genus was applied in what order, it is highly secure. For this reason, unlike the conventional patent document 1 and patent document 2, it is possible to realize a system in which the types of functions used by the keys are different and difficult to decipher without applying a burden of preparing a plurality of large-scale encryption functions. It became so.
Further, as shown in the sixth embodiment, a system that is more difficult to decipher can be realized by adding the method of the first embodiment to the second to fifth embodiments.
As described above, according to the present invention, the security of encryption can be improved as compared with the conventional method.

本実施形態の実施形態1の擬似乱数発生システムを用いて文書の暗号化及び復号化を行なう場合のシステム構成例を示す図である。It is a figure which shows the example of a system structure in the case of encrypting and decoding a document using the pseudorandom number generation system of Embodiment 1 of this embodiment. 本実施形態の実施形態2,3,5の暗号化システム及び復号化システムのシステム構成例を示す図である。It is a figure which shows the system configuration example of the encryption system of Embodiment 2, 3, 5 of this embodiment, and a decoding system. 本実施形態の実施形態4の擬似乱数発生システムを用いて文書の暗号化及び復号化を行なう場合のシステム構成例を示す図である。It is a figure which shows the system structural example in the case of encrypting and decoding a document using the pseudorandom number generation system of Embodiment 4 of this embodiment. (a)従来のストリームサイファの処理の流れを示す図である。(b)従来のブロックサイファの処理の流れを示す図である。(A) It is a figure which shows the flow of a process of the conventional stream cipher. (B) It is a figure which shows the flow of a process of the conventional block cipher. 実施形態1の擬似乱数発生システムの処理の流れを示す図である。It is a figure which shows the flow of a process of the pseudorandom number generation system of Embodiment 1. 実施形態2,3の暗号化システム及び実施形態4の擬似乱数発生システムの処理の流れを示す図である。It is a figure which shows the flow of a process of the encryption system of Embodiment 2, 3, and the pseudorandom number generation system of Embodiment 4. 実施形態5の暗号化システムの処理の流れを示す図である。It is a figure which shows the flow of a process of the encryption system of Embodiment 5.

以降、本発明の擬似乱数発生システム、暗号化システム及び復号化システムの実施形態を、具体的な例を挙げて詳細に説明する。実施形態1及び4は擬似乱数発生システムを文書の暗号化・復号化に用いる場合を例とした実施形態である。また、実施形態2,3,5は暗号化システム及び復号化システムの実施形態である。
なお、以降で用いる用語を以下のように定義する。
ワード: 本実施形態では、1ワード=32ビットとする。
ブロック: 何ワードごとに暗号化を行なうかの単位ブロック。(例えば1ブロック=4ワード)
Hereinafter, embodiments of the pseudo random number generation system, the encryption system, and the decryption system of the present invention will be described in detail with specific examples. Embodiments 1 and 4 are embodiments in which a pseudo-random number generation system is used for document encryption / decryption as an example. The second, third, and fifth embodiments are embodiments of the encryption system and the decryption system.
The terms used hereinafter are defined as follows.
Word: In this embodiment, 1 word = 32 bits.
Block: A unit block of how many words are encrypted. (For example, 1 block = 4 words)

(実施形態1) あらかじめ用意した数列から生成した暗号的に安全でない擬似乱数列のワードと、1ワードのメモリに書かれたワードとの積を次々にとり、結果を該1ワードのメモリに格納し、その上位ビットから安全な暗号乱数列を生成することを特徴とする擬似乱数発生システム。数列に共有鍵を用いることにより、生成した暗号乱数列をストリームサイファによる文書の暗号化・復号化に用いることができる。
(実施形態2) ブロックに分割した文書を、ブロックごとに共有鍵から生成した擬似乱数列(拡張鍵)により選択される関数で変換して暗号化文書を生成することを特徴とする暗号化システム及び復号化システムの基本的な例(ブロックサイファ)である。
(実施形態3) ブロックに分割した文書を、ブロックごとに共有鍵から生成した擬似乱数列により選択される関数で変換して暗号化文書を生成することを特徴とする暗号化システム及び復号化システム(ストリームサイファ)である。
(実施形態4) あらかじめ用意した数列から生成した擬似乱数列のブロックを、当該擬似乱数列により選択される関数で変換して、安全な暗号乱数列を生成することを特徴とする擬似乱数列発生システム。数列に共有鍵を用いることにより、生成した暗号乱数列をストリームサイファによる文書の暗号化・復号化に用いることができる。
(実施形態5) 実施形態3と同様の暗号化システム及び復号化システムに、後述する「JUMP処理」を加えることにより、より効率的な暗号化を行なう手法を提案する。なお、このJUMP処理は実施形態2の暗号化システム及び復号化システム及び実施形態4の擬似乱数列発生システムにおいても使用することができる。
(実施形態6) 実施形態2〜5の各実施形態で用いる擬似乱数列を、実施形態1の方法で生成することにより、より複雑な暗号化を行なう手法を提案する。
以降、各実施形態を順に詳しく説明する。
(Embodiment 1) A product of a cryptographically insecure pseudorandom number sequence generated from a number sequence prepared in advance and a word written in a one-word memory are successively taken, and the result is stored in the one-word memory. A pseudo-random number generation system characterized in that a secure cryptographic random number sequence is generated from the higher-order bits. By using a shared key for the number sequence, the generated encrypted random number sequence can be used for document encryption / decryption by stream cipher.
(Embodiment 2) An encryption system characterized in that an encrypted document is generated by converting a document divided into blocks with a function selected by a pseudo-random number sequence (extended key) generated from a shared key for each block And a basic example (block cipher) of a decoding system.
(Embodiment 3) An encryption system and a decryption system for generating an encrypted document by converting a document divided into blocks with a function selected by a pseudo-random number sequence generated from a shared key for each block (Stream cipher).
(Embodiment 4) Generation of a pseudo-random number sequence, wherein a block of a pseudo-random number sequence generated from a number sequence prepared in advance is converted by a function selected by the pseudo-random number sequence to generate a secure cryptographic random number sequence system. By using a shared key for the number sequence, the generated encrypted random number sequence can be used for document encryption / decryption by stream cipher.
(Fifth Embodiment) A method of performing more efficient encryption by adding a “JUMP process” to be described later to an encryption system and a decryption system similar to those in the third embodiment is proposed. This JUMP process can also be used in the encryption system and decryption system of the second embodiment and the pseudo-random number sequence generation system of the fourth embodiment.
(Embodiment 6) The method of performing more complicated encryption by producing | generating the pseudorandom number sequence used in each embodiment of Embodiment 2-5 with the method of Embodiment 1 is proposed.
Hereinafter, each embodiment will be described in detail.

<1.実施形態1>
実施形態1は、あらかじめ用意した数列(共有鍵)から生成した暗号的に安全でない擬似乱数列のワードと、1ワードのメモリに書かれたワードとの積を次々にとり、結果を該1ワードのメモリに格納し、その上位ビットから安全な暗号乱数列を生成することを特徴とする擬似乱数発生システムである。暗号化通信における共有鍵を数列として用いることにより、生成した暗号乱数列をストリームサイファによる文書の暗号化・復号化に用いることができる。
<1. Embodiment 1>
In the first embodiment, a product of a cryptographically insecure pseudorandom number sequence generated from a number sequence (shared key) prepared in advance and a word written in a one-word memory are successively taken, and the result is obtained as one word. This is a pseudorandom number generation system characterized in that it is stored in a memory and a secure cryptographic random number sequence is generated from the upper bits. By using the shared key in encrypted communication as a number sequence, the generated encrypted random number sequence can be used for document encryption / decryption by stream cipher.

(1−1.従来のストリームサイファの概要と問題点)
文書のブロックbの集合をBLとすると、ストリームサイファとは、暗号化側でE,E,…なる暗号化関数
: BL→BL’
の列を用意し、復号化側でD,D,…なる復号化関数
: BL’ →BL
の列を用意し、BLの全てのブロックbでD(E(b))=bとなるようにしておいて、メッセージ=ブロックの列b,b,…を暗号化してE(b),E(b),…として送信し、復号化側はそれぞれにD,D,…を施して復号化するものである。
典型的には、BLの元からなる擬似乱数列r,r,…を生成して
(b) := b EXOR r
(b) := b EXOR r
とするものである。すなわち、送信側、受信側は擬似乱数列rの生成手段を持っていればよい。
(1-1. Overview and problems of conventional stream ciphers)
Assuming that a set of document blocks b is BL, a stream cipher is an encryption function E i that is E 1 , E 2 ,... On the encryption side: BL → BL ′.
, And a decoding function D i : BL ′ → BL on the decoding side consisting of D 1 , D 2 ,...
The column prepared in advance so as to be D i (E i (b) ) = b in all blocks b The BL, column b 1, b 2 messages = block, E 1 a ... by encrypting (B 1 ), E 2 (b 2 ),..., And the decoding side performs decoding by applying D 1 , D 2 ,.
Typically, pseudo random number sequences r 1 , r 2 ,... Composed of BL elements are generated, and E i (b): = b EXOR r i
D i (b): = b EXOR r i
It is what. That is, the transmission side, the receiving side need only have a generator of the pseudo random number sequence r i.

上述の従来のストリームサイファの処理の流れを示したのが、図4(a)である。擬似乱数列PN(pseudorandom numbers)を生成するのに、メモリ420(状態メモリ)を用い、それに次状態関数462を作用させ、メモリ420に書き込む。これを繰り返すことにより、メモリ420の内容は次々に変換される。このメモリ420の内容を、出力関数464を用いて変換し、擬似乱数列PNとして用いる。
生成されたPN(上述の例では列(r)に該当)と、平文メッセージM(ブロックの列)に対し、暗号化関数470(上記の例ではE(r,b)に該当)を計算して、暗号化文C(cryptography)を計算する。
図4(a)の暗号化関数470に示すように、関数に小さな丸がついているのは、逆関数がつくれる、すなわち計算機で容易に計算できることを示している。この小さな丸の意味は、以降の図においても同じである。ここでは、復号化関数D(r,c)があって、D(r,E(r,b))=bとなるということである。上述したストリームサイファの典型的な例では、EもDもEXORである。
ストリームサイファであって、E=E=…,従ってD=D=…となっているものをブロックサイファという。
FIG. 4A shows the process flow of the conventional stream cipher described above. A memory 420 (state memory) is used to generate a pseudo random number sequence PN (pseudorandom numbers), and a next state function 462 is applied to the memory 420 (state memory), and is written in the memory 420. By repeating this, the contents of the memory 420 are converted one after another. The contents of the memory 420 are converted using the output function 464 and used as a pseudo random number sequence PN.
For the generated PN (corresponding to the sequence (r i ) in the above example) and the plaintext message M (block sequence), the encryption function 470 (corresponding to E (r i , b i ) in the above example) Is calculated, and an encrypted text C (cryptography) is calculated.
As shown in the encryption function 470 in FIG. 4A, a small circle in the function indicates that an inverse function can be created, that is, it can be easily calculated by a computer. The meaning of this small circle is the same in the following figures. Here, there is a decryption function D (r i , c i ), and D (r i , E (r i , b)) = b. In the typical example of the stream cipher described above, both E and D are EXOR.
A stream cipher having E 1 = E 2 =..., And thus D 1 = D 2 =.

図4(a)に示す従来のストリームサイファ(例えば、B. Schneier, "Applied Cryptography," John Wiley & Sons, Inc., 1996.pp. 369〜428)では、次状態関数462が複雑である(例えば、上述の従来技術BBS(Blum−Blum−Shub)では、メモリは大きな桁数の整数を保持し、その自乗をmodulo Mで計算するのが次状態関数)か、出力関数464が複雑(例えば、ハッシュ関数)であるか、暗号化関数470が複雑である(例えば、ブロック暗号)か、のいずれかによって暗号強度を保持している。
しかしながら、次状態関数を複雑にすると、擬似乱数列PNの生成速度が落ちる。また、PN周期や分布が計算できない。
次状態関数を線形にすればPNを高速生成でき、周期・分布も計算できる。例として、メルセンヌツイスター(MT)がある。(メルセンヌツイスターについては、http://www.math.keio.ac.jp/〜matsumoto/mt.html, M. Matsumoto and T. Nishimura, "Mersenne Twister: A 623-dimensionally equidistributed uniform pseudorandom number generator", ACM Trans. on Modeling and Computer Simulation Vol.8, No.1, January pp.3-30 (1998) を参照のこと。)この擬似乱数は高速に発生でき、周期が長い。しかし、出力関数が単純であれば、出力列から内部状態が推測されるので、暗号学的に安全であるとはいえない。
In the conventional stream cipher shown in FIG. 4A (for example, B. Schneier, “Applied Cryptography,” John Wiley & Sons, Inc., 1996.pp. 369-428), the next state function 462 is complicated ( For example, in the above-described prior art BBS (Blum-Blum-Shub), the memory holds an integer with a large number of digits, and its square is calculated by modulo M as a next state function) or the output function 464 is complicated (for example, , Hash function) or the encryption function 470 is complicated (for example, block cipher).
However, when the next state function is complicated, the generation speed of the pseudo random number sequence PN decreases. In addition, the PN period and distribution cannot be calculated.
If the next state function is linear, PN can be generated at high speed, and the period and distribution can be calculated. An example is Mersenne Twister (MT). (For Mersenne Twister, http://www.math.keio.ac.jp/~matsumoto/mt.html, M. Matsumoto and T. Nishimura, "Mersenne Twister: A 623-dimensionally equidistributed uniform pseudorandom number generator", (See ACM Trans. On Modeling and Computer Simulation Vol.8, No.1, January pp.3-30 (1998).) This pseudo-random number can be generated at high speed and has a long period. However, if the output function is simple, the internal state is inferred from the output sequence, so it cannot be said that it is cryptographically safe.

(1−2.本実施形態の擬似乱数発生システム)
これに対し、本実施形態の擬似乱数発生システム(cryptMTと呼ぶ)は、暗号学的には安全ではないかも知れない擬似乱数列PNを、安全擬似乱数列SPN(secure pseudorandom numbers)に変換する。
図5は、本実施形態の擬似乱数発生システムの処理の流れを示す図である。なお、図5に示されたPN(安全ではないかも知れない擬似乱数列)の前には、図4(a)のPNの左側部分の処理を行なっている。なお、本実施形態において、この構成を何度も繰り返すようにしてもよい。つまり、図5のSPN生成までの処理を、図5の入力となるPNの位置にさらにつなげてもよい。
図5に示す本実施形態の構成において、次のような場合がスピード対安全性で最も効果がある。
・PN生成部分(図5につながる図4(a)のPNの左側部)には、高速高次元分布な線形生成法(図4(a)の次状態関数462が線形、例:上述のMT)を用いる。
・PN→SPN変換部分の次状態関数562は、線形ではないが高速に計算できるもの(例:32ビット整数とみての乗算)を用いる。
・SPN変換部分の出力関数564は、単純で高速なもの(例:32ビットから、上位8ビットのみをとり、残りは捨てる)を用いる。
これらの効果のある方法を用いたのが、本実施形態のcryptMTである。ただし、乗算を用いており、偶数の積はmodulo 2{32}で可逆でないため、MTの出力の最下位ビットを強制的に1にする必要がある。
(1-2. Pseudorandom number generation system of this embodiment)
On the other hand, the pseudo-random number generation system (called cryptoMT) of the present embodiment converts a pseudo-random number sequence PN that may not be cryptographically secure into a secure pseudo-random number sequence SPN (secure pseudorandom number).
FIG. 5 is a diagram showing a processing flow of the pseudo-random number generation system of this embodiment. Before the PN shown in FIG. 5 (a pseudo-random number sequence that may be unsafe), the processing on the left side of the PN in FIG. 4A is performed. In the present embodiment, this configuration may be repeated many times. That is, the processing up to the SPN generation in FIG. 5 may be further connected to the position of the PN that is the input in FIG.
In the configuration of the present embodiment shown in FIG. 5, the following case is most effective in speed versus safety.
In the PN generation part (the left part of the PN in FIG. 4A connected to FIG. 5), the linear generation method with a high-speed and high-dimensional distribution (the next state function 462 in FIG. 4A is linear, for example, the above-described MT ) Is used.
The next state function 562 of the PN → SPN conversion portion is not linear but can be calculated at high speed (eg, multiplication as if it were a 32-bit integer).
The output function 564 of the SPN conversion part is a simple and high-speed one (eg, only the upper 8 bits are taken out from 32 bits and the rest are discarded).
The cryptoMT of this embodiment uses a method having these effects. However, since multiplication is used and an even product is modulo 2 {32} and is not reversible, it is necessary to force the least significant bit of the MT output to 1.

以降、図4(a)及び図5を参照しながら、本実施形態の擬似乱数発生システムを用いて、ストリームサイファにより文書(平文)の暗号化及び復号化を行なう場合の処理を説明する。なお、ここでは上述したように図4(a)の次状態関数462にメルセンヌツイスターを使用する例で説明する。
(1)共有鍵(図4(a)の鍵430)を初期シード配列として、非線形初期化法(init_by_array)により624ワードのデータを生成し、メルセンヌツイスター(以後MT)mt19937ar.cを初期化する。これは、図4(a)の鍵変換432の処理に該当し、これによりMT(次状態関数462)の状態メモリ(メモリ420)を初期化する。出力関数464は、単にメモリ420の最初のワードを出力する。
(2)初期化後のMTの出力ワード列をM(0),M(1),M(2),…とする。これが図4(a)に示す擬似乱数列PN(安全ではないかも知れない擬似乱数列)であり、図5に送られる(図5の左上のPNに該当)。なお、上述したようにM(n)はMTの出力の最下位ビットを強制的に1にしたものである。
(3)1ワード=32ビットのメモリ(変数)accumを用意する。これが図5のメモリ520に該当する。
(4)accumに初期値(例えば1)を代入する。なお、初期値は他の値(ただし、ゼロ以外)でもよい。
(5)以後、代入
accum←accum×M(n) (mod2{32}
を繰り返す(次状態関数562)。ここで、最初の64回は空回しし、65回目からあらかじめ定めた回数までaccumの上位8ビットを次々に出力する(出力関数564)。これにより、暗号学的に安全な8ビット整数擬似乱数列(SPN)を出力することができる。
なお、上述の演算の繰返し回数は例であり、システムに応じて必要な回数とすればよい。また、上述のaccumの上位8ビットの代わりに、accumのビット列の全部又は一部(例えば1ビットおきに出力するなど)を、安全擬似乱数列として次々に出力するようにしてもよい。
(6)出力された安全なSPNと、文書(平文M)とのEXORをとることにより(暗号化関数570に該当)、暗号文Cを出力する。
Hereinafter, with reference to FIG. 4A and FIG. 5, processing in the case of encrypting and decrypting a document (plain text) by stream cipher using the pseudorandom number generation system of the present embodiment will be described. Here, as described above, an example in which a Mersenne twister is used for the next state function 462 in FIG.
(1) Using a shared key (key 430 in FIG. 4A) as an initial seed array, data of 624 words is generated by a nonlinear initialization method (init_by_array), and Mersenne Twister (hereinafter referred to as MT) mt19937ar. c is initialized. This corresponds to the process of the key conversion 432 in FIG. 4A, and thereby initializes the state memory (memory 420) of the MT (next state function 462). Output function 464 simply outputs the first word of memory 420.
(2) The MT output word string after initialization is M (0), M (1), M (2),. This is a pseudo-random number sequence PN (a pseudo-random number sequence that may not be safe) shown in FIG. 4A and is sent to FIG. 5 (corresponding to the upper left PN in FIG. 5). As described above, M (n) is obtained by forcing the least significant bit of the MT output to 1.
(3) Prepare 1-word = 32-bit memory (variable) accum. This corresponds to the memory 520 in FIG.
(4) An initial value (for example, 1) is assigned to accum. Note that the initial value may be other values (however, other than zero).
(5) After that, substitution accum <-accum * M (n) (mod2 {32} )
Is repeated (next state function 562). Here, the first 64 times are idled, and the upper 8 bits of accum are output one after another from the 65th to the predetermined number of times (output function 564). As a result, a cryptographically secure 8-bit integer pseudorandom number sequence (SPN) can be output.
The number of repetitions of the above calculation is an example, and may be set to a necessary number depending on the system. Instead of the upper 8 bits of the above-mentioned accum, all or part of the accumulative bit string (for example, outputting every other bit) may be output one after another as a safe pseudorandom number string.
(6) The ciphertext C is output by performing an EXOR between the output safe SPN and the document (plaintext M) (corresponding to the encryption function 570).

また、上記(2)〜(5)の処理を、次のようにしてもよい。メルセンヌツイスターにより生成した擬似乱数のnワード目のデータの最下位ビットを1にしたデータをM(n)とし、32ビットのメモリaccumに、共有鍵データからハッシュ関数を用いた数列をつくってaccumの初期値とする。ここで、この数列の最下位ビットを強制的に1にしてもよい。次に、n=1,2,3,…について、
accum←accum×M(n) (mod2{32}
を計算し、accumの上位8ビットを出力して、暗号学的に安全な8ビット整数擬似乱数として出力する。
Further, the processes (2) to (5) may be performed as follows. M (n) is a data in which the least significant bit of the n-th word data of pseudorandom numbers generated by Mersenne Twister is set to 1, and a number sequence using a hash function is created from the shared key data in a 32-bit memory accum. The initial value of. Here, the least significant bit of this sequence may be forced to be 1. Next, for n = 1, 2, 3,.
accum ← accum × M (n) (mod2 {32} )
, And the higher 8 bits of accum are output and output as cryptographically secure 8-bit integer pseudorandom numbers.

(1−3.効果)
本実施形態では擬似乱数として、メルセンヌツイスター(mt19937ar.c)を用いたことで、出力される暗号乱数列は周期が219937−1であることが数学的に証明できる。この周期は従来知られているどの暗号乱数列よりも長く、安心して長期間利用することができる。
また、accumに非線形な演算(乗算)を行うことと、線形性の残る最下位ビットを使わないことで、暗号乱数列として十分な安全性を持つ。
また、メルセンヌツイスターのように、暗号的に安全でないが高速な擬似乱数を、32ビットの積という比較的速い関数で変換したことにより、このアルゴリズムを用いて生成する暗号乱数生成法は、現在アメリカのスタンダード暗号乱数生成法であるAESの最速オプティマイズ版の1.5倍以上と、非常に高速である。
また、MTの内部空間の大きさにより、time−memory−trade−off攻撃に対しても耐性が強い。
(1-3. Effect)
In this embodiment, Mersenne Twister (mt19937ar.c) is used as a pseudo-random number, so that it is possible to mathematically prove that the output encrypted random number sequence has a period of 2199937-1 . This period is longer than any conventionally known cryptographic random number sequence, and can be used for a long period of time with confidence.
Further, by performing non-linear operation (multiplication) on accum and not using the least significant bit that remains linear, the cipher random number sequence has sufficient security.
In addition, the cryptographic random number generation method generated using this algorithm by converting a pseudo-random number that is cryptographically insecure but high-speed like Mersenne Twister using a relatively fast function of a 32-bit product is currently available in the United States. The standard encryption random number generation method of AES is 1.5 times more than the fastest optimized version of AES, which is very fast.
Further, due to the size of the internal space of the MT, it is highly resistant to time-memory-trade-off attacks.

(1−4.本実施例を用いた暗号化システム及び復号化システムの構成例)
最後に、本実施形態の擬似乱数発生システムを用いて、ストリームサイファにより文書(平文)の暗号化及び復号化を行なう場合のシステム構成を、図1のシステム構成図を参照しながら説明する。
本実施形態のシステムは、例えば通常のパソコン等の端末に実装するものする。図1に示すように、文書を暗号化して送信する側の端末には暗号化システム110を、文書を受信して復号化する側の端末には復号化システム150を実装する。また、暗号化システム110及び復号化システム150の双方に、数列(共有鍵122)及び本実施形態の擬似乱数発生システム130を用意する。
暗号化システム110において、擬似乱数発生システム130の擬似乱数生成プログラム132により、共有鍵122から上述で説明した本実施形態の手法を用いて安全な擬似乱数列(安全擬似乱数列)125を生成する。次に、ストリームサイファの典型的な例として、暗号化プログラム136は、安全な擬似乱数列125と文書124のEXORをとることにより文書124を暗号化して、暗号化文書140を生成する。
(1-4. Configuration Example of Encryption System and Decryption System Using This Example)
Finally, a system configuration in the case of encrypting and decrypting a document (plain text) by stream cipher using the pseudo random number generation system of the present embodiment will be described with reference to the system configuration diagram of FIG.
The system of the present embodiment is mounted on a terminal such as a normal personal computer. As shown in FIG. 1, an encryption system 110 is installed in a terminal that encrypts and transmits a document, and a decryption system 150 is installed in a terminal that receives and decrypts a document. In addition, in both the encryption system 110 and the decryption system 150, a numerical sequence (shared key 122) and the pseudorandom number generation system 130 of this embodiment are prepared.
In the encryption system 110, the pseudo random number generation program 132 of the pseudo random number generation system 130 generates a secure pseudo random number sequence (safe pseudo random number sequence) 125 from the shared key 122 using the method of the present embodiment described above. . Next, as a typical example of the stream cipher, the encryption program 136 encrypts the document 124 by taking the EXOR of the secure pseudo-random number sequence 125 and the document 124 to generate the encrypted document 140.

一方、復号化システム150においては、擬似乱数発生システム130の擬似乱数生成プログラム132により、共有鍵122から上述で説明した本実施形態の手法を用いて安全な擬似乱数列125を生成する。次に、復号化プログラム166は、安全な擬似乱数列125と復号化文書124のEXORをとることにより暗号化文書140を復号し、元の文書124を得る。暗号化システム110と復号化システム150とでは、同じ共有鍵122から同じ擬似乱数生成プログラム132を用いて、同じ安全な擬似乱数列125を生成するため、対応する暗号化・復号化の処理を行なうことができる。   On the other hand, in the decryption system 150, the pseudo random number generation program 132 of the pseudo random number generation system 130 generates a secure pseudo random number sequence 125 from the shared key 122 using the method of the present embodiment described above. Next, the decryption program 166 decrypts the encrypted document 140 by taking the OROR of the secure pseudorandom number sequence 125 and the decrypted document 124 to obtain the original document 124. In the encryption system 110 and the decryption system 150, the same secure pseudorandom number sequence 125 is generated from the same shared key 122 using the same pseudorandom number generation program 132, and therefore corresponding encryption / decryption processing is performed. be able to.

<2.実施形態2>
実施形態2は、ブロックに分割した文書を、ブロックごとに共有鍵から生成した擬似乱数列により選択される関数で変換して暗号化文書を生成することを特徴とする暗号化システム及び復号化システムの基本的な例であり、ブロックサイファである。関数の選択及び関数のパラメータには、共有鍵から生成した擬似乱数列が用いられる。ここで、後述の実施形態3では、文書が長いほど擬似乱数列を消費するが、本実施形態2は、一定の長さしか消費しない。このため、本実施例では、共有鍵から生成した一定の長さの擬似乱数列を「拡張鍵」とよぶ。
<2. Second Embodiment>
Embodiment 2 is an encryption system and a decryption system that generate an encrypted document by converting a document divided into blocks by a function selected by a pseudo-random number sequence generated from a shared key for each block Is a basic example of a block cipher. A pseudo-random number sequence generated from the shared key is used for function selection and function parameters. Here, in Embodiment 3 to be described later, the longer the document, the more the pseudorandom number sequence is consumed. In Embodiment 2, however, only a certain length is consumed. For this reason, in this embodiment, a fixed-length pseudorandom number sequence generated from the shared key is called an “extended key”.

(2−1.従来のブロックサイファの概要と問題点)
AESなどの従来のブロックサイファは、図4(b)に示す構成である。すなわち、平文Mのブロックをメモリ420に取り込み、擬似乱数列PNを使って変換(466に示すEXOR)を行ない、メモリ420に書き込む。これを数回繰り返して暗号文Cを得る。ここで、右下の関数460は複雑な全単射である。なお、上述の図4(a)で説明したとおり、関数に小さな丸がついているのは、逆関数がつくれる、すなわち計算機で容易に計算できることを示している。
しかしながら、上述したように、従来のブロックサイファは、鍵情報から一つの複雑な暗号化関数を作り、これを用いて平文を変換するため、高速な暗号システムでは作られる関数に偏りがあり、暗号解読のための情報を得られやすいという問題がある。たとえば暗号を解読しようとする際には、差分解読法や、線形解読法などの、既知の平文を暗号化させることによる攻撃がよく用いられている。すなわち攻撃する人物が、任意の文書を暗号化させられる状況では、解読に用いるデータを採取され、鍵の全数検索よりも簡単に暗号が破られてしまう。
(2-1. Overview and problems of conventional block ciphers)
A conventional block cipher such as AES has the configuration shown in FIG. That is, the plaintext M block is taken into the memory 420, converted (EXOR indicated by 466) using the pseudo random number sequence PN, and written into the memory 420. This is repeated several times to obtain ciphertext C. Here, the lower right function 460 is a complex bijection. As described with reference to FIG. 4A, the small circle in the function indicates that an inverse function can be created, that is, it can be easily calculated by a computer.
However, as described above, the conventional block cipher creates a complex encryption function from the key information and converts the plaintext using this, so the function created in a high-speed encryption system is biased. There is a problem that it is easy to obtain information for decoding. For example, when trying to decrypt a cipher, an attack by encrypting a known plaintext, such as differential cryptanalysis or linear cryptanalysis, is often used. In other words, in a situation where an attacking person can encrypt an arbitrary document, data used for decryption is collected, and the encryption is broken more easily than an exhaustive key search.

(2−2.処理の流れ)
これに対し、本実施形態では、次のような構成をとることにより、従来の問題点を解決する。
図6は、本実施形態の暗号化システムの処理の流れを示す図である。なお、後述の実施形態3の暗号化システムの処理も同図に示す通りである。
本実施形態(及び実施形態3)では、ブロックbの集合BLについて、
F: PARAM×BL→BL
の形をした単純な関数と、逆操作に当たる
F’: PARAM×BL→BL
の関数を複数個用意し(F’(P,F(P,b))=bとなるものである)、図6に示すように、擬似乱数列PN(図6の左上に示すPN)をパラメータPとして消費しながら、平文Mのブロックが取り込まれたメモリ620の内容を繰り返し変換して、暗号文Cを得る。変換の際、どの関数660(上記のFに該当)を使うかは、PNをセレクタ640に送って選択する。
(2-2. Process flow)
On the other hand, in this embodiment, the conventional problems are solved by adopting the following configuration.
FIG. 6 is a diagram showing a processing flow of the encryption system of the present embodiment. The processing of the encryption system according to the third embodiment described later is also as shown in FIG.
In the present embodiment (and the third embodiment), for the set BL of the block b,
F: PARAM × BL → BL
Simple function in the form of, and F 'which corresponds to the reverse operation: PARAM × BL → BL
Are prepared (F ′ (P, F (P, b)) = b), and as shown in FIG. 6, a pseudo-random number sequence PN (PN shown in the upper left of FIG. 6) is obtained. While being consumed as the parameter P, the contents of the memory 620 in which the block of the plaintext M is taken are repeatedly converted to obtain the ciphertext C. In the conversion, which function 660 (corresponding to F above) is used is selected by sending the PN to the selector 640.

上記の構成をとることにより、本実施形態(及び実施形態3)では関数の組み合わせの自由度が指数的に増大し、強固な暗号が実現できる。
また、擬似乱数列PNからパラメータ(図6における関数660で、白丸のついていないところ)を取り込むため柔軟性があり、より強固な暗号が実現できる。
さらに、共有鍵を図4(a)に示す鍵430として、上述のメルセンヌツイスターなどを用いて擬似乱数列PNを生成すれば、PNはいくらでも生成することができる。そのため、関数660による平文の変換の繰り返し回数を増やすことができ、暗号化の強度を上げることができる。
また、図6において、平文が複数のブロックからなる場合には、各ブロックに対して異なる組み合わせの関数による暗号化を行なうことができる(つまり、ストリームサイファとして使える)。
By adopting the above configuration, in the present embodiment (and the third embodiment), the degree of freedom of the combination of functions increases exponentially, and a strong encryption can be realized.
In addition, since the parameter (where the function 660 in FIG. 6 does not have a white circle) is taken in from the pseudo-random number sequence PN, there is flexibility and a stronger encryption can be realized.
Furthermore, if the pseudo-random number sequence PN is generated by using the Mersenne Twister as described above as the shared key 430 shown in FIG. 4A, any number of PNs can be generated. Therefore, the number of times plaintext conversion is repeated by the function 660 can be increased, and the encryption strength can be increased.
In addition, in FIG. 6, when the plaintext is composed of a plurality of blocks, each block can be encrypted with a different combination of functions (that is, it can be used as a stream cipher).

(2−3.前提条件)
本実施形態では、1ブロック=4ワード(8ワードまたは16ワードでもよい)、128ビット以上の共有秘密鍵情報での暗号化方式を例に挙げて説明する。
前処理として、共有鍵を必要なサイズにハッシュ関数で拡張して擬似乱数列PN、すなわち拡張鍵(図6の左上のPNに該当)を生成する。本実施例では、文書はブロックサイズ(4ワード)に分割し、ブロックごとに変換するものとする。
(2-3. Preconditions)
In this embodiment, an encryption method using shared secret key information of 1 block = 4 words (may be 8 words or 16 words) and 128 bits or more will be described as an example.
As pre-processing, the shared key is expanded to a required size with a hash function to generate a pseudo random number sequence PN, that is, an extended key (corresponding to the upper left PN in FIG. 6). In this embodiment, the document is divided into block sizes (4 words) and converted for each block.

(2−4.用意する関数)
ブロックの変換には以下の7種類の、ブロックサイズのデータを高速で変換することができる、性質の全く異なる関数(図6の関数660に該当)を用いる。以降、これらの関数族をPEF(primitive encryption family)とよぶ。本実施形態では、ワード内の計算を行なう関数(ワード内関数)4種類と、ブロック内の複数のワードを跨ぐ計算を行なう関数(ワード間関数)3種類を用意する。なお、復号化において、ワード内関数に対応する逆関数をワード内逆関数、ワード間関数に対応する逆関数をワード間逆関数という。
t回目の演算(変換)には拡張鍵(擬似乱数列PN)のtブロック目のデータを用いる。また、拡張鍵の最後の1ブロックは関数の選択に用いる。
(2-4. Prepared functions)
For the block conversion, the following seven kinds of functions having completely different properties (corresponding to the function 660 in FIG. 6) that can convert block size data at high speed are used. Hereinafter, these function families are referred to as PEF (primary encryption family). In the present embodiment, four types of functions (intraword functions) for performing calculations within words and three types of functions (interword functions) for performing calculations across a plurality of words in a block are prepared. In decoding, an inverse function corresponding to an intraword function is referred to as an intraword inverse function, and an inverse function corresponding to an interword function is referred to as an interword inverse function.
Data for the t block of the extended key (pseudo random number sequence PN) is used for the t th operation (conversion). The last block of the extended key is used for selecting a function.

(a)ワード内の計算(4種類)
(1)EXOR: ブロックの各ワードに、拡張鍵のtブロック目のデータをワードごとに排他的論理和で加える。
(2)+: ブロックの各ワードに、拡張鍵のtブロック目のデータをワードごとにmod232で加える。
(3)×: ブロックの各ワードに、拡張鍵のtブロック目の、対応するそれぞれのワードの最下位ビットを1に変えたものをmod232で掛け算する。なお、この変換については、最下位ビットを1に変えた拡張鍵のワードの掛け算の逆関数をすべて計算して辞書引きできるよう保存しておく。
(4)横シフト: ブロックの各ワードについて、拡張鍵のtブロック目の対応するそれぞれのワードの下5ビットずつを数字として用いて、その大きさの分だけのビットを右にシフトする。ワードの右にはみ出た部分をビット反転させて、左に書く。
(A) Calculation within a word (4 types)
(1) EXOR: The data of the t-th block of the extended key is added to each word of the block by exclusive OR for each word.
(2) +: Data of the t-th block of the extended key is added to each word of the block with mod 2 32 for each word.
(3) x: Mod 2 32 multiplies each word of the block by changing the least significant bit of the corresponding word of the t-th block of the extended key to 1. For this conversion, all inverse functions of multiplication of expanded key words with the least significant bit changed to 1 are calculated and stored so that they can be looked up in a dictionary.
(4) Horizontal shift: For each word of the block, the lower 5 bits of each corresponding word of the t-th block of the extended key are used as numbers, and the bits corresponding to the size are shifted to the right. The part that protrudes to the right of the word is bit-reversed and written to the left.

(b)ワードを跨ぐ計算(3種類)
(5)縦回転: 1ブロックをワードの4個(1ブロック=4ワードの場合。なお、1ブロック=8ワードとする場合は8個、1ブロック=16ワードとする場合は16個)の配列とみなし、4行32列(1ブロック=8ワードとする場合は8行32列、1ブロック=16ワードとする場合は16行32列)の0,1からなる行列とみなす。拡張鍵のtブロック目から1ワード取り出す。この1ワードでビットが1のところに対応する列をビット反転させて、さらに下方向に1行分シフトする。一番下の行のデータは一番上に書く(ローテート)。
(6)置換: 拡張鍵のtブロック目から2ビット(1ブロック=4ワードの場合。なお、1ブロック=8ワードとする場合は3ビット、1ブロック=16ワードとする場合は4ビット)を4回取り出し、それぞれを数として見た値kについて配列されたブロックのk行目と((k+5)mod4)行目(1ブロック=4ワードの場合。なお、1ブロック=8ワードとする場合は((k+5)mod8)行目,1ブロック=16ワードとする場合は((k+5)mod16)行目)を入れ換えることを、4回行う。
(7)和置換: 拡張鍵のtブロック目から2ビット(1ブロック=4ワードの場合。なお、1ブロック=8ワードとする場合は3ビット、1ブロック=16ワードとする場合は4ビット)を4回取り出し、それぞれを数として見た値kについて配列されたブロックのk行目に((k+7)mod4)行目(1ブロック=4ワードの場合。なお、1ブロック=8ワードとする場合は((k+7)mod8)行目,1ブロック=16ワードとする場合は((k+7)mod16)行目)を排他的論理和で加えることを4回行う。
(B) Calculations across words (3 types)
(5) Vertical rotation: An array of 4 words per block (when 1 block = 4 words. When 1 block = 8 words, 8 when 1 block = 16 words) And a matrix of 0, 1 of 4 rows and 32 columns (8 rows and 32 columns when 1 block = 8 words, 16 rows and 32 columns when 1 block = 16 words). One word is extracted from the t-th block of the extended key. The column corresponding to the bit of 1 in this one word is bit-inverted and further shifted downward by one row. Write the data on the bottom line at the top (rotate).
(6) Replacement: 2 bits from the t-th block of the extended key (if 1 block = 4 words. 3 bits if 1 block = 8 words, 4 bits if 1 block = 16 words) Extracted 4 times, and the k-th and ((k + 5) mod4) -th row of blocks arranged with respect to the value k as a number (when 1 block = 4 words. When 1 block = 8 words) If ((k + 5) mod 8) line, 1 block = 16 words, ((k + 5) mod 16) line) is replaced four times.
(7) Sum replacement: 2 bits from the t-th block of the extended key (when 1 block = 4 words, 3 bits when 1 block = 8 words, 4 bits when 1 block = 16 words) Are extracted four times, and each is expressed as a number. The k-th row of the block arranged for the value k ((k + 7) mod 4) row (when 1 block = 4 words. When 1 block = 8 words) In the case of ((k + 7) mod 8) line, 1 block = 16 words, ((k + 7) mod 16) line) is added four times by exclusive OR.

(2−5.文書の暗号化)
文書の暗号化は、文書をブロックサイズに区切り、それぞれのブロックに上述の関数を以下のように拡張鍵(擬似乱数列PN)に依存して選択して変換する。上述したように、t回目の演算(変換)には拡張鍵のtブロック目のデータを関数(図6の関数660)のパラメータとして用いる。また、拡張鍵の最後の1ブロックは関数の選択に用いる。図6で説明すると、PNの最後の1ブロックをセレクタ640に送り、セレクタ640により関数660を選択する。
本実施形態では、文書の各ブロック(図6ではメモリ620に取り込まれた平文Mのブロック)に対し、上述した7種類の関数を、例えば「横シフト・×・縦回転・(置換または和置換)・(+またはEXOR)」の順に施すことを1セットとし、これを8セット行なうことによりブロックを変換する。ただし、後ろ2つのそれぞれ2種類の関数を()内に示している箇所においては、拡張鍵の最終ブロックから1ビットずつを2×8回次々に用いて、0なら前者を、1なら後者を選択するものとする。この場合、t=40回の演算(変換)を行なうことになるため、拡張鍵は41ブロックのサイズに生成し、最後の41ブロック目を関数の選択に用いる。
なお、上記(1)〜(7)の関数は一例であり、高速に処理できる他の演算を用意してもよい。また、上記の関数の組み合わせや順序は一例であり、他の組み合わせや順序でもよい。また、繰り返し回数も上記の8セット以外の回数でもよい。また、最初の1セットと最後の1セットで全種類の変換を行ない、間のセットで全種類の関数の中から拡張鍵を用いてどれかを選択することを例えば5回以上繰り返すなどの方法を用いてもよい。1セットを複数回行なう理由は、本実施形態では全てのブロックに対して同じ変換を施すため、安全性を高める必要があるからである。
(2-5. Document encryption)
In the encryption of a document, the document is divided into block sizes, and the above function is selected and converted into each block depending on the extension key (pseudorandom number sequence PN) as follows. As described above, the t-th block data of the extended key is used as the parameter of the function (function 660 in FIG. 6) for the t-th calculation (conversion). The last block of the extended key is used for selecting a function. Referring to FIG. 6, the last block of PN is sent to the selector 640, and the function 660 is selected by the selector 640.
In the present embodiment, for each block of the document (in FIG. 6, the plaintext M block fetched in the memory 620), the above-described seven types of functions are changed to, for example, “horizontal shift, x, vertical rotation, (substitution or sum substitution). ) · (+ Or EXOR) ”is set as one set, and the block is converted by performing eight sets. However, at the places where the two types of functions are shown in parentheses, each one bit from the last block of the extended key is used 2 × 8 times one after the other. Shall be selected. In this case, since computation (conversion) is performed t = 40 times, the extended key is generated with a size of 41 blocks, and the last 41 blocks are used for function selection.
The above functions (1) to (7) are merely examples, and other operations that can be processed at high speed may be prepared. Moreover, the combination and order of the above functions are examples, and other combinations and orders may be used. Further, the number of repetitions may be other than the above eight sets. In addition, for example, it is possible to repeat all types of conversions in the first set and the last set, and select one of all types of functions using an extended key in the set between, for example, 5 times or more. May be used. The reason why one set is performed a plurality of times is that in the present embodiment, the same conversion is performed on all blocks, and thus it is necessary to improve safety.

(2−6.文書の復号化)
復号化は、暗号化の逆の順番で、それぞれの変換の逆写像を施せばよく、本実施形態では暗号化と同じくらいの時間で計算できる。
(2-6. Document Decryption)
Decryption may be performed by performing reverse mapping of each conversion in the reverse order of encryption, and can be calculated in the same amount of time as encryption in this embodiment.

(2−7.効果)
本実施形態の暗号化システム及び復号化システムによれば、それぞれの変換が高速であることから大量の文書を高速に暗号化でき、施された関数のタイプとその順番がわからないことから、従来のブロックサイファよりも解読が困難となる。
(2-7. Effect)
According to the encryption system and the decryption system of the present embodiment, since each conversion is fast, a large amount of documents can be encrypted at a high speed, and the types of functions applied and their order are not known. Decoding is more difficult than block ciphers.

(2−8.本実施例を用いた暗号化システム及び復号化システムの構成例)
最後に、本実施形態の暗号化システム及び復号化システムを用いて、文書の暗号通信を行なう場合のシステム構成例を、図2を参照しながら説明する。なお、後述の実施形態3,実施形態5も同様のシステム構成とすることができる。
本実施形態の暗号化システム及び復号化システムは例えば通常のパソコン等の端末に実装するものとする。図2に示すように、文書を暗号化して送信する側の端末には暗号化システム110を、文書を受信して復号化する側の端末には復号化システム150を実装する。また、暗号化システム110には共有鍵122及び暗号化に用いる複数の関数126を用意し、復号化システム150には共有鍵122及び復号化に用いる複数の逆関数128(関数126の各関数に対応し、それぞれ逆の操作をする関数)を用意する。
(2-8. Configuration example of encryption system and decryption system using this embodiment)
Finally, an example of a system configuration when performing encrypted communication of a document using the encryption system and the decryption system of the present embodiment will be described with reference to FIG. It should be noted that Embodiments 3 and 5 described later can have the same system configuration.
It is assumed that the encryption system and the decryption system of this embodiment are mounted on a terminal such as a normal personal computer, for example. As shown in FIG. 2, an encryption system 110 is installed in a terminal that encrypts and transmits a document, and a decryption system 150 is installed in a terminal that receives and decrypts a document. Also, the encryption system 110 is provided with a shared key 122 and a plurality of functions 126 used for encryption, and the decryption system 150 is provided with a plurality of inverse functions 128 (each function 126 is used for each function 126). Corresponding functions are prepared for each operation.

上述したように、本実施形態の暗号化システム及び復号化システムは、共有鍵の情報(共有鍵から生成した擬似乱数列)を暗号化関数の選択及び選択された関数のパラメータとして用いていることが主要な特徴であり、これにより高速で安全性の高いシステムを実現している。暗号化システム110では、まず、擬似乱数生成プログラム232により、共有鍵122から擬似乱数列225(本実施形態においては拡張鍵)を生成する。次に、生成された擬似乱数列(拡張鍵)225を用いて、関数選択プログラム234は関数126から文書124の暗号化に用いる関数を選択する。また、暗号化プログラム236は、擬似乱数列(拡張鍵)225を関数選択プログラム234で選択された関数のパラメータとして用いて関数を実行して文書124を暗号化する。これにより暗号化文書140を生成する。
一方、復号化システム150では、まず、擬似乱数生成プログラム232により、共有鍵122から送信端末110と同じ擬似乱数列(拡張鍵)225を生成する。次に、生成された擬似乱数列(拡張鍵)225を用いて、逆関数選択プログラム264は逆関数128から受信した暗号化文書140の復号に用いる逆関数を選択する。ここでは、送信端末110で選択された関数に対応する逆関数が選択されることになる。復号化プログラム266は、擬似乱数列(拡張鍵)225を逆関数選択プログラム264で選択された逆関数のパラメータとして用いて逆関数を実行し、暗号化文書140を復号する。これにより元の文書124を得る。
As described above, the encryption system and the decryption system of the present embodiment use the shared key information (a pseudo-random number sequence generated from the shared key) as the encryption function selection and the selected function parameters. Is the main feature, and this realizes a high-speed and highly secure system. In the encryption system 110, first, the pseudo random number generation program 232 generates a pseudo random number sequence 225 (an extended key in this embodiment) from the shared key 122. Next, using the generated pseudorandom number sequence (extended key) 225, the function selection program 234 selects a function to be used for encrypting the document 124 from the function 126. Also, the encryption program 236 executes the function using the pseudo random number sequence (extended key) 225 as the parameter of the function selected by the function selection program 234 and encrypts the document 124. Thereby, the encrypted document 140 is generated.
On the other hand, in the decryption system 150, first, the pseudo random number generation program 232 generates the same pseudo random number sequence (extended key) 225 as the transmission terminal 110 from the shared key 122. Next, using the generated pseudo-random number sequence (extended key) 225, the inverse function selection program 264 selects an inverse function used for decryption of the encrypted document 140 received from the inverse function 128. Here, an inverse function corresponding to the function selected by the transmission terminal 110 is selected. The decryption program 266 executes the inverse function using the pseudo random number sequence (extended key) 225 as the parameter of the inverse function selected by the inverse function selection program 264, and decrypts the encrypted document 140. As a result, the original document 124 is obtained.

<3.実施形態3>
実施形態3は、ブロックに分割した文書を、ブロックごとに共有鍵から生成した擬似乱数列により選択される関数で変換して暗号化文書を生成することを特徴とする暗号化システム及び復号化システムの例であり、ストリームサイファである。共有鍵の情報(共有鍵から生成した擬似乱数列)は、関数の選択及び関数のパラメータに用いられる。
本実施形態のシステム構成例は上述の実施形態2で図2を用いて説明した通りである。また、その処理の流れは実施形態2で図6を用いて説明した通りである。本実施形態と、上述の実施形態2との違いは、実施形態2(ブロックサイファ)では、一度複数の関数を選択してパラメータを決定したら、同じ関数及びパラメータですべてのブロックを変換するが、本実施形態(ストリームサイファ)では、文書のブロックごとに、関数とパラメータを決めて変換する。すなわち、全く同じブロックが2つあったときに、実施形態2ではこの2つのブロックは同じ暗号文に変換されるが、実施形態3では選択される関数もパラメータも違うため違う暗号文になる。また、上述したように、実施形態2は、一定の長さの擬似乱数列(拡張鍵)しか使わないが、実施形態3の方は、文書の長さに応じて擬似乱数を消費することになる。
<3. Embodiment 3>
Embodiment 3 is an encryption system and decryption system that generate an encrypted document by converting a document divided into blocks with a function selected by a pseudo-random number sequence generated from a shared key for each block This is an example of a stream cipher. The shared key information (a pseudo-random number sequence generated from the shared key) is used for function selection and function parameters.
The system configuration example of the present embodiment is as described in the second embodiment with reference to FIG. The processing flow is as described in the second embodiment with reference to FIG. The difference between the present embodiment and the above-described second embodiment is that in the second embodiment (block cipher), once a plurality of functions are selected and parameters are determined, all blocks are converted with the same function and parameters. In this embodiment (stream cipher), a function and a parameter are determined and converted for each block of the document. That is, when there are two identical blocks, the two blocks are converted into the same ciphertext in the second embodiment, but in the third embodiment, the functions and parameters selected are different, so that different ciphertexts are obtained. Further, as described above, the second embodiment uses only a pseudo-random number sequence (extended key) having a certain length, but the third embodiment consumes pseudo-random numbers according to the length of the document. Become.

(3−1.前処理)
共有鍵に基づき擬似乱数を発生させて、32種類の乗算値(32ビット符号なしの整定数で、どれも奇数なもの)を準備する。そして、それらのmod232での乗法逆数値を計算して表にしておく。
(3-1. Preprocessing)
Pseudorandom numbers are generated based on the shared key, and 32 types of multiplication values (32-bit unsigned integer constants, all odd numbers) are prepared. These multiplicative inverse values at mod 2 32 are calculated and tabulated.

(3−2.ユーザが決めるマクロ定数)
(1)1ブロックのワード数(Tuple)を定義する。
#define Log_Tuple 2
#define Tuple (1UL<<Log_Tuple)
本実施形態においては、1ブロックはTuple個のワードとする。
Tupleの値は2巾であり、4以上16以下である必要がある。
Tupleの2を底としたログを、Log_Tupleとして指定する。
上記は、1ブロック=4ワードとする場合の記述である。
(2)文書のブロックの暗号化関数による変換回数(Iteration)を定義する。
#define Iteration 10
上記は、変換回数を10回とする場合の記述である。
(3-2. Macro constants determined by the user)
(1) Define the number of words (Tuple) in one block.
#Define Log_Tuple 2
#Define Tuple (1UL << Log_Tuple)
In this embodiment, one block is Tuple words.
The value of Tuple is 2 and needs to be 4 or more and 16 or less.
A log with Tuple 2 as the base is designated as Log_Tuple.
The above is a description when 1 block = 4 words.
(2) Define the number of conversions (Iteration) by the encryption function of the document block.
#Define Iteration 10
The above is a description when the number of conversions is 10.

(3−3.グローバル変数)
暗号化したい文書(平文)を入れておく配列は二重配列
msg[Msg_Length][Tuple]
である。本実施形態で用いるグローバル変数は次の通りである。
(1)暗号化したい文書(平文)を格納する。
unsigned long msg[Msg_Length][Tuple];
(2)配列msgを直接書き換えて暗号化する。
hmnencode(key[],init_value[])
(3)配列msgを直接書き換えて復号化する。
hmndecode(key[],init_value[])
(3-3. Global variables)
The array for storing the document (plain text) to be encrypted is a double array msg [Msg_Length] [Tuple]
It is. The global variables used in this embodiment are as follows.
(1) Store a document (plain text) to be encrypted.
unsigned long msg [Msg_Length] [Tuple];
(2) The array msg is directly rewritten and encrypted.
hmncode (key [], init_value [])
(3) Decoding by directly rewriting the array msg.
hmndecode (key [], init_value [])

(3−4.用意する関数)
Tuple個のワードからなるブロックの変換に用いる関数(PEF)(図6の関数660に該当)として、本実施形態では、あらかじめ、ワード内の計算を行なう関数5種類と、ブロック内の複数のワードを跨ぐ計算を行なう関数3種類の計8種類の関数を用意する。
これらの関数は全て、
PEF: BL×PARAM→BL
なる写像である。ここで、BLは文書のブロックの集合であり、PARAMは関数に与えるパラメータであり、PARAMはBLと同じくTuple個のワードからなるデータの集合であり、擬似乱数列PNから得る。
ここでは、Tuple=4の場合を例として
(w, w, w, w)←PEF(w,w,w,w; p, p, p, p
の形で記述することにする。
以降、PEFの8種類の関数とその逆関数(_inv)をそれぞれ説明する。なお、これらの(1)〜(8)の関数は一例であり、高速に処理できる他の演算を用意してもよい。
(3-4. Prepared functions)
As a function (PEF) (corresponding to the function 660 in FIG. 6) used for conversion of a block of Tuple words, in the present embodiment, five types of functions for performing calculation in a word and a plurality of words in a block in advance. A total of 8 types of functions, ie, 3 types of functions that perform calculations across the two, are prepared.
All of these functions
PEF: BL × PARAM → BL
It is a mapping. Here, BL is a set of document blocks, PARAM is a parameter given to the function, and PARAM is a set of data consisting of Tuple words as in BL, and is obtained from a pseudo-random number sequence PN.
Here, as an example of Tuple = 4, (w 1 , w 2 , w 3 , w 4 ) ← PEF (w 1 , w 2 , w 3 , w 4 ; p 1 , p 2 , p 3 , p 4 )
It will be described in the form of
Hereinafter, each of eight types of PEF functions and their inverse functions (_inv) will be described. Note that these functions (1) to (8) are merely examples, and other operations that can be processed at high speed may be prepared.

(a)ワード内の計算(ワード内関数及びそれに対応するワード内逆関数)5種類
(1)crypt_plus
crypt_plus
←w+p (i=1,2,3,4).
crypt_plus_inv
←w−p (i=1,2,3,4).
(A) Five types of calculations within a word (intraword function and corresponding inverse function within word)
(1) crypto_plus
crypto_plus
w i ← w i + p i (i = 1, 2, 3, 4).
crypto_plus_inv
w i <-w i −p i (i = 1, 2, 3, 4).

(2)crypt_exor
crypt_exor
←w EOR p (i=1,2,3,4).
crypt_exor_inv
←w EOR p (i=1,2,3,4).
(2) crypto_exor
crypto_exor
w i ← w i EOR p i (i = 1,2,3,4).
crypto_exor_inv
w i ← w i EOR p i (i = 1,2,3,4).

(3)crypt_multi
最近のCPUは掛け算命令を持っているが、割り算は遅い。そのため、本実施形態では上述の(3−1.前処理)で述べたようにMulti_Size個(=32個)の掛け算用乱数定数を用意し、global変数の配列multi_tableに格納する。
実際の処理としては、
1)prepare_multi()を呼び出すと、multi_tableに乱数が格納される。
2)下位ビットを強制的に変換し、mod7で3のものと、mod16で7のものをmulti_table内に交互におく。これらは、mod232での乗法群を生成する。
3)prepare_multi_inv()を呼び出すと、inv_tableにmulti_tableの乗法逆数が格納される。
crypt_multi
←w×mutli_table[pの上位5ビット]
←w−p
をi=1,2,3,4について行う。すなわち、パラメータpの上位5ビットに対応する乗算用定数をmutli_table[]から読み出し、それをwに掛ける。pの下位27ビットが捨てられるのはもったいないので、wからpを引いておく。
crypt_multi_inv
←w+p
←w×inv_table[pの上位5ビット]
をi=1,2,3,4について行う。
(3) crypto_multi
Modern CPUs have multiplication instructions, but division is slow. Therefore, in the present embodiment, Multi_Size (= 32) random number constants for multiplication are prepared and stored in the global variable array multi_table as described in (3-1. Preprocessing) above.
As actual processing,
1) When prepare_multi () is called, a random number is stored in multi_table.
2) The lower bits are forcibly converted, and those with 3 in mod7 and those with 7 in mod16 are alternately placed in the multi_table. These generate a multiplicative group with mod2 32 .
3) When prepare_multi_inv () is called, the multiplicative inverse of multi_table is stored in inv_table.
crypto_multi
[upper 5 bits of p i] w i ← w i × mutli_table
w i ← w i −p i
Is performed for i = 1, 2, 3, 4. That is, read out for multiplication constant corresponding to the upper 5 bits of the parameters p i from mutli_table [], hang it in w i. Since the low-order 27 bits of p i is discarded waste, keep pulling the p i from w i.
crypto_multi_inv
w i ← w i + pi
[upper 5 bits of p i] w i ← w i × inv_table
Is performed for i = 1, 2, 3, 4.

(4)crypt_hori_rotate
crypt_hori_rotate
ワードごとに、ビットを反転しながら横ローテートを行う。すなわち
←pの上位5ビット、ただし下から4ビット目は常に1にセット
←(wのビット反転の右32−sシフト)と(wの左sシフト)のOR
←w−p
をi=1,2,3,4で行う。4ビット目を1にするのは、パラメータが0でもローテートをするため。
crypt_hori_rotate_inv
上述の逆変換
(4) crypto_hori_rotate
crypto_hori_rotate
Rotate horizontally while inverting bits for each word. That s i ← the upper 5 bits of p i, where the fourth bit from the bottom is always 1 to set w i ← (the bit inversion right 32-s i shift of the w i) (left s i shift of w i) OR
w i ← w i −p i
Is performed at i = 1, 2, 3, 4. The fourth bit is set to 1 in order to rotate even if the parameter is 0.
crypto_hori_rotate_inv
Inverse transformation described above

(5)crypt_hori_rightshift
crypt_hori_rightshift
ワードごとに、ビットを反転しながら横ローテートを行う。すなわち
←pの上位5ビット、ただし下から5ビット目は常に1にセット
←w EOR (wのビット反転の右sシフト)
←w+p
をi=1,2,3,4で行う。5ビット目を1にするのは、パラメータが0でもローテートをするためと、逆変換を易しくするため。
crypt_hori_rightshift_inv
上記の逆変換
(5) crypto_hori_rightshift
crypto_hori_rightshift
Rotate horizontally while inverting bits for each word. That s i p i upper 5 bits, but (bit inversion right s i shift of the w i) 5-th bit set is always to 1 w i ← w i EOR from the bottom of the
w i ← w i + pi
Is performed at i = 1, 2, 3, 4. The 5th bit is set to 1 in order to rotate even if the parameter is 0 and to facilitate reverse conversion.
crypto_hori_rightshift_inv
Inverse transformation above

(b)ワードを跨ぐ計算(ワード間関数及びそれに対応するワード間逆関数)3種類
(6)crypt_vert_rotate
crypt_vert_rotate
key←p+p
keyを32ビットランダムパターンと思う。
,w,w,wに関して、keyにおいて1になっているビットについては縦方向にビット反転しながらローテートする。乱数がもったいないので
←w+p
をi=1,2,3,4について行う。
crypt_vert_rotate_inv
上記の逆変換
(B) Calculations across words (word function and corresponding inverse function between words) (6) crypto_vert_rotate
crypto_vert_rotate
key ← p 1 + p 4
I think the key is a 32-bit random pattern.
Regarding w 1 , w 2 , w 3 , and w 4 , the bits that are 1 in the key are rotated while being inverted in the vertical direction. Since random numbers are wasteful, w i ← w i + p i
Is performed for i = 1, 2, 3, 4.
crypto_vert_rotate_inv
Inverse transformation above

(7)crypt_add_permute
crypt_add_permute
i=1,2,3,4について、
←w+w
という和を行う。ここでjはpの最下位Low_Mask=2ビットを用いて決められるが、たまたまそれがiと同じであるときにはjをmod Low_Maskでincrementしておく。
−pの有効活用のために
←w EOR p
をi=1,2,3,4でやっておく。
crypt_add_permute_inv
上記の逆変換
(7) crypto_add_permute
crypto_add_permute
For i = 1, 2, 3, 4
w i ← w i + w j
Do the sum. Although where j is determined by using the lowest Low_Mask = 2 bits p i, keep increment the j in mod Low_Mask when happens the same it to i.
w for the effective use of p 1 -p 4 i ← w i EOR p i
I = 1, 2, 3, 4
crypto_add_permute_inv
Inverse transformation above

(8)crypt_exor_permute
crypt_exor_permute
i=1,2,3,4について、
←w EXOR w
という和を行う。ここでjはpの最下位Low_Mask=2ビットを用いて決められるが、たまたまそれがiと同じであるときにはjをmod Low_Maskでincrementしておく。
−pの有効活用のために
←w−p
をi=1,2,3,4でやっておく。
crypt_exor_permute_inv
上記の逆変換
(8) crypto_exor_permute
crypto_exor_permute
For i = 1, 2, 3, 4
w i ← w i EXOR w j
Do the sum. Although where j is determined by using the lowest Low_Mask = 2 bits p i, keep increment the j in mod Low_Mask when happens the same it to i.
for the effective use of p 1 -p 4 w i ← w i -p i
I = 1, 2, 3, 4
crypto_exor_permute_inv
Inverse transformation above

(3−5.擬似乱数列)
ここでは擬似乱数列PN(図6の左上のPNに該当)の生成方法として、上述のメルセンヌツイスター(mt19937ar.c)を用いる。mt19937ar.cは、任意長の配列を初期値として受け取る機能を持つ。
擬似乱数列は4ワードずつ読み込むようにした。内部配列長の624が4でわりきれるため、624/4回読み込むごとに配列全体に擬似乱数列を生成しなおす。
genrand_fourint32(param)
により、param[0]〜param[3]に32ビット長符号なし整数乱数が読み込まれる。
暗号化する際の
crypt_...(unsigned long block[Tuple])
では、どれも内部でgenrand_fourint32(param)を呼び出してp,p,p,pを生成している。それに対し、復号化する際の
crypt_..._inv(block[],param[])
では、paramのところにp〜pを指定する。この違いは、復号化する場合には擬似乱数列を逆向きに生成しなくてはならないことに起因する。復号化する場合には、擬似乱数列を配列temp_randにいったん記録しておき、逆向きに使う。
(3-5. Pseudorandom number sequence)
Here, the Mersenne Twister (mt19937ar.c) described above is used as a method for generating the pseudo-random number sequence PN (corresponding to the upper left PN in FIG. 6). mt19937ar. c has a function of receiving an arbitrary-length array as an initial value.
The pseudo-random number sequence was read 4 words at a time. Since the internal array length 624 can be divided by 4, a pseudo-random number sequence is generated again for the entire array every time it is read 624/4 times.
genrand_fourint32 (param)
Thus, a 32-bit long unsigned integer random number is read into param [0] to param [3].
When encrypting crypt_. . . (Unsigned long block [Tuple])
Then, all generate genland_fourint32 (param) to generate p 1 , p 2 , p 3 , and p 4 . On the other hand, crypt_. . . _Inv (block [], param [])
In, specify the p 1 ~p 4 at the param. This difference is due to the fact that a pseudo-random number sequence must be generated in the reverse direction when decoding. In the case of decoding, a pseudo-random number sequence is once recorded in the array temp_rand and used in the reverse direction.

(3−6.文書の暗号化)
hmnencode(key[],init_value[])
を呼び出すと、文書(図6においては、メモリ620に取り込んだ平文Mのブロック)の暗号化を行なう。key,init_valueは配列で、あわせてメルセンヌツイスターの初期化に使われる。
(1)multi_tableに乗算定数をしまう。
(2)擬似乱数列PNを4ワードfunc_choice[0]−[3]の4つに格納し、積とEORを用いて新たな4ワードに書き換える。(あとでこの4ワードを3ビットずつに切り出し、上述の5+3種のPEFの選択を行う。)
(3)まずは平文に対して次の3つを施す。
crypt_multi(msg[i]);
crypt_vert_rotate(msg[i]);
crypt_hori_rightshift(msg[i]);
(4)その後はIterate回、func_choiceを用いてPEF関数を選択し(図6のセレクタ640の処理に該当)、MTで生成した擬似乱数列PNをパラメータとして与えながら変換を繰り返す。
(5)最後に再び
crypt_multi(msg[i]);
crypt_vert_rotate(msg[i]);
crypt_hori_rightshift(msg[i]);
を作用させる。
(3-6. Document Encryption)
hmncode (key [], init_value [])
Is called, the document (in FIG. 6, the block of plaintext M captured in the memory 620) is encrypted. The key and init_value are arrays and are used together to initialize the Mersenne Twister.
(1) A multiplication constant is stored in multi_table.
(2) The pseudo random number sequence PN is stored in four of four words func_choice [0]-[3], and rewritten to new four words using the product and EOR. (Later, these 4 words are cut into 3 bits, and the above 5 + 3 types of PEFs are selected.)
(3) First, the following three are applied to plaintext.
crypto_multi (msg [i]);
crypto_vert_rotate (msg [i]);
crypto_hori_rightshift (msg [i]);
(4) After that, the PEF function is selected using Iterate times and func_choice (corresponding to the processing of the selector 640 in FIG. 6), and the conversion is repeated while giving the pseudo random number sequence PN generated by MT as a parameter.
(5) Finally, again, crypto_multi (msg [i]);
crypto_vert_rotate (msg [i]);
crypto_hori_rightshift (msg [i]);
Act.

(3−7.文書の復号化)
hmndecode(key[], init_value[])
を呼び出すと、復号化を行なう。key,init_valueは配列で、あわせてメルセンヌツイスターの初期化に使われる。
(1)multi_tableに乗算定数をしまう。
(2)inv_tableにその乗算に関する逆元をしまう。
(3)擬似乱数を4ワードfunc_choice[0]〜[3]の4つに格納し、積とEORを用いて新たな4ワードに書き換える。(あとでこの4ワードを3ビットずつに切り出し、上述の5+3種のPEFの選択を行う。)
(4)後で使われるべき乱数ブロックを、3+Iteration+3個作って配列temp_randにしまっておく。
(5)暗号文に対して、3つの逆変換を施す。
crypt_hori_rightshift_inv(msg[i],temp_rand[−−k]);
crypt_vert_rotate_inv(msg[i],temp_rand[−−k]);
crypt_multi_inv(msg[i],temp_rand[−−k]);
(6)その後はIterate回、func_choiceを用いてPEF関数を選択し、格納しておいたMTの出力を与えながら逆変換を繰り返す。
(7)最後に再び
crypt_hori_rightshift_inv(msg[i],temp_rand[−−k]);
crypt_vert_rotate_inv(msg[i],temp_rand[−−k]);
crypt_multi_inv(msg[i],temp_rand[−−k]);
を作用させる。
(3-7. Decryption of Document)
hmndecode (key [], init_value [])
When is called, decryption is performed. The key and init_value are arrays and are used together to initialize the Mersenne Twister.
(1) A multiplication constant is stored in multi_table.
(2) The inverse element related to the multiplication is stored in inv_table.
(3) Pseudorandom numbers are stored in four of four words func_choice [0] to [3], and rewritten to new four words using the product and EOR. (Later, these 4 words are cut into 3 bits, and the above 5 + 3 types of PEFs are selected.)
(4) 3 + Iteration + 3 random number blocks to be used later are created and stored in the array temp_rand.
(5) Three reverse transformations are performed on the ciphertext.
crypto_hori_rightshift_inv (msg [i], temp_rand [-k]);
crypto_vert_rotate_inv (msg [i], temp_rand [-k]);
crypto_multi_inv (msg [i], temp_rand [-k]);
(6) After that, the PEF function is selected using Iterate times and func_choice, and the inverse transformation is repeated while giving the stored MT output.
(7) Finally, again, crypt_hori_rightshift_inv (msg [i], temp_rand [-k]);
crypto_vert_rotate_inv (msg [i], temp_rand [-k]);
crypto_multi_inv (msg [i], temp_rand [-k]);
Act.

<4.実施形態4>
実施形態4は、あらかじめ用意した数列(共有鍵)から生成した擬似乱数列のブロックを、当該擬似乱数列により選択される関数で変換して、安全な暗号乱数列を生成することを特徴とする擬似乱数列発生システムである。ここで、数列は、関数の選択及び関数のパラメータとして用いられる。暗号化通信における共有鍵を数列として用いることにより、生成した暗号乱数列をストリームサイファによる文書の暗号化・復号化に用いることができる。
<4. Embodiment 4>
The fourth embodiment is characterized in that a secure cryptographic random number sequence is generated by converting a block of a pseudo random number sequence generated from a number sequence (shared key) prepared in advance with a function selected by the pseudo random number sequence. This is a pseudo random number sequence generation system. Here, the numerical sequence is used as a function selection and a function parameter. By using the shared key in encrypted communication as a number sequence, the generated encrypted random number sequence can be used for document encryption / decryption by stream cipher.

(4−1.擬似乱数列の生成)
一般に実験などに利用されている擬似乱数列は、高速に生成されるが、いくつかのワードを見ると他のワードがわかってしまうため、暗号学的には安全でない。このため、従来、暗号乱数列の生成には、BBS法に代表される計算量の大きな暗号化方式が用いられている。本実施形態は、本発明のポイントである、鍵情報を関数選択に用いることで、高速な擬似乱数列を少ない計算量で暗号乱数列に書き換えることを特徴とした擬似乱数発生システムであり、高速で安全なストリームサイファを構成することができる。
ここでは擬似乱数PNの生成方法として実施形態1で説明したメルセンヌツイスター(mt19937ar.c)を用いる。高速で周期が長い擬似乱数列を生成できるためである。なお、他の擬似乱数生成方法を用いてもよい。
前処理として、あらかじめ暗号化・復号化を行う双方で、共有鍵を用いて624ワードの秘密の擬似乱数列の初期値を求めておく。使い続ける共有秘密鍵の他に、一回の通信ごとにセッション鍵を受け取る場合には、ここで作成した初期値の一部をセッション鍵に変えたものを、その通信で用いる擬似乱数列の初期値とし、乱数は初期値の次の値から使うものとする。
(4-1. Generation of pseudo-random number sequence)
In general, a pseudo-random number sequence used for experiments and the like is generated at a high speed. However, when some words are seen, other words are known, so that it is not cryptographically secure. For this reason, conventionally, an encryption method with a large amount of calculation represented by the BBS method has been used to generate an encrypted random number sequence. This embodiment is a pseudorandom number generation system characterized by rewriting a high-speed pseudorandom number sequence into a cryptographic random number sequence with a small amount of calculation by using key information for function selection, which is a point of the present invention. And a safe stream cipher can be configured.
Here, the Mersenne Twister (mt19937ar.c) described in the first embodiment is used as a method for generating the pseudorandom number PN. This is because a pseudo-random number sequence having a long period and a high cycle can be generated. Other pseudo random number generation methods may be used.
As preprocessing, the initial value of a 624-word secret pseudorandom number sequence is obtained using a shared key in both encryption and decryption. If you want to receive a session key for each communication in addition to the shared secret key that you continue to use, replace the initial value created here with the session key, and use the initial pseudo-random number sequence used for that communication. The random number is used from the next value after the initial value.

擬似乱数列PNは、必要になった分だけ次々に作ることとして、以下のように安全な擬似乱数列を出力する。擬似乱数列PNの12nワード目のデータを、12n+1ワード目から12n+11ワード目のデータを用いて次のように書き換える。以下、擬似乱数のmワード目のデータをR(m)であらわす。
x=R(12n)とし、R(12n+1)のデータを上から2ビットずつ10回見て、この値により次の操作でxを書き換えていく。
t回目の2ビットが
(1)00ならば、xを、x+R(12n+t+1)mod232に書き換える。
(2)01ならば、xを、x EXOR R(12n+t+1)に書き換える。
(3)10ならば、xを、x×R(12n+t+1)に書き換える。ただし、pは、pの最下位ビットを1にした数とする。
(4)11ならば、xを、x shift R(12n+t+1)に書き換える。ただし、s shift tは、tの上5ビットの大きさの分だけのsのビットを右にシフトし、ワードの右にはみ出た部分をビット反転させて、左に書いたものとする。
10回書き換えたら、xを暗号乱数列のnワード目として出力する。
The pseudo random number sequence PN is generated one after another as much as necessary, and a safe pseudo random number sequence is output as follows. The 12n word data of the pseudo random number sequence PN is rewritten as follows using the 12n + 1 word to 12n + 11 word data. Hereinafter, the mth word data of the pseudorandom number is represented by R (m).
x = R (12n), R (12n + 1) data is viewed 10 bits at a time, 2 bits from the top, and x is rewritten in the next operation using this value.
If the 2nd bit of the t-th time is (1) 00, x is rewritten to x + R (12n + t + 1) mod2 32 .
(2) If 01, rewrite x to x EXOR R (12n + t + 1).
(3) If 10, rewrite x to x × R (12n + t + 1) * . However, p * is a number obtained by setting the least significant bit of p to 1.
(4) If 11, rewrite x to x shift R (12n + t + 1). It is assumed that s shift t is written to the left by shifting the bit of s by the size of the upper 5 bits of t to the right, bit-inverting the portion protruding to the right of the word.
After rewriting 10 times, x is output as the nth word of the cryptographic random number sequence.

なお、上記(1)〜(4)の関数は一例であり、高速に処理できる他の演算を用意してもよい。また、必要な強度に応じて変換の回数を増やし、また強制的に掛け算とシフトがあらわれるようにするなどの方法で、安全性を高めることができる。1つのワードを求めるのにm+2ワード(mは6〜16くらい)用いて変換の回数をm回とし、1回目とm−1回目の変換をシフト、2回目とm回目の変換を掛け算と決めるなど必要に応じて調整すると良い。
メルセンヌツイスターには、周期の完全な保障と、分布のある程度の保障がある。周期がとても長いことから、生成した安全擬似乱数列の周期も使い切ることができないくらい長くなり、共有鍵を取り替えずに長く使い続けることができる。
The above functions (1) to (4) are merely examples, and other operations that can be processed at high speed may be prepared. In addition, safety can be improved by increasing the number of conversions according to the required strength and forcibly causing multiplication and shift. To obtain one word, m + 2 words (m is about 6 to 16) are used, the number of conversions is m times, the first and m-1 conversions are shifted, and the second and mth conversions are determined as multiplications. It is good to adjust as necessary.
Mersenne Twister has full guarantee of period and some guarantee of distribution. Since the period is very long, the period of the generated secure pseudorandom number sequence is too long to be used up, and can be used for a long time without changing the shared key.

(4−2.本実施例を用いた暗号化システム及び復号化システムの構成例)
最後に、本実施形態の擬似乱数発生システムを用いて、ストリームサイファにより文書(平文)の暗号化及び復号化を行なう場合のシステム構成例を、図3のシステム構成図を参照しながら説明する。
本実施形態のシステムは、例えば通常のパソコン等の端末に実装するものする。図1に示すように、文書を暗号化して送信する側の端末には暗号化システム110を、文書を受信して復号化する側の端末には復号化システム150を実装する。また、暗号化システム110及び復号化システム150の双方に、数列(共有鍵122)、関数126、及び本実施形態の擬似乱数発生システム330を用意する。
暗号化システム110では、まず、共有鍵122から従来技術の手法により安全ではないかもしれない擬似乱数列PNを生成する。次に、生成されたPNを用いて、関数選択プログラム334は関数126からPNの暗号化に用いる関数を選択する。また、擬似乱数生成プログラム332は、PNを関数選択プログラム334で選択された関数のパラメータとして用いて関数を実行し、PNを暗号化する。これにより、安全な擬似乱数列325を生成して、記憶領域に一時的に格納する。次に、ストリームサイファの典型的な例として、暗号化プログラム336は、擬似乱数列325と文書124のEXORをとることにより文書124を暗号化して、暗号化文書140を生成する。
(4-2. Configuration Example of Encryption System and Decryption System Using This Example)
Finally, a system configuration example in the case of encrypting and decrypting a document (plain text) by stream cipher using the pseudo random number generation system of this embodiment will be described with reference to the system configuration diagram of FIG.
The system of the present embodiment is mounted on a terminal such as a normal personal computer. As shown in FIG. 1, an encryption system 110 is installed in a terminal that encrypts and transmits a document, and a decryption system 150 is installed in a terminal that receives and decrypts a document. In addition, a number sequence (shared key 122), a function 126, and a pseudo-random number generation system 330 of this embodiment are prepared for both the encryption system 110 and the decryption system 150.
In the encryption system 110, first, a pseudo-random number sequence PN that may not be secure is generated from the shared key 122 by a conventional technique. Next, using the generated PN, the function selection program 334 selects a function used for PN encryption from the function 126. Further, the pseudo random number generation program 332 executes the function using the PN as a parameter of the function selected by the function selection program 334, and encrypts the PN. As a result, a safe pseudo-random number sequence 325 is generated and temporarily stored in the storage area. Next, as a typical example of the stream cipher, the encryption program 336 encrypts the document 124 by taking the EXOR of the pseudorandom number sequence 325 and the document 124 to generate the encrypted document 140.

一方、復号化システム150でも、共有鍵122から従来技術の手法により安全ではないかもしれない擬似乱数列PNを生成する。次に、生成されたPNを用いて、関数選択プログラム334は関数126からPNの暗号化に用いる関数を選択する。また、擬似乱数生成プログラム332は、PNを関数選択プログラム334で選択された関数のパラメータとして用いて関数を実行し、PNを暗号化する。これにより、安全な擬似乱数列325を生成して、記憶領域に一時的に格納する。次に、復号化プログラム366は、擬似乱数列325と暗号化文書140のEXORをとることにより暗号化文書140を復号し、元の文書124を得る。
暗号化システム110と復号化システム150とでは、同じ共有鍵122及び関数126を用いて、同じ安全な擬似乱数列325を生成するため、暗号化に対応する復号化の処理を行なうことができる。
On the other hand, the decryption system 150 also generates a pseudo-random number sequence PN that may not be secure from the shared key 122 by a conventional technique. Next, using the generated PN, the function selection program 334 selects a function used for PN encryption from the function 126. Further, the pseudo random number generation program 332 executes the function using the PN as a parameter of the function selected by the function selection program 334, and encrypts the PN. As a result, a safe pseudo-random number sequence 325 is generated and temporarily stored in the storage area. Next, the decryption program 366 decrypts the encrypted document 140 by taking the EXOR of the pseudorandom number sequence 325 and the encrypted document 140 to obtain the original document 124.
The encryption system 110 and the decryption system 150 generate the same secure pseudo-random number sequence 325 using the same shared key 122 and the function 126, so that the decryption process corresponding to the encryption can be performed.

<5.実施形態5>
実施形態5は、上述の実施形態2〜4のシステムに、後述する「JUMP処理」を加えることにより、より効率の良い暗号化を行なう手法を提案する。なお、ここでは実施形態3と同様の暗号化システム及び復号化システムにJUMP処理を追加する例で説明するが、使用する関数(PEF)等については、実施形態3とは異なるものを用意して説明する。
本実施形態の暗号化システムの処理の流れを、図7に示す。
まず、共有鍵(数列)から上述の実施形態2〜4と同様の方法(例えばメルセンヌツイスター)により擬似乱数列を生成して、これを本実施形態で使用する擬似乱数列PNとする(図7の左上部)。
次に、擬似乱数列PNをセレクタ740に送り、どの関数760を選ぶかを決定する。図6で示した実施形態2〜4との違いは、ブロックの変換が何ステップ目であるかを記録する履歴メモリ750が追加されている点であり。これによりjumpという値が計算される。
jumpは、「各ワードの情報を、どれだけ離れたワードに渡すか」を各関数に指定するものである。1つのブロックを変換するとき、jumpは1ステップ目の変換では1,2ステップ目は2,3ステップ目は4,…と二倍二倍に増えて行き、t(1ブロック内のワード数)以上になったら1に戻す。このjumpの処理は、履歴メモリ750がセレクタ740に指示を出すことにより行なう。
<5. Embodiment 5>
The fifth embodiment proposes a technique for performing more efficient encryption by adding “JUMP processing” to be described later to the systems of the above-described second to fourth embodiments. Here, an example in which JUMP processing is added to the same encryption system and decryption system as in the third embodiment will be described. However, functions (PEF) and the like to be used are different from those in the third embodiment. explain.
FIG. 7 shows a processing flow of the encryption system of this embodiment.
First, a pseudorandom number sequence is generated from the shared key (number sequence) by the same method (for example, Mersenne Twister) as in Embodiments 2 to 4 described above, and this is used as the pseudorandom number sequence PN used in this embodiment (FIG. 7). At the top left).
Next, the pseudo random number sequence PN is sent to the selector 740 to determine which function 760 to select. The difference from Embodiments 2 to 4 shown in FIG. 6 is that a history memory 750 for recording the number of steps of block conversion is added. As a result, the value jump is calculated.
“jump” specifies to each function “how far away the information of each word is passed to”. When converting one block, jump is doubled twice in the first step conversion, the first step is the second step, the third step is 4, ..., t (number of words in one block) Return to 1 when it is above. This jump processing is performed when the history memory 750 issues an instruction to the selector 740.

また、本実施形態では、関数の選択においても、第1ステップでは本実施形態で用いる9種類の関数(PF1〜PF9)のうちからワード内関数PF1〜PF4(ワード内の計算を行なう関数)の1つを選び、第2ステップではワード間関数PF5〜PF8(ブロック内の複数のワード間に跨る計算を行なう関数)の1つを選び、第3ステップではPF9を選び、第4ステップではPF1〜PF4の1つを選び、…という具合に、ステップごとに関数選択の範囲が変わる。この処理も履歴メモリ750がセレクタ740に指示を出すことにより行なう。なお、本実施形態で用いる9種類の関数(PF1〜PF9)については後で詳しく説明する。
また、選択された関数760は、ブロックサイズと同程度の大きさのパラメータを受け取る。関数のパラメータには、実施形態2〜4と同様、共有鍵(数列)から生成した擬似乱数列PNを用いる。
In the present embodiment, even in the selection of a function, in the first step, among the nine types of functions (PF1 to PF9) used in the present embodiment, the in-word functions PF1 to PF4 (functions for performing calculations in the word) are selected. In the second step, one of the inter-word functions PF5 to PF8 (a function for performing calculation across a plurality of words in the block) is selected, PF9 is selected in the third step, and PF1 to PF1 in the fourth step. Select one of PF4, and so on, and so on, the range of function selection changes at each step. This processing is also performed when the history memory 750 gives an instruction to the selector 740. The nine types of functions (PF1 to PF9) used in the present embodiment will be described in detail later.
Also, the selected function 760 receives a parameter that is approximately as large as the block size. As a function parameter, a pseudorandom number sequence PN generated from a shared key (number sequence) is used as in the second to fourth embodiments.

上述のjumpの効用は、次の通りである。1ブロック=tワードとして、ワード間関数を用いてワード間に跨る変換を行なう場合、あるワードの情報を他の全てのワードに早く渡すためには、隣接する次のワードのみに情報を渡すのは、あるワードの情報が他の全てのワードに達するのにt回の繰り返しが必要なため、最も効率的な方法ではない。高速に変換するには2ワードなど少ないワード間の計算の方がよく、変換を行なうごとに、最初は1ワード隣り(間隔1)、次は2ワード隣り(間隔2)、次は4ワード隣り(間隔4)、…という具合にワードの間隔を倍倍にしていくのが最も効率的である。
ここで対象となる2ワードを●で表すと、上記のワードの間隔とは、
●● 間隔1の関係
●○● 間隔2の関係
●○○○● 間隔4の関係
である。
このように、全ての自然数tがlog(t)桁の2進数によって表されることにより、log(t)回の繰り返しによって、0,1,…,t−1の全ての距離のワードに対して情報を渡すことができる。すなわち、JUMP処理はワード間関数が少ないワード間(本実施形態においては2ワード間)の計算であっても、少ない繰り返し回数で十分な撹拌がされるようにするための処理である。
The utility of the jump described above is as follows. If 1 block = t words and conversion between words is performed using the inter-word function, in order to pass information of a word to all other words quickly, the information is passed only to the next adjacent word. Is not the most efficient method because it requires t iterations for information in one word to reach all other words. It is better to calculate between two words, such as 2 words, for high-speed conversion. Every time conversion is performed, the next is adjacent to 1 word (interval 1), the next is adjacent to 2 words (interval 2), and the next is adjacent to 4 words. It is most efficient to double the word interval (interval 4), and so on.
Here, if the target two words are represented by ●, the above-mentioned word interval is
●● Relationship of interval 1 ● ○ ● Relationship of interval 2 ● ○○○ ● Relationship of interval 4.
In this way, since all natural numbers t are represented by binary numbers of log 2 (t) digits, words of all distances of 0, 1,..., T−1 can be obtained by repeating log 2 (t) times. Can pass information to. That is, the JUMP process is a process for allowing sufficient agitation with a small number of repetitions even when the calculation is performed between words (in this embodiment, between two words) with a small number of word-to-word functions.

(5−1.前提条件及び前処理)
(1)Wを32bit=1ワード符号なし整数の集合とする。
ここには、二項演算としてビットごとのEXOR,AND,OR,足し算,掛け算(modulo 2{32})、単項演算として右シフト,左シフト,ビット反転が行える。これらは最近のCPUの命令セットに通常入っている演算である。
(2)ブロックbの集合BLを、
BL=W
で定義する。ただし、tは4,8,または16とする。
(3)パラメータpの集合PARAMを、
PARAM=W×{0,1,2,…,t/2}
で定義し、飛ばし値jの集合JUMPを
JUMP={1,2,4,8,…,t/2}
で定義する。
(4)次の形の関数(PEF)を9種類(PF1,...,PF9)用意する。これが図7でいうところの関数760に該当する。なお、9種類のPEFの詳細は後で詳しく説明する。
PF: JUMP×PARAM×BL→BL.
これらのJUMP,PARAM,BLが図7の関数760への入力線3本にそれぞれ対応している。
ここで、PFの逆関数
PF’: JUMP×PARAM×BL→BL.
も復号化のために構成しておく。ここで、
PF’(j, P, PF(j, P, b))=b
である必要があり、また高速に計算できるものが望ましい。
(5)本実施形態では、鍵情報(共有鍵)は上述の他の実施形態と同様にメルセンヌツイスター(MT)の処理に送られる。MTを用いて乗法定数テーブル、加法定数テーブルを作成する。乗法定数テーブル、加法定数テーブルについては後で詳しく説明する。
なお、上記以外の前提条件及び前処理は、上述の実施形態3の(3−1.前処理)〜(3−3.グローバル変数)で説明した通りであり、あらかじめIteration(変換回数)とLog_Tuple(ブロック内のワード数の対数)を決めておく。
(5-1. Preconditions and preprocessing)
(1) Let W be a set of 32-bit = 1-word unsigned integers.
Here, EXOR, AND, OR, addition, and multiplication (modulo 2 {32} ) for each bit can be performed as binary operations, and right shift, left shift, and bit inversion can be performed as unary operations. These are operations that are normally included in recent CPU instruction sets.
(2) A set BL of blocks b is
BL = W t
Define in. However, t is 4, 8, or 16.
(3) A set PARAM of parameters p is
PARAM = W t × {0, 1, 2,..., T / 2}
And a set JUMP of skip values j is defined as JUMP = {1, 2, 4, 8,..., T / 2}
Define in.
(4) Nine types (PF1,..., PF9) of the following functions (PEF) are prepared. This corresponds to the function 760 in FIG. Details of the nine types of PEF will be described later.
PF: JUMP × PARAM × BL → BL.
These JUMP, PARAM, and BL correspond to three input lines to the function 760 in FIG.
Here, the inverse function PF ′ of PF: JUMP × PARAM × BL → BL.
Is also configured for decoding. here,
PF ′ (j, P, PF (j, P, b)) = b
It is necessary to be able to calculate at high speed.
(5) In this embodiment, the key information (shared key) is sent to the Mersenne Twister (MT) process as in the other embodiments described above. A multiplicative constant table and an additive constant table are created using MT. The multiplicative constant table and the additive constant table will be described in detail later.
The preconditions and preprocessing other than those described above are the same as those described in (3-1. Preprocessing) to (3-3. Global variable) in the above-described third embodiment. Determine (logarithm of the number of words in the block).

(5−2.文書の暗号化)
次に、平文ブロックを暗号化する。ここでは、1ブロック=4ワード、変換回数を4回として説明する。なお、本実施形態において、文書の暗号化は、JUMP処理以外の部分は実施形態3と同様である。
今、与えられた平文ブロックはワード長変数t個の配列
B:=(b,b,...,b{t−1}
に格納されているものとする。
本実施形態の一ラウンドは次のようになっている。
1)ラウンドの開始
2)PF1〜PF4から1つランダムに選んで、それを用いてBを書き換える
3)PF5〜PF8から1つランダムに選んで、それを用いてBを書き換える
4)PF9を用いてBを書き換える
5)ラウンドの終了
上記を4ラウンド行い、1ブロック分の暗号化ブロックを得る。
(5-2. Document Encryption)
Next, the plaintext block is encrypted. Here, it is assumed that 1 block = 4 words and the number of conversions is 4. In the present embodiment, the document encryption is the same as that of the third embodiment except for the JUMP process.
Now, the given plaintext block is an array B of word-length variables t: = (b 0 , b 1 ,..., B {t−1} ).
Is stored.
One round of this embodiment is as follows.
1) Start of round 2) Randomly select one from PF1 to PF4 and rewrite B using it 3) Randomly select one from PF5 to PF8 and rewrite B using it 4) Use PF9 5) End of the round 4 rounds are performed to obtain one block of encrypted blocks.

具体的には、1ブロックの暗号化は、次のようにして行われる。
(0)jump←1
(1)MTから4ワードの擬似乱数を取得
(2)この4ワードから2ビットの擬似乱数を8組生成し、c,c,c,...,cとする(生成方法については後で説明する)
(3)c=0,1,2,3に従って、PF1,PF2,PF3,PF4のうちの1つPFを選択する
(4)MTから4ワードの擬似乱数を取得し、これをPとする
(5)PF(jump,P,B)を用いてBを書き換える。jumpを2倍し、t以上になったら1にする
(6)c=0,1,2,3に従って、PF5,PF6,PF7,PF8のうちの一つPFを選択する
(7)MTから4ワードの擬似乱数を取得、Pとする
(8)PF(jump,P,B)を用いてBを書き換える。jumpを2倍し、t以上になったら1にする
(9)MTから4ワードの擬似乱数を取得、Pとする
(10)PF9(jump,P,B)を用いてBを書き換える。jumpを2倍し、t以上になったら1にする
(3)〜(10)を4回繰り返す。2回目ではc,cの代わりにc,cを使う。
3回目ではc,c,4回目ではc,cをそれぞれ使う。なお、図7でいうと、jumpが履歴メモリ750に格納されている。
Specifically, one block encryption is performed as follows.
(0) jump ← 1
(1) Obtain 4-word pseudo-random numbers from MT (2) Generate 8 sets of 2-bit pseudo-random numbers from these 4 words, and c 1 , c 2 , c 3 ,. . . , C 8 (the generation method will be described later)
(3) Select one PF * from PF1, PF2, PF3, and PF4 according to c 1 = 0, 1, 2, 3. (4) Obtain a 4-word pseudorandom number from MT, (5) Rewrite B using PF * (jump, P, B). Double jump and set it to 1 when t is greater than or equal to t (6) Select one PF * from PF5, PF6, PF7, and PF8 according to c 2 = 0, 1, 2, 3 (7) MT (4) Rewrite B using PF * (jump, P, B). Double jump and set it to 1 when t is greater than or equal to (9) Acquire a 4-word pseudorandom number from MT and set it to P (10) Rewrite B using PF9 (jump, P, B). Double the jump and set it to 1 when t or more (3) to (10) are repeated four times. In the second time, c 3 and c 4 are used instead of c 1 and c 2 .
In the third c 5, c 6, using respectively the c 7, c 8 in the fourth. Note that jump is stored in the history memory 750 in FIG.

次に、上述の(2)のc〜cの生成方法を説明する。
上記(1)で取得した4ワードをfunc_choice[0],...,func_choice[3]として、次の変換を行う。
func_choice[2]=(func_choice[0]|1);
func_choice[3]=(func_choice[1]|1);
func_choice[0]^=(func_choice[3]>>5);
func_choice[1]^=(func_choice[2]>>5);
ここで、=は左辺に右辺を掛けて左辺に代入する命令,^=は左辺に右辺とEXORをとって、左辺に代入する命令,|はビットごとのOR,>>5は5ビット右シフトを表す。こうして、func_choice[0]の上位2ビットがc,次の2ビットがc,と順番にとっていく。ラウンドの回数が16より多いときには、例えばfunc_choice[1]の上位ビットから用いるようにする。
Next, a method for generating c 1 to c 8 in the above (2) will be described.
The four words obtained in the above (1) are converted into func_choice [0],. . . , Func_choice [3], the following conversion is performed.
func_choice [2] * = (func_choice [0] | 1);
func_choice [3] * = (func_choice [1] | 1);
func_choice [0] ^ = (func_choice [3] >>5);
func_choice [1] ^ = (func_choice [2] >>5);
Where * = is the instruction to multiply the left side by the right side and assign to the left side, ^ = is the instruction to take the right side and EXOR to the left side and assign to the left side, | is the bitwise OR, >> 5 is 5 bits right Represents a shift. In this way, the upper 2 bits of func_choice [0] are c 0 , and the next 2 bits are c 1 . When the number of rounds is greater than 16, for example, the upper bits of func_choice [1] are used.

(5−3.文書の復号化)
本実施形態における文書の復号化は、JUMP処理以外の部分は実施形態3と同様である。
(1)復号に用いるJUMPの初期値を求める。
これは暗号化に用いる上述の2つの定数、Iteration(変換回数)とLog_Tuple(ブロック内のワード数の対数)から、次の式で求める事が出来る。
JUMP=1<<((3*Iteration−1)%Log_Tuple)
ここで、%は剰余を求める演算であり、1 << は、1を<<の右の回数だけ2倍するという意味である。
(2)JUMPの変化は、暗号化の逆にする。
すなわち、1ブロック=4ワードの場合は、繰り返し毎に4,2,1と半分にしていき、1の次は4に戻る。
(3)このようにJUMPが決定されれば、暗号化の時に使用した関数に対応する逆関数を選択し、このJUMP値および暗号化時と同じパラメータを与えることができる。
(5-3. Document Decryption)
The document decryption in the present embodiment is the same as that in the third embodiment except for the JUMP process.
(1) An initial value of JUMP used for decoding is obtained.
This can be obtained from the above two constants used for encryption, Iteration (number of conversions) and Log_Tuple (logarithm of the number of words in the block) by the following equation.
JUMP = 1 <<< ((3 * Iteration-1)% Log_Tuple)
Here,% is an operation for obtaining a remainder, and 1 << means that 1 is doubled by the number of times to the right of <<.
(2) The change in JUMP is the reverse of encryption.
In other words, if 1 block = 4 words, the number is halved to 4, 2, 1 every time it is repeated, and the next to 1 returns to 4.
(3) If JUMP is determined in this way, an inverse function corresponding to the function used at the time of encryption can be selected, and this JUMP value and the same parameters as at the time of encryption can be given.

(5−4.用意する関数)
本実施形態で用いる関数として、ブロック内のそれぞれのワードを主にワード内で変換する関数としてPF1,PF2,PF3,PF4の4種類、ワード間の情報を混ぜるための変換を行なう関数としてPF5,PF6,PF7,PF8の4種類、関数として1種類、計9種類の関数を用意する。以降、これら9種類の関数について順に説明する。なお、これらのPF1〜PF9の関数は一例であり、高速に処理できる他の演算を用意してもよい。
(5-4. Prepared functions)
As functions used in this embodiment, four types of PF1, PF2, PF3, and PF4 are mainly used as functions for converting each word in a block, and PF5 is used as a function for performing conversion for mixing information between words. Four types of PF6, PF7, and PF8, one type as a function, and a total of nine types of functions are prepared. Hereinafter, these nine types of functions will be described in order. Note that these functions of PF1 to PF9 are examples, and other operations that can be processed at high speed may be prepared.

(1)PF1〜PF4(ワード内関数)
PF1〜PF4は、ブロック内のそれぞれのワードを主にワード内で変換するワード内関数である。復号化にはそれぞれ関数の逆の処理を行なう逆関数(ワード内逆関数)を用いる。
ブロックをb,b,…,b{t−1}なるtワードとし、パラメータをp,p,...,p{t−1}なるtワードとする。まず、
←b EXOR p
なる代入を行う。(j=0,1,…,t−1)。つぎに、奇数定数をかける:
←b×c(mod 2{32},以下modはいつもついているが省略)(j=0,1,…,t−1)。
は、あらかじめMTにより生成された奇数乱数のテーブルm,m,…,m{31}より次の方法で選ばれる。m,…,m{31}はすべて奇数であるよう、最下位ビットを1にしてある。また、c:=m{kj}であり、kはp{j+ell}の最上位5ビットを0〜31の整数と見たものである。ここで、ellの値はPF1,PF2,PF3,PF4のときそれぞれ1,2,2,3である。なお、テーブルを用意したのは復号化の際にcの逆数(modulo 2{32})を用いるからである。
本実施形態では、暗号化を行う前処理としてこの乗法定数テーブルm,…,m{31}をMTにより作成し、そのmodulo 2{32}での乗法逆数のテーブルを作成して保存する。さらに、ある加法定数テーブルadd,…,add{31}もMTにより作成して保存する。
(1) PF1 to PF4 (in-word function)
PF1 to PF4 are intra-word functions that convert each word in the block mainly within the word. In the decoding, an inverse function (inverse function in word) that performs the inverse process of the function is used.
The block is a t word b 0 , b 1 ,..., B {t−1} , and the parameters are p 0 , p 1 ,. . . , P {t−1} . First,
b j ← b j EXOR p j
Is assigned. (J = 0, 1,..., T−1). Next, multiply by an odd constant:
b j ← b j × c j (mod 2 {32} , hereinafter, mod is always attached but omitted) (j = 0, 1,..., t−1).
c j is selected by the following method from an odd random number table m 0 , m 1 ,..., m {31} generated in advance by MT. The least significant bit is set to 1 so that m 0 ,..., m {31} are all odd numbers. Also, c j : = m {kj} , where k j is the most significant 5 bits of p {j + ell} viewed as an integer from 0 to 31. Here, the values of “ell” are 1, 2, 2, and 3 for PF1, PF2, PF3, and PF4, respectively. The table was prepared because the inverse of c j (modulo 2 {32} ) is used for decoding.
In the present embodiment, this multiplicative constant table m 0 ,..., M {31} is created by MT as preprocessing for encryption, and a multiplicative reciprocal table of modulo 2 {32} is created and stored. Further, a certain additive constant table add 0 ,..., Add {31} is also created and stored by the MT.

次に、
{(j+jump)mod t}←b{(j+jump)mod t}□add{[bj>>(32−5)]}
なる代入を行なう。j=0,1,2,…,t−1を、この順序で計算する。これは、まずbの上位5ビットを見て、それに対応するaddのテーブル(加法定数テーブル)の値と、b{j+jump}(添え字はmodulo tで見る)の値とを二項演算□を取って、その結果をb{j+jump}に格納するということである。二項演算□は、PF1,PF2,PF3,PF4のときにそれぞれ+,EOR,+,EORである。
次に、以下のようにして16〜23に値をとる擬似乱数sを生成する。
←((p>>(32−4))|0x10)&0x17
ここで、&はビットごとのAND演算である。
を用いて、bに対して次の二つの変換のいずれかを行う。
←((〜b)<<(32−s))|(b>>s).
←b EXOR ((〜sim b)>>s).
上はローテート(ただし、左からあふれた分はビット反転〜をとる)である。下は、ビット反転したものを右にsシフトしたものをbに足すものである(シフトと呼ぶ)。PF1,PF2,PF3,PF4で、それぞれローテート、ローテート、シフト、シフトを選ぶ。
next,
b {(j + jump) mod t} ← b {(j + jump) mod t} □ add {[bj >> (32-5)]}
Is assigned. j = 0, 1, 2,..., t−1 are calculated in this order. This is done by first looking at the upper 5 bits of b j and performing a binary operation on the value of the corresponding add table (additive constant table) and the value of b {j + jump} (the subscript is seen in modulo t). Take □ and store the result in b {j + jump} . The binary operations □ are +, EOR, +, and EOR for PF1, PF2, PF3, and PF4, respectively.
Next, a pseudo random number s j having a value of 16 to 23 is generated as follows.
s j ← ((p j >> (32-4)) | 0x10) & 0x17
Here, & is an AND operation for each bit.
s j is used to perform one of the following two transformations on b j .
b j ← ((˜b j ) << (32-s j )) | (b j >> s j ).
b j ← b j EXOR ((˜sim b j ) >> s j ).
The top is rotate (however, the bit overflow from the left is bit-reversed). Below is a bit-inverted version shifted s j to the right and added to b j (called a shift). Rotate, rotate, shift, and shift are selected with PF1, PF2, PF3, and PF4, respectively.

(2)PF5〜PF8(ワード間関数)
PF5〜PF8は、は、主にワード間(本実施形態においては2ワード間)の情報を混ぜるための変換を行なうワード間関数である。復号化にはそれぞれの関数の処理の逆の操作を行なう逆関数(ワード間逆関数)を用いる。
1)PF5
まずj=0とし、
←b+(b{j−jump}×p
を行なう。
←((p>>(32−4))|0x10)&0x17
により16〜23に値をとる擬似乱数を生成し、
←b EXOR ((〜sim b)>>s).
を行う。これをj=0,1,2,…,t−1とこの順に繰り返す。
(2) PF5 to PF8 (inter-word function)
PF5 to PF8 are interword functions that perform conversion mainly for mixing information between words (in this embodiment, between two words). For decoding, an inverse function (inverse function between words) that performs the reverse operation of the processing of each function is used.
1) PF5
First, j = 0
b j ← b j + (b {j−jump} × p j )
To do.
s j ← ((p j >> (32-4)) | 0x10) & 0x17
To generate a pseudo-random number that takes a value between 16 and 23,
b j ← b j EXOR ((˜sim b j ) >> s j ).
I do. This is repeated in this order as j = 0, 1, 2,.

2)PF6〜PF8
j=0とする。
s←(p>>(32−log(t)))
により、sにpの上位log(t)ビットを格納する。s=jとなったときは、sから1を引く(modulo tで計算する)。これにより、sとjは異なる。ここで、
PF6では、
←(b EXOR (b{j−jump}×b))−p
←b EXOR (b>>16)
なる代入を行う。添え字はmodulo tで考える。
PF7,PF8では、
←(b EXOR (b{j−jump}×(b□−p));
←b EXOR (b>>c);
なる代入を行う。ここで、□は、PF7の時にはビットごとのOR,PF8ではEXORである。また、cは、PF7のときには16、PF8のときには17である。
2) PF6 to PF8
Let j = 0.
s ← (p j >> (32-log 2 (t)))
Thus, the upper log 2 (t) bits of p j are stored in s. When s = j, 1 is subtracted from s (calculated by modulo t). Thereby, s and j are different. here,
In PF6,
b j ← (b j EXOR (b {j−jump} × b s )) − p j
b j ← b j EXOR (b j >> 16)
Is assigned. Subscripts are considered as modulo t.
In PF7 and PF8,
b j ← (b j EXOR (b {j−jump} × (b s □ −p j ));
b j ← b j EXOR (b j >>c);
Is assigned. Here, □ is OR for each bit at PF7 and EXOR at PF8. C is 16 for PF7 and 17 for PF8.

(3)PF9
k=2(p+p{t−1})+1 mod 2{32}
としておいて、jump_oddをjump以下の最大の奇数とする。ブロックb,b,…,b{t−1}において、kのビットパターンで1になっているところを、jump_oddとばしに巡回置換する。すなわち、以下の置換を行う。
1)kのビットパターンで1になっている部分に対応するbのビットを抽出し、保存しておく。これは、bとkのビットごとAND演算の結果を保存することと等しい。
2)次に、bにおける上記のビットを、b{−jump_odd}における対応するビットによって置換する。ここで、bの添え字はmodulo tで計算するものとする。
3)次に、b{−jump_odd}における対応するビットを、b{−2jump_odd}に対応するビットによって置換する。このように、玉突き的にb{−j×jump_odd}における対応するビットを、
{−(j+1)×jump_odd}における対応するビットに置換する、という操作をj=0,1,…t−1について行う。
4)最後に、b{−(t+1)×jump_odd}における対応するビットを、保存しておいたbの対応するビットに置換する。
復号化には、上述の処理の逆の操作を行なう逆関数を用いる。
(3) PF9
k = 2 (p 0 + p {t−1} ) +1 mod 2 {32}
Where jump_odd is the largest odd number less than or equal to jump. In block b 0 , b 1 ,..., B {t−1} , the place where k is 1 in the bit pattern is cyclically replaced with jump_odd. That is, the following substitution is performed.
1) The bit b 0 corresponding to the portion that is 1 in the k bit pattern is extracted and stored. This is equivalent to storing the result of the bitwise AND operation of b 0 and k.
2) Next, replace the above bit in b 0 with the corresponding bit in b {-jump_odd} . Here, the subscript of b is calculated as modulo t.
3) Next, replace the corresponding bit in b {-jump_odd} with the bit corresponding to b {-2 jump_odd} . Thus, the corresponding bits in b {−j × jump_odd}
b The operation of replacing with the corresponding bit in {− (j + 1) × jump_odd} is performed for j = 0, 1 ,.
4) Finally, the corresponding bit in b {− (t + 1) × jump_odd} is replaced with the corresponding bit in b 0 that has been saved.
For decoding, an inverse function that performs the reverse operation of the above process is used.

<6.実施形態6>
実施形態6は、実施形態2〜5の各実施形態において、あらかじめ用意した数列(共有鍵)から上述のcryptMT(実施形態1)の方法で生成した暗号学的に安全な擬似乱数列SPNを、これらの実施形態で用いる擬似乱数列PNとする手法である。この手法では、暗号化に用いる関数の選択及び関数のパラメータに暗号学的に安全な擬似乱数列を用いるため、より解読が困難な暗号化を行なうことができる。
<6. Embodiment 6>
In the sixth embodiment, in each of the second to fifth embodiments, a cryptographically secure pseudo-random number sequence SPN generated by the method of the above-described cryptoMT (embodiment 1) from a number sequence (shared key) prepared in advance is used. This is a method of using a pseudo-random number sequence PN used in these embodiments. In this method, encryption that is more difficult to decipher can be performed because a cryptographically secure pseudo-random number sequence is used for selection of a function used for encryption and a parameter of the function.

Claims (10)

あらかじめ与えられた共有鍵で文書を暗号化する暗号化システムであって、
前記文書を記憶している文書記憶手段と、
あらかじめ定めたビット数をワードとして、あらかじめ定めたワード数のブロック単位に、複数種類の関数を実行する関数実行手段と、
前記共有鍵から擬似乱数列を生成する擬似乱数生成手段と、
前記関数実行手段の関数の種類を重複を許して選択する関数選択手段と
あらかじめ初期値を設定した、あらかじめ定めたビット数(ワード)の記憶手段と
を備えており、
前記擬似乱数生成手段は、前記共有鍵から擬似乱数列を生成した後に、該生成した擬似乱数列をワードに切り出して最下位ビットを1にし、前記記憶手段に前記切り出したワードを2のワード長乗を法として繰り返し乗算した結果のビット列の一部または全体を前記擬似乱数列とし、
前記関数選択手段は、前記文書記憶手段からの文書の前記ブロック単位ごとに、前記擬似乱数列により関数を順次選択し、
前記関数実行手段は、前記選択された関数で、前記擬似乱数列のブロックをパラメータとして用いて、前記文書を変換して暗号化すること
を特徴とする暗号化システム。
An encryption system for encrypting a document with a pre-assigned shared key,
Document storage means for storing the document;
Function execution means for executing a plurality of types of functions in units of blocks of a predetermined number of words, with a predetermined number of bits as a word,
Pseudo-random number generation means for generating a pseudo-random number sequence from the shared key;
Function selection means for selecting a function type of the function execution means by allowing duplication ; and
A storage means for storing a predetermined number of bits (words) with an initial value set in advance ,
The pseudo-random number generation means generates a pseudo-random number sequence from the shared key, then cuts the generated pseudo-random number sequence into words, sets the least significant bit to 1, and stores the cut-out word in the storage means with a word length of 2 A part or the whole of a bit string resulting from repeated multiplication using a power as a modulus is the pseudo random number sequence,
The function selection means sequentially selects a function by the pseudo random number sequence for each block unit of the document from the document storage means,
The function execution means converts and encrypts the document using the block of the pseudo-random number sequence as a parameter with the selected function.
請求項1に記載の暗号化システムであって、
前記擬似乱数生成手段は、線形次状態関数を用いて擬似乱数列を生成すること
を特徴とする暗号化システム。
The encryption system according to claim 1,
The pseudorandom number generating means generates a pseudorandom number sequence using a linear order state function.
請求項1又は2に記載の暗号化システムであって、
前記関数選択手段及び前記関数実行手段は、前記ブロックごとに、あらかじめ定めた回数選択・変換を繰り返して、前記文書を暗号化すること
を特徴とする暗号化システム。
The encryption system according to claim 1 or 2 ,
The function selection means and the function execution means encrypt the document by repeating selection / conversion a predetermined number of times for each block.
請求項1〜3のいずれかに記載の暗号化システムであって、
前記関数実行手段は、複数ワードに対するワード間関数を含み、該ワード間関数は、文書を暗号化するごとに、該複数ワードの間隔を変化すること
を特徴とする暗号化システム。
The encryption system according to any one of claims 1 to 3 ,
The function execution means includes an inter-word function for a plurality of words, and the inter-word function changes an interval of the plurality of words every time a document is encrypted.
あらかじめ与えられた共有鍵で暗号化文書を復号する復号化システムであって、
前記暗号化文書を記憶する暗号化文書記憶手段と、
あらかじめ定めたビット数をワードとして、あらかじめ定めたワード数のブロック単位に、暗号化に用いる複数種類の関数に対応する複数種類の逆関数を実行する逆関数実行手段と、
前記共有鍵から擬似乱数列を生成する擬似乱数生成手段と、
前記逆関数実行手段の逆関数の種類を重複を許して選択する逆関数選択手段と
あらかじめ初期値を設定した、あらかじめ定めたビット数(ワード)の記憶手段と
を備えており、
前記擬似乱数生成手段は、前記共有鍵から擬似乱数列を生成した後に、該生成した擬似乱数列をワードに切り出して最下位ビットを1にし、前記記憶手段に前記切り出したワードを2のワード長乗を法として繰り返し乗算した結果のビット列の一部または全体を前記擬似乱数列とし、
前記逆関数選択手段は、前記暗号化文書記憶手段からの暗号化文書の前記ブロック単位ごとに、前記擬似乱数列により逆関数を選択し、
前記逆関数実行手段は、前記選択された逆関数で、前記擬似乱数列のブロックをパラメータとして用いて、前記暗号化文書を変換して復号すること
を特徴とする復号化システム。
A decryption system for decrypting an encrypted document with a shared key given in advance,
Encrypted document storage means for storing the encrypted document;
Inverse function execution means for executing a plurality of types of inverse functions corresponding to a plurality of types of functions used for encryption in units of blocks of a predetermined number of words, with a predetermined number of bits as a word,
Pseudo-random number generation means for generating a pseudo-random number sequence from the shared key;
Inverse function selection means for selecting the type of inverse function of the inverse function execution means while allowing duplication ;
A storage means for storing a predetermined number of bits (words) with an initial value set in advance ,
The pseudo-random number generation means generates a pseudo-random number sequence from the shared key, then cuts the generated pseudo-random number sequence into words, sets the least significant bit to 1, and stores the cut-out word in the storage means with a word length of 2 A part or the whole of a bit string resulting from repeated multiplication using a power as a modulus is the pseudo random number sequence,
The inverse function selection means selects an inverse function from the pseudo-random number sequence for each block unit of the encrypted document from the encrypted document storage means,
The decryption system characterized in that the inverse function executing means transforms and decrypts the encrypted document with the selected inverse function using the block of the pseudo random number sequence as a parameter.
請求項5に記載の復号化システムであって、
前記擬似乱数生成手段は、線形次状態関数を用いて擬似乱数列を生成すること
を特徴とする復号化システム。
The decoding system according to claim 5 , wherein
The pseudorandom number generation means generates a pseudorandom number sequence using a linear order state function.
請求項5又は6に記載の復号化システムであって、
前記逆関数選択手段及び前記逆関数実行手段は、前記ブロックごとに、あらかじめ定めた回数選択・変換を繰り返して、前記暗号化文書を復号すること
を特徴とする復号化システム。
The decoding system according to claim 5 or 6 , comprising:
The decryption system, wherein the inverse function selection unit and the inverse function execution unit decrypt the encrypted document by repeating selection / conversion a predetermined number of times for each block.
請求項5〜7のいずれかに記載の復号化システムであって、
前記逆関数実行手段は、複数ワードに対するワード間逆関数を含み、該ワード間逆関数は、暗号化文書を復号するごとに、該複数ワードの間隔を変化すること
を特徴とする復号化システム。
The decoding system according to any one of claims 5 to 7 ,
The decryption system characterized in that the inverse function execution means includes an inverse function between words for a plurality of words, and the inverse function between words changes an interval of the plurality of words every time the encrypted document is decrypted.
請求項1〜4のいずれかに記載の暗号化システムの機能をコンピュータ・システムに構築させるプログラム。 The program which makes a computer system build the function of the encryption system in any one of Claims 1-4 . 請求項5〜8のいずれかに記載の復号化システムの機能をコンピュータ・システムに構築させるプログラム。 The program which makes a computer system construct | assemble the function of the decoding system in any one of Claims 5-8 .
JP2011061812A 2011-03-19 2011-03-19 Encryption system and decryption system Expired - Fee Related JP5268011B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2011061812A JP5268011B2 (en) 2011-03-19 2011-03-19 Encryption system and decryption system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2011061812A JP5268011B2 (en) 2011-03-19 2011-03-19 Encryption system and decryption system

Related Parent Applications (1)

Application Number Title Priority Date Filing Date
JP2005141725A Division JP4774509B2 (en) 2005-05-13 2005-05-13 Pseudo random number generation system

Publications (2)

Publication Number Publication Date
JP2011145698A JP2011145698A (en) 2011-07-28
JP5268011B2 true JP5268011B2 (en) 2013-08-21

Family

ID=44460530

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2011061812A Expired - Fee Related JP5268011B2 (en) 2011-03-19 2011-03-19 Encryption system and decryption system

Country Status (1)

Country Link
JP (1) JP5268011B2 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111324897B (en) * 2018-12-13 2022-08-09 中国科学院深圳先进技术研究院 Image encryption method and device and image decryption method and device

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP3053106B2 (en) * 1990-11-02 2000-06-19 株式会社日立製作所 Encryption processing device and decryption processing device
JPH10153954A (en) * 1996-11-22 1998-06-09 Nippon Signal Co Ltd:The Ciphering device
JPH1124558A (en) * 1997-06-30 1999-01-29 Nippon Telegr & Teleph Corp <Ntt> Ciphering device
JPH11149367A (en) * 1997-11-19 1999-06-02 Sony Corp Random number generating method, recording medium stored with program for implementing same random number generating method, and random number generating device
US6804354B1 (en) * 1999-12-02 2004-10-12 Honeywell International Inc. Cryptographic isolator using multiplication

Also Published As

Publication number Publication date
JP2011145698A (en) 2011-07-28

Similar Documents

Publication Publication Date Title
JP4774509B2 (en) Pseudo random number generation system
JP5822970B2 (en) Encryption device for pseudo-random generation, data encryption, and message encryption hashing
JP5911654B2 (en) Random number generator and stream cipher
CN113206736A (en) Encryption method based on AES encryption algorithm
EP3371928A1 (en) Key sequence generation for cryptographic operations
Elgeldawi et al. A comparative analysis of symmetric algorithms in cloud computing: a survey
US9391770B2 (en) Method of cryption
Ahmed et al. Strongest AES with S-Boxes bank and dynamic key MDS matrix (SDK-AES)
JP5207153B2 (en) Pseudo random number generation system
CN107493164B (en) DES encryption method and system based on chaotic system
JP5268011B2 (en) Encryption system and decryption system
JP4709685B2 (en) Pseudorandom number generation device, pseudorandom number generation method, pseudorandom number generation program, encryption device, and decryption device
JP5268010B2 (en) Encryption system and decryption system
KR101076747B1 (en) Method and apparatus for random accessible encryption and decryption by using a hierarchical tree structure of stream cipher module
JP2018514816A (en) High-speed AES using a modified key
WO2009104827A1 (en) Method and apparatus for generating key stream for stream cipher, s-box for block cipher and method for substituting input vector using the s-box
JP7406108B2 (en) Encryption/decryption system, encryption/decryption method, and encryption/decryption program
CN115801227B (en) Method and device for generating substitution table
JP4990843B2 (en) Cryptographic operation apparatus, method thereof, and program
KR20010032479A (en) Method for cryptographic conversion of l-bit input blocks of digital data into l-bit output blocks
JP5818768B2 (en) Mask generation apparatus, information processing apparatus, method thereof, and program
TW201528754A (en) Encryption and decryption system and method using chaotic mapping with spatial-temporal perturbation
CN117318986A (en) Data transmission method and system based on multiple encryption
Abubaker Probabilistic, lightweight cryptosystems based on finite automata
Erdem et al. Use of Rijndael Block Cipher on J2ME Devices for encryption and hashing

Legal Events

Date Code Title Description
A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20110413

A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20110413

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20130109

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20130311

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

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20130426

R150 Certificate of patent or registration of utility model

Free format text: JAPANESE INTERMEDIATE CODE: R150

LAPS Cancellation because of no payment of annual fees