JP3275881B2 - Code generation method and apparatus - Google Patents

Code generation method and apparatus

Info

Publication number
JP3275881B2
JP3275881B2 JP20577199A JP20577199A JP3275881B2 JP 3275881 B2 JP3275881 B2 JP 3275881B2 JP 20577199 A JP20577199 A JP 20577199A JP 20577199 A JP20577199 A JP 20577199A JP 3275881 B2 JP3275881 B2 JP 3275881B2
Authority
JP
Japan
Prior art keywords
data
bit
bits
cyclic shift
message
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 - Lifetime
Application number
JP20577199A
Other languages
Japanese (ja)
Other versions
JP2000035755A (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.)
Hitachi Ltd
Original Assignee
Hitachi Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Hitachi Ltd filed Critical Hitachi Ltd
Priority to JP20577199A priority Critical patent/JP3275881B2/en
Publication of JP2000035755A publication Critical patent/JP2000035755A/en
Application granted granted Critical
Publication of JP3275881B2 publication Critical patent/JP3275881B2/en
Anticipated expiration legal-status Critical
Expired - Lifetime legal-status Critical Current

Links

Description

【発明の詳細な説明】DETAILED DESCRIPTION OF THE INVENTION

【0001】[0001]

【発明の属する技術分野】本発明は、コード生成方法及
び装置に関する。
[0001] The present invention relates to a code generation method and apparatus.

【0002】[0002]

【従来の技術】従来の代表的な暗号アルゴリズムとして
は、DES(Data Encryption Standard)とFEAL
(Fast Encryption Standard)が知られており、DES
に関しては例えば、(1)小山他、「現代暗号理論」、
電子通信学会、pp.41〜49、昭和61年9月にお
いて、また、FEALに関しては、(2)清水他、「高
速データ暗号アルゴリズムFEAL」、電子通信学会論
文誌D、Vol.J70−D.7、pp.1413〜
1423、1987年7月において、それぞれ詳細に述
べられている。
2. Description of the Related Art Conventional typical encryption algorithms include DES (Data Encryption Standard) and FEAL.
(Fast Encryption Standard) is known and DES
For example, (1) Koyama et al., "Modern Cryptography",
IEICE, pp. 41-49, September 1986, and regarding FEAL, (2) Shimizu et al., "High-speed Data Encryption Algorithm FEAL", IEICE Transactions D, Vol. J70-D. 7, pp. 1413 ~
1423, July 1987, respectively.

【0003】先ず、DESの処理における非線形の計算
部分、つまりSボックスといわれる処理について説明す
る(上記(1)のp.45、図3−2とp46、図3−
3参照)。32ビットのRは、まず、表1に示す拡大型
転置表によって置き換えられると共に、一部のビットは
重複されて48ビットに拡大されている。
First, a non-linear calculation part in the DES process, that is, a process called an S box will be described (see (1) p. 45, FIGS. 3-2 and p 46, FIG.
3). The 32-bit R is first replaced by the extended transposition table shown in Table 1, and some bits are duplicated and expanded to 48 bits.

【0004】 このようにして得られた48ビットのRは、頭から4ビ
ットごとにその後の2ビットを加えた次のような6ビッ
トずつの8組のブロックを形成している。
[0004] The 48-bit R obtained in this way forms the following eight sets of 6-bit blocks, each of which is obtained by adding the subsequent 2 bits for every 4 bits from the beginning.

【0005】 r31 r1 r2 r3 r4 r5, r4 r5 r6 r7 r8 r9, r8 r9 r10 r11 r12 r13, r12 r13 ……, ……、r28 r29, r28 r29 r30 r31 r32 r1, この48ビットのR’は、同じく48ビットの鍵Kと排
他的論理和の演算を行ない、6ビットずつ8組に分割し
て、S1からS8までの8つのSボックスに入力する。
S1〜S8を選択関数と呼ぶ。これらのSボックスは、
6ビットを入力して4ビットを出力する。
[0005] r31 r1 r2 r3 r4 r5, r4 r5 r6 r7 r8 r9, r8 r9 r10 r11 r12 r13, r12 r13 ......, r28 r29, r28 r29 r30 r31 r32 r31 r32 r31 Similarly, an exclusive OR operation with the 48-bit key K is performed, and the result is divided into eight sets of 6 bits each and input to eight S boxes from S1 to S8.
S1 to S8 are called selection functions. These S boxes are
Input 6 bits and output 4 bits.

【0006】例として、表2に一つのSボックスS1を
取り上げてその換字表を示す。
As an example, Table 2 shows a substitution table for one S box S1.

【0007】 一つのSボックスには、4種類(行番号0,1,2,
3)が用意され、この4種類の換字表のどれを用いるか
は、入力した6ビットのうち最初と最後のビットを用い
て換字表を選ぶ。そして選ばれた換字表にしたがって入
力した6ビットの中央の4ビットが換字される。具体的
な例として、S1に対して2進数の入力パターンが01
1011となっている場合、最初の0と最後の1で表わ
されている01、つまり行1(2進数01は10進数1
であるから)の換字表が選ばれる。次に中央の4ビット
のパターン1101(10進数13)で表わされる列1
3で指定され、この結果行1、列13で指定される値
5、つまり0101が出力されて4ビットの換字パター
ンとなる。DESではこのような処理f(R,K)を用
い一段の処理を構成し、これを16段繰り返す。
[0007] One S box has four types (line numbers 0, 1, 2,
3) is prepared, and the substitution table is selected by using the first and last bits of the input 6 bits to determine which of the four types of substitution table is used. Then, the central 4 bits of the 6 bits input according to the selected substitution table are substituted. As a specific example, the binary input pattern is 01 for S1.
If it is 1011, 01 represented by the first 0 and the last 1, that is, row 1 (binary 01 is decimal 1
) Is selected. Next, a column 1 represented by a central 4-bit pattern 1101 (decimal 13)
3 is output, and as a result, the value 5 specified in the row 1 and the column 13, that is, 0101 is output to form a 4-bit substitution pattern. In the DES, a single-stage process is configured using such a process f (R, K), and this is repeated 16 stages.

