WO2014003117A1 - 暗号化装置、暗号化方法およびプログラム - Google Patents

暗号化装置、暗号化方法およびプログラム Download PDF

Info

Publication number
WO2014003117A1
WO2014003117A1 PCT/JP2013/067652 JP2013067652W WO2014003117A1 WO 2014003117 A1 WO2014003117 A1 WO 2014003117A1 JP 2013067652 W JP2013067652 W JP 2013067652W WO 2014003117 A1 WO2014003117 A1 WO 2014003117A1
Authority
WO
WIPO (PCT)
Prior art keywords
memory
data
box
table entry
round key
Prior art date
Application number
PCT/JP2013/067652
Other languages
English (en)
French (fr)
Inventor
智保 洲崎
Original Assignee
日本電気株式会社
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 日本電気株式会社 filed Critical 日本電気株式会社
Priority to JP2014522679A priority Critical patent/JP6028798B2/ja
Priority to US14/411,595 priority patent/US9571269B2/en
Publication of WO2014003117A1 publication Critical patent/WO2014003117A1/ja

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/06Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols the encryption apparatus using shift registers or memories for block-wise or stream coding, e.g. DES systems or RC4; Hash functions; Pseudorandom sequence generators
    • H04L9/0618Block ciphers, i.e. encrypting groups of characters of a plain text message using fixed encryption transformation
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/06Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols the encryption apparatus using shift registers or memories for block-wise or stream coding, e.g. DES systems or RC4; Hash functions; Pseudorandom sequence generators
    • H04L9/0618Block ciphers, i.e. encrypting groups of characters of a plain text message using fixed encryption transformation
    • H04L9/0631Substitution permutation network [SPN], i.e. cipher composed of a number of stages or rounds each involving linear and nonlinear transformations, e.g. AES algorithms
    • GPHYSICS
    • G09EDUCATION; CRYPTOGRAPHY; DISPLAY; ADVERTISING; SEALS
    • G09CCIPHERING OR DECIPHERING APPARATUS FOR CRYPTOGRAPHIC OR OTHER PURPOSES INVOLVING THE NEED FOR SECRECY
    • G09C1/00Apparatus or methods whereby a given sequence of signs, e.g. an intelligible text, is transformed into an unintelligible sequence of signs by transposing the signs or groups of signs or by replacing them by others according to a predetermined system
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L2209/00Additional information or applications relating to cryptographic mechanisms or cryptographic arrangements for secret or secure communication H04L9/00
    • H04L2209/24Key scheduling, i.e. generating round keys or sub-keys for block encryption

