JPH0435432A - Data ciphering system - Google Patents

Data ciphering system

Info

Publication number
JPH0435432A
JPH0435432A JP2141781A JP14178190A JPH0435432A JP H0435432 A JPH0435432 A JP H0435432A JP 2141781 A JP2141781 A JP 2141781A JP 14178190 A JP14178190 A JP 14178190A JP H0435432 A JPH0435432 A JP H0435432A
Authority
JP
Japan
Prior art keywords
block
register
data
output
input
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.)
Pending
Application number
JP2141781A
Other languages
Japanese (ja)
Inventor
Yasuhiro Ishii
保弘 石井
Masahiro Yamashita
正弘 山下
Kazuo Takaragi
和夫 宝木
Tokuhiro Tsukiyama
築山 徳広
Masahiro Takano
雅弘 高野
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 JP2141781A priority Critical patent/JPH0435432A/en
Publication of JPH0435432A publication Critical patent/JPH0435432A/en
Pending legal-status Critical Current

Links

Abstract

PURPOSE:To execute ciphering/decoding processings even if a data length is short by taking the exclusive OR of a result obtained by means of ciphering an initial chain value and plaintext data and setting plaintext data as cryptotext data. CONSTITUTION:The ciphering/decoding processings are executed with a data Encryption Standard (DES) arithmetic circuit 1 executing the operation of a DES system as a center. When the data length of plaintext data executing the ciphering processing is less than a block length, the initial chain value is ciphered and the exclusive OR between the ciphered initial chain value and inputted plaintext data is taken, whereby plaintext data is set to be ciphered data. Thus, even a short plaintext less than one block can be ciphered by taking the exclusive OR with data obtained by ciphering the initial chain value. Furthermore, a next ciphered block is read in advance and therefore the cryptotext block inputted from an opposite direction can successively be decoded.

Description

【発明の詳細な説明】 〔産業上の利用分野〕 本発明は、データ暗号化方式に関し、特に、初期連鎖値
を有し、データをブロック化してブロック連鎖によりブ
ロック毎に暗号化処理を行うデータ暗号化方式において
、データ長が短い場合にも、暗号化および復号化の処理
が行えるデータ暗号化方式に関するものである。
[Detailed Description of the Invention] [Industrial Application Field] The present invention relates to a data encryption method, and in particular, the present invention relates to a data encryption method, and particularly to data encryption methods that have an initial chain value, block data, and perform encryption processing for each block by block chaining. The present invention relates to a data encryption method that can perform encryption and decryption processing even when the data length is short.

〔従来の技術〕[Conventional technology]

標準暗号方式において、ブロック連鎖の暗号化方式は、
例えば、国際標準規格委員会のISO/I  E  C
D  I  S  10116  ”1nfri+at
ion  ProcessingMode of 0p
eration for an n−bit bloc
k ciper aIHorithIffi”で規定さ
れているC B C(Cipher BlockCha
ining)モートの暗号化方式が知られている。
In the standard encryption method, the block chain encryption method is
For example, the International Standards Committee ISO/IEC
D I S 10116 ”1nfri+at
ion ProcessingMode of 0p
eration for an n-bit block
C B C (Cipher BlockCha
Ining) mote encryption methods are known.

第5図は、CBCモードにおける暗号化処理を説明する
ブロック図である。第5図に示すように、暗号化される
平文51は、まず、8バイト嚇位にブロック化され、平
文ブロックO9平文ブロック1、平文ブロック2.・、
平文ブロックn、平文ブロック(n+1)とされる。こ
のため、最後の平文ブロック(n+1)は、8バイト未
満となることがある。暗号化の処理は、平文ブロックO
は初期連鎖値(ICV)52と排他的論理和53がとら
れ、このデータを暗号化回路54により暗号化して暗号
文ブロックOとする。次の平文ブロック1に対しては、
平文ブロック1と暗号文ブロックOとの排他的論理和5
5がとられ、このデータを次の暗号化回路56により暗
号化して、暗号文ブロック1とする。これを順次に行い
、各々のブロック毎に暗号化の処理を行い5平文5]を
暗号文57とする。
FIG. 5 is a block diagram illustrating encryption processing in CBC mode. As shown in FIG. 5, the plaintext 51 to be encrypted is first divided into 8-byte blocks, including plaintext block O9, plaintext block 1, plaintext block 2, and so on.・、
Plaintext block n is defined as plaintext block (n+1). Therefore, the final plaintext block (n+1) may be less than 8 bytes. The encryption process uses plaintext blocks O
is subjected to an exclusive OR 53 with an initial chain value (ICV) 52, and this data is encrypted by an encryption circuit 54 to form a ciphertext block O. For the next plaintext block 1,
Exclusive OR 5 of plaintext block 1 and ciphertext block O
5 is taken, and this data is encrypted by the next encryption circuit 56 to form ciphertext block 1. This is performed sequentially, and the encryption process is performed for each block, so that the plaintext 5] becomes the ciphertext 57.

このように、平文ブロック1に対しては前ブロックの暗
号文ブロック(i−1)と排他的論理和がとられ、この
データを暗号化して暗号文ブロック1とする。最後の平
文ブロック(n+1)が8バイトのときは上述の方法と
同様に処理登行って、暗号化の処理を完了する。しかし
、最後の平文ブロック(n+1)が8バイト未満の場合
、1つ前の暗号文ブロックnを暗号化回路58により再
度暗号化して、最終の平文ブロック(n + 1)の先
頭バイトをそろえて、その長さ分の排他的論理和59を
とり、これを最終暗号文ブロック(n+1)とする。
In this way, exclusive OR is performed on plaintext block 1 with the previous block, ciphertext block (i-1), and this data is encrypted to form ciphertext block 1. When the last plaintext block (n+1) is 8 bytes, processing is performed in the same manner as in the above method, and the encryption processing is completed. However, if the last plaintext block (n + 1) is less than 8 bytes, the previous ciphertext block n is encrypted again by the encryption circuit 58 to align the first bytes of the final plaintext block (n + 1). , the exclusive OR 59 of the length is taken, and this is defined as the final ciphertext block (n+1).