【0008】上記の処理例に見られるように、DESは
1ビット単位の処理が基本になっている。
As can be seen from the above processing example, DES is based on 1-bit unit processing.

【0009】次にFEALの処理における非線形の計算
部分、つまり、関数Sを含んでいる部分について説明す
る(上記(2)のp.1416,図4及び図5参照)。
FEALの非線形部はDESの非線形部に比べ、数学的
な記述が簡単である。32ビットデータαは8ビットの
データα0,α1,α2,α3にそれぞれ分割された
後、8ビットの単位として、鍵データと排他的論理和が
とられる。その後、所定の関数Sによる処理が実行され
る。
Next, a non-linear calculation part in the FEAL processing, that is, a part including the function S will be described (see p. 1416 of the above (2), FIGS. 4 and 5).
The non-linear part of FEAL is easier to describe mathematically than the non-linear part of DES. The 32-bit data α is divided into 8-bit data α0, α1, α2, and α3, respectively, and exclusive-ORed with the key data in 8-bit units. After that, processing by a predetermined function S is performed.

【0010】 関数S:S(x1+x2+δ)=Rot2(w) ただし、w=(x1+x2+δ)mod256 δ=0または1(定数) この処理f(α,β)を用い、一段の処理を構成し、こ
れが8段繰り返される。上記の処理に見られるように、
FEALは8ビット単位の処理が基本になっている。
Function S: S (x1 + x2 + δ) = Rot2 (w) where w = (x1 + x2 + δ) mod 256 δ = 0 or 1 (constant) Using this process f (α, β), a one-stage process is configured. Repeated eight steps. As seen in the above process,
FEAL is based on 8-bit processing.

【0011】[0011]

【発明が解決しようとする課題】情報処理と通信技術の
進歩によるコンピュータ・ネットワークの普及化、大衆
化に伴い、データの不正使用や奪取等に対する情報セキ
ュリティを確保するため、伝送路上のデータやコンピュ
ータに蓄積されたデータを暗号化することは有効な対策
であると考えられる。
With the spread and widespread use of computer networks due to advances in information processing and communication technology, data and computers on transmission lines are required to secure information security against unauthorized use or capture of data. It is considered that encrypting the data stored in the server is an effective countermeasure.

【0012】昭和52年に、米国商務省標準局が暗号ア
ルゴリズムの標準として制定したDESは、データの暗
号化を行う一つの手段である。
DES, established in 1982 by the United States Department of Commerce as a standard for encryption algorithms, is one means of encrypting data.

【0013】ところが、DESはビット単位での処理が
たいへん多いため、バイト単位の処理を基調とするマイ
クロコンピュータのソフトで実現しようとすると、処理
に時間がかかり、実用的な速度が得られなかった。
[0013] However, since DES performs a great deal of processing in bit units, it takes a long time to implement it with microcomputer software based on byte processing, and a practical speed cannot be obtained. .

【0014】この問題に対し、上記FEALは、1バイ
ト(8ビット)単位の処理を基調とするため、8ビット
マイクロコンピュータで実現する場合、DESに比べ数
倍以上の高速化を達成することができた。FEALによ
り、8ビットマイクロコンピュータのソフトを用いてあ
る程度実用的な速度が得られるようになったと考えられ
る。
In order to solve this problem, the FEAL is based on processing in units of 1 byte (8 bits). Therefore, when the FEAL is realized by an 8-bit microcomputer, it is possible to achieve speedup several times or more as compared with DES. did it. It is considered that FEAL has made it possible to obtain a practical speed to some extent using software of an 8-bit microcomputer.

【0015】しかし、最近のマイクロエレクトロニクス
の技術の進歩によって、8ビットマイクロコンピュータ
よりも16ビットマイクロコンピュータ、さらに、16
ビットマイクロコンピュータよりも32ビットマイクロ
コンピュータが使われ出している。近い将来、32ビッ
トマイクロコンピュータが使われる割合がたいへん大き
くなると予想されている。32ビットマイクロコンピュ
ータの時代になると、さらに高速の暗号処理が要求され
るものと予想される。ところが、32ビットマイクロコ
ンピュータは4バイト基調の処理を行うため、1バイト
基調の8ビットマイクロコンピュータ用に設計されたF
EALを32ビットマイクロコンピュータで実現しよう
とすると非効率であった。
However, with recent advances in microelectronics technology, 16-bit microcomputers have been replaced by 8-bit microcomputers,
32-bit microcomputers have been used rather than bit microcomputers. It is anticipated that the use of 32-bit microcomputers will increase significantly in the near future. In the era of 32-bit microcomputers, higher-speed encryption processing is expected to be required. However, since a 32-bit microcomputer performs processing based on 4-byte data, an F designed for an 8-bit microcomputer based on 1-byte data is used.
Attempting to implement the EAL with a 32-bit microcomputer was inefficient.

【0016】そこで、32ビットマイクロコンピュータ
向けの4バイト基調の処理を行う暗号アルゴリズムが望
まれていた。
Therefore, there has been a demand for an encryption algorithm for a 32-bit microcomputer that performs a 4-byte key processing.

【0017】本発明の目的は、32ビット単位で処理可
能な演算器において好適な暗号化を行う暗号化装置を提
供することにある。
An object of the present invention is to provide an encryption device that performs suitable encryption in an arithmetic unit capable of processing in 32-bit units.

【0018】[0018]

【課題を解決するための手段】上記の問題点を解決する
ため、次の手段を用いる。
To solve the above problems, the following means are used.