Definitions

  • the present invention is based on a Japanese patent application: Japanese Patent Application No. 2012-145470 (filed on June 28, 2012), and the entire contents of this application are incorporated in the present specification by reference.
  • the present invention relates to an encryption device, an encryption method, and a program, and more particularly, to an encryption device, an encryption method, and a program based on a common key block cipher for concealing data during data communication and storage.
  • Block encryption is known as a technique for concealing communication data and stored data.
  • Typical block encryption algorithms include DES (Data Encryption Standard) and AES (Advanced Encryption Standard) described in Non-Patent Document 1.
  • FIG. 7 is a block diagram illustrating an example of the configuration of the encryption device 110 that converts plaintext to ciphertext based on block cipher.
  • the encryption device 110 includes a key schedule unit 111 and a data agitation unit 112.
  • the key schedule unit 111 generates a round key from a secret key (cipher key).
  • cipher key When the encryption apparatus 110 is realized by being implemented as software on a computer, the generated round key is held in a memory.
  • the data agitation unit 112 agitates the plain text and the round key to generate a cipher text.
  • the flow of encryption processing is as follows.
  • the key schedule unit 111 operates at the time of starting the program operation or updating the secret key, and generates a round key from the secret key.
  • the data agitation unit 112 performs the operation a number of times corresponding to the length of the plaintext during the encryption process.
  • a substitution table called S-box (also referred to as a substitution table) is used.
  • the S-box is a component that performs a non-linear operation, and is one of the components that form the basis of safety.
  • Cryptographic security required for the S-box includes a difference probability, a linear probability, a Boolean algebraic degree, and the number of terms of an interpolation polynomial.
  • a method for designing an S-box having good properties with respect to these items a method that combines a power operation on a Galois field and an affine transformation is known.
  • an implementation method is employed in which the calculation results calculated in advance are stored in a table. When performing the encryption process, it is possible to obtain the calculation result by referring to the data before the calculation as a table index.
  • key data round key
  • An exclusive OR exclusive OR, hereinafter referred to as “XOR”
  • XOR exclusive OR
  • Equation 2 ⁇ is a symbol representing XOR.
  • the key data k is generated from the secret key by the key schedule unit 111.
  • r1 to r4 are registers, and data x is assigned to the register r1, the head address of the table S is assigned to the register r3, and the address of the round key k is assigned to the register r4.
  • the key data k is loaded into the register r2 by the first LOAD instruction.
  • x ⁇ k that is the XOR of the data x and the key data k is calculated, and the result is assigned to the register r1.
  • (x ⁇ k) is added to the head address of the table S, and the result is stored in the register r1. By this addition, an address where the calculation result is stored is obtained.
  • the operation result stored at the address r1 is loaded into the register r2 by the second LOAD instruction.
  • Equation 3 As described above, in order to perform S-box reference, it is necessary to execute a series of four instructions shown in Equation 3.
  • Microcomputers used in embedded systems often have lower functions than processors used in personal computers and servers. For example, functions such as instruction pipeline and out-of-order optimize the execution order of instructions and shorten the processing time in a high-performance processor. However, low-function microcomputers often do not have these functions. Therefore, when implementing cryptographic algorithms on a microcomputer, implementation with a reduced number of instructions is required.
  • the objective of this invention is providing the encryption apparatus, encryption method, and program which solve this subject.
  • the encryption device is: Round key generation means for generating a round key from a secret key; The start address of the S-box table of n (n ⁇ 2) bits arranged at the 2 m (m ⁇ n) bit boundary of the memory and the round key are added, and the obtained value is held as a table entry.
  • Table entry generation means Data agitation means for agitating the data by referring to the S-box stored in the memory using an exclusive OR of the table entry and data as a table index;
  • the encryption method is: A computer generating a round key from a secret key; The start address of the S-box table of n (n ⁇ 2) bits arranged at the 2 m (m ⁇ n) bit boundary of the memory and the round key are added, and the obtained value is held as a table entry. Process, And agitation of the data by referring to the S-box stored in the memory using an exclusive OR of the table entry and data as a table index.
  • the program according to the third aspect of the present invention is: Processing to generate a round key from a secret key; The start address of the S-box table of n (n ⁇ 2) bits arranged at the 2 m (m ⁇ n) bit boundary of the memory and the round key are added, and the obtained value is held as a table entry. Processing, By referring to the S-box stored in the memory using the exclusive OR of the table entry and data as a table index, the computer is caused to execute the process of mixing the data.
  • the program can be provided as a program product recorded on a computer-readable recording medium (non-transitory computer-readable storage medium).
  • the encryption apparatus the encryption method, and the program according to the present invention, it is possible to reduce processing time when a block cipher that refers to a table is implemented by software.
  • FIG. 1 is a block diagram showing an example of the configuration of an encryption device (10) according to the present invention.
  • the encryption device (10) includes a key schedule unit (11) and data agitation means (12).
  • FIG. 2 is a block diagram showing a detailed configuration of the key schedule unit (11) as an example.
  • the key schedule unit (11) includes a round key generation unit (13) and a table entry generation unit (14).
  • the round key generation means (13) generates a round key from the secret key.
  • the table entry generating means (14) adds the head address (ST) of the n (n ⁇ 2) bit S-box table arranged at the 2 m (m ⁇ n) bit boundary of the memory and the round key. The obtained value is held as a table entry.
  • the data agitation means (12) agitates the data by referring to the S-box stored in the memory using the exclusive OR of the table entry and the data as a table index.
  • the table entry generating means (14) The start address (ST) of the S-box table on the first memory (ROM) and the round key may be added, and the obtained value may be stored in the second memory (for example, RAM) as a table entry.
  • the data agitation means (12) uses the exclusive OR of the table entry and data stored in the second memory (RAM) as a table index, and stores the S ⁇ stored in the first memory (ROM). The data is agitated by referring to the box.
  • the table entry generating means 15
  • the S-box table is copied to the 2 m (m ⁇ n) bit boundary of the second memory (for example, RAM), and the first address (ST) of the S-box table on the second memory (RAM) and the round
  • the value obtained by adding the key may be stored in the second memory (RAM) as a table entry.
  • the data agitation means (12) uses the exclusive OR of the table entry and data stored in the second memory (RAM) as a table index, and stores the S ⁇ stored in the second memory (RAM). The data is agitated by referring to the box table.
  • k ′ is the sum of the address of the S-box table and the key data k.
  • Equation 4 it can be seen that the ADD instruction in Equation 3 can be reduced.
  • the S-box table is referenced many times. For example, in the case of AES-128, 160 S-box table references are performed in one encryption process. That is, by reducing one instruction per S-box table reference, 160 instructions can be reduced by one encryption process. Therefore, according to the encryption device (10) of the present invention, the processing time when the block cipher that refers to the table is implemented by software can be greatly reduced.
  • the value obtained by the operation A + (BBC) for the data A, B, and C is different from the value obtained by the operation (A + B) BC in which the operation order is changed between addition and XOR. .
  • the addition instruction may cause a carry from the lower bit to the upper bit.
  • the data width of data A is n A
  • the data width of data B and C is n (n A > n).
  • FIG. 1 is a block diagram showing an example of the configuration of an encryption device 10 according to this embodiment.
  • the encryption device 10 includes a key schedule unit 11 and a data agitation unit 12.
  • FIG. 2 is a block diagram illustrating a detailed configuration of the key schedule unit 11 as an example.
  • the key schedule unit 11 includes a round key generation unit 13 and a table entry generation unit 14.
  • the round key generation means 13 is implemented according to a method defined by the encryption algorithm, and generates a round key from the secret key.
  • the table entry generation unit 14 generates a table entry from the start address ST of the S-box table arranged on the ROM and the round key generated by the round key generation unit 13, and stores the table entry in a RAM (Random Access Memory). .
  • Non-Patent Document 1 AES-128 (Non-Patent Document 1) will be described as an example of the encryption algorithm.
  • FIG. 3 shows the AES-128 encryption process.
  • AddRoundKey exclusively ORs a 128-bit round key RK i (0 ⁇ i ⁇ 10) to 128-bit data.
  • SubBytes divides 128-bit data into 16 8-bit data, and performs conversion by S-box.
  • ShiftRows is a data transposition process in units of 8 bits.
  • MixColumns performs an operation on 8-bit ⁇ 4 data using an MDS (Maximum Distance Separable) matrix. Details of the algorithm are described in Non-Patent Document 1.
  • FIG. 4 shows the configuration of the round key generation means 13 for AES-128.
  • FIG. 4 shows a procedure for generating RK i + 1 from the round key RK i (0 ⁇ i ⁇ 9).
  • RK 0 a 128-bit secret key is set.
  • the round key generation unit 13 inputs the round keys RK 0 to RK 10 to the table entry generation unit 14. As a delivery method, all the round keys RK 0 to RK 10 may be generated and then stored in the memory via the table entry generating means 14, or the table entry generating means every time the round key RK i is generated. 14 may be transferred.
  • the table entry generation means 14 also receives the head address ST of the S-box referred to by SubBytes.
  • the A-ES S-box is an 8-bit input / output, it is assumed that the head of the S-box is arranged on a 2 m- bit boundary (m ⁇ 8). That is, the lower m bits of the head address ST are 0. However, the length of the address ST itself is m + 1 bits or more.
  • the table entry generation means 14 divides the round key RK i (0 ⁇ i ⁇ 9) into 8-bit units.
  • the divided 8-bit round key is set as RK i j (0 ⁇ j ⁇ 15).
  • the table entry generation means 14 adds RK i j and the head address ST to form a table entry (see FIG. 5).
  • the generated table entry is stored on the RAM. However, since SubBytes does not exist after RK 10 's AddRoundKey, addition with the head address ST is not performed, and only RK 10 is stored.
  • the head address of the n-bit S-box table referred to by the data agitation unit 12 is arranged at a 2 m (m ⁇ n) bit boundary on the ROM, and the key schedule unit 11 generates A value obtained by converting the head address of the table into the round key is stored in the RAM as a table entry.
  • the data agitation unit 12 loads the data with the data added to the table entry as an address.
  • the S-box table is referred to according to Equation 4, and the table can be referred to with a smaller number of instructions than when the S-box table is referred to according to Equation 3. Therefore, according to the encryption device 10, it is possible to greatly reduce the processing time when the block cipher that refers to the table is implemented by software.
  • the encryption device according to the present embodiment includes a key schedule unit 11 and a data agitation unit 12 as in the configuration of the encryption device 10 according to the first embodiment (FIG. 1).
  • FIG. 6 is a block diagram showing, as an example, a detailed configuration of the key schedule unit 11 in the encryption device of the present embodiment.
  • the key schedule unit 11 includes a round key generation unit 13 and a table entry generation unit 15.
  • an S-box table on a ROM Read Only Memory
  • the table entry generating means 15 copies the S-box table on the ROM to the 2 m- bit boundary ST on the RAM.
  • the table entry generating unit 15 generates a table entry from the head address ST of the S-box table copied on the RAM and the round key generated by the round key generating unit 13, and stores it on the RAM.
  • the S-box table is referenced according to Equation 4, and compared with the case where the S-box table is referenced according to Equation 3.
  • table reference can be performed with a small number of instructions. According to such an encryption apparatus, it is possible to greatly reduce the processing time when the block cipher that refers to the table is implemented by software.
  • the encryption device can be applied to uses such as concealment of communication data such as a voice communication terminal and a data communication device, and encryption of data stored on a storage.

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Storage Device Security (AREA)