第6図は、CBCモードにおける復号化処理浸説明する
ブロック図である。復号化処理は、暗号化処理の逆の処
理を行う。すなわち、復号化する暗号文61は、まず、
8バイト墜位にブロック化し、暗号文ブロックO9暗号
文ブロック1.暗号文ブロック2.・・・、暗号文ブロ
ックD、暗号文ブロック(n+1)とする。復号化にお
いては、暗号文ブロック0を復号化回路62により復号
化した後に、初期連鎖値(ICV)63と排他的論理和
64をとる。これによIJ、このデータが平文ブロック
Oとなる。次に、暗号文ブロック1を復号化回路65に
より復号化し、た後、暗号文ブロックOとの排他的論理
和66をとる。これにより平文ブロック]に復号される
。同様にして、これを順次に各々のブロック毎に復号化
の処理を行い、暗号文61を平文67とする。この場合
、暗号文ブロックlを復号化した後に、前ブロックの暗
号文ブロック(i−1)との排他的論理和をとることに
より、平文ブロックlを復元する。
FIG. 6 is a block diagram illustrating the decoding process in the CBC mode. The decryption process is the reverse of the encryption process. That is, the ciphertext 61 to be decrypted is first
Blocked into 8-byte blocks, ciphertext block O9 ciphertext block 1. Ciphertext block 2. ..., ciphertext block D, ciphertext block (n+1). In decryption, after the ciphertext block 0 is decrypted by the decryption circuit 62, an exclusive OR 64 with the initial chain value (ICV) 63 is taken. As a result, IJ, this data becomes plaintext block O. Next, ciphertext block 1 is decrypted by a decryption circuit 65, and then an exclusive OR 66 with ciphertext block O is calculated. As a result, it is decrypted into a plaintext block]. Similarly, decryption processing is sequentially performed for each block, and the ciphertext 61 is converted into the plaintext 67. In this case, after decrypting the ciphertext block 1, the plaintext block 1 is restored by performing exclusive OR with the ciphertext block (i-1) of the previous block.