【0019】すなわち、メッセージから各々がnビット
長の鍵データK2、K3を切り出し、A,Bを各々nビ
ット長のデータとし、π3(A,B)をnビット長のデ
ータAと、Aと鍵データK2との第1の加法演算を行な
い、当該第1の加法演算から得られるデータに対して第
1のビット数での循環シフトを行ない、当該第1のビッ
ト数での循環シフトから得られるデータに対して鍵デー
タK3との第2の加法演算を行ない、当該第2の加法演
算から得られるデータに対して第1と異なる第2のビッ
ト数での循環シフトを行ない、さらに当該第2のビット
数での循環シフトから得られるデータとBとの第3の加
法演算を行なったnビット長のデータとの組を出力する
関数とし、2つのnビット長のデータからなる初期値に
対して、メッセージから切り出し演算器に接続されたレ
ジスタに保持される鍵データK2、K3を用いて、関数
π3で規定される演算を含む処理を加法演算は加法命令
を用いて、循環シフトは循環シフト命令を用いて前記演
算器により実行した結果得られる2つのnビット長のデ
ータにより2nビット長のコードを生成する。
That is, key data K2 and K3 each having an n-bit length are cut out from the message, A and B are each data having an n-bit length, and π3 (A, B) is data A having an n-bit length and A and The first addition operation with the key data K2 is performed, the data obtained from the first addition operation is subjected to a cyclic shift by the first number of bits, and the data obtained from the cyclic shift by the first number of bits is performed. A second addition operation with the key data K3 is performed on the obtained data, a cyclic shift is performed on the data obtained from the second addition operation with a second number of bits different from the first, and the second addition operation is further performed. A function that outputs a set of data obtained from the cyclic shift with the number of bits of 2 and n-bit data obtained by performing a third addition operation on B is defined as an initial value consisting of two n-bit data. In contrast, a message Using key data K2 and K3 held in a register connected to a computing unit, processing including an operation defined by a function π3 is performed using an additive instruction, and a cyclic shift is performed using a cyclic shift instruction. Then, a 2n-bit length code is generated from two n-bit length data obtained as a result of execution by the arithmetic unit.

【0020】これにより、32ビットマイクロコンピュ
ータを用いて、1回の基本命令で32ビットのデータが
換字または転置されるので、コード生成を高速に行うこ
とができる。
As a result, since 32-bit data is replaced or transposed by one basic instruction using a 32-bit microcomputer, code can be generated at high speed.

【0021】[0021]

【発明の実施の形態】(1)第1の実施例 図1は、本発明の一実施例である。DESCRIPTION OF THE PREFERRED EMBODIMENTS (1) First Embodiment FIG. 1 shows an embodiment of the present invention.

【0022】図1において、64ビットの平文101と
64ビット×4=256ビットの鍵データ100が32
ビットマイクロコンピュータに入力され、その後、プロ
グラム103内の命令の順に32ビットマイクロコンピ
ュータ102において暗号変換され、その結果として6
4ビットの暗号文104が出力される。
In FIG. 1, a 64-bit plaintext 101 and 64 bits × 4 = 256 bits of key data 100 are 32 bits.
Input to the 32-bit microcomputer 102, and thereafter, are cryptographically converted by the 32-bit microcomputer 102 in the order of the instructions in the program 103.
The 4-bit ciphertext 104 is output.

【0023】図2は、図1の32ビットマイクロコンピ
ュータ102とプログラム103において実行される暗
号変換処理のフローを示している。
FIG. 2 shows a flow of a cryptographic conversion process executed by the 32-bit microcomputer 102 and the program 103 in FIG.

【0024】201:入力されたデータMは上位32ビ
ットM1と下位32ビットM2に分割される。
201: Input data M is divided into upper 32 bits M1 and lower 32 bits M2.

【0025】202:M1とM2のビット対応の排他的
論和がとられる。
202: An exclusive OR operation corresponding to the bits of M1 and M2 is performed.

【0026】WORK2 ← M1 (+) M2 以下、(+)は同様の処理を示すものとする。なお、図
中では、排他的論理和は、○と+とを重ね合わせた記号
で示している。
WORK2 ← M1 (+) M2 Hereinafter, (+) indicates the same processing. In the figure, the exclusive OR is indicated by a symbol obtained by superimposing ○ and +.

【0027】203:WORK2と鍵データK1のモジ
ュロ加算が行われる。
203: Modulo addition of WORK2 and key data K1 is performed.

【0028】x ← WORK2 + K1 ここに、x+K1はxとK1の和を232で割った余り
をとるという、232を法としたモジュロ加算を示して
いる。
X ← WORK2 + K1 Here, x + K1 indicates a modulo addition modulo 232, that is, a remainder obtained by dividing the sum of x and K1 by 232.

【0029】以下、+は同様の処理を示すものとする。Hereinafter, + indicates the same processing.

【0030】204:xを左へ2ビット循環シフトした
後、そのデータとxと1のモジュロ加算をとる。
204: After x is cyclically shifted to the left by 2 bits, modulo addition of the data and x and 1 is performed.

【0031】x ← Rot2(x)+x+1 以下、Rot2は同様の処理を示すものとする。X ← Rot2 (x) + x + 1 Hereinafter, Rot2 indicates the same processing.

【0032】105:xを左へ4ビット循環シフトした
後、そのデータとxとの排他的論理和をとる。
105: After x is cyclically shifted to the left by 4 bits, the exclusive OR of the data and x is calculated.

【0033】x←Rot4(x)(+)x 以下、Rot4は同様の処理を示すものとする。X ← Rot4 (x) (+) x Hereinafter, Rot4 indicates the same processing.

【0034】 206:WORK1←x(+)M1 207:x←x+K2 208:x←Rot2(x)+x+1 y←x 209:x←Rot3(x)(+)x ここに、Rot3(x)はxを左へ8ビット循環シフト
させることを示す。
206: WORK1 ← x (+) M1 207: x ← x + K2 208: x ← Rot2 (x) + x + 1 y ← x 209: x ← Rot3 (x) (+) x Here, Rot3 (x) is x Is cyclically shifted left by 8 bits.