Abstract

 テーブルを参照するブロック暗号をソフトウェアで実装するときの処理時間を削減する。暗号化装置は、秘密鍵からラウンド鍵を生成するラウンド鍵生成手段と、メモリの2(m≧n)ビット境界に配置されたn(n≧2)ビットのS-boxテーブルの先頭アドレスとラウンド鍵とを加算して、得られた値をテーブルエントリとして保持するテーブルエントリ生成手段と、テーブルエントリとデータとの排他的論理和をテーブルインデックスとして、メモリに格納されたS-boxを参照することで、データを攪拌するデータ攪拌手段と、を備える。

Description

暗号化装置、暗号化方法およびプログラム
 [関連出願についての記載]
 本発明は、日本国特許出願:特願2012-145470号(2012年6月28日出願)に基づくものであり、同出願の全記載内容は引用をもって本書に組み込み記載されているものとする。
 本発明は、暗号化装置、暗号化方法およびプログラムに関し、特に、データの通信や蓄積の際にデータを秘匿するための共通鍵ブロック暗号に基づく暗号化装置、暗号化方法およびプログラムに関する。
 通信データや蓄積データを秘匿する技術として、ブロック暗号が知られている。代表的なブロック暗号アルゴリズムとして、DES(Data Encryption Standard)や、非特許文献1に記載されたAES(Advanced Encryption Standard)などが挙げられる。
 図7は、ブロック暗号に基づいて平文(plaintext)を暗号文(ciphertext)に変換する暗号化装置110の構成を一例として示すブロック図である。図7を参照すると、暗号化装置110は、鍵スケジュール部111およびデータ攪拌手段112を備える。
 鍵スケジュール部111は、秘密鍵(cipher key)からラウンド鍵(round key)を生成する。計算機上にソフトウェアとして実装することで暗号化装置110を実現する場合には、生成されたラウンド鍵はメモリ上に保持される。データ攪拌手段112は、平文とラウンド鍵を攪拌して暗号文を生成する。
 暗号化処理の流れは、次のとおりである。鍵スケジュール部111は、プログラムの動作開始時や秘密鍵の更新処理時に動作し、秘密鍵からラウンド鍵を生成する。データ攪拌手段112は、暗号化処理時に、平文の長さに応じた回数の動作を行う。
 多くのブロック暗号では、S-boxと呼ばれる換字表(substitution table、置換表ともいう。)が使用される。S-boxは、非線形な演算を行う部品であり、安全性の基礎をなす構成要素の一つである。S-boxに求められる暗号学的安全性として、差分確率、線形確率、ブール代数次数、補間多項式の項数などがある。これらの項目に関して良い性質を有するS-boxの設計方法として、ガロア体上のべき乗演算とアフィン変換を組み合わせた方法が知られている。しかしながら、かかる方法によると、演算量が多いため、処理時間が長くなるという問題がある。そこで、事前に計算した演算結果をテーブルに格納する実装方法が採用されている。暗号化処理を行う際には、演算前のデータをテーブルのインデックスとしてテーブル参照することで、演算結果を求めることができる。
 一例として、AESで使用されるS-boxについて説明する。AESのS-boxは8ビット(1バイト)の値に対して演算を行うため、値域は256である。演算前のデータが0x00の場合、演算結果は0x63、0x01の場合は0x7C、0x02の場合は0x77、…、0xFFの場合は0x16となる(非特許文献1、Fig. 7)。このとき、S-boxの演算結果を格納するテーブルSは、数式1で定義される。