また、最終の暗号文ブロック(n+1)が8バイト未満
の場合には、最終より1つ前の暗号文ブロックnを暗号
化回路68により暗号化し、このデータの先頭バイトと
最終の暗号文ブロック(n+1)の先頭をそろえて、そ
の長さ分の排他的論理和69をとれば、最終の平文ブロ
ック(n+1)を得ることができる。
In addition, if the final ciphertext block (n+1) is less than 8 bytes, the encryption circuit 68 encrypts the ciphertext block n one before the last, and the first byte of this data and the final ciphertext block ( The final plaintext block (n+1) can be obtained by aligning the beginnings of the blocks (n+1) and calculating exclusive OR 69 for that length.

〔発明が解決しようとするil!題〕[il the invention tries to solve! Title]

ところで、」二連したように、CBCモードにおける暗
号化処理および復号化処理が行なわれるが。
By the way, the encryption process and the decryption process in the CBC mode are performed as if they were repeated twice.

このような暗号化処理および復号化処理を行なう場合に
は、次のような問題がある。すなわち、(1)CBCモ
ートにおいて、平文の長さがブロック長(8バイト)未
満の場合には、暗号化ができない。
When performing such encryption processing and decryption processing, the following problems arise. That is, (1) in CBC mote, if the length of the plaintext is less than the block length (8 bytes), encryption cannot be performed.

(2)各ブロックの復号化処理は、INブロックのの暗
号文ブロックを用いるため、逆方向からは復号化できな
い。
(2) Since the decryption process for each block uses the ciphertext block of the IN block, it cannot be decrypted from the reverse direction.

本発明は、このような問題を解決するためになされたも
のである。
The present invention has been made to solve such problems.

本発明の目的は、データ暗号化方式のCBCモートにお
いて、ブロック長未満の平文データであっても暗号化で
き、また、逆方向からも暗号文ブロックを復号化できる
データ暗号化方式を提供することにある。
An object of the present invention is to provide a data encryption method that can encrypt plaintext data even if it is less than the block length in a CBC mote data encryption method, and can also decrypt ciphertext blocks from the opposite direction. It is in.

〔課題を解決するための手段〕[Means to solve the problem]

上記目的を達成するため、本発明のデータ暗号化方式は
、初期連#1値を有し、データをブロック化してブロッ
ク連鎖によりブロック毎に暗号化処理を行うデータ暗号
化方式において、暗号化処理を行う平文データのデータ
長がブロック長未満の場合に、初期連鎖値を暗号化した
結果と平文データとの排他的論理和をとり、当該平文デ
ータを暗号文データとすることを特徴とする。
In order to achieve the above object, the data encryption method of the present invention has an initial sequence #1 value, blocks data, and performs encryption processing for each block by block chaining. If the data length of the plaintext data to be used is less than the block length, the result of encrypting the initial chain value and the plaintext data are exclusive ORed, and the plaintext data is used as the ciphertext data.

〔作用〕[Effect]

これによれば、データ暗号化方式においては、暗号化の
処理では、暗号化処理を行う平文データのデータ長がブ
ロック長未満の場合、CBCモートの初期連鎖値を暗号
化して、この暗号化した初期連鎖値と入力した平文デー
タとの排他的論理和をとり、平文データを暗号文データ
とする。CBCモートにおいて、初期達S値は平文対応
に作られるブロック長(8バイト)のデータである。こ
の初期連鎖値を暗号化するとブロック長(8バイト)の
暗号文ブロックが得られる。したがって。
According to this, in the data encryption method, in the encryption process, if the data length of the plaintext data to be encrypted is less than the block length, the initial chain value of the CBC mote is encrypted, and the initial chain value of the CBC mote is encrypted. An exclusive OR is performed between the initial chain value and the input plaintext data, and the plaintext data is made into ciphertext data. In the CBC mote, the initial S value is data with a block length (8 bytes) created for plaintext. When this initial chain value is encrypted, a ciphertext block of block length (8 bytes) is obtained. therefore.

この初期連鎖値を暗号化した暗号文ブロックとブロック
長未満の平文データとを平文データのデータ長だけの排
他的論理和をとれば、ブロック長未満の平文データであ
っても、その長さ分の暗号文データを生成することがで
きる。
If we take the exclusive OR of the ciphertext block obtained by encrypting this initial chain value and the plaintext data shorter than the block length by the data length of the plaintext data, even if the plaintext data is shorter than the block length, the length of the plaintext data will be can generate ciphertext data.

このように、ブロック長未満の平文データを暗号文デー
タとすることができ、また、同様な逆の処理によって、
ブロック長未満の暗号文データに対しても、そのまま平
文データとすることができる。すなわち、ブロック長未
満の暗号文データに対し、初期連鎖値を暗号化した暗号
文データとの排他的論理和をとり、ブロック長未満の暗
号文データのデータ長だけのデータとすれば、平文デ・
−タに復号できる。
In this way, plaintext data that is less than the block length can be made into ciphertext data, and by similar reverse processing,
Even ciphertext data that is less than the block length can be converted into plaintext data as is. In other words, for the ciphertext data that is less than the block length, if the initial chain value is exclusive-ORed with the encrypted ciphertext data and the data is only the data length of the ciphertext data that is less than the block length, then the plaintext data is・
- Can be decoded to data.

このように、ブロック長未満の暗号文データの平文デー
タとできることにより、逆方向からも暗号文データを復
号化できる。すなわち、復号化の処理では、暗号文デー
タをブロック化し、ブロック長未満の暗号文ブロックを
復号した後、復号すべき暗号文ブロックを復号化し1次
の暗号文ブロックを先き読みして、これと排他的論理和
をとり、暗号文ブロックを平文ブロックとする復号化を
行う。CBCモードにおいて、暗号化された暗号文デー
タを最終の暗号文ブロックから最初の暗号文ブロックま
で、1ブロツクずつ逆方向に入力し、その度毎に平文ブ
ロックを得るために、入力された暗号文ブロックを、ブ
ロック長未満の暗号文ブロックも含めて復号化して1次
に入力される暗号文ブロックと排他的論理和をとること
により各々の平文ブロックを得ることができる。これに
より。
In this way, by converting ciphertext data smaller than the block length into plaintext data, the ciphertext data can be decrypted from the opposite direction as well. That is, in the decryption process, ciphertext data is divided into blocks, ciphertext blocks smaller than the block length are decrypted, the ciphertext block to be decoded is decrypted, the first ciphertext block is read in advance, and this Exclusive OR is performed on the ciphertext block and the plaintext block is decrypted. In CBC mode, the encrypted ciphertext data is input block by block in the reverse direction from the last ciphertext block to the first ciphertext block, and the input ciphertext data is input in order to obtain a plaintext block each time. Each plaintext block can be obtained by decrypting the blocks, including the ciphertext blocks smaller than the block length, and performing an exclusive OR with the ciphertext block inputted first. Due to this.

逆方向からも暗号文データを復号化することができる。Encrypted data can also be decrypted from the opposite direction.

〔実施例〕〔Example〕

以下、本発明の一実施例を図面を用いて具体的に説明す
る。
Hereinafter, one embodiment of the present invention will be specifically described using the drawings.

第1図は、本発明の一実施例にかかるデータ暗号化方式
を一態様で実施する暗号化処理回路を示すブロック図で
ある。第1図において、1はDES (Data En
cryption 5tandard)方式の演算を行
うDES演算回路であり、このDES演算回路1を中心
として、暗号化および復号化の処理が行なわれる。DE
S演算回路1には、演算を行う暗号#KEYが鍵レジス
タ2から入力される。また、入力レジスタとして、平文
ブロックあるいは暗号文ブロックを格納する入力レジス
タ(IN)4と初期連鎖値を格納する初期連鎖値レジス
タ(ICV)3が設けられており、出力レジスタとして
、暗号化あるは復号化された出力ブロックを格納する出
力レジスタ(OUT)5が設けられている。
FIG. 1 is a block diagram showing an encryption processing circuit that implements a data encryption method according to an embodiment of the present invention in one aspect. In Figure 1, 1 is DES (Data En
This is a DES arithmetic circuit that performs arithmetic operations based on the encryption (5 standard) method, and the DES arithmetic circuit 1 performs encryption and decryption processing. D.E.
The S arithmetic circuit 1 receives a code #KEY from the key register 2 to perform the arithmetic operation. In addition, an input register (IN) 4 for storing a plaintext block or a ciphertext block and an initial chain value register (ICV) 3 for storing an initial chain value are provided as input registers. An output register (OUT) 5 is provided to store the decoded output block.

入力レジスタ4からのデータ出力は、入力Aレジスタ(
INA)7と、排他的論理和ゲート10と、セレクタ1
4に入力される。また、初期連鎖値レジスタ3からのデ
ータ出力は、セレクタ12に入力される。入力Aレジス
タ7のデータ出力は、入力Bレジスタ(INB)8に入
力され、入力Bレジスタ8からのデータ出力は、セレク
タ12に入力される。セレクタ12の出力は、セレクタ
13および排他的論理和ゲート11への入力となり。
The data output from input register 4 is input to input A register (
INA) 7, exclusive OR gate 10, and selector 1
4 is input. Further, the data output from the initial chain value register 3 is input to the selector 12. The data output of the input A register 7 is input to an input B register (INB) 8, and the data output from the input B register 8 is input to the selector 12. The output of the selector 12 becomes an input to the selector 13 and exclusive OR gate 11.

セレクタ13の出力は、排他的論理和ゲート10の入力
およびセレクタ14の入力となっている。
The output of the selector 13 serves as an input to the exclusive OR gate 10 and an input to the selector 14.

また、排他的論理和ゲート10からの出力は。Further, the output from the exclusive OR gate 10 is as follows.

セレクタ14に入力され、セレクタ14の出力は、入力
Cレジスタ(INC)6に入力される。入力Cレジスタ
6は、DES演算回路1の入力レジスタとなり−DES
演算回路1の出力は、出力Cレジスタ(OUTC)9に
ラッチされる。この出力Cレジスタ9からの出力は、セ
レクタ]3.セレクタ15.および排他的論理和ゲート
11に入力される。 411:他的論理和ゲート11の
出力は、セレクタ15に入力され、セレクタ15の出力
は、出力レジスタ (OUT)に入力されて、ランチさ
れた後に、出力される。
The input signal is input to the selector 14, and the output of the selector 14 is input to the input C register (INC) 6. The input C register 6 becomes the input register of the DES calculation circuit 1.
The output of the arithmetic circuit 1 is latched into an output C register (OUTC) 9. The output from this output C register 9 is the selector]3. Selector 15. and is input to exclusive OR gate 11. 411: The output of the algebraic OR gate 11 is input to the selector 15, and the output of the selector 15 is input to the output register (OUT) and output after being launched.