【0035】 210:x←x+K3 211:x←Rot2(x)+x+1 212:x←Rot16(x)+(x∧y) ここに、Rot16(x)はxを左へ16ビット循環シ
フトすることを示す。また、x∧yはxとyとのビット
対応の論理積をとることを示す。
210: x ← x + K3 211: x ← Rot2 (x) + x + 1 212: x ← Rot16 (x) + (x∧y) where Rot16 (x) shifts x to the left by 16 bits. Show. In addition, x∧y indicates that a logical AND of x and y corresponding to bits is taken.

【0036】 213:WORK2←x(+)WORK2 214:x←WORK2+K4 215:x←Rot2(x)+x 216:WORK1←WORK1(+)x 217:WORK2←WORK2(+)WORK1 218:WORK1を出力データの上位32ビット、W
ORK2を出力データの下位32ビットとして出力す
る。
213: WORK2 ← x (+) WORK2 214: x ← WORK2 + K4 215: x ← Rot2 (x) + x 216: WORK1 ← WORK1 (+) x 217: WORK2 ← WORK2 (+) WORK1 218: Output data of WORK1 Upper 32 bits of W
ORK2 is output as the lower 32 bits of the output data.

【0037】以上、図2に示すように関数π1〜π4を
定義すると、本実施例は、 C=π1・π4・π3・π2・π1(M) というように合成関数で表すことができる。
As described above, when the functions π1 to π4 are defined as shown in FIG. 2, this embodiment can be expressed by a composite function as C = π1, π4, π3, π2, π1 (M).

【0038】関数πi・πi(i=1〜4)はすべて、 πi・πi(x)=x というように同じ関数変換を2回繰り返すとともに戻る
という性質がある。
All functions πi · πi (i = 1 to 4) have the property of repeating the same function conversion twice and returning as πi · πi (x) = x.

【0039】したがって、復号関数として、 M=π1・π2・π3・π4・π1(C) を用いれば、暗号文Cをもとの平文Mに戻すことができ
る。
Therefore, if M = π1, π2, π3, π4, π1 (C) is used as the decryption function, the ciphertext C can be returned to the original plaintext M.

【0040】(2)実施例の変形例1 上記実施例における変換関数π1からπ4までにあたる
処理を2回繰り返したものを暗号変換として用いてもよ
い、すなわち、暗号変換を、 C=π1・π4・π3・π2・π1・π4・π3・π2
・π1(M) としてもよい。
(2) Modification Example 1 of Embodiment A process obtained by repeating the process corresponding to the conversion functions π1 to π4 twice in the above embodiment may be used as the cryptographic conversion. That is, the cryptographic conversion is performed by C = π1 · π4.・ Π3 ・ π2 ・ π1 ・ π4 ・ π3 ・ π2
・ It may be π1 (M).

【0041】このとき、復号変換の式は M=π1・π2・π3・π4・π1・π2・π3・π4
・π1(C) である。
At this time, the equation of the decoding conversion is M = π1, π2, π3, π4, π1, π2, π3, π4.
Π1 (C)

【0042】同様に、一般に本実施例をn回繰り返した
ものを暗号変換としてもよい。
Similarly, in general, what is obtained by repeating this embodiment n times may be used as encryption conversion.

【0043】(3)実施例の変形例2 図4は、本発明の他の実施例である。(3) Second Modified Example of Embodiment FIG. 4 shows another embodiment of the present invention.

【0044】401:入力されたデータMは上位16ビ
ットM1と下位16ビットM2に分割される。
401: Input data M is divided into upper 16 bits M1 and lower 16 bits M2.

【0045】402:M1とM2のビット対応の排他的
論理和がとられる。
402: The exclusive OR of the bits of M1 and M2 is calculated.

【0046】WORK2←M1+M2 以下、+は同様の処理を示すものとする。WORK2 ← M1 + M2 Hereinafter, + indicates the same processing.

【0047】403:xと鍵データK1のモジュロ減算
が行われる。
403: Modulo subtraction of x and key data K1 is performed.

【0048】x←x−K1 ここに、x−K1はxとK1の差を216で割った余り
をとるという、216を法としたモジュロ減算を示して
いる。
X ← x−K1 Here, x−K1 indicates a modulo subtraction modulo 216, that is, the remainder obtained by dividing the difference between x and K1 by 216.

【0049】以下、−は同様の処理を示すものとする。Hereinafter, "-" indicates the same processing.

【0050】404:xを左へ2ビット循環シフトした
後、そのデータと1のモジュロ減算を行う。
404: After cyclically shifting x by 2 bits to the left, modulo subtraction of the data and 1 is performed.

【0051】x←Rot(x)−x−1 以下、Rot2は同様の処理を示すものとする。X ← Rot (x) −x−1 Hereinafter, Rot2 indicates the same processing.

【0052】405:xを左4ビット循環シフトした
後、そのデータとxとの排他的論理和をとる。
405: After x is cyclically shifted left by 4 bits, exclusive OR of the data and x is obtained.

【0053】x←Rot4(x)(+)x 以下、Rot4は同様の処理を示すものとする。X ← Rot4 (x) (+) x Hereinafter, Rot4 indicates the same processing.

【0054】 406:WORK1←x(+)M1 407:x←x−K2y←x 408:x←Rot2(x)−x−1 409:Rot8(x)−(x∧y) ここに、Rot8(x)はxを左へ8ビット循環シフト
することを示す。また、x∧yはxとyとのビット対応
の論理積をとることを示す。
406: WORK1 ← x (+) M1 407: x ← x−K2y ← x 408: x ← Rot2 (x) −x−1 409: Rot8 (x) − (x∧y) Here, Rot8 ( x) indicates that x is cyclically shifted left by 8 bits. In addition, x∧y indicates that a logical AND of x and y corresponding to bits is taken.