[数1]
S[256]={0x63,0x7C,0x77,…,0x16}
 一般に、S-boxによる演算を行う前にデータに対して鍵データ(ラウンド鍵)を作用させる。データに対して鍵データを作用させる演算として、排他的論理和(exclusive OR、以下「XOR」という。)を用いる。演算前のデータをx、鍵データをk、演算後のデータをyとしたとき、S-box参照の手続きは、C言語風に記載すると、数式2のように表される。
[数2]
y=S[x○k]
 数式2において、○はXORを表す記号である。鍵データkは、鍵スケジュール部111によって秘密鍵から生成される。
 また、S-box参照の処理をアセンブラレベルの擬似コードで記述すると、数式3のように表される。
[数3]
LOAD r2,[r4]
XOR  r1,r2
ADD  r1,r3
LOAD r2,[r1]
 数式3において、r1~r4はレジスタであり、レジスタr1にはデータx、レジスタr3にはテーブルSの先頭アドレス、レジスタr4にはラウンド鍵kのアドレスが代入されているものとする。
 数式3を参照すると、まず、1つ目のLOAD命令でレジスタr2に鍵データkがロードされる。次に、XOR命令では、データxと鍵データkとのXORであるx○kが計算され、結果がレジスタr1に代入される。次に、ADD命令では、テーブルSの先頭アドレスに(x○k)を加算し、結果がレジスタr1に格納される。この加算により、演算結果が格納されているアドレスが求められる。次に、2つ目のLOAD命令により、アドレスr1に保存されている演算結果をレジスタr2にロードする。
 以上のように、S-box参照を行うためには、数式3に示した一連の4命令を実行する必要がある。
Federal Information Processing Standards Publication 197, "Announcing the ADVANCED ENCRYPTION STANDARD (AES)," November 26, 2001.
 以下の分析は、本発明者によってなされたものである。
 組み込みシステムに利用されるマイコン(特に、安価なマイコン)は、パソコンやサーバに用いられるプロセッサよりも低機能であることが多い。例えば、命令パイプラインやアウト・オブ・オーダーなどの機能は、高機能なプロセッサにおいては、命令の実行順序を最適化し、処理時間を短縮する。しかしながら、低機能なマイコンでは、これらの機能が搭載されないことが多い。したがって、マイコン上で暗号アルゴリズムをソフトウェア実装する場合、命令数を削減した実装が必要とされる。
 そこで、テーブルを参照するブロック暗号をソフトウェアで実装したときの処理時間を削減することが課題となる。本発明の目的は、かかる課題を解決する暗号化装置、暗号化方法およびプログラムを提供することにある。
 本発明の第1の視点に係る暗号化装置は、
 秘密鍵からラウンド鍵を生成するラウンド鍵生成手段と、
 メモリの2(m≧n)ビット境界に配置されたn(n≧2)ビットのS-boxテーブルの先頭アドレスと前記ラウンド鍵とを加算して、得られた値をテーブルエントリとして保持するテーブルエントリ生成手段と、
 前記テーブルエントリとデータとの排他的論理和をテーブルインデックスとして、前記メモリに格納された前記S-boxを参照することで、前記データを攪拌するデータ攪拌手段と、を備える。
 本発明の第2の視点に係る暗号化方法は、
 コンピュータが、秘密鍵からラウンド鍵を生成する工程と、
 メモリの2(m≧n)ビット境界に配置されたn(n≧2)ビットのS-boxテーブルの先頭アドレスと前記ラウンド鍵とを加算して、得られた値をテーブルエントリとして保持する工程と、
 前記テーブルエントリとデータとの排他的論理和をテーブルインデックスとして、前記メモリに格納された前記S-boxを参照することで、前記データを攪拌する工程と、を含む。
 本発明の第3の視点に係るプログラムは、
 秘密鍵からラウンド鍵を生成する処理と、
 メモリの2(m≧n)ビット境界に配置されたn(n≧2)ビットのS-boxテーブルの先頭アドレスと前記ラウンド鍵とを加算して、得られた値をテーブルエントリとして保持する処理と、
 前記テーブルエントリとデータとの排他的論理和をテーブルインデックスとして、前記メモリに格納された前記S-boxを参照することで、前記データを攪拌する処理と、をコンピュータに実行させる。
 なお、プログラムは、コンピュータ読み取り可能な記録媒体(non-transitory computer-readable storage medium)に記録されたプログラム製品として提供することができる。
 本発明に係る暗号化装置、暗号化方法およびプログラムによると、テーブルを参照するブロック暗号をソフトウェアで実装したときの処理時間を削減することが可能となる。