次に2このように構成される暗号化処理回路を用いて、
平文データを暗号文データとする動作を説明する。通常
の暗号化および復号化の処理は、第5図および第6図で
説明したように、平文データまたは暗号文データをブロ
ック化した後、各ブロック毎に、暗号化および復号化の
処理を行うことにより行なわれる。
Next, using the encryption processing circuit configured as described above,
The operation of converting plaintext data into ciphertext data will be explained. In normal encryption and decryption processing, as explained in Figs. 5 and 6, plaintext data or ciphertext data is divided into blocks, and then encryption and decryption processing is performed for each block. This is done by

暗号化処理を行う場合、平文ブロックOが入力レジスタ
4に入力されると5セレクタ12およびセレクタ13は
、初期連鎖値レジスタ(ICV)3の出力製選択する。
When performing encryption processing, when the plaintext block O is input to the input register 4, the 5 selector 12 and the selector 13 select the output of the initial chain value register (ICV) 3.

このため、排他的論理和ゲート]0により、平文ブロッ
クOと初期連鎖値との排他的論理和かとられ、セレクタ
14を経て、入力Cレジスタ6にラッチされる。DES
演算回路1は、入力Cレジスタ6の出力を鍵レジスタ2
のKEYに従って暗号化し、暗号文ブロックのデータを
出力Cレジスタ9に出力する。このとき、セレクタ]5
は出力Cレジスタ9の出力を選択し、出力レジスタ5に
暗化文ブロック0を入力する。
Therefore, the exclusive OR gate 0 performs the exclusive OR of the plaintext block O and the initial chain value, and the result is latched into the input C register 6 via the selector 14. DES
The arithmetic circuit 1 inputs the output of the input C register 6 to the key register 2.
The data of the ciphertext block is encrypted according to the KEY of , and the data of the ciphertext block is output to the output C register 9. At this time, selector ] 5
selects the output of output C register 9 and inputs encrypted text block 0 to output register 5.

次に平文ブロックj、(i=1〜n)が入力レジスタ4
に入力されると、セレクタユ3は出力Cレジスタ9の出
力を選択するので、排他的論理和ゲート1oにおいては
、平文ブロックlと暗号文ブロック(i−1)の排他的
論理和がとられる。この排他的論理和の出力はセレクタ
14で選択されて、セレクタ14を経て、入力Cレジス
タ6にラッチされる。DES演算回路]は入力Cレジス
タ6の出力データを暗号化し7、暗号文ブロック]とし
て出力Cレジスタ9に出力する。セレクタ15は出力C
レジスタ9の出力を選択し、出力レジスタ5に暗号文ブ
ロックiを格納する。このようにして、平文ブロック1
〜平文ブロックnが暗号化され、暗号文ブロツク1〜暗
号文ブロックnが生成される。
Next, plaintext block j, (i=1 to n) is input to input register 4.
Since the selector 3 selects the output of the output C register 9, the exclusive OR gate 1o performs the exclusive OR of the plaintext block l and the ciphertext block (i-1). The output of this exclusive OR is selected by the selector 14, passes through the selector 14, and is latched into the input C register 6. The DES operation circuit encrypts the output data of the input C register 6 and outputs it to the output C register 9 as a ciphertext block. Selector 15 outputs C
The output of register 9 is selected and ciphertext block i is stored in output register 5. In this way, plaintext block 1
-Plaintext block n is encrypted, and ciphertext block 1 -ciphertext block n are generated.

次に、平文ブロック(n+1)が入力レジスタ4に入力
されると、セレクタ]−3およびセレクタ14は出力C
レジスタ9からの出力を選択する。
Next, when the plaintext block (n+1) is input to the input register 4, the selector]-3 and the selector 14 output C
Select the output from register 9.

これにより、入力Cレジスタ6には、暗号文ブロックn
がセットされる。この間、入力レジスタ4からの出力は
入力Aレジスタ7を経て、入力Bレジスタ8にラッチさ
れる。DES演算回路1は入力Cレジスタ6の出力を暗
号化して、出力Cレジスタ9に出力する。また、セレク
タ12は入力Bレジスタ8の出力を選択するので、排他
的論理和ゲート11において、出力Cレジスタ9の出力
と入力Bレジスタ8の出力との排他的論理和がとられる
。セレクタ15は排他的論理和ゲート11の出力を選択
し、出力レジスタ5に暗号文ブロック(n+1)を格納
する。
As a result, the input C register 6 contains the ciphertext block n
is set. During this time, the output from the input register 4 passes through the input A register 7 and is latched into the input B register 8. The DES arithmetic circuit 1 encrypts the output of the input C register 6 and outputs it to the output C register 9. Furthermore, since the selector 12 selects the output of the input B register 8, the exclusive OR gate 11 performs the exclusive OR of the output of the output C register 9 and the output of the input B register 8. The selector 15 selects the output of the exclusive OR gate 11 and stores the ciphertext block (n+1) in the output register 5.