【0055】 410:WORK2←x(+)WORK2 411:x←WORK2−K3 412:x←Rot2(x)−x−1 413:WORK1←WORK1(+)x 414:WORK2←WORK2(+)WORK1 415:WORK1を出力データの上位16ビット、W
ORK2を出力データの下位16ビットとして出力す
る。
410: WORK2 ← x (+) WORK2 411: x ← WORK2-K3 412: x ← Rot2 (x) −x−1 413: WORK1 ← WORK1 (+) x 414: WORK2 ← WORK2 (+) WORK1 415 : WORK1 as upper 16 bits of output data, W
ORK2 is output as the lower 16 bits of the output data.

【0056】(4)実施例の変形例3 図5は、本発明の他の実施例である。(4) Third Modification of Embodiment FIG. 5 shows another embodiment of the present invention.

【0057】501:入力されたデータMは上位8ビッ
トM1と下位8ビットM2に分割される。
501: Input data M is divided into upper 8 bits M1 and lower 8 bits M2.

【0058】502:M1とM2のビット対応の排他的
論和がとられる。
502: An exclusive OR operation corresponding to the bits of M1 and M2 is performed.

【0059】WORK2←M1(+)M2 以下、+は同様の処理を示すものとする。WORK2 ← M1 (+) M2 Hereinafter, + indicates the same processing.

【0060】503:xと鍵データK1のモジュロ加算
が行われる。
503: Modulo addition of x and key data K1 is performed.

【0061】x←WORK2+K1 y←x ここに、x+K1はxとK1の差を28で割った余りを
とるという、28を法としたモジュロ加算を示してい
る。
X ← WORK2 + K1 y ← x Here, x + K1 indicates a modulo addition modulo 28 in which the difference between x and K1 is divided by 28.

【0062】以下、+は同様の処理を示すものとする。Hereinafter, + indicates the same processing.

【0063】504:xを左へ2ビット循環シフトした
後、そのデータとxと1のモジュロ加算を行う。
504: After shifting x by 2 bits to the left, modulo addition of the data and x and 1 is performed.

【0064】x←Rot2(x)+x+1 以下、Rot2は同様の処理を示すものとする。X ← Rot2 (x) + x + 1 Hereinafter, Rot2 indicates the same processing.

【0065】 505:x←Rot4(x)+(x∧y) ここに、Rot4(x)はxを左へ4ビット循環シフト
することを示す。また、x∧yはxとyとのビット対応
の論理積をとることを示す。
505: x ← Rot4 (x) + (x∧y) Here, Rot4 (x) indicates that x is cyclically shifted left by 4 bits. In addition, x∧y indicates that a logical AND of x and y corresponding to bits is taken.

【0066】 506:WORK1←WORK1(+)x 507:x←WORK1+K2 508:x←Rot4(x)+x+1 509:WORK2←WORK2(+)x 510:WORK1←WORK1(+)WORK2 511:WORK1を出力データの上位8ビット、WO
RK2を出力データの下位8ビットとして出力する。
506: WORK1 ← WORK1 (+) x 507: x ← WORK1 + K2 508: x ← Rot4 (x) + x + 1 509: WORK2 ← WORK2 (+) x 510: WORK1 ← WORK1 (+) WORK2 511: Output WORK1 Upper 8 bits of WO
RK2 is output as the lower 8 bits of the output data.

【0067】(5)実施例の変形例4 図6は本発明の他の一実施例である。(5) Fourth Modified Example of Embodiment FIG. 6 shows another embodiment of the present invention.

【0068】(1)認証を行うメッセージ62を鍵デー
タとして、任意の初期値61を本発明によるアルゴリズ
ム63を用いて暗号化する。
(1) Using a message 62 for performing authentication as key data, an arbitrary initial value 61 is encrypted using an algorithm 63 according to the present invention.

【0069】(2)暗号結果64を、(1)において用
いたメッセージの続きのデータにより再び暗号化し、メ
ッセージの終わりまでこの操作を繰り返す。
(2) The encryption result 64 is encrypted again with the subsequent data of the message used in (1), and this operation is repeated until the end of the message.

【0070】(3)最終的な暗号結果をメッセージ認証
コード65として出力する。
(3) The final encryption result is output as the message authentication code 65.

【0071】(6)実施例の変形例5 図7は本発明の他の実施例である。本ICカードは、メ
ッセージの認証コードを生成する。
(6) Fifth Modification of Embodiment FIG. 7 shows another embodiment of the present invention. This IC card generates an authentication code of the message.

【0072】(1)メッセージの認証を行うために必要
な初期値76をI/O74を通して、ICカード71内
のマイクロコンピュータ72に送信する。
(1) An initial value 76 necessary for message authentication is transmitted to the microcomputer 72 in the IC card 71 through the I / O 74.

【0073】(2)認証を行うメッセージ77を(1)
と同様にマイクロコンピュータ72に順次送信し、マイ
クロコンピュータ72は、メモリ73に記憶されている
暗号ソフト75により認証コード78を生成する。
(2) A message 77 for performing authentication is sent to (1)
The microcomputer 72 generates the authentication code 78 using the encryption software 75 stored in the memory 73 in the same manner as described above.

【0074】本実施例は、図3にしめすような換字、転
置の繰返しを行っている。
In this embodiment, substitution and transposition are repeated as shown in FIG.

【0075】つまり、図2に示す実施例、(203、2
04)、(207、208)、(210、211)、
(214、215)の処理は、 x←x+Ki x←Rot2(x)+(x)+1 の形となっており、これは、それぞれ、32ビットのデ
ータを4ビットずつのブロックに分割したとき、各ブロ
ック単位の換字処理を、上記2回のデータ変換により8
ブロック分一斉に行っていると見ることができる。
That is, in the embodiment shown in FIG.
04), (207, 208), (210, 211),
The processing of (214, 215) has the form of x ← x + Kix ← Rot2 (x) + (x) +1, which is obtained by dividing 32-bit data into blocks each having 4 bits. Substitution processing for each block is performed by the above two data conversions.
It can be seen that they are going all at once for the block.