第1の実施形態に係る暗号化装置の構成を一例として示すブロック図である。 第1の実施形態に係る暗号化装置における鍵スケジュール部の構成を一例として示すブロック図である。 AES-128に基づく暗号化処理の動作を示すフロー図である。 AES-128に基づくラウンド鍵生成手段の構成を示すブロック図である。 RAM上のテーブルエントリを示す図である。 第2の実施形態に係る暗号化装置における鍵スケジュール部の構成を一例として示すブロック図である。 ブロック暗号の基本的な構成を示すブロック図である。
 はじめに、一実施形態の暗号化装置の概要について説明する。なお、この概要に付記する図面参照符号は、専ら理解を助けるための例示であり、本発明を図示の態様に限定することを意図するものではない。
 図1は、本発明に係る暗号化装置(10)の構成を一例として示すブロック図である。図1を参照すると、暗号化装置(10)は、鍵スケジュール部(11)およびデータ攪拌手段(12)を備える。図2は、鍵スケジュール部(11)の詳細な構成を一例として示すブロック図である。図2を参照すると、鍵スケジュール部(11)は、ラウンド鍵生成手段(13)およびテーブルエントリ生成手段(14)を備える。
 ラウンド鍵生成手段(13)は、秘密鍵からラウンド鍵を生成する。テーブルエントリ生成手段(14)は、メモリの2(m≧n)ビット境界に配置されたn(n≧2)ビットのS-boxテーブルの先頭アドレス(ST)とラウンド鍵とを加算して、得られた値をテーブルエントリとして保持する。データ攪拌手段(12)は、テーブルエントリとデータとの排他的論理和をテーブルインデックスとして、メモリに格納されたS-boxを参照することで、データを攪拌する。
 図2に示すように、S-boxテーブルが第1のメモリ(例えば、ROM)の2(m≧n)ビット境界に配置されている場合には、テーブルエントリ生成手段(14)は、第1のメモリ(ROM)上におけるS-boxテーブルの先頭アドレス(ST)とラウンド鍵とを加算して、得られた値をテーブルエントリとして第2のメモリ(例えば、RAM)に格納してもよい。このとき、データ攪拌手段(12)は、第2のメモリ(RAM)に格納されたテーブルエントリとデータとの排他的論理和をテーブルインデックスとして、第1のメモリ(ROM)に格納されたS-boxを参照することで、データを攪拌する。
 一方、図6に示すように、S-boxテーブルが第1のメモリ(例えば、ROM)の2(m≧n)ビット境界に配置されていない場合には、テーブルエントリ生成手段(15)は、S-boxテーブルを第2のメモリ(例えば、RAM)の2(m≧n)ビット境界にコピーし、第2のメモリ上(RAM)におけるS-boxテーブルの先頭アドレス(ST)とラウンド鍵とを加算して、得られた値をテーブルエントリとして第2のメモリ(RAM)に格納してもよい。このとき、データ攪拌手段(12)は、第2のメモリ(RAM)に格納されたテーブルエントリとデータとの排他的論理和をテーブルインデックスとして、第2のメモリ(RAM)に格納されたS-boxテーブルを参照することで、データを攪拌する。
 このように、予めテーブルのアドレスと鍵データとの加算を行っておくことにより、データ攪拌手段(12)によるS-boxテーブル参照に要する命令数を削減することが可能となる。ここで、S-boxテーブルのアドレスと鍵データkを加算したものをk’とする。このときのS-boxテーブル参照の処理をアセンブラレベルの擬似コードで記述すると、数式4で表される。レジスタr1にはデータx、レジスタr4には鍵データk’のアドレスが代入されているものとする。