復号化処理を行う場合にも、同様なセレクタの選択の操
作によりDES演算演算回路後号化処理および排他的論
理和ゲート10.11の排他的論理和の演算操作により
、復号化が行なわれる。
When performing the decoding process, the decoding is performed by the DES arithmetic operation circuit post-encoding process and the exclusive OR operation of the exclusive OR gate 10.11 using the same selector selection operation.

まず、暗号文ブロックOが入力レジスタ4に入力される
と、セレクタ14は入力レジスタ4の出力に選択し、入
力Cレジスタ6に暗号文ブロック0をランチする。この
間に、入力レジスタ4の出力は入力Aレジスタ7にラッ
チされる。DES演算回路1は、鍵レジスタ2の*KE
Yに従って復号化演算を行い、その出力を出力Cレジス
タ9にセットする。また、セレクタ12は初期連鎖値レ
ジスタ3の出力を選択するため、排他的論理和ゲート1
1では出力Cレジスタ9とセレクタ12からの出力との
排他的論理和がとられる。このとき、セレクタ15が排
他的論理和ゲート11の出力を選択することにより、復
号化された平文ブロックOが出力レジスタ5にセットさ
れる。
First, when the ciphertext block O is input to the input register 4, the selector 14 selects the output of the input register 4 and launches the ciphertext block 0 to the input C register 6. During this time, the output of input register 4 is latched into input A register 7. The DES calculation circuit 1 uses *KE of the key register 2.
A decoding operation is performed according to Y, and the output is set in the output C register 9. In addition, the selector 12 selects the output of the initial chain value register 3, so the exclusive OR gate 1
1, the exclusive OR of the output from the output C register 9 and the output from the selector 12 is taken. At this time, the selector 15 selects the output of the exclusive OR gate 11, so that the decrypted plaintext block O is set in the output register 5.

次に、暗号文ブロックi  (i=l〜n)が入力レジ
スタ4に入力されると、セレクタ]4はその出力を、入
力Cレジスタ6に出力する。これにより、DES演算回
路1は、暗号文ブロックjを復号化し、出力Cレジスタ
9にその結果を出力する。
Next, when the ciphertext block i (i=l to n) is input to the input register 4, the selector 4 outputs its output to the input C register 6. Thereby, the DES arithmetic circuit 1 decrypts the ciphertext block j and outputs the result to the output C register 9.

この間、入力Aレジスタ7の出力は入力Bレジスタ8に
ランチされる。その後に、入力レジスタ4からの暗号文
ブロック1が入力Aレジスタ7にラッチされる。セレク
タ12は入力Bレジスタ8の出力の暗号文ブロック(i
−1)を選択するので、排他的論理和ゲート11では、
出力Cレジスタ9の出力と入力Bレジスタ8の出力との
排他的論理和がとられ、平文ブロックlが復号される。
During this time, the output of input A register 7 is launched into input B register 8. Thereafter, ciphertext block 1 from input register 4 is latched into input A register 7. The selector 12 selects the ciphertext block (i
-1), so in the exclusive OR gate 11,
The output of the output C register 9 and the output of the input B register 8 are exclusive ORed, and the plaintext block l is decoded.

これをセレクタ15で選択して、復号した平文ブロック
lが出力レジスタ5にラッチされる。このようにして、
暗号文ブロツク1〜@′号文ブロックnの各ブロックが
平文ブロック1〜平文ブロックnに復号化される。
This is selected by the selector 15, and the decoded plaintext block l is latched into the output register 5. In this way,
Each block of ciphertext block 1 to @' ciphertext block n is decrypted into plaintext block 1 to plaintext block n.

次に、暗号文ブロック(n + 1 )が入力レジスタ
4にセットされると、入力Aレジスタ7からの出力(暗
号文ブロックn)が人力Bレジスタ8゜セレクタ12.
セレクタ13.セレクタ14を介して、入力Cレジスタ
6にラッチされる。DES演算回路1は、この場合、入
力Cレジスタ6の出力を暗号化して、その出力を出力C
レジスタ9にラッチする。この間に、入力レジスタ4の
出力の暗号文ブロック(n+1)は、入力Aレジスタ7
を経て入力Bレジスタ8にラッチされる。セレクタ12
は入力Bレジスタ8の出力を選択し、排他的論理和ゲー
ト11は出力Cレジスタ9の呂カと入力Bレジスタ8の
出力との排他的論理和をとり、復号化して平文ブロック
(n+1)を得る。このときの排他的論理和の出力の平
文ブロック(n+1)はセレクタ15を経て、出力レジ
スタ5に格納される。
Next, when the ciphertext block (n + 1) is set in the input register 4, the output from the input A register 7 (ciphertext block n) is manually input to the B register 8° selector 12.
Selector 13. It is latched into the input C register 6 via the selector 14. In this case, the DES arithmetic circuit 1 encrypts the output of the input C register 6 and sends the output to the output C.
Latch into register 9. During this time, the ciphertext block (n+1) output from input register 4 is transferred to input A register 7.
The input signal is latched into the input B register 8 through the input B register 8. Selector 12
selects the output of the input B register 8, and the exclusive OR gate 11 takes the exclusive OR of the output of the output C register 9 and the output of the input B register 8, decrypts it, and obtains the plaintext block (n+1). obtain. The plaintext block (n+1) output from the exclusive OR at this time passes through the selector 15 and is stored in the output register 5.

第2図および第3図は、それぞれ、暗号化する平文デー
タがブロック長の8バイトに満たない場合の暗号化処理
および復号化処理を説明するブロック図である。
FIGS. 2 and 3 are block diagrams illustrating encryption processing and decryption processing, respectively, when the plaintext data to be encrypted is less than the block length of 8 bytes.

まず、第2図を参照して暗号化処理を説明する。First, the encryption process will be explained with reference to FIG.