【0076】ここに、4ビットのブロックデータ A=(a1,a2,a3,a4)、ただし、 ai=1 or 0(i=1〜4) が、 B=(b1,b2,b3,b4)、ただし、 bi=1 or 0(i=1〜4) に換字変換されるということは、ブール代数の演算f
1、f2、f3、f4が存在して、 b1=f1(a1,a2,a3,a4) b2=f2(a1,a2,a3,a4) b3=f3(a1,a2,a3,a4) b4=f4(a1,a2,a3,a4) となることを示す。
Here, 4-bit block data A = (a1, a2, a3, a4), where ai = 1 or 0 (i = 1 to 4), B = (b1, b2, b3, b4) However, the fact that the conversion is made to bi = 1 or 0 (i = 1 to 4) means that the Boolean algebra operation f
1, f2, f3, and f4 exist; b1 = f1 (a1, a2, a3, a4) b2 = f2 (a1, a2, a3, a4) b3 = f3 (a1, a2, a3, a4) b4 = f4 (a1, a2, a3, a4).

【0077】また、図2の205、209、212はそ
れぞれ、 (1)x←Rot4(x)(+)x (2)x←Rot8(x)(+)x (3)x←Rot16(x)+(x∧y) の処理を行っており、これらは、それぞれ、(1)4ビ
ット左循環シフトを行うという転置を行った後、さらに
換字を行うという処理、(2)8ビット左循環シフトを
行うという転置を行った後、さらに換字を行うという処
理、(3)16ビット左循環シフトを行うという処理を
示している。
Further, 205, 209 and 212 in FIG. 2 are (1) x ← Rot4 (x) (+) x (2) x ← Rot8 (x) (+) x (3) x ← Rot16 (x ) + (X∧y), which are (1) transposed to perform a 4-bit left circular shift and then further substituted, (2) 8-bit left circular The figure shows a process of performing a transposition after performing a transposition of performing a shift, and a process of performing (3) a 16-bit left circular shift.

【0078】図3から明らかなように、最初の32ビッ
トのデータのうち、いかなるビットの変化も最後の32
ビットのデータすべてに影響を与えることが分かる。
As is apparent from FIG. 3, any bit change in the first 32 bits of data is the last 32 bits.
It can be seen that all bits of data are affected.

【0079】[0079]

【発明の効果】これにより、本実施例は、高度なランダ
ム性を持つ暗号変換を効率良く行うという効果が得られ
ることが分かる。
As a result, it can be seen that the present embodiment has an effect of efficiently performing encryption conversion having a high degree of randomness.

【図面の簡単な説明】[Brief description of the drawings]

【図1】本発明を実施する暗号変換装置の一実施例。FIG. 1 shows an embodiment of a cryptographic conversion device for implementing the present invention.

【図2】図1における暗号変換の詳細を示すフローチャ
ート。
FIG. 2 is a flowchart showing details of encryption conversion in FIG. 1;

【図3】本発明の実施例が効率的に換字変換、転置変換
を繰り返していることを示す説明図。
FIG. 3 is an explanatory diagram showing that the embodiment of the present invention efficiently repeats substitution conversion and transposition conversion.

【図4】16ビットマイクロコンピュータを用いた場合
の暗号変換の詳細を示すフローチャート。
FIG. 4 is a flowchart showing details of cryptographic conversion when a 16-bit microcomputer is used.

【図5】8ビットマイクロコンピュータを用いた場合の
暗号変換の詳細を示すフローチャート。
FIG. 5 is a flowchart showing details of encryption conversion when an 8-bit microcomputer is used.

【図6】本発明による暗号アルゴリズムを用いてメッセ
ージ認証コードを生成する方法を示すフローチャート。
FIG. 6 is a flowchart illustrating a method for generating a message authentication code using a cryptographic algorithm according to the present invention.

【図7】本発明による暗号アルゴリズムを用いてメッセ
ージ認証コードを生成するICカードの構成図である。
FIG. 7 is a configuration diagram of an IC card that generates a message authentication code using an encryption algorithm according to the present invention.

【符号の説明】[Explanation of symbols]

100:鍵データ、101:平文、102:32ビット
マイクロコンピュータ、103:プログラム、104:
暗号文。
100: key data, 101: plaintext, 102: 32-bit microcomputer, 103: program, 104:
Cryptogram.

───────────────────────────────────────────────────── フロントページの続き (72)発明者 佐々木 良一 神奈川県川崎市麻生区王禅寺1099番地株 式会社日立製作所 システム開発研究所 内 (56)参考文献 特開 昭63−58538(JP,A) D.W.Davies and W. L.Price 著/上園忠宏 監訳, ネットワーク・セキュリティ,日本,日 経マグロウヒル社,1985年12月 5日, 1版1刷,p.57−58 H.Feistel,Cryptog raphy and Computer Privacy,米国,Scient ific American,Vol. 228,No.5,p.15−23 (58)調査した分野(Int.Cl.7,DB名) G09C 1/00 ──────────────────────────────────────────────────続 き Continuation of the front page (72) Inventor Ryoichi Sasaki 1099 Ozenji Temple, Aso-ku, Kawasaki City, Kanagawa Prefecture, Ltd. System Development Laboratory, Hitachi, Ltd. (56) References JP-A-63-58538 (JP, A) D . W. Davies and W. L. Price / Translated by Tadahiro Kamizono, Network Security, Japan, Nikkei McGraw-Hill, December 5, 1985, 1st edition, 1st press, p. 57-58H. Feistel, Cryptography and Computer Privacy, USA, Scientific American, Vol. 5, p. 15-23 (58) Field surveyed (Int. Cl. 7 , DB name) G09C 1/00

Claims (2)