[数4]
LOAD r2,[r4]
XOR  r1,r2
LOAD r2,[r1]
 数式4においては、数式3におけるADD命令を削減できていることが分かる。1回の暗号化処理において、S-boxテーブルの参照は多数回行われる。例えば、AES-128の場合、1回の暗号化処理で160回のS-boxテーブル参照が行われる。すなわち、S-boxテーブル参照1回当たり1命令を削減することで、1回の暗号化処理では160命令も削減することができる。したがって、本発明に係る暗号化装置(10)によると、テーブルを参照するブロック暗号をソフトウェアで実装したときの処理時間を大幅に削減することができる。
 一般に、データA、B、Cに対してA+(B○C)という演算によって得られる値は、加算とXORの間で演算順序を変更した(A+B)○Cという演算によって得られる値とは異なる。加算命令では、下位ビットから上位ビットへ桁上りが発生する可能性があるからである。ここで、データAのデータ幅をn、データBとCのデータ幅をnとする(n>n)。S-boxテーブルSの先頭アドレスを2ビット境界(n>m≧n)に配置すると、テーブルSの先頭アドレスの下位mビットは0になる。このとき、下位mビットにいかなる値を加算してもm+1ビット以上への桁上りは発生しない。このとき、(A+B)○Cという演算を行っても、A+(B○C)という演算を行った場合と同一の結果が得られる。よって、数式4の処理に従ってS-boxテーブル参照を行った場合においても、数式3の処理に従ってS-box参照を行った場合と同一の結果が得られる。
 (実施形態1)
 第1の実施形態に係る暗号化装置について、図面を参照して詳細に説明する。図1は、本実施形態に係る暗号化装置10の構成を一例として示すブロック図である。図1を参照すると、暗号化装置10は、鍵スケジュール部11およびデータ攪拌手段12を備える。
 図2は、鍵スケジュール部11の詳細な構成を一例として示すブロック図である。図2を参照すると、鍵スケジュール部11は、ラウンド鍵生成手段13およびテーブルエントリ生成手段14を備える。
 ラウンド鍵生成手段13は、暗号アルゴリズムで規定されている方式に従って実装され、秘密鍵からラウンド鍵を生成する。テーブルエントリ生成手段14は、ROM上に配置されたS-boxテーブルの先頭アドレスSTとラウンド鍵生成手段13で生成されたラウンド鍵からテーブルエントリを生成し、RAM(Random Access Memory)上に格納する。
 以下では、本実施形態の暗号化装置10の動作を、具体的な暗号アルゴリズムを用いて詳細に説明する。ここでは、暗号アルゴリズムとしてAES-128(非特許文献1)を例に説明する。図3は、AES-128の暗号化処理を示す。AddRoundKeyは、128ビットのデータに対して128ビットのラウンド鍵RK(0≦i≦10)を排他的論理和する。SubBytesは、128ビットのデータを16個の8ビットデータに分割し、それぞれをS-boxによる変換を行う。ShiftRowsは、8ビット単位のデータ転置処理である。MixColumnsは、8ビット×4のデータに対してMDS(Maximum Distance Separable)行列による演算を行う。アルゴリズムの詳細については、非特許文献1に記載されている。
 図4は、AES-128に対するラウンド鍵生成手段13の構成を示す。図4は、ラウンド鍵RKからRKi+1を生成する手順を示している(0≦i≦9)。RKには、128ビットの秘密鍵が設定される。
 ラウンド鍵生成手段13は、ラウンド鍵RK~RK10をテーブルエントリ生成手段14に入力する。受け渡しの方法として、すべてのラウンド鍵RK~RK10を生成してからテーブルエントリ生成手段14を経由してメモリに格納してもよいし、ラウンド鍵RKを生成するごとにテーブルエントリ生成手段14に受け渡すようにしてもよい。テーブルエントリ生成手段14は、SubBytesで参照するS-boxの先頭アドレスSTも受け付ける。
 AESのS-boxは8ビット入出力であるから、S-boxの先頭は2ビット境界に配置されているものとする(m≧8)。すなわち、先頭アドレスSTの下位mビットは0である。ただし、アドレスST自体の長さはm+1ビット以上である。
 テーブルエントリ生成手段14は、ラウンド鍵RK(0≦i≦9)を8ビット単位に分割する。分割した8ビットラウンド鍵をRK とする(0≦j≦15)。テーブルエントリ生成手段14は、RK と先頭アドレスSTとを加算し、テーブルエントリとする(図5参照)。生成されたテーブルエントリは、RAM上に保存される。ただし、RK10のAddRoundKeyの後にはSubBytesが存在しないため、先頭アドレスSTとの加算は行わず、RK10のみを保存する。
 暗号化処理におけるAddRoundKeyとSubBytesの処理は、数式4で示した命令により実現される。最初のLOAD命令では、テーブルエントリの単位でロードする。それに対してデータをXORすることで、S-boxの演算結果が格納されたアドレスの計算が完了する。
 本実施形態の暗号化装置10では、データ攪拌手段12で参照するnビットのS-boxテーブルの先頭アドレスをROM上の2(m≧n)ビット境界に配置し、鍵スケジュール部11では生成したラウンド鍵にテーブルの先頭アドレスを換算した値をテーブルエントリとしてRAMに保存する。データ攪拌手段12では、データをテーブルエントリに加算したものをアドレスとしてデータをロードする。
 暗号化装置10によると、数式4に従ってS-boxテーブルの参照が行われ、数式3に従ってS-boxテーブルの参照を行う場合と比較して、少ない命令数でテーブル参照を行うことができる。したがって、暗号化装置10によると、テーブルを参照するブロック暗号をソフトウェアで実装したときの処理時間を大幅に削減することが可能となる。
 (実施形態2)
 第2の実施形態に係る暗号化装置について、図面を参照して詳細に説明する。本実施形態に係る暗号化装置は、第1の実施形態に係る暗号化装置10の構成(図1)と同様に、鍵スケジュール部11およびデータ攪拌手段12を備える。
 図6は、本実施形態の暗号化装置における鍵スケジュール部11の詳細な構成を一例として示すブロック図である。図6を参照すると、鍵スケジュール部11は、ラウンド鍵生成手段13およびテーブルエントリ生成手段15を備える。
 図6を参照すると、本実施形態では、ROM(Read Only Memory)上のS-boxテーブルが2ビット(p<m)境界に配置されている。このとき、テーブルエントリ生成手段15は、ROM上のS-boxテーブルをRAM上の2ビット境界STにコピーする。また、テーブルエントリ生成手段15は、RAM上にコピーされたS-boxテーブルの先頭アドレスSTとラウンド鍵生成手段13で生成されたラウンド鍵からテーブルエントリを生成し、RAM上に格納する。
 本実施形態の暗号化装置によると、第1の実施形態の暗号化装置と同様に、数式4に従ってS-boxテーブルの参照が行われ、数式3に従ってS-boxテーブルの参照を行う場合と比較して、少ない命令数でテーブル参照を行うことができる。かかる暗号化装置によると、テーブルを参照するブロック暗号をソフトウェアで実装したときの処理時間を大幅に削減することが可能となる。
 本発明に係る暗号化装置は、音声通信端末やデータ通信装置などの通信データの秘匿や、ストレージ上の蓄積データの暗号化といった用途に適用することができる。
 なお、上記の特許文献の先行技術文献の開示を、本書に引用をもって繰り込むものとする。本発明の全開示(請求の範囲を含む)の枠内において、さらにその基本的技術思想に基づいて、実施形態の変更・調整が可能である。また、本発明の請求の範囲の枠内において種々の開示要素(各請求項の各要素、各実施形態の各要素、各図面の各要素等を含む)の多様な組み合わせ、ないし、選択が可能である。すなわち、本発明は、請求の範囲を含む全開示、技術的思想にしたがって当業者であればなし得るであろう各種変形、修正を含むことは勿論である。特に、本書に記載した数値範囲については、当該範囲内に含まれる任意の数値ないし小範囲が、別段の記載のない場合でも具体的に記載されているものと解釈されるべきである。
10、110  暗号化装置
11、111  鍵スケジュール部
12、112  データ攪拌手段
13  ラウンド鍵生成手段
14、15  テーブルエントリ生成手段