暗号化処理では、第2図に示すように、ブロック長未満
の平文データは、初期連#J値を暗号化した暗号文ブロ
ックとの排他的論理和をとり、当該平文データが暗号文
データとされる。
In the encryption process, as shown in Figure 2, plaintext data smaller than the block length is exclusive-ORed with the ciphertext block obtained by encrypting the initial sequence #J value, and the plaintext data is combined with the ciphertext data. be done.

8バイトに満たない平文ブロックOが入力レジスタ4に
入力されると、初期連鎖値レジスタ3からの出力はセレ
クタ12.セレクタ13.セレクタ14を経て、入力C
レジスタ6にラッチされ、DES演算回路1において鍵
レジスタ2の鍵KEYに従って暗号化される。この初期
連鎖値を暗号化した暗号文ブロックは、DES演算回路
1から出力Cレジスタ9にラッチされる。この間、入力
レジスタ4の出力は入力Aレジスタ7を経て入力Bレジ
スタ8にラッチされる。セレクタ12は入力Bレジスタ
8の出力を選択し、排他的論理和ゲート11は出力Cレ
ジスタ9と入力Bレジスタ8の出力との排他的論理和を
とる。この排他的論理和ゲート11の出力である暗号文
ブロックOがセレクタ15で選択されて出力レジスタ5
に格納される。 次に、第3図を参照して復号化処理を
説明する。復号化処理においても、第3図に示すように
、晴晴化処理と同様に、ブロック長未満の暗号文データ
は、初期連鎖値を暗号化した暗号文ブロックとの排他的
論理和をとり、当該暗号文データが平文データとされる
When a plaintext block O of less than 8 bytes is input to the input register 4, the output from the initial chain value register 3 is sent to the selector 12. Selector 13. Through selector 14, input C
It is latched in the register 6 and encrypted in the DES arithmetic circuit 1 according to the key KEY of the key register 2. A ciphertext block obtained by encrypting this initial chain value is latched from the DES calculation circuit 1 to the output C register 9. During this time, the output of the input register 4 is latched into the input B register 8 via the input A register 7. The selector 12 selects the output of the input B register 8, and the exclusive OR gate 11 performs the exclusive OR of the output of the output C register 9 and the output of the input B register 8. The ciphertext block O which is the output of this exclusive OR gate 11 is selected by the selector 15 and output register 5
is stored in Next, the decoding process will be explained with reference to FIG. In the decryption process, as shown in Figure 3, similarly to the clearing process, the ciphertext data smaller than the block length is exclusive-ORed with the ciphertext block in which the initial chain value was encrypted, and the corresponding The ciphertext data is treated as plaintext data.

8バイトに満たない暗号文ブロックOが、入力レジスタ
4に入力されると、暗号化処理と同様に、初期連鎖値レ
ジスタ3からの出力はセレクタ12゜セレクタ13.セ
レクタ14を経て、入力Cレジスタ6にラッチされ、D
ES演算回路1で鍵レジスタ2のIIIKEYに従って
暗号化される。そして、この初期連鎖値を暗号化した暗
号文ブロックは、出力Cレジスタ9にラッチされる。こ
の間、入力レジスタ4の出力は入力Aレジスタ7を経て
、入力Bレジスタ8にラッチされる。次に、セレクタ1
2が入力Bレジスタ8の出力を選択し、排他的論理和ゲ
ート11において、出力Cレジスタ9の出力と入力Bレ
ジスタ8の出力との排他的論理和をとり、この出力であ
る平文ブロック0がセレクタ15を経て出力レジスタ5
に格納される。
When a ciphertext block O of less than 8 bytes is input to the input register 4, the output from the initial chain value register 3 is sent to selector 12, selector 13, . It is latched into the input C register 6 through the selector 14, and the D
It is encrypted in the ES calculation circuit 1 according to IIIKEY of the key register 2. Then, the ciphertext block obtained by encrypting this initial chain value is latched into the output C register 9. During this time, the output of the input register 4 passes through the input A register 7 and is latched into the input B register 8. Next, selector 1
2 selects the output of input B register 8, exclusive OR gate 11 performs exclusive OR of the output of output C register 9 and the output of input B register 8, and this output, plaintext block 0, is Output register 5 via selector 15
is stored in

第4図は、暗号文を逆方向から復号化処理を行う場合の
処理を説明するブロック図である。この場合にも、復号
化する暗号文データは、ブロック化された後に、各々の
ブロック毎に逆方向に復号化の処理が行なわれる。
FIG. 4 is a block diagram illustrating processing when decrypting a ciphertext from the reverse direction. In this case as well, the ciphertext data to be decrypted is divided into blocks, and then the decryption process is performed in the reverse direction for each block.

第4図を参照して説明する。ブロック化の後、8バイト
に満たない暗号文ブロック(n+1)が入力レジスタ4
に入力されると、入力レジスタ4の出力を入力Aレジス
タ7を経て、入力Bレジスタ8にラッチする。次に、暗
号文ブロックわが入力レジスタ4に入力されると、入力
レジスタ4の出力を入力Aレジスタ7にラッチする。ま
た、入力レジスタ4の出力はセレクタ14を経て入力C
レジスタ6にラッチされて、この暗号文ブロックに対し
てのみ、DES演算回路1で鍵レジスタ2の@KEYに
従って暗号化され、その出力が出力Cレジスタ9にラッ
チされる。排他的論理和ゲート11はセレクタ12で選
択された入力Bレジスタ8の出力と出力Cレジスタ9の
出力との排他的論理和をとり、平文ブロック(n+1)
として復号化する。この出力の平文ブロック(n+1)
はセレクタ15を経て、出力レジスタ5に、出力される
This will be explained with reference to FIG. After blocking, the ciphertext block (n+1) that is less than 8 bytes is stored in the input register 4.
, the output of the input register 4 passes through the input A register 7 and is latched into the input B register 8. Next, when the ciphertext block is input to the input register 4, the output of the input register 4 is latched to the input A register 7. Furthermore, the output of the input register 4 passes through the selector 14 to the input C
It is latched in the register 6, and only this ciphertext block is encrypted in the DES calculation circuit 1 according to @KEY of the key register 2, and its output is latched in the output C register 9. The exclusive OR gate 11 takes the exclusive OR of the output of the input B register 8 selected by the selector 12 and the output of the output C register 9, and generates a plaintext block (n+1).
Decrypt as . Plaintext block (n+1) of this output
is output to the output register 5 via the selector 15.