(57)【特許請求の範囲】(57) [Claims] 【請求項1】64ビット長の初期値をメッセージを用い
て、2つの32ビット長のデータの加法演算を1命令の
加法命令で実行可能であり、1つの32ビット長のデー
タをmビット循環シフトする演算を1命令の循環シフト
命令で実行可能である32ビット単位で処理可能な演算
器により64ビット長のコードに変換するコード生成方
法であって、メッセージ記憶手段に記憶されている前記メッセージか
各々が32ビット長の鍵データK2、K3を切り出
し、 A,Bを各々32ビット長のデータとし、 π3(A,B)を32ビット長のデータAと、Aと鍵デ
ータK2との第1の加法演算を行ない、当該第1の加法
演算から得られるデータに対して第1のビット数での循
環シフトを行ない、当該第1のビット数での循環シフト
から得られるデータに対して鍵データK3との第2の加
法演算を行ない、当該第2の加法演算から得られるデー
タに対して第1と異なる第2のビット数での循環シフト
を行ない、さらに当該第2のビット数での循環シフトか
ら得られるデータとBとの第3の加法演算を行なった
ビット長のデータとの組を出力する関数とし、 2つの32ビット長のデータからなる前記初期値に対し
て、前記メッセージから切り出した鍵データK2、K3
を用いて、関数π3で規定される演算を含む処理を加法
演算は前記加法命令を用いて、循環シフトは前記循環シ
フト命令を用いて前記演算器により実行した結果得られ
る2つの32ビット長のデータにより前記64ビット長
のコードを生成することを特徴とするコード生成方法。
1. An addition operation of two 32- bit data can be executed by an addition instruction of one instruction by using a message as an initial value of a 64- bit length, and one 32- bit data is circulated by m bits. A code generation method for converting a shift operation into a 64- bit length code by an arithmetic unit capable of processing in 32-bit units, which can be executed by one circular shift instruction, wherein the message stored in a message storage means is provided. Or
Luo each cut out key data K2, K3 of 32-bit length, A, B and each 32-bit data, π3 (A, B) and a 32-bit data A, first of A and the key data K2 1 is performed, the data obtained from the first addition is subjected to a cyclic shift by a first number of bits, and the data obtained from the cyclic shift by the first number of bits is subjected to a key. A second addition operation with the data K3 is performed, a cyclic shift is performed on the data obtained from the second addition operation with a second number of bits different from the first, and further, the data is obtained with the second number of bits. 3 was subjected to the third addition operation between data and B obtained from the cyclic shift
A function for outputting a set of 2- bit data is used as a function. The key data K2 and K3 cut out from the message are compared with the initial value consisting of two 32- bit data.
With, the addition operation processing including operations defined by the function π3 using the additive instruction, cyclic shift of the two 32-bit length obtained as a result of executing by the arithmetic unit using the cyclic shift instruction A code generation method, comprising: generating the 64- bit length code from data.
【請求項2】64ビット長の初期値をメッセージを用い
て、64ビット長のコードに変換する32ビット単位で
処理可能な演算器を有するコード生成装置であって、 前記メッセージから各々が32ビット長の鍵データK
2、K3を切り出す切り出し手段と、 A,Bを各々32ビット長のデータとし、 π3(A,B)を32ビット長のデータAと、Aと鍵デ
ータK2との第1の加法演算を行ない、当該第1の加法
演算から得られるデータに対して第1のビット数での循
環シフトを行ない、当該第1のビット数での循環シフト
から得られるデータに対して鍵データK3との第2の加
法演算を行ない、当該第2の加法演算から得られるデー
タに対して第1と異なる第2のビット数での循環シフト
を行ない、さらに当該第2のビット数での循環シフトか
ら得られるデータとBとの第3の加法演算を行なった
ビット長のデータとの組を出力する関数とし、 2つの32ビット長のデータからなる前記初期値に対し
て、前記切り出し手段により前記メッセージから切り出
した鍵データK2、K3を用いて、関数π3で規定され
る演算を含む処理を実行した結果得られる2つの32
ット長のデータにより前記64ビット長のコードを生成
する手段とを有することを特徴とするコード生成装置。
2. A 32-bit unit for converting a 64- bit length initial value into a 64- bit length code using a message.
A code generating device having a processable calculator, key data K of each 32 bits long from the message
2. A cutout means for cutting out K3, A and B each being 32- bit data, and π3 (A, B) being a 32- bit data A, and performing a first addition operation of A and key data K2. Performs a cyclic shift by a first number of bits on data obtained from the first addition operation, and performs a second shift of key data K3 on data obtained from the circular shift by the first number of bits. Is performed, the data obtained from the second addition operation is subjected to a cyclic shift with a second number of bits different from the first, and the data obtained from the cyclic shift with the second number of bits is further performed. And a third addition operation of B and 3
A function that outputs a set of 2- bit data is used as a function. The key data K2 and K3 cut out from the message by the cut-out means are used for a function π3 with respect to the two initial values consisting of 32- bit data. Means for generating the 64- bit length code from two 32- bit length data obtained as a result of executing a process including an operation defined by the following.
JP20577199A 1988-04-28 1988-04-28 Code generation method and apparatus Expired - Lifetime JP3275881B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP20577199A JP3275881B2 (en) 1988-04-28 1988-04-28 Code generation method and apparatus

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
JP20577199A JP3275881B2 (en) 1988-04-28 1988-04-28 Code generation method and apparatus
JP9329841A JP2980085B2 (en) 1988-04-28 1988-04-28 Encryption method and decryption method

Related Parent Applications (1)

Application Number Title Priority Date Filing Date
JP9329841A Division JP2980085B2 (en) 1988-04-28 1988-04-28 Encryption method and decryption method

Publications (2)

Publication Number Publication Date
JP2000035755A JP2000035755A (en) 2000-02-02
JP3275881B2 true JP3275881B2 (en) 2002-04-22

Family

ID=18225838

Family Applications (11)