Claims (12)

  1.  秘密鍵からラウンド鍵を生成するラウンド鍵生成手段と、
     メモリの2(m≧n)ビット境界に配置されたn(n≧2)ビットのS-boxテーブルの先頭アドレスと前記ラウンド鍵とを加算して、得られた値をテーブルエントリとして保持するテーブルエントリ生成手段と、
     前記テーブルエントリとデータとの排他的論理和をテーブルインデックスとして、前記メモリに格納された前記S-boxを参照することで、前記データを攪拌するデータ攪拌手段と、を備える、暗号化装置。
  2.  前記テーブルエントリ生成手段は、前記S-boxテーブルが第1のメモリの2(m≧n)ビット境界に配置されている場合、前記第1のメモリ上における前記S-boxテーブルの先頭アドレスと前記ラウンド鍵とを加算して、得られた値をテーブルエントリとして第2のメモリに格納し、
     前記データ攪拌手段は、前記第2のメモリに格納された前記テーブルエントリとデータとの排他的論理和をテーブルインデックスとして、前記第1のメモリに格納された前記S-boxを参照することで、前記データを攪拌する、請求項1に記載の暗号化装置。
  3.  前記テーブルエントリ生成手段は、前記S-boxテーブルが第1のメモリの2(m≧n)ビット境界に配置されていない場合、前記S-boxテーブルを第2のメモリの2(m≧n)ビット境界にコピーし、前記第2のメモリ上における前記S-boxテーブルの先頭アドレスと前記ラウンド鍵とを加算して、得られた値をテーブルエントリとして第2のメモリに格納し、
     前記データ攪拌手段は、前記第2のメモリに格納された前記テーブルエントリとデータとの排他的論理和をテーブルインデックスとして、前記第2のメモリに格納された前記S-boxテーブルを参照することで、前記データを攪拌する、請求項1に記載の暗号化装置。
  4.  前記データ攪拌手段は、AES(Advanced Encryption Standard)のアルゴリズムに従って前記データを攪拌する、請求項1ないし3のいずれか1項に記載の暗号化装置。
  5.  コンピュータが、秘密鍵からラウンド鍵を生成する工程と、
     メモリの2(m≧n)ビット境界に配置されたn(n≧2)ビットのS-boxテーブルの先頭アドレスと前記ラウンド鍵とを加算して、得られた値をテーブルエントリとして保持する工程と、
     前記テーブルエントリとデータとの排他的論理和をテーブルインデックスとして、前記メモリに格納された前記S-boxを参照することで、前記データを攪拌する工程と、を含む、暗号化方法。
  6.  前記コンピュータが、前記S-boxテーブルが第1のメモリの2(m≧n)ビット境界に配置されている場合、前記第1のメモリ上における前記S-boxテーブルの先頭アドレスと前記ラウンド鍵とを加算して、得られた値をテーブルエントリとして第2のメモリに格納し、
     前記第2のメモリに格納された前記テーブルエントリとデータとの排他的論理和をテーブルインデックスとして、前記第1のメモリに格納された前記S-boxを参照することで、前記データを攪拌する、請求項5に記載の暗号化方法。
  7.  前記コンピュータが、前記S-boxテーブルが第1のメモリの2(m≧n)ビット境界に配置されていない場合、前記S-boxテーブルを第2のメモリの2(m≧n)ビット境界にコピーし、前記第2のメモリ上における前記S-boxテーブルの先頭アドレスと前記ラウンド鍵とを加算して、得られた値をテーブルエントリとして第2のメモリに格納し、
     前記第2のメモリに格納された前記テーブルエントリとデータとの排他的論理和をテーブルインデックスとして、前記第2のメモリに格納された前記S-boxテーブルを参照することで、前記データを攪拌する、請求項5に記載の暗号化方法。
  8.  前記コンピュータが、AES(Advanced Encryption Standard)のアルゴリズムに従って前記データを攪拌する、請求項5ないし7のいずれか1項に記載の暗号化方法。
  9.  秘密鍵からラウンド鍵を生成する処理と、
     メモリの2(m≧n)ビット境界に配置されたn(n≧2)ビットのS-boxテーブルの先頭アドレスと前記ラウンド鍵とを加算して、得られた値をテーブルエントリとして保持する処理と、
     前記テーブルエントリとデータとの排他的論理和をテーブルインデックスとして、前記メモリに格納された前記S-boxを参照することで、前記データを攪拌する処理と、をコンピュータに実行させる、プログラム。
  10.  前記S-boxテーブルが第1のメモリの2(m≧n)ビット境界に配置されている場合、前記第1のメモリ上における前記S-boxテーブルの先頭アドレスと前記ラウンド鍵とを加算して、得られた値をテーブルエントリとして第2のメモリに格納し、
     前記第2のメモリに格納された前記テーブルエントリとデータとの排他的論理和をテーブルインデックスとして、前記第1のメモリに格納された前記S-boxを参照することで、前記データを攪拌する処理を、前記コンピュータに実行させる、請求項9に記載のプログラム。
  11.  前記S-boxテーブルが第1のメモリの2(m≧n)ビット境界に配置されていない場合、前記S-boxテーブルを第2のメモリの2(m≧n)ビット境界にコピーし、前記第2のメモリ上における前記S-boxテーブルの先頭アドレスと前記ラウンド鍵とを加算して、得られた値をテーブルエントリとして第2のメモリに格納し、
     前記第2のメモリに格納された前記テーブルエントリとデータとの排他的論理和をテーブルインデックスとして、前記第2のメモリに格納された前記S-boxテーブルを参照することで、前記データを攪拌する処理を、前記コンピュータに実行させる、請求項9に記載のプログラム。
  12.  AES(Advanced Encryption Standard)のアルゴリズムに従って前記データを攪拌する処理を前記コンピュータに実行させる、請求項9ないし11のいずれか1項に記載のプログラム。
PCT/JP2013/067652 2012-06-28 2013-06-27 暗号化装置、暗号化方法およびプログラム WO2014003117A1 (ja)

Priority Applications (2)

Application Number Priority Date Filing Date Title
JP2014522679A JP6028798B2 (ja) 2012-06-28 2013-06-27 暗号化装置、暗号化方法およびプログラム
US14/411,595 US9571269B2 (en) 2012-06-28 2013-06-27 Encryption device, encryption method and program

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
JP2012145470 2012-06-28
JP2012-145470 2012-06-28

Publications (1)

Publication Number Publication Date
WO2014003117A1 true WO2014003117A1 (ja) 2014-01-03

Family

ID=49783254

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/JP2013/067652 WO2014003117A1 (ja) 2012-06-28 2013-06-27 暗号化装置、暗号化方法およびプログラム

Country Status (3)