この以後、暗号文ブロックn−暗号文ブロックOが入力
され、逆方向の復号化処理により平文ブロックn〜平文
ブロックOに復号される。入力Aレジスタ7の出力が入
力Bレジスタ8にラッチされ、次に暗号文ブロックi 
 (i= (n  1)〜O)が入力レジスタ4に入力
されると、入力レジスタ4の出力は入力Aレジスタ7に
ラッチされると同時に、入力Bレジスタ8の出力はセレ
クタ12゜セレクタコ、3.セレクタ14を経て、入力
Cレジスタ6にラッチされて、DES演算回路1で復号
化される。復号化された出力は出力Cレジスタ9にラッ
チされる。この時に、入力Aレジスタ7の出力が入力B
レジスタ8にラッチされる。セレクタ12は入力Bレジ
スタ8の出力を選択して、排他的論理和ゲー1−11に
入力する。これにより、排他的論理和ゲート11におい
てはセレクタ12によって選択された人力Bレジスタ8
の出力と、出力Cレジスタ9の出力との排他的論理和が
とられて、平文ブロック(i+1)が復号される。この
排他的論理和の出力の平文ブロック(i+1)はセレク
タ15を経て、出力レジスタ5に出力される。
Thereafter, ciphertext block n - ciphertext block O are input, and are decrypted into plaintext block n - plaintext block O by decryption processing in the reverse direction. The output of input A register 7 is latched into input B register 8, and then ciphertext block i
When (i = (n 1) ~ O) is input to the input register 4, the output of the input register 4 is latched to the input A register 7, and at the same time, the output of the input B register 8 is input to the selector 12° selector 3. .. It passes through the selector 14, is latched into the input C register 6, and is decoded by the DES arithmetic circuit 1. The decoded output is latched into the output C register 9. At this time, the output of input A register 7 is input to input B.
It is latched into register 8. The selector 12 selects the output of the input B register 8 and inputs it to the exclusive OR game 1-11. As a result, in the exclusive OR gate 11, the manual B register 8 selected by the selector 12
The output of the output C register 9 is exclusively ORed with the output of the output C register 9, and the plaintext block (i+1) is decoded. The plaintext block (i+1) output from this exclusive OR is output to the output register 5 via the selector 15.

また、1;oの場合の暗号文ブロック1の復号化は、こ
の後に、入力Bレジスタ8の出力がセレクタコ2.セレ
クタ1;3.セレクタ]4を経て、入力Cレジスタ6に
ラッチされ、DES演算回路1で復号化された後、次に
初期連鎖値との排他的論理和をとることにより行なわれ
る。DES演算回路1の出力が入力Cレジスタ9にラッ
チされると、排他的論理和ゲート11はセレクタ12に
より選択された初期連鎖値レジスタ3の出力と、出力C
レジスタ9の出力との排他的論理和をとり、平文ブロッ
クOに復号化される。この排他的論理和の出力の平文ブ
ロックOはセレクタ15を経て、出力レジスタ5に出力
される。
Further, in the case of 1;o, the decryption of the ciphertext block 1 is performed after the output of the input B register 8 is input to the selector 2. Selector 1; 3. selector] 4, is latched into the input C register 6, decoded by the DES arithmetic circuit 1, and then exclusive ORed with the initial chain value. When the output of the DES calculation circuit 1 is latched to the input C register 9, the exclusive OR gate 11 outputs the output of the initial chain value register 3 selected by the selector 12 and the output C
It is exclusive ORed with the output of register 9 and decoded into plaintext block O. The plaintext block O output from this exclusive OR is output to the output register 5 via the selector 15.

このように、暗号文ブロックと次の入力ブロックとを排
他的論理和をとって、ブロック連鎖を行うデータ暗号化
方式において、暗号化されたデースを暗号最終ブロック
から暗号開始ブロックへと逆方向に入力し、復号すべき
暗号文ブロックを復号化し、次に入力される暗号文ブロ
ックとの排他的論理和を取ることにより、暗号文ブロッ
クを逆方向に復号化し、順次に平文ブロックのデータと
することができる。
In this way, in a data encryption method that performs block chaining by exclusive ORing a ciphertext block and the next input block, the encrypted data is transferred in the reverse direction from the last cipher block to the cipher start block. Decrypt the input ciphertext block to be decrypted, and perform exclusive OR with the next input ciphertext block to decrypt the ciphertext block in the reverse direction and sequentially convert it into plaintext block data. be able to.

以上、説明したように、本実施例によれば、平文が8バ
イト未滴の場合においても、暗号処理が可能となり、ま
た、暗号文ブロックを逆方向から逐次に復号できるとい
う効果がある。
As described above, according to the present embodiment, it is possible to perform cryptographic processing even when 8 bytes of plaintext are missing, and the ciphertext blocks can be sequentially decrypted from the reverse direction.

以上、本発明を実施例にもとづき具体的に説明したが5
本発明は、前記実施例に限定されるものではなく、その
要旨を逸脱しない範囲において神々変更可能であること
は言うまでもない。
The present invention has been specifically described above based on examples.
It goes without saying that the present invention is not limited to the above-mentioned embodiments, and can be modified without departing from the spirit thereof.

〔発明の効果〕〔Effect of the invention〕

以上、説明したように、本発明によれば、以下に記載さ
れるような効果を奏する。
As explained above, according to the present invention, the following effects are achieved.

(])初期連鎖値を暗号化したデータと排他的論理和を
とることにより、1ブロツクに満たない短い平文でも暗
号化が可能となる。
(]) By exclusive ORing the initial chain value with the encrypted data, it is possible to encrypt even short plaintexts that are less than one block.