Application Number Title Priority Date Filing Date
JP9329844A Expired - Lifetime JP2798087B2 (en) 1988-04-28 1988-04-28 Cryptographic converter
JP9329845A Expired - Lifetime JP2870532B2 (en) 1988-04-28 1988-04-28 Cryptographic converter
JP11205770A Pending JP2000035756A (en) 1988-04-28 1988-04-28 Encryption apparatus
JP9329841A Expired - Lifetime JP2980085B2 (en) 1988-04-28 1988-04-28 Encryption method and decryption method
JP2001310859A Pending JP2002182558A (en) 1988-04-28 1988-04-28 Information processor, computer program product, code generating method, and ic card
JP9329843A Expired - Lifetime JP2870531B2 (en) 1988-04-28 1988-04-28 Encryption and decryption device
JP20577199A Expired - Lifetime JP3275881B2 (en) 1988-04-28 1988-04-28 Code generation method and apparatus
JP9329842A Expired - Lifetime JP2798086B2 (en) 1988-04-28 1988-04-28 Encryption and decryption device
JP9329846A Expired - Lifetime JP2993487B2 (en) 1988-04-28 1997-04-28 Information processing apparatus, IC card, and code generation method
JP22132098A Expired - Lifetime JP3277894B2 (en) 1988-04-28 1998-08-05 Information processing apparatus and code generation method
JP10221319A Pending JPH11109851A (en) 1988-04-28 1998-08-05 Computer program product

Family Applications Before (6)

Application Number Title Priority Date Filing Date
JP9329844A Expired - Lifetime JP2798087B2 (en) 1988-04-28 1988-04-28 Cryptographic converter
JP9329845A Expired - Lifetime JP2870532B2 (en) 1988-04-28 1988-04-28 Cryptographic converter
JP11205770A Pending JP2000035756A (en) 1988-04-28 1988-04-28 Encryption apparatus
JP9329841A Expired - Lifetime JP2980085B2 (en) 1988-04-28 1988-04-28 Encryption method and decryption method
JP2001310859A Pending JP2002182558A (en) 1988-04-28 1988-04-28 Information processor, computer program product, code generating method, and ic card
JP9329843A Expired - Lifetime JP2870531B2 (en) 1988-04-28 1988-04-28 Encryption and decryption device

Family Applications After (4)

Application Number Title Priority Date Filing Date
JP9329842A Expired - Lifetime JP2798086B2 (en) 1988-04-28 1988-04-28 Encryption and decryption device
JP9329846A Expired - Lifetime JP2993487B2 (en) 1988-04-28 1997-04-28 Information processing apparatus, IC card, and code generation method
JP22132098A Expired - Lifetime JP3277894B2 (en) 1988-04-28 1998-08-05 Information processing apparatus and code generation method
JP10221319A Pending JPH11109851A (en) 1988-04-28 1998-08-05 Computer program product

Country Status (1)

Country Link
JP (11) JP2798087B2 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2005309148A (en) * 2004-04-22 2005-11-04 Hitachi Ltd Data converter and the data conversion method

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
D.W.Davies and W.L.Price 著/上園忠宏 監訳,ネットワーク・セキュリティ,日本,日経マグロウヒル社,1985年12月 5日,1版1刷,p.57−58
H.Feistel,Cryptography and Computer Privacy,米国,Scientific American,Vol.228,No.5,p.15−23

Also Published As

Publication number Publication date
JPH10149100A (en) 1998-06-02
JP2870532B2 (en) 1999-03-17
JP2002182558A (en) 2002-06-26
JPH11109852A (en) 1999-04-23
JP2000035755A (en) 2000-02-02
JPH10149099A (en) 1998-06-02
JP2870531B2 (en) 1999-03-17
JPH11109851A (en) 1999-04-23
JP2798086B2 (en) 1998-09-17
JPH10149098A (en) 1998-06-02
JPH10149097A (en) 1998-06-02
JP2993487B2 (en) 1999-12-20
JP2980085B2 (en) 1999-11-22
JPH10149102A (en) 1998-06-02
JP2000035756A (en) 2000-02-02
JP2798087B2 (en) 1998-09-17
JPH10149101A (en) 1998-06-02
JP3277894B2 (en) 2002-04-22

Similar Documents

Publication Publication Date Title
JP2760799B2 (en) Encryption method
JP3225440B2 (en) Digital signal block conversion device and method of using the same
AU767323B2 (en) Block encryption device using auxiliary conversion
EP0725511A2 (en) Method for data encryption/decryption using cipher block chaining (CBC) and message authetication codes (MAC)
JP2950485B2 (en) Stream cipher processor
JP3275881B2 (en) Code generation method and apparatus
JP4515716B2 (en) Extended key generation device, encryption device, and encryption system
JP2825205B2 (en) Encryption device
JPH10153954A (en) Ciphering device
KR100494560B1 (en) Real time block data encryption/decryption processor using Rijndael block cipher and method therefor
US7142673B1 (en) Method for the cryptographic conversion of L-bit input blocks of digital data into L-bit output blocks
JPH10153955A (en) Ciphering device
JPH1152850A (en) Device and method for cipher conversion
JP2834450B2 (en) Encryption device
RU2140716C1 (en) Method for cryptographic conversion of digital data blocks
KR19990048318A (en) Fast block cipher algorithm
JP2008046151A (en) Encryption processing method
JPH0744375A (en) Ciphered data processor
CN115622745A (en) Encryption method, device, terminal equipment and computer readable storage medium
JPH10214026A (en) Electronic signature method
JP2005529365A (en) AES mix column conversion
CN115001663A (en) Data encryption method and device, computer equipment and storage medium
CN112910626A (en) Data encryption and decryption method based on power operation
KR19990027040A (en) Encryption method and device
JPH10153953A (en) Ciphering device

Legal Events

Date Code Title Description
FPAY Renewal fee payment (prs date is renewal date of database)

Year of fee payment: 6

Free format text: PAYMENT UNTIL: 20080208

EXPY Cancellation because of completion of term
FPAY Renewal fee payment (prs date is renewal date of database)

Free format text: PAYMENT UNTIL: 20090208

Year of fee payment: 7

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

Free format text: PAYMENT UNTIL: 20090208

Year of fee payment: 7