Country Link
US (1) US9571269B2 (ja)
JP (1) JP6028798B2 (ja)
WO (1) WO2014003117A1 (ja)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2017215518A (ja) * 2016-06-01 2017-12-07 富士電機株式会社 データ処理装置、データ処理方法及びプログラム

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9319878B2 (en) * 2012-09-14 2016-04-19 Qualcomm Incorporated Streaming alignment of key stream to unaligned data stream
KR101932680B1 (ko) 2018-09-27 2018-12-26 (주)아이엔아이 데이터를 안전하게 보호하는 암호화 키 생성 모듈
JP7383985B2 (ja) * 2019-10-30 2023-11-21 富士電機株式会社 情報処理装置、情報処理方法及びプログラム

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP3818263B2 (ja) * 2003-01-28 2006-09-06 日本電気株式会社 Aes暗号処理装置、aes復号処理装置、aes暗号・復号処理装置、aes暗号処理方法、aes復号処理方法、および、aes暗号・復号処理方法

Family Cites Families (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP3600454B2 (ja) * 1998-08-20 2004-12-15 株式会社東芝 暗号化・復号装置、暗号化・復号方法、およびそのプログラム記憶媒体
WO2006020238A2 (en) * 2004-07-16 2006-02-23 Ns8 Corporation Method and system for managing the use of electronic works
KR100837270B1 (ko) 2006-06-07 2008-06-11 삼성전자주식회사 스마트 카드 및 그것의 데이터 보안 방법
US20080019524A1 (en) * 2006-06-29 2008-01-24 Kim Moo S Apparatus and method for low power aes cryptographic circuit for embedded system
US8189792B2 (en) * 2007-12-28 2012-05-29 Intel Corporation Method and apparatus for performing cryptographic operations
US9336160B2 (en) * 2008-10-30 2016-05-10 Qualcomm Incorporated Low latency block cipher
US9014370B2 (en) * 2012-12-09 2015-04-21 Sandisk Technologies Inc. High performance hardware-based execution unit for performing C2 block cipher encryption/decryption

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP3818263B2 (ja) * 2003-01-28 2006-09-06 日本電気株式会社 Aes暗号処理装置、aes復号処理装置、aes暗号・復号処理装置、aes暗号処理方法、aes復号処理方法、および、aes暗号・復号処理方法

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
JUNKO NAKAJIMA ET AL.: "Performance evaluation of block encryption algorithms on Core2", MITSUBISHI DENKI GIHO, vol. 82, no. 5, 25 May 2008 (2008-05-25), pages 27 - 30 *
SEIICHI AMADA ET AL.: "Improvement of Fast Software Implementation of Block Ciphers : A New Algorithm Which Reduces the Number of Instructions in Functions Used in Block Ciphers", IEICE TECHNICAL REPORT, vol. 97, no. 71, 26 May 1997 (1997-05-26), pages 107 - 119 *

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2017215518A (ja) * 2016-06-01 2017-12-07 富士電機株式会社 データ処理装置、データ処理方法及びプログラム
US10411881B2 (en) 2016-06-01 2019-09-10 Fuji Electric Co., Ltd. Data processing apparatus, method for processing data, and medium

Also Published As

Publication number Publication date
US9571269B2 (en) 2017-02-14
US20150163051A1 (en) 2015-06-11
JPWO2014003117A1 (ja) 2016-06-02
JP6028798B2 (ja) 2016-11-16

Similar Documents

Publication Publication Date Title
Rijmen et al. Advanced encryption standard
US8966279B2 (en) Securing the implementation of a cryptographic process using key expansion
US8634549B2 (en) Ciphertext key chaining
US9515818B2 (en) Multi-block cryptographic operation
US9189425B2 (en) Protecting look up tables by mixing code and operations
TWI447683B (zh) Information processing device
Muir A tutorial on white-box AES
US20120170739A1 (en) Method of diversification of a round function of an encryption algorithm
JP5704159B2 (ja) ブロック暗号化装置、ブロック復号装置、ブロック暗号化方法、ブロック復号方法及びプログラム
US20130236005A1 (en) Cryptographic processing apparatus
CN107257279B (zh) 一种明文数据加密方法及设备
US8675866B2 (en) Multiplicative splits to protect cipher keys
US20120254625A1 (en) Protecting states of a cryptographic process using group automorphisms
US10148427B2 (en) Information processing apparatus, method for processing information, and medium
Gueron Advanced encryption standard (AES) instructions set
JP6028798B2 (ja) 暗号化装置、暗号化方法およびプログラム
Dolmatov GOST R 34.12-2015: Block Cipher" Kuznyechik"
JP5652363B2 (ja) 暗号処理装置、および暗号処理方法、並びにプログラム
US8774402B2 (en) Encryption/decryption apparatus and method using AES rijndael algorithm
WO2022254511A1 (ja) 暗号装置、方法、及びプログラム
JP2010256749A (ja) ハッシュ値生成装置、ハッシュ値生成方法およびプログラム
JP2013205437A (ja) 非線形関数S−boxの計算方法及び装置
Shi et al. On security of a white-box implementation of SHARK
Dooley et al. The Machines Take Over: Computer Cryptography
JP5096794B2 (ja) ストリーム暗号の暗号化装置、ストリーム暗号の復号化装置、自己同期型ストリーム暗号の暗号化装置、自己同期型ストリーム暗号の復号化装置、ストリーム暗号の暗号化方法、自己同期型ストリーム暗号の暗号化方法およびプログラム

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 13810257

Country of ref document: EP

Kind code of ref document: A1

ENP Entry into the national phase

Ref document number: 2014522679

Country of ref document: JP

Kind code of ref document: A

NENP Non-entry into the national phase

Ref country code: DE

WWE Wipo information: entry into national phase

Ref document number: 14411595

Country of ref document: US

122 Ep: pct application non-entry in european phase

Ref document number: 13810257

Country of ref document: EP

Kind code of ref document: A1