(2)次の暗号化ブロックを先取りして読み取ることに
より、逆方向から入力された暗号文ブロックも逐次に復
号化することができる。
(2) By reading the next encrypted block in advance, it is possible to sequentially decrypt encrypted text blocks input from the opposite direction.

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

第1図は、本発明の一実施例にかかるデータ暗号化方式
を一態様で実施する暗号化処理回路を示すブロック図、 第2図および第3図は、そ才りそれ、暗号化する平文デ
ータがブロック長の8バイトに満たない場合の暗号化処
理および復号化処理を説明するブロック図、 第4図は、暗号文を逆方向から復号化処理を行う場合の
処理を説明するブロック図、 第5図は、CBCモードにおける暗号化処理を説明する
ブロック図、 第6図は、CBCモートにおける復号化処理を説明する
ブロック図である。 図中、1・・DES演算回路、2−・鍵レジスタ、3・
−初期連鎖値レジスタ、4・・入力レジスタ、5・・出
力レジスタ、6・−人力Cレジスタ、7・・入力Aレジ
スタ、8・・・入力Bレジスタ、9・・・呂カCレジス
タ、10・・・排他的論理和ゲート、11・・・排他的
論理和ゲート、12・・・セレクタ、13・・・セレク
タ、14・・・セレクタ、15・・セレクタ。
FIG. 1 is a block diagram showing an encryption processing circuit that implements a data encryption method in one aspect according to an embodiment of the present invention, and FIGS. 2 and 3 show the plain text to be encrypted. A block diagram illustrating the encryption process and decryption process when the data is less than the block length of 8 bytes; FIG. 4 is a block diagram illustrating the process when the ciphertext is decrypted from the reverse direction; FIG. 5 is a block diagram illustrating encryption processing in CBC mode, and FIG. 6 is a block diagram illustrating decryption processing in CBC mode. In the figure, 1--DES calculation circuit, 2--Key register, 3--
- Initial chain value register, 4... Input register, 5... Output register, 6... - Manual C register, 7... Input A register, 8... Input B register, 9... Power C register, 10 ...Exclusive OR gate, 11...Exclusive OR gate, 12...Selector, 13...Selector, 14...Selector, 15...Selector.

Claims (1)

【特許請求の範囲】[Claims] 1、初期連鎖値を有し、データをブロック化してブロッ
ク連鎖によりブロック毎に暗号化処理を行うデータ暗号
化方式において、暗号化処理を行う平文データのデータ
長がブロック長未満の場合に、初期連鎖値を暗号化した
結果と平文データとの排他的論理和をとり、当該平文デ
ータを暗号文データとすることを特徴とするデータ暗号
化方式。
1. In a data encryption method that has an initial chain value and blocks data and performs encryption processing for each block by block chaining, if the data length of the plaintext data to be encrypted is less than the block length, the initial A data encryption method characterized by performing an exclusive OR of the result of encrypting a chain value and plaintext data, and using the plaintext data as ciphertext data.
JP2141781A 1990-05-30 1990-05-30 Data ciphering system Pending JPH0435432A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2141781A JPH0435432A (en) 1990-05-30 1990-05-30 Data ciphering system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2141781A JPH0435432A (en) 1990-05-30 1990-05-30 Data ciphering system

Publications (1)

Publication Number Publication Date
JPH0435432A true JPH0435432A (en) 1992-02-06

Family

ID=15300020

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2141781A Pending JPH0435432A (en) 1990-05-30 1990-05-30 Data ciphering system

Country Status (1)

Country Link
JP (1) JPH0435432A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2007034212A (en) * 2005-07-29 2007-02-08 Nippon Telegr & Teleph Corp <Ntt> Block encryption apparatus, block decryption apparatus, and their method and program
JP2008061041A (en) * 2006-08-31 2008-03-13 Sharp Corp Communication system, program and recording medium

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2007034212A (en) * 2005-07-29 2007-02-08 Nippon Telegr & Teleph Corp <Ntt> Block encryption apparatus, block decryption apparatus, and their method and program
JP2008061041A (en) * 2006-08-31 2008-03-13 Sharp Corp Communication system, program and recording medium

Similar Documents

Publication Publication Date Title
US10256972B2 (en) Flexible architecture and instruction for advanced encryption standard (AES)
JP2000162965A (en) Ciphering and deciphering device, and storage medium
JPS6333749B2 (en)
JP3824121B2 (en) Method and apparatus for decrypting encrypted data
JP3769804B2 (en) Decoding method and electronic device
US20050147239A1 (en) Method for implementing advanced encryption standards using a very long instruction word architecture processor
US7103180B1 (en) Method of implementing the data encryption standard with reduced computation
JPH0697930A (en) Block cipher processor
WO2009090689A1 (en) Encoding device, encoding method and program
JPH0435432A (en) Data ciphering system
KR20040071462A (en) Apparatus and method for enciphering a data packet of variable width
JP2002510058A (en) Method for cryptographic conversion of binary data blocks
JPH05249891A (en) Ciphering processor and ciphering process method using the same
KR100494560B1 (en) Real time block data encryption/decryption processor using Rijndael block cipher and method therefor
JP2009098321A (en) Information processor
JP2002108205A (en) Block ciphering method and decoding method
JPH027080A (en) Variable enciphering device
KR100546777B1 (en) Apparatus and method for SEED Encryption/Decryption, and F function processor therefor
JP4708914B2 (en) Decryption method
JPS6281145A (en) Data ciphering system
JP2003333036A (en) Message authentication device, message authenticating method, message authenticating program, and computer- readable recording medium with the program stored thereon
JPH0553990A (en) Password ciphering/compositing system using numerical train
JP4335374B2 (en) Data conversion apparatus and data conversion method
JP2009069686A (en) Encryption circuit and decryption circuit
KR20040032239A (en) Apparatus and method for ciphering in mobile communication system