JP2004088632A - Encryption device - Google Patents

Encryption device Download PDF

Info

Publication number
JP2004088632A
JP2004088632A JP2002249369A JP2002249369A JP2004088632A JP 2004088632 A JP2004088632 A JP 2004088632A JP 2002249369 A JP2002249369 A JP 2002249369A JP 2002249369 A JP2002249369 A JP 2002249369A JP 2004088632 A JP2004088632 A JP 2004088632A
Authority
JP
Japan
Prior art keywords
inspection
encryption
key
signature
test
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.)
Withdrawn
Application number
JP2002249369A
Other languages
Japanese (ja)
Inventor
Hideo Sato
佐藤 英雄
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.)
Sony Corp
Original Assignee
Sony Corp
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 Sony Corp filed Critical Sony Corp
Priority to JP2002249369A priority Critical patent/JP2004088632A/en
Publication of JP2004088632A publication Critical patent/JP2004088632A/en
Withdrawn legal-status Critical Current

Links

Images

Abstract

<P>PROBLEM TO BE SOLVED: To enhance the security property by making it difficult to perform the estimation of internal key information or the analysis of hardware without performing post processing such as pattern cut, etc. <P>SOLUTION: An encryption device is equipped with: a storage means which stores data for inspection, parameters for inspection, random numbers for inspection, and a key for inspection as initial values; and an encryption processing means which performs encoding processing. The encryption processing means performs the encryption processing using the data for inspection, the parameter for inspection, the random numbers for inspection, and the key for inspection stored in the storage means, according to the instruction of an inspection mode is given from outside. <P>COPYRIGHT: (C)2004,JPO

Description

【0001】
【発明の属する技術分野】
本発明は、暗号化処理を行う暗号化装置に関する。
【0002】
【従来の技術】
近年、例えばいわゆるインターネット等を利用した電子商取引やオンラインショッピングといった各種通信技術を利用した様々なサービスが普及しつつある。また、近年では、通信技術の進歩に伴い、端末を介した通信技術のみならず、例えば交通機関の料金徴収やいわゆる電子マネー等に利用するための通信機能を集積回路化した非接触型半導体メモリカードといったカード状のデバイスも開発されている。
【0003】
このような通信機能を有するカード状のデバイス(以下、非接触型IC(Integrated Circuit)カードと称する。)を用いたサービスにおいては、セキュリティ性の向上が必要不可欠であるため、通常、通信相手の正当性を認証するための相互認証処理や、データ通信の安全性を確保するための暗号化処理が行われる。その際、非接触型ICカードにおいては、処理の高速化が要求されることから、これらの機能をソフトウェアによって実装すると、高いクロックのCPU(Central Processing Unit)を要することとなり、実用的でない。そのため、非接触型ICカードにおいては、これらの機能をソフトウェアによって実装するのではなく、ハードウェアによって実装するのが望ましい。
【0004】
ここで、このようなハードウェアによって上述した機能を実装する非接触型ICカードにおいては、電力消費を極力抑制するために、例えばいわゆるDES(Data Encryption Standard)暗号化方式といった比較的少ない回路規模及び電力消費で実装することができるいわゆる共通鍵暗号化方式を採用するものが多かった。
【0005】
しかしながら、暗号化及び復号に共通の鍵を用いる共通鍵暗号化方式は、鍵データの授受を行う必要があるといった観点から、不正な第三者による攻撃に弱いという問題がある。そのため、非接触型ICカードにおいては、将来的に金融サービスに適用する場合等の問題が懸念されていた。
【0006】
そのため、非接触型ICカードを用いたサービスにおいては、非接触型ICカードとして、例えばいわゆるRSA(Rivest−Shamir−Adleman)暗号化方式や楕円曲線暗号化方式(Elliptic Curve Cryptosystem;ECC)といったように、暗号化と復号とに用いる鍵を異なるものとし、秘密に保つ必要がある共通鍵を特定の1人が持てばよいいわゆる公開鍵暗号化方式を採用したセキュリティの高いシステムが要求されつつあり、公開鍵を用いた署名生成及び署名検証を行う非接触型ICカードの開発も多く試みられている。
【0007】
【発明が解決しようとする課題】
ところで、上述したような公開鍵暗号化方式を採用した非接触型ICカード等に搭載されるためのICチップを製造する際には、製造後に暗号化装置が正常に動作するか否かを確認するために、ICチップの製造者又は検査をする者が出荷検査を行わなければならない。このため、非接触型ICカードのICチップには、暗号化装置に直接アクセスして暗号化装置の故障の有無を検査するための専用の外部バスである検査用外部入出力端子が設けられている。
【0008】
ここで、通常の暗号化装置の検査用の回路は、図7のように構成されている。すなわち、各部を制御するCPUと、このCPUのワークエリアとして機能するメモリであるRAM(Random Access Memory)と、各種プログラム等を記憶する読み出し専用のメモリであるROM(Read Only Memory)と、電気的に書き換え可能とされるメモリであるEEPROM(Electrically Erasable ProgrammableRead Only Memory)とを備えるCPU/RAM/ROM/EEPROMと、暗号化処理を行う暗号化処理手段としての暗号エンジンとを備え、CPU/RAM/ROM/EEPROM及び暗号エンジンがそれぞれ図示しない検査用外部入出力端子に接続されている。
【0009】
そして暗号エンジンの検査をする際には、検査用外部入力端子から暗号エンジンに検査用データ及び検査用パラメータ等を直接入力する。CPU/RAM/ROM/EEPROMの制御のもとに暗号エンジンが暗号化処理を行い、検査用外部出力端子から出力値が出力される。検査をする者は、出力値が正確であるか否かの答え合わせを行うことによって、暗号エンジンの故障の有無を判断する。
【0010】
つまり、検査をする者は、少なくとも検査用データ、検査用パラメータ等の入力データ及び出力データの正しい値である期待値を知っておく必要がある。
【0011】
ところで、専用の検査用外部入出力端子は、暗号化装置の検査のために必要不可欠である一方で、不正な第三者が暗号エンジンへアクセスし、上述した入力データや期待値等を利用して内部の鍵情報等を取得又は推定したり、上記のような検査を繰り返すことでハードウェアを解析する手段となり得るため、セキュリティ上の問題点となっている。
【0012】
そこで、チップ製造後にこの検査用外部入出力端子を例えば機械的に切断するいわゆるパターンカットと呼ばれる手法や、検査用外部入出力端子を電気的に焼き切り使用不可能とする手法等により、暗号エンジンへのアクセスを不可能とする方法が一般的に採用されている。
【0013】
しかしながら、これらの手法を実施すると、出荷後のICチップに不良が発生した場合にこの不良品の検査や調査が不可能となり、不良原因が特定できなくなるという別の問題を生じたり、製品の歩留まりを悪化させる原因ともなる。
【0014】
そこで本発明はこのような従来の問題点を解決するために提案されたものであり、パターンカット等の後処理を行うことなく内部の鍵情報の推定やハードウェアの解析を困難とし、セキュリティ性の向上を図ることが可能な暗号化装置を提供することを目的とする。
【0015】
【課題を解決するための手段】
上述の目的を達成するために、本発明に係る暗号化装置は、検査用データ、検査用パラメータ、検査用乱数及び検査用鍵を初期値として格納する記憶手段と、暗号化処理を行う暗号化処理手段とを備え、上記暗号化処理手段は、検査モードの命令が外部から与えられるのに応じて、上記記憶手段に記憶された上記検査用データ、上記検査用パラメータ、上記検査用乱数及び上記検査用鍵を用いて暗号化処理を行うことを特徴とする。
【0016】
以上のような本発明に係る暗号化装置は、検査用データ、検査用パラメータ、検査用乱数及び検査用鍵を初期値として記憶手段に格納しておき、外部から検査モードの命令が入力されたらこれらを読み出して暗号化処理し、結果を出力する。検査をする者は、出力結果の正しい値である期待値を知っていれば、この期待値と出力された結果とを比較することで暗号化装置の故障の有無を判定できる。このため、検査用データ等の入出力を繰り返すことによる暗号化装置に対する攻撃を回避できる。
【0017】
【発明の実施の形態】
以下、本発明を適用した暗号化装置について、図面を参照しながら詳細に説明する。
【0018】
本発明の暗号化装置は、例えば通信機能を集積回路化した非接触型半導体メモリカードといったカード状のデバイス(以下、非接触型IC(Integrated Circuit)カードと称する。)等に内蔵されるICチップ等に適用することができるものであって、通信相手の正当性を認証するための相互認証処理や、データ通信の安全性を確保するための暗号化処理の機能を、ハードウェアによって実装したものである。
【0019】
ここでは、最初に、暗号化装置の基本的な構成及び検査方法について説明し、次に、実際の非接触型ICカードに搭載された暗号化装置において検査を行う場合の具体例について説明する。
【0020】
先ず、本発明の暗号化装置の検査用回路の基本的な構成である第1の例について図1を参照しながら説明する。
【0021】
図1に示す検査用回路は、各部を制御するCPUと、このCPUのワークエリアとして機能するメモリであるRAMと、各種プログラム等を記憶する読み出し専用のメモリであるROMと、電気的に書き換え可能とされるメモリであるEEPROMとを備えるCPU/RAM/ROM/EEPROMと、暗号化処理を行う暗号化処理手段としての暗号エンジンとを備え、CPU/RAM/ROM/EEPROMの入力側が図示しない検査用外部入力端子に、及びCPU/RAM/ROM/EEPROMと暗号エンジンとの出力側が図示しない検査用外部出力端子に接続されている。
【0022】
暗号エンジンは、シーケンサーを持たせることで、CPUの助けが無くても暗号化処理を行えるように自立的に構成する。
【0023】
また、暗号エンジン内の記憶手段としてのROM又はゲートに、初期値として検査用データ、検査用パラメータ、検査用乱数及び検査用鍵を予め記憶させておく。これらの値を実際には運用されない検査専用の値としておけば、万が一何らかの情報が盗まれた場合であっても攻撃の対象になる等の問題を引き起こさないため安全である。
【0024】
なお、ROM又はゲートに記憶されたこれらの値は、CPUからアクセスできるレジスタ、メモリ領域等を制限することによりリバースエンジニアリングを困難とする等として極力外部から読みとれないようにしておく。
【0025】
そして暗号エンジンの検査をする際には、検査用外部入出力端子から暗号エンジンの検査を行うモードである検査モードのコマンドをCPU/RAM/ROM/EEPROMに入力する。検査モードのコマンドがCPUを介して暗号エンジンに受け渡されると、暗号エンジンは、ゲートに記憶された検査用データ、検査用パラメータ、検査用乱数及び検査用鍵を読み出して暗号化処理を行い、検査用外部出力端子から出力値を出力する。そして検査をする者は、出力値が正確であるか否かの答え合わせを行うことによって、暗号エンジンの故障の有無を判断する。
【0026】
なお、暗号エンジンが公開鍵暗号化方式による暗号化処理を行うものである場合、より具体的には、以下のようにして署名生成処理を行うことにより、暗号エンジンの検査を行う。
【0027】
先ず、図示しない検査用外部入力端子から検査モードのコマンドをCPUを介して暗号エンジンに与えると、暗号エンジンの内部のROM又はゲートから初期値としての検査用データ、検査用パラメータ、検査用乱数及び検査用鍵としての検査用秘密鍵が読み出され、例えば後述するALU RAM(Arithmetic and Logical Unit Random Access Memory)のような図示しない演算RAMに読み出された初期値が転送される。
【0028】
次に、読み出された初期値を用いて暗号エンジンが実際に署名生成を行い、署名を生成する。署名生成に際しては、暗号エンジンが例えばSHA−1処理を行い検査用データのハッシュ値を算出し、算出されたハッシュ値と、検査用パラメータと、検査用乱数と、検査用秘密鍵とを用いて、例えば楕円曲線暗号化処理を行い、署名生成する。
【0029】
次に、生成した署名を出力値として検査用外部出力端子から出力する。そして検査をする者は、出力値としての署名が正確であるか否かの答え合わせを行うことによって、暗号エンジンの故障の有無を判断する。
【0030】
以上のように、暗号エンジンを検査する際には、内部データのみを用いて暗号化処理を行い、結果である出力値と正しい出力値である期待値とを比較することで暗号エンジンが正常に動作したか否かを判断できる。このとき、検査をする者は、期待値のみを知っていればよい。したがって、外部から暗号エンジンへ直接にデータやパラメータ等を入力するといったセキュリティ上の危険を冒すことなく、暗号エンジンの検査を安全に行うことができる。また、検査をする者が知っておく期待値は、その元になる検査用データ、検査用パラメータ等が外部からわからないので、鍵情報等の暗号エンジンの内部情報を取得しようとする攻撃者にとってあまり意味を持たない。
【0031】
次に、上述の第1の例を変形した第2の例について図2を用いて説明する。この第2の例は、暗号化処理の結果をそのまま出力値として出力せずに、暗号化処理の結果が正しいか否かを結果フラグとして出力する点で、第1の例と異なるものである。
【0032】
具体的には、図2に示す第2の例の検査用回路は、各部を制御するCPUと、このCPUのワークエリアとして機能するメモリであるRAMと、各種プログラム等を記憶する読み出し専用のメモリであるROMと、電気的に書き換え可能とされるメモリであるEEPROMとを備えるCPU/RAM/ROM/EEPROMと、暗号化処理を行う暗号化処理手段としての暗号エンジンとを備え、CPU/RAM/ROM/EEPROMの入力側が図示しない検査用外部入力端子に、及びCPU/RAM/ROM/EEPROMと暗号エンジンとの出力側が図示しない検査用外部出力端子に接続されている。
【0033】
暗号エンジンは、シーケンサーを持たせることで、CPUの助けが無くても暗号化処理を行えるように自立的に構成する。
【0034】
また、暗号エンジン内の記憶手段としてのROM又はゲートに初期値として検査用データ、検査用パラメータ、検査用乱数及び検査用鍵を予め記憶させておく。これらの値を実際には運用されない検査専用の値としておけば、万が一何らかの情報が盗まれた場合であっても攻撃の対象になる等の問題を引き起こさないため安全である。
【0035】
また、この第2の例においては、検査用データ、検査用パラメータ、検査用乱数及び検査用鍵に基づく期待値を記憶手段としてのROM又はゲートに予め記憶させておく。
【0036】
なお、ROM又はゲートに記憶されたこれらの値は、CPUからアクセスできるレジスタ、メモリ領域等を制限することによりリバースエンジニアリングを困難とする等として極力外部から読みとれないようにしておく。
【0037】
そして暗号エンジンの検査をする際には、検査用外部入力端子から検査開始のコマンドをCPU/RAM/ROM/EEPROMに入力する。検査モードのコマンドがCPUを介して暗号エンジンに受け渡されると、暗号エンジンは記憶手段に記憶された検査用データ、検査用パラメータ、検査用乱数及び検査用鍵を読み出して暗号化処理を行う。さらに、暗号エンジンは、暗号化処理の結果とROM又はゲートに記憶された期待値とを比較し、検査用外部出力端子から一致又は不一致の結果フラグを出力する。そして検査をする者は、結果フラグによって暗号エンジンの故障の有無を判断する。
【0038】
なお、暗号エンジンが公開鍵暗号化方式による暗号化処理を行うものである場合、より具体的には、以下のようにして署名生成処理を行うことにより、暗号エンジンの検査を行う。
【0039】
先ず、図示しない検査用外部入力端子から検査モードのコマンドをCPUを介して暗号エンジンに与えると、暗号エンジンの内部のROM又はゲートから初期値として検査用データ、検査用パラメータ、検査用乱数、検査用鍵としての検査用秘密鍵及び期待値が読み出され、例えば後述するALU RAMのような図示しない演算RAMに読み出された初期値が転送される。
【0040】
次に、読み出された初期値を用いて暗号エンジンが実際に署名生成を行い、署名を生成する。署名生成に際しては、暗号エンジンが例えばSHA−1処理を行い検査用データのハッシュ値を算出し、算出されたハッシュ値と、検査用パラメータと、検査用乱数と、検査用秘密鍵とを用いて、例えば楕円曲線暗号化処理を行い、署名生成する。
【0041】
次に、暗号エンジンにおいて、生成した署名と演算RAMに読み出された期待値とを比較し、検査用外部出力端子から一致又は不一致の結果フラグを出力する。そして検査をする者は、結果フラグによって暗号エンジンの故障の有無を判断する。
【0042】
なお、この第2の例の場合、上述した署名生成処理だけでなく、以下に述べるように署名生成処理と署名検証処理とをペアで行い、内部で答え合わせをすることで、2つの処理回路が正常に動作したか否かを1度の暗号エンジンの検査で調べることができる。
【0043】
この方法では先ず、上述したように初期値を用いて署名生成を行う。次に生成した署名をそのまま用いて内部で署名検証を行い、署名が正しいことを確認し、結果フラグを出力する。署名生成及び署名検証のどちらも正常に動作した場合には、1ビットの結果フラグを出力するだけで、暗号エンジンが正常に動作したことを証明できる。
【0044】
ただし、結果フラグを1ビットとした場合、署名生成及び署名検証の両方で特殊な値をとった場合等に確実性が低下するので、以下に述べるように署名生成後と署名検証後とにおいてそれぞれ結果フラグを出力するように暗号エンジンを構成することが好ましい。
【0045】
具体的には、先ず、暗号エンジンの内部のROM又はゲートから初期値として検査用データ、検査用パラメータ、検査用乱数、検査用鍵としての検査用秘密鍵及び期待値が読み出され、例えばALU RAMのような図示しない演算RAMに読み出された初期値がロードされる。
【0046】
次に、読み出された初期値を用いて暗号エンジンが実際に署名生成を行い、署名を生成する。署名生成に際しては、暗号エンジンが例えばSHA−1処理を行い検査用データのハッシュ値を算出し、算出されたハッシュ値と、検査用パラメータと、検査用乱数と、検査用秘密鍵とを用いて、例えば楕円曲線暗号化処理を行い、署名生成する。
【0047】
次に、暗号エンジンにおいて、生成した署名と演算RAMに読み出された期待値とを比較し、検査用外部出力端子から一致又は不一致の結果フラグを出力する。それとともに、暗号エンジンで生成した署名を、引き続く署名検証処理で用いるために、演算RAMに格納する。
【0048】
次に、検査用外部入力端子から署名検証開始のコマンドをCPUを介して暗号エンジンに与え、演算RAMに格納された署名を用いて署名検証処理を行う。署名検証に際しては、暗号エンジンが検査用パラメータ、検査用乱数、ハッシュ値及び検査用鍵としての検査用公開鍵を例えば演算RAMにロードする。次に暗号エンジンは、演算RAMにロードされた各種の値を用いて、例えば楕円曲線暗号化処理により署名検証処理を行う。そして、計算された署名と演算RAMに格納された署名とが一致しているか否かの結果フラグを、検査用外部出力端子から出力する。
【0049】
以上のように、暗号エンジンを検査する際には、内部データのみを用いて暗号化処理を行い、さらに暗号化処理の結果と期待値との一致又は不一致を示す結果フラグを確認するだけで、暗号エンジンが正常に動作したか否かを判断できる。したがって、外部から暗号エンジンへ直接にデータやパラメータ等を入力するといったセキュリティ上の危険を冒すことなく、暗号エンジンの検査を安全に行うことができる。さらに、第2の例においては、検査をする者は、暗号エンジンの故障の有無を判断するにあたって、期待値も知る必要がないため、暗号化処理の結果をそのまま出力する第1の例に比べてセキュリティ性をさらに高めることができる。
【0050】
また、署名生成処理と署名検証処理とをペアで行い、内部で答え合わせをすることで、2つの処理回路が正常に動作したか否かを1度の暗号コアの検査で調べることができるので、暗号エンジンの検査をより簡略化できる。
【0051】
次に、上述の第2の例を変形した第3の例について図3を用いて説明する。この第3の例は、初期値を記憶する記憶手段が暗号エンジンの外にある点で、第2の例と異なるものである。
【0052】
具体的には、第3の例は、各部を制御するCPUと、このCPUのワークエリアとして機能するメモリであるRAMと、電気的に書き換え可能とされるメモリであるEEPROMとを備えるCPU/RAM/EEPROMと、暗号化処理を行う暗号化処理手段としての暗号エンジンとを備え、CPU/RAM/EEPROMの入力側、及びCPU/RAM/EEPROMと暗号エンジンとの出力側が図示しない検査用外部入出力端子に接続されている。
【0053】
暗号エンジンは、シーケンサーを持たせることで、CPUの助けが無くても暗号化処理を行えるように自立的に構成する。
【0054】
また、この第3の例においては、各種プログラム等を記憶する読み出し専用のメモリであるMASK ROMに、初期値として検査用データ、検査用パラメータ、検査用乱数及び検査用鍵を予め記憶させておく。また、検査用データ、検査用パラメータ、検査用乱数及び検査用鍵に基づく暗号化処理の結果である期待値もMASK ROMに予め記憶させておく。MASK ROMは、製造時にデータが書き込まれるROMであり、開発時に初期値を書き換える等の不正な改竄が不可能となる。これらの値を実際には運用されない検査専用の値としておけば、万が一何らかの情報が盗まれた場合であっても攻撃の対象になる等の問題を引き起こさないため安全である。
【0055】
なお、MASK ROMに格納されたこれらの値は、CPUからアクセスできるレジスタ、メモリ領域等を制限することによりリバースエンジニアリングを困難とする等として極力外部から読みとれないようにしておく。
【0056】
そして暗号エンジンの検査をする際には、検査用外部入力端子から検査モードのコマンドをCPU/RAM/EEPROMに入力する。このとき、MASK ROMから初期値が読み出され、ALU RAM等の図示しない演算RAMにこれらの値が転送される。検査モードのコマンドがCPUを介して暗号エンジンに受け渡されると、暗号エンジンは演算RAMから初期値を読み出して暗号化処理を行う。さらに、暗号エンジンは、暗号化処理の結果と期待値とを比較し、検査用外部出力端子から一致又は不一致の結果フラグを出力する。そして検査をする者は、結果フラグによって暗号エンジンの故障の有無を判断する。
【0057】
以上のように、暗号エンジンを検査する際には、内部データのみを用いて暗号化処理を行い、さらに暗号化処理の結果と期待値との一致又は不一致を示す結果フラグを確認するだけで、暗号エンジンが正常に動作したか否かを判断できる。したがって、外部から暗号エンジンへ直接にデータやパラメータ等を入力するといったセキュリティ上の危険を冒すことなく、暗号エンジンの検査を安全に行うことができる。さらに、検査をする者は、暗号エンジンの故障の有無を判断するにあたって、期待値も知る必要がないため、暗号化処理の結果をそのまま出力する第1の例に比べてセキュリティ性をさらに高めることができる。
【0058】
なお、この第3の例の場合も、第2の例と同様にして署名生成と署名検証とをペアで行い、内部で答え合わせをすることで、2つの処理回路が正常に動作したか否かを1度の暗号コアの検査で調べることができる。
【0059】
次に、第4の例として、FPGA(Field Programmable Gate Array)に本発明の暗号化装置を適用した場合について、図4を参照しながら説明する。なお、以下では、説明の便宜上、このFPGAにおいては、暗号化装置が公開鍵暗号化方式による署名生成を行うものとする。
【0060】
図4に示すように、FPGA内部には、演算用の内蔵RAMと、暗号化処理を行う暗号エンジンとを備え、暗号エンジンの入力側及び出力側が図示しない検査用外部入出力端子に接続されている。
【0061】
暗号エンジンは、シーケンサーを持たせることで、CPUの助けが無くても暗号化処理を行えるように自立的に構成する。
【0062】
FPGAの内部には、例えばゲート等の図示しない記憶手段に、初期値として検査用データ、検査用パラメータ、検査用乱数及び検査用鍵を予め記憶させておく。これらの値を実際には運用されない検査専用の値としておけば、万が一何らかの情報が盗まれた場合であっても攻撃の対象になる等の問題を引き起こさないため安全である。なお、記憶されたこれらの値は、CPUからアクセスできるレジスタ、メモリ領域等を制限することによりリバースエンジニアリングを困難とする等として極力外部から読みとれないようにしておく。
【0063】
このような構成のFPGAを起動すると、内蔵RAMに上述した初期値が自動的にロードされる。
【0064】
そして暗号エンジンの検査をする際には、先ず、図示しない検査用外部入力端子から検査モードのコマンドを暗号エンジンに与えると、FPGAにロードされた初期値としての検査用データ、検査用パラメータ、検査用乱数及び検査用鍵としての検査用秘密鍵が暗号エンジンによって読み出される。次に、読み出された初期値を用いて暗号エンジンが実際に署名生成を行い、署名を生成する。署名生成に際しては、暗号エンジンが例えばSHA−1処理を行い検査用データのハッシュ値を算出し、算出されたハッシュ値と、検査用パラメータと、検査用乱数と、検査用秘密鍵とを用いて、例えば楕円曲線暗号化処理を行い、署名生成する。最後に、生成した署名を出力値として検査用外部出力端子から出力する。そして検査をする者は、出力値としての署名が正確であるか否かの答え合わせを行うことによって、暗号エンジンの故障の有無を判断する。
【0065】
以上のように、暗号エンジンを検査する際には、内部データのみを用いて暗号化処理を行い、結果である出力値と期待値とを比較することで暗号エンジンが正常に動作したか否かを判断できる。このとき、検査をする者は、期待値のみを知っていればよい。したがって、FPGAに内蔵された暗号化装置であっても、外部から暗号エンジンへ直接にデータやパラメータ等を入力するといったセキュリティ上の危険を冒すことなく、暗号エンジンの検査を安全に行うことができる。また、検査をする者が知っておく期待値は、その元になる検査用データ、検査用パラメータ等が外部からわからないので、鍵情報等の暗号エンジンの内部情報を取得しようとする攻撃者にとってあまり意味を持たない。
【0066】
次に、第5の例として、実際の非接触型ICカードに本発明の暗号化装置を適用した場合について図5を参照しながら説明する。
【0067】
非接触型ICカードに内蔵されたICチップは、図5に示すように、各部を制御するCPU10と、このCPU10のワークエリアとして機能するメモリであるRAM20と、各種プログラム等を記憶する読み出し専用のメモリであるROM30と、電気的に書き換え可能とされるメモリであるEEPROM40と、電源回路用のアナログブロック50と、暗号化処理を行う暗号コア60と、公開鍵暗号化方式に用いられるいわゆるハッシュ値等を格納するALU RAM70と、暗号コア60の故障の有無を検査するための専用の外部バスである検査用外部入出力端子80と、CPU10と各部との間でデータの授受を行うためのバスであるCPUインターフェース90と、図示しない無線通信を行うためのRF(Radio Frequency)ブロックとを集積回路化したいわゆるLSI(Large Scale Integration)として構成される。
【0068】
なお、以下では説明の便宜上、暗号化処理手段としての暗号コア60は、公開鍵暗号化方式としていわゆる楕円曲線暗号化方式(Elliptic Curve Cryptosystem;ECC)を採用し、認証やディジタル署名等に用いるハッシュ関数としていわゆるSHA−1(Secure Hash Algorithm−1)を用いるものとして説明する。
【0069】
また、以下では、上述した第2の例のように、初期値として検査用データ、検査用パラメータ、検査用乱数及び検査用鍵としての検査用秘密鍵及び検査用公開鍵が暗号コア60内のゲートに予め記憶されるとともに、暗号コア60が暗号化処理の結果が正しいか否かを結果フラグとして出力する場合を例に挙げて説明する。
【0070】
また、暗号コア60の検査を具体的に説明するために、図6に示すように、図5に示す非接触ICカードの各部を機能的に表現する。なお、同図においては、説明の便宜上、暗号コア60を、楕円曲線暗号化処理及びSHA−1処理の機能を表すECC/SHA−1ブロック60と、トリプルDES(Data Encryption Standard)暗号化処理の機能を表すDESブロック60とに大別して表現している。なお、DESブロック60は、暗号化処理を行う際に必要となる鍵生成の過程等において用いる乱数を、共通鍵暗号化方式の1つであるいわゆるDES(Data Encryption Standard)暗号化方式を用いて生成するブロックである。また、図6においては、図5に示す検査用外部入出力端子80をテストブロック80として表現している。
【0071】
このような非接触型ICカードに搭載された暗号コア60の故障の有無を検査する際には、以下のようにして暗号コア60により署名を生成し、生成した署名が正しいか否かを判断する。
【0072】
先ず、検査用外部入出力端子80から検査モードのコマンドをCPU10を介して暗号コア60に与えると、暗号コア60の内部のゲートから初期値として検査用データ、検査用パラメータ、検査用乱数及び検査用鍵としての検査用秘密鍵が読み出され、ALU RAM70に格納される。
【0073】
次に、ALU RAM70に格納された検査用データが読み出され、ECC/SHA−1ブロック60によるSHA−1処理によってハッシュ値が計算される。生成したハッシュ値はALU RAM70に格納される。
【0074】
このとき、SHA−1処理によって算出されたハッシュ値のALU RAM70上における格納場所を、後述する楕円曲線暗号化処理にて用いられるアドレスに予め設定しておくことにより、SHA−1処理によるハッシュ値の算出後に、そのまま楕円曲線暗号化処理へと即座に移行することができることから、署名生成及び署名検証等の一連の動作の大半をハードウェアによって高速に実行することができる。したがって、暗号化装置においては、CPUの負荷を削減することができ、さらには、ソフトウェアの改竄等による攻撃に対する耐性も強固となる。通常、暗号化処理においては、途中の演算結果の授受をCPUに委任した場合には、ソフトウェアを改竄することによって容易に成りすましを許容してしまう一方で、暗号化装置においては、このような演算途中におけるCPUの介入による改竄を回避することができる。
【0075】
次に、ハッシュ値、検査用パラメータ、検査用乱数及び検査用秘密鍵がALURAM70から読み出され、これらの値を用いてECC/SHA−1ブロック60によって楕円曲線暗号化処理が行われ、署名を生成する。
【0076】
次に、得られた署名と、ALU RAM70に格納された期待値とを比較し、例えば1ビットの結果フラグを検査用外部入出力端子80から出力する。
【0077】
一方で、得られた署名は、引き続く署名検証処理で用いるために、ALU RAM70に格納される。
【0078】
そして、検査用外部入出力端子80から署名検証開始のコマンドがCPU10を介してECC/SHA−1ブロック60に与えられると、ALU RAM70に格納された署名を用いた署名検証処理に移行する。
【0079】
署名検証に際しては、先ず、検査用パラメータ、検査用乱数、ハッシュ値及び検査用鍵としての検査用公開鍵をALU RAM70にロードする。
【0080】
次に、検査用パラメータ、検査用乱数、ハッシュ値及び検査用鍵としての検査用公開鍵がALU RAM70から読み出され、ECC/SHA−1ブロック60により、楕円曲線暗号化処理によって署名検証処理が行われる。
【0081】
そして、計算された署名とALU RAM70に格納された署名とが一致しているか否かを示す結果フラグを、検査用外部入出力端子80から出力する。
【0082】
以上のように、暗号コア60を検査する際には、内部データのみを用いて暗号化処理を行い、さらに暗号化処理の結果と期待値との一致又は不一致を示す結果フラグを確認するだけで、暗号コア60が正常に動作したか否かを判断できる。すなわち、検査用外部入出力端子80から暗号コア60へ直接にデータやパラメータ等を入力するといったセキュリティ上の危険を冒すことなく、暗号コア60の検査を安全に行うことができる。さらに、検査をする者は、暗号コア60の故障の有無を判断するにあたって、期待値も知る必要がないため、暗号化処理の結果をそのまま出力する場合に比べてセキュリティ性をさらに高めることができる。
【0083】
また、暗号コア60の故障検出率を十分に確保できるテストパターンをシミュレーションで逆算しておき、このテストパターンを初期値としてゲートやROM等の記憶手段に予め記憶させておくことが好ましい。通常、暗号コア60の故障検出率を高めるために、非常に多くのテストパターンを外部から入力し、検査する必要があるが、シミュレーションで逆算されたテストパターンを初期値とすれば検査の回数を増やすことなく高い故障検出率が確保される。なお、レジスターやフラグ等は別途検査すればよい。したがって、本発明の暗号化装置を組み込んだ非接触型ICカードは、量産にも十分に対応可能である。
【0084】
また、本発明によればICチップに設けられた検査用外部入出力端子80からのデータの入出力による暗号コア60の攻撃を回避できるので、検査用外部入出力端子80のパターンカット等の製造後の加工が不要となる。
【0085】
また、本発明の暗号化装置は上述のような構成をとるため、たとえICテスタ等が不正な第三者によって盗難された場合であっても暗号機能の解析が不可能である。
【0086】
なお、本発明は、上述した実施の形態に限定されるものではない。例えば、上述した実施の形態では、公開鍵暗号化方式として、楕円曲線暗号化方式を採用して説明したが、本発明は、例えばRSA暗号化方式等の他の公開鍵暗号化方式にも容易に適用することができる。
【0087】
また、上述した実施の形態では、いわゆる公開鍵暗号化方式による暗号化処理を行う暗号化装置について説明したが、共通鍵暗号化方式による暗号化装置にも勿論適用することができる。
【0088】
また、上述した実施の形態では、ハッシュ関数として、SHA−1を用いるものとして説明したが、本発明は、例えばMD5(Message Digest 5)等の他のハッシュ関数にも容易に適用することができる。
【0089】
さらにまた、上述した実施の形態では、暗号化装置の適用例として、FPGA及び非接触型ICカードに内蔵されるICチップを用いて説明したが、本発明は、同様の機能を要求する任意の装置やデバイスに適用することができるのは勿論である。
【0090】
このように、本発明は、その趣旨を逸脱しない範囲で適宜変更が可能であることはいうまでもない。
【0091】
【発明の効果】
以上の説明からも明らかなように、本発明に係る暗号化装置は、検査用データ、検査用パラメータ、検査用乱数及び検査用鍵を初期値として記憶手段に格納しておき、外部から検査モードの命令が入力されたらこれらを読み出して暗号化処理し、結果を出力する。検査をする者は、出力結果の正しい値である期待値を知っていれば、この期待値と出力された結果とを比較することで暗号化装置の故障の有無を判定できる。このため、検査用データ等の入出力を繰り返すことによる暗号化装置に対する攻撃を回避できる。したがって本発明によれば、検査の際に外部から検査用データ等を直接入力するといったセキュリティ上の危険を冒すことなく検査を確実に行うことが可能な暗号化装置を実現できる。
【図面の簡単な説明】
【図1】本発明の暗号化装置の第1の例であって、検査用回路の構成を示す図である。
【図2】本発明の暗号化装置の第2の例であって、検査用回路の構成を示す図である。
【図3】本発明の暗号化装置の第3の例であって、検査用回路の構成を示す図である。
【図4】本発明の第4の例であって、暗号化装置が組み込まれたFPGAの構成を示す図である。
【図5】本発明の第5の例であって、暗号化装置が組み込まれた非接触型ICカードのICチップの構成を示す図である。
【図6】図5に示す非接触型ICカードのICチップを機能的に表現したブロック図である。
【図7】従来の暗号化装置の検査用回路の構成を示す図である。
【符号の説明】
10  CPU
20  RAM
30  ROM
40  EEPROM
50  アナログブロック
60  暗号コア
70  ALU RAM
80  検査用外部入出力端子(テストブロック)
90  インターフェース
[0001]
TECHNICAL FIELD OF THE INVENTION
The present invention relates to an encryption device that performs an encryption process.
[0002]
[Prior art]
2. Description of the Related Art In recent years, various services using various communication technologies such as electronic commerce and online shopping using the so-called Internet or the like have become widespread. In recent years, with the progress of communication technology, a non-contact type semiconductor memory in which not only communication technology via a terminal but also a communication function for use in, for example, toll collection of transportation or so-called electronic money is integrated. Card-like devices such as cards have also been developed.
[0003]
In a service using a card-shaped device having such a communication function (hereinafter, referred to as a non-contact type IC (Integrated Circuit) card), it is generally essential to improve security. Mutual authentication processing for authenticating validity and encryption processing for ensuring security of data communication are performed. At that time, the non-contact type IC card requires high-speed processing. Therefore, if these functions are implemented by software, a CPU (Central Processing Unit) with a high clock rate is required, which is not practical. Therefore, in the non-contact type IC card, it is desirable that these functions are implemented not by software but by hardware.
[0004]
Here, in the non-contact type IC card in which the above-described functions are implemented by such hardware, a relatively small circuit scale such as a so-called DES (Data Encryption Standard) encryption method is used in order to suppress power consumption as much as possible. Many employ so-called common key encryption schemes that can be implemented with power consumption.
[0005]
However, the common key encryption method that uses a common key for encryption and decryption has a problem that it is vulnerable to an attack by an unauthorized third party from the viewpoint that it is necessary to exchange key data. For this reason, there has been a concern about the non-contact type IC card in the case where it is applied to financial services in the future.
[0006]
Therefore, in a service using a contactless IC card, the contactless IC card is, for example, a so-called RSA (Rivest-Shamir-Adleman) encryption system or an elliptic curve encryption system (ECC). There is a growing demand for a highly secure system that employs a so-called public key encryption scheme in which a specific person needs to have a common key that needs to be kept secret while a different key is used for encryption and decryption. Many attempts have been made to develop a contactless IC card that performs signature generation and signature verification using a public key.
[0007]
[Problems to be solved by the invention]
By the way, when manufacturing an IC chip to be mounted on a non-contact type IC card or the like employing the above-described public key encryption method, it is necessary to confirm whether or not the encryption device operates normally after the manufacture. In order to do this, the manufacturer or the inspector of the IC chip must perform a shipping inspection. For this reason, the IC chip of the non-contact type IC card is provided with an external I / O terminal for inspection, which is a dedicated external bus for directly accessing the encryption device and inspecting the encryption device for a failure. .
[0008]
Here, an inspection circuit of a normal encryption device is configured as shown in FIG. That is, a CPU that controls each unit, a RAM (Random Access Memory) that is a memory that functions as a work area of the CPU, a ROM (Read Only Memory) that is a read-only memory that stores various programs, and the like, A CPU / RAM / ROM / EEPROM having an electrically erasable programmable read only memory (EEPROM), which is a rewritable memory; The ROM / EEPROM and the encryption engine are respectively connected to a not-shown external input / output terminal for inspection.
[0009]
When the cryptographic engine is inspected, the inspection data and the inspection parameters are directly input to the encryption engine from the external input terminal for inspection. The encryption engine performs encryption processing under the control of the CPU / RAM / ROM / EEPROM, and outputs an output value from the external output terminal for inspection. The inspector determines whether or not the cryptographic engine has a failure by checking whether or not the output value is correct.
[0010]
In other words, the person performing the inspection needs to know at least the expected values which are the correct values of the input data and the output data such as the inspection data and the inspection parameters.
[0011]
By the way, while the dedicated external input / output terminal for inspection is indispensable for the inspection of the encryption device, an unauthorized third party accesses the encryption engine and uses the above-mentioned input data and expected values. This can be a means for analyzing hardware by acquiring or estimating internal key information or the like, or by repeating the above-described inspection, which is a security problem.
[0012]
For this reason, after the chip is manufactured, a method called a so-called pattern cut, for example, which mechanically cuts the external input / output terminal for inspection, or a method of electrically burning out the external input / output terminal for inspection to the cryptographic engine, is used. In general, a method of making access impossible is adopted.
[0013]
However, if these methods are implemented, if a defect occurs in an IC chip after shipment, it becomes impossible to inspect or investigate the defective product, causing another problem that the cause of the defect cannot be specified, or a product yield. Can also be aggravated.
[0014]
Therefore, the present invention has been proposed to solve such a conventional problem, and makes it difficult to estimate internal key information and analyze hardware without performing post-processing such as pattern cutting, and to improve security. It is an object of the present invention to provide an encryption device capable of improving the encryption.
[0015]
[Means for Solving the Problems]
In order to achieve the above object, an encryption device according to the present invention includes a storage unit that stores test data, a test parameter, a test random number, and a test key as initial values, and an encryption device that performs an encryption process. Processing means, wherein the encryption processing means, in response to an inspection mode command being externally provided, stores the inspection data, the inspection parameter, the inspection random number, and the inspection data stored in the storage means. The encryption processing is performed using the inspection key.
[0016]
As described above, the encryption device according to the present invention stores inspection data, an inspection parameter, an inspection random number, and an inspection key in a storage unit as initial values, and when an instruction of an inspection mode is input from outside. These are read, encrypted, and the result is output. If the inspector knows the expected value, which is the correct value of the output result, it can determine whether or not the encryption device has a failure by comparing the expected value with the output result. For this reason, it is possible to avoid an attack on the encryption device due to repeated input / output of test data and the like.
[0017]
BEST MODE FOR CARRYING OUT THE INVENTION
Hereinafter, an encryption device to which the present invention is applied will be described in detail with reference to the drawings.
[0018]
The encryption device of the present invention is an IC chip built in a card-like device (hereinafter, referred to as a non-contact type IC (Integrated Circuit) card) such as a non-contact type semiconductor memory card having a communication function integrated. Etc., which implements the functions of mutual authentication processing for authenticating the validity of the communication partner and encryption processing for ensuring the security of data communication by hardware. It is.
[0019]
Here, first, the basic configuration and the inspection method of the encryption device will be described, and then, a specific example in the case where the inspection is performed by the encryption device mounted on the actual non-contact type IC card will be described.
[0020]
First, a first example of the basic configuration of the inspection circuit of the encryption device of the present invention will be described with reference to FIG.
[0021]
The test circuit shown in FIG. 1 is electrically rewritable between a CPU that controls each unit, a RAM that functions as a work area of the CPU, and a ROM that is a read-only memory that stores various programs and the like. A CPU / RAM / ROM / EEPROM having an EEPROM as a memory, and an encryption engine as encryption processing means for performing an encryption process, and the input side of the CPU / RAM / ROM / EEPROM has an The output side of the CPU / RAM / ROM / EEPROM and the cryptographic engine is connected to an external input terminal and an external output terminal for inspection (not shown).
[0022]
The cryptographic engine has a sequencer and is configured autonomously so that the cryptographic processing can be performed without the help of the CPU.
[0023]
In addition, inspection data, an inspection parameter, an inspection random number, and an inspection key are stored in advance as initial values in a ROM or a gate as storage means in the encryption engine. If these values are used as inspection-only values that are not actually used, even if any information is stolen, it is safe because it does not cause a problem such as being targeted by an attack.
[0024]
Note that these values stored in the ROM or the gate should not be read from the outside as much as possible, for example, by making the reverse engineering difficult by limiting the registers and the memory area that can be accessed by the CPU.
[0025]
When the cryptographic engine is inspected, a command for an inspection mode, which is a mode for inspecting the cryptographic engine, is input to the CPU / RAM / ROM / EEPROM from the external input / output terminal for inspection. When the inspection mode command is passed to the encryption engine via the CPU, the encryption engine reads the inspection data, the inspection parameter, the inspection random number, and the inspection key stored in the gate and performs encryption processing. The output value is output from the inspection external output terminal. Then, the inspector determines whether or not the cryptographic engine has a failure by checking whether or not the output value is correct.
[0026]
When the cryptographic engine performs an encryption process using a public key encryption method, more specifically, the signature engine is inspected by performing a signature generation process as described below.
[0027]
First, when a command of a test mode is given from a test external input terminal (not shown) to the cryptographic engine via the CPU, the test data, the test parameter, the test random number, The inspection secret key as an inspection key is read, and the read initial value is transferred to an arithmetic RAM (not shown) such as an ALU RAM (Arithmetic and Logical Unit Random Access Memory) to be described later.
[0028]
Next, the cryptographic engine actually generates a signature using the read initial value, and generates a signature. At the time of signature generation, the cryptographic engine performs, for example, SHA-1 processing to calculate a hash value of the test data, and uses the calculated hash value, the test parameter, the test random number, and the test secret key. For example, an elliptic curve encryption process is performed to generate a signature.
[0029]
Next, the generated signature is output from the inspection external output terminal as an output value. Then, the inspector determines whether or not the cryptographic engine has a failure by checking whether or not the signature as the output value is correct.
[0030]
As described above, when inspecting the cryptographic engine, the cryptographic engine performs encryption processing using only the internal data and compares the output value that is the result with the expected value that is the correct output value. It can be determined whether or not it has operated. At this time, the person performing the inspection need only know the expected value. Therefore, the cryptographic engine can be safely inspected without risking security such as directly inputting data, parameters, and the like to the cryptographic engine from the outside. The expected value that the inspector knows is too small for an attacker who tries to obtain internal information of the cryptographic engine such as key information, because the original inspection data and inspection parameters are unknown from outside. Has no meaning.
[0031]
Next, a second example obtained by modifying the first example will be described with reference to FIG. The second example is different from the first example in that the result of the encryption process is not output as it is, but is output as a result flag indicating whether or not the result of the encryption process is correct. .
[0032]
Specifically, the inspection circuit of the second example shown in FIG. 2 includes a CPU that controls each unit, a RAM that functions as a work area of the CPU, and a read-only memory that stores various programs and the like. CPU / RAM / ROM / EEPROM having a ROM which is an electrically rewritable memory, and an encryption engine as encryption processing means for performing encryption processing. The input side of the ROM / EEPROM is connected to an external input terminal for inspection (not shown), and the output side of the CPU / RAM / ROM / EEPROM and the encryption engine is connected to an external output terminal for inspection (not shown).
[0033]
The cryptographic engine has a sequencer and is configured autonomously so that the cryptographic processing can be performed without the help of the CPU.
[0034]
In addition, inspection data, an inspection parameter, an inspection random number, and an inspection key are stored in advance in a ROM or a gate as storage means in the encryption engine as initial values. If these values are used as inspection-only values that are not actually used, even if any information is stolen, it is safe because it does not cause a problem such as being targeted by an attack.
[0035]
In the second example, the inspection data, the inspection parameter, the inspection random number, and the expected value based on the inspection key are stored in advance in a ROM or a gate as storage means.
[0036]
Note that these values stored in the ROM or the gate should not be read from the outside as much as possible, for example, by making the reverse engineering difficult by limiting the registers and the memory area that can be accessed by the CPU.
[0037]
When the cryptographic engine is inspected, an inspection start command is input to the CPU / RAM / ROM / EEPROM from the external input terminal for inspection. When the inspection mode command is passed to the encryption engine via the CPU, the encryption engine reads the inspection data, the inspection parameter, the inspection random number, and the inspection key stored in the storage unit and performs an encryption process. Further, the cryptographic engine compares the result of the encryption process with the expected value stored in the ROM or the gate, and outputs a match or mismatch result flag from the external output terminal for inspection. Then, the inspector determines whether there is a failure in the cryptographic engine based on the result flag.
[0038]
When the cryptographic engine performs an encryption process using a public key encryption method, more specifically, the signature engine is inspected by performing a signature generation process as described below.
[0039]
First, when a command of a test mode is given to the cryptographic engine via a CPU from a test external input terminal (not shown) via the CPU, test data, a test parameter, a test random number, a test The inspection secret key as the service key and the expected value are read, and the read initial value is transferred to, for example, an arithmetic RAM (not shown) such as an ALU RAM described later.
[0040]
Next, the cryptographic engine actually generates a signature using the read initial value, and generates a signature. At the time of signature generation, the cryptographic engine performs, for example, SHA-1 processing to calculate a hash value of the test data, and uses the calculated hash value, the test parameter, the test random number, and the test secret key. For example, an elliptic curve encryption process is performed to generate a signature.
[0041]
Next, the cryptographic engine compares the generated signature with the expected value read into the arithmetic RAM, and outputs a match or mismatch result flag from the external test output terminal. Then, the inspector determines whether or not the cryptographic engine has failed based on the result flag.
[0042]
In the case of the second example, not only the above-described signature generation processing but also a signature generation processing and a signature verification processing are performed as a pair as described below, and the answers are internally matched, so that two processing circuits are provided. Can be checked by a single check of the cryptographic engine.
[0043]
In this method, first, a signature is generated using the initial value as described above. Next, the generated signature is used as it is to internally verify the signature, confirm that the signature is correct, and output a result flag. If both signature generation and signature verification operate normally, only outputting a 1-bit result flag can prove that the cryptographic engine operates normally.
[0044]
However, if the result flag is 1 bit, the reliability decreases when a special value is taken in both signature generation and signature verification. Therefore, as described below, after the signature generation and after the signature verification, Preferably, the cryptographic engine is configured to output a result flag.
[0045]
Specifically, first, inspection data, an inspection parameter, an inspection random number, an inspection secret key as an inspection key, and an expected value are read as initial values from a ROM or a gate inside the cryptographic engine. The read initial values are loaded into a not-shown operation RAM such as a RAM.
[0046]
Next, the cryptographic engine actually generates a signature using the read initial value, and generates a signature. At the time of signature generation, the cryptographic engine performs, for example, SHA-1 processing to calculate a hash value of the test data, and uses the calculated hash value, the test parameter, the test random number, and the test secret key. For example, an elliptic curve encryption process is performed to generate a signature.
[0047]
Next, the cryptographic engine compares the generated signature with the expected value read into the arithmetic RAM, and outputs a match or mismatch result flag from the external test output terminal. At the same time, the signature generated by the cryptographic engine is stored in the arithmetic RAM for use in subsequent signature verification processing.
[0048]
Next, a signature verification start command is provided from the external input terminal for inspection to the cryptographic engine via the CPU, and signature verification processing is performed using the signature stored in the arithmetic RAM. At the time of signature verification, the cryptographic engine loads an inspection parameter, an inspection random number, a hash value, and an inspection public key as an inspection key into, for example, an arithmetic RAM. Next, the cryptographic engine performs signature verification processing by, for example, elliptic curve encryption processing using various values loaded in the operation RAM. Then, a result flag indicating whether or not the calculated signature matches the signature stored in the operation RAM is output from the external output terminal for inspection.
[0049]
As described above, when inspecting the cryptographic engine, the encryption process is performed using only the internal data, and furthermore, the result flag indicating whether the result of the encryption process matches or does not match the expected value is simply checked. It can be determined whether or not the encryption engine operates normally. Therefore, the cryptographic engine can be safely inspected without risking security such as directly inputting data, parameters, and the like to the cryptographic engine from the outside. Furthermore, in the second example, since the inspector does not need to know the expected value in determining whether or not the cryptographic engine has a failure, compared with the first example in which the result of the encryption processing is output as it is. Security can be further improved.
[0050]
Also, by performing a signature generation process and a signature verification process as a pair and performing an internal answer, it is possible to check whether or not the two processing circuits operate normally by a single cryptographic core inspection. In addition, the inspection of the cryptographic engine can be further simplified.
[0051]
Next, a third example, which is a modification of the second example, will be described with reference to FIG. This third example differs from the second example in that the storage means for storing the initial value is outside the cryptographic engine.
[0052]
Specifically, a third example is a CPU / RAM including a CPU that controls each unit, a RAM that functions as a work area of the CPU, and an EEPROM that is an electrically rewritable memory. / EEPROM, and an encryption engine as encryption processing means for performing an encryption process, and an input side of the CPU / RAM / EEPROM and an output side of the CPU / RAM / EEPROM and the encryption engine have external input / output for inspection (not shown). Connected to terminal.
[0053]
The cryptographic engine has a sequencer and is configured autonomously so that the cryptographic processing can be performed without the help of the CPU.
[0054]
In the third example, test data, a test parameter, a test random number, and a test key are stored in advance in a MASK ROM, which is a read-only memory that stores various programs and the like, as initial values. . Also, the expected value which is the result of the encryption processing based on the inspection data, the inspection parameter, the inspection random number, and the inspection key is stored in the MASK ROM in advance. The MASK ROM is a ROM in which data is written at the time of manufacturing, and cannot be tampered with, such as rewriting an initial value at the time of development. If these values are used as inspection-only values that are not actually used, even if any information is stolen, it is safe because it does not cause a problem such as being targeted by an attack.
[0055]
Note that these values stored in the MASK ROM should not be read from the outside as much as possible, for example, by limiting the registers and memory areas that can be accessed by the CPU to make reverse engineering difficult.
[0056]
When the cryptographic engine is inspected, an inspection mode command is input to the CPU / RAM / EEPROM from an external input terminal for inspection. At this time, initial values are read from the MASK ROM, and these values are transferred to an arithmetic RAM (not shown) such as an ALU RAM. When the inspection mode command is passed to the encryption engine via the CPU, the encryption engine reads an initial value from the arithmetic RAM and performs an encryption process. Further, the encryption engine compares the result of the encryption process with the expected value, and outputs a match or mismatch result flag from the external output terminal for inspection. Then, the inspector determines whether or not the cryptographic engine has failed based on the result flag.
[0057]
As described above, when inspecting the cryptographic engine, the encryption process is performed using only the internal data, and furthermore, the result flag indicating whether the result of the encryption process matches or does not match the expected value is simply checked. It can be determined whether or not the encryption engine operates normally. Therefore, the cryptographic engine can be safely inspected without risking security such as directly inputting data, parameters, and the like to the cryptographic engine from the outside. Further, since the inspector does not need to know the expected value in determining whether or not the cryptographic engine has failed, the security is further improved as compared with the first example in which the result of the encryption processing is output as it is. Can be.
[0058]
In the case of the third example as well, the signature generation and signature verification are performed as a pair in the same manner as in the second example, and the answers are internally matched to determine whether the two processing circuits operate normally. Can be checked by one inspection of the cryptographic core.
[0059]
Next, as a fourth example, a case where the encryption device of the present invention is applied to an FPGA (Field Programmable Gate Array) will be described with reference to FIG. In the following, for convenience of explanation, in this FPGA, it is assumed that an encryption device generates a signature by a public key encryption method.
[0060]
As shown in FIG. 4, the FPGA has a built-in RAM for calculation and a cryptographic engine for performing an encryption process. The input side and the output side of the cryptographic engine are connected to an external input / output terminal for inspection (not shown). I have.
[0061]
The cryptographic engine has a sequencer and is configured autonomously so that the cryptographic processing can be performed without the help of the CPU.
[0062]
In the FPGA, for example, inspection data, an inspection parameter, an inspection random number, and an inspection key are stored in advance in storage means (not shown) such as a gate as initial values. If these values are used as inspection-only values that are not actually used, even if any information is stolen, it is safe because it does not cause a problem such as being targeted by an attack. Note that these stored values are prevented from being read from the outside as much as possible, for example, by making the reverse engineering difficult by limiting registers and memory areas that can be accessed by the CPU.
[0063]
When the FPGA having such a configuration is started, the above-described initial values are automatically loaded into the built-in RAM.
[0064]
When the cryptographic engine is inspected, first, a test mode command is given to the cryptographic engine from an external input terminal for inspection (not shown), and the inspection data, the inspection parameters, and the inspection parameters are loaded as initial values into the FPGA. The inspection random number and the inspection secret key as the inspection key are read by the cryptographic engine. Next, the cryptographic engine actually generates a signature using the read initial value, and generates a signature. At the time of signature generation, the cryptographic engine performs, for example, SHA-1 processing to calculate a hash value of the test data, and uses the calculated hash value, the test parameter, the test random number, and the test secret key. For example, an elliptic curve encryption process is performed to generate a signature. Finally, the generated signature is output as an output value from the external output terminal for inspection. Then, the inspector determines whether or not the cryptographic engine has a failure by checking whether or not the signature as the output value is correct.
[0065]
As described above, when inspecting the cryptographic engine, the cryptographic processing is performed using only the internal data, and the output value as a result is compared with an expected value to determine whether the cryptographic engine operates normally. Can be determined. At this time, the person performing the inspection need only know the expected value. Therefore, even if the encryption device is built in the FPGA, the inspection of the encryption engine can be performed safely without risking security such as directly inputting data and parameters from the outside to the encryption engine. . The expected value that the inspector knows is too small for an attacker who tries to obtain internal information of the cryptographic engine such as key information, because the original inspection data and inspection parameters are unknown from outside. Has no meaning.
[0066]
Next, as a fifth example, a case where the encryption device of the present invention is applied to an actual non-contact type IC card will be described with reference to FIG.
[0067]
As shown in FIG. 5, an IC chip built in the non-contact type IC card includes a CPU 10 for controlling each unit, a RAM 20 serving as a memory functioning as a work area of the CPU 10, and a read-only memory for storing various programs and the like. ROM 30 as a memory, EEPROM 40 as an electrically rewritable memory, an analog block 50 for a power supply circuit, a cryptographic core 60 for performing an encryption process, and a so-called hash value used for a public key cryptosystem ALU RAM 70 for storing data, etc., an external I / O terminal 80 for inspection, which is a dedicated external bus for checking the presence or absence of a failure in the cryptographic core 60, and a bus for transmitting and receiving data between the CPU 10 and each unit. And an RF (Radio Frequency) for performing wireless communication (not shown). cy) constituted a block as an integrated circuit was called LSI (Large Scale Integration).
[0068]
In the following, for convenience of description, the cryptographic core 60 as an encryption processing unit employs a so-called Elliptic Curve Cryptography system (ECC) as a public key encryption system, and has a hash used for authentication and digital signature. Description will be made assuming that what is called SHA-1 (Secure Hash Algorithm-1) is used as a function.
[0069]
In the following, as in the above-described second example, the inspection data, the inspection parameter, the inspection random number, and the inspection secret key and the inspection public key as the inspection key are stored in the encryption core 60 as initial values. A case will be described as an example in which the information is stored in the gate in advance and the cryptographic core 60 outputs whether or not the result of the encryption process is correct as a result flag.
[0070]
Further, in order to specifically explain the inspection of the cryptographic core 60, as shown in FIG. 6, each part of the contactless IC card shown in FIG. 5 is functionally represented. In the figure, for convenience of explanation, the cryptographic core 60 is represented by an ECC / SHA-1 block 60 representing the functions of the elliptic curve encryption processing and the SHA-1 processing. 1 And a DES block 60 representing a function of a triple DES (Data Encryption Standard) encryption process 2 It is roughly divided into and expressed. The DES block 60 2 Is a block for generating a random number used in a key generation process and the like required for performing an encryption process, using a so-called DES (Data Encryption Standard) encryption method, which is one of the common key encryption methods. . 6, the test external input / output terminal 80 shown in FIG. 5 is represented as a test block 80.
[0071]
When checking for a failure of the cryptographic core 60 mounted on such a non-contact type IC card, a signature is generated by the cryptographic core 60 as described below, and it is determined whether or not the generated signature is correct. I do.
[0072]
First, when an inspection mode command is given from the inspection external input / output terminal 80 to the cryptographic core 60 via the CPU 10, the inspection data, the inspection parameter, the inspection random number, and the inspection The inspection secret key as a service key is read and stored in the ALU RAM 70.
[0073]
Next, the test data stored in the ALU RAM 70 is read, and the ECC / SHA-1 block 60 is read. 1 The hash value is calculated by the SHA-1 process according to. The generated hash value is stored in the ALU RAM 70.
[0074]
At this time, the storage location of the hash value calculated by the SHA-1 processing on the ALU RAM 70 is set in advance to an address used in the elliptic curve encryption processing described later, so that the hash value by the SHA-1 processing is obtained. After the calculation, the process can be immediately shifted to the elliptic curve encryption process, so that most of a series of operations such as signature generation and signature verification can be executed at high speed by hardware. Therefore, in the encryption device, the load on the CPU can be reduced, and the resistance against an attack due to software tampering and the like can be enhanced. Normally, in the encryption process, if the transfer of an intermediate operation result is delegated to the CPU, the software can be easily tampered with by falsification. It is possible to avoid tampering due to CPU intervention on the way.
[0075]
Next, the hash value, the inspection parameter, the inspection random number, and the inspection secret key are read from the ALURAM 70, and the ECC / SHA-1 block 60 is used by using these values. 1 Performs an elliptic curve encryption process to generate a signature.
[0076]
Next, the obtained signature is compared with the expected value stored in the ALU RAM 70, and a 1-bit result flag is output from the inspection external input / output terminal 80, for example.
[0077]
On the other hand, the obtained signature is stored in the ALU RAM 70 for use in subsequent signature verification processing.
[0078]
Then, a command to start signature verification is sent from the external input / output terminal for inspection 80 via the CPU 10 to the ECC / SHA-1 block 60. 1 , The process proceeds to a signature verification process using the signature stored in the ALU RAM 70.
[0079]
At the time of signature verification, first, an inspection parameter, an inspection random number, a hash value, and an inspection public key as an inspection key are loaded into the ALU RAM 70.
[0080]
Next, the inspection parameter, the inspection random number, the hash value, and the inspection public key as the inspection key are read from the ALU RAM 70, and the ECC / SHA-1 block 60 is read. 1 Thus, the signature verification processing is performed by the elliptic curve encryption processing.
[0081]
Then, a result flag indicating whether or not the calculated signature matches the signature stored in the ALU RAM 70 is output from the external input / output terminal 80 for inspection.
[0082]
As described above, when inspecting the cryptographic core 60, the encryption process is performed using only the internal data, and further, the result flag indicating whether the result of the encryption process matches or does not match the expected value is checked. It can be determined whether or not the cryptographic core 60 operates normally. That is, the inspection of the cryptographic core 60 can be performed safely without risking security such as directly inputting data, parameters, and the like from the external input / output terminal 80 for inspection to the cryptographic core 60. Further, since the inspector does not need to know the expected value in determining whether or not the cryptographic core 60 has a failure, the security can be further improved as compared with the case where the result of the encryption processing is output as it is. .
[0083]
In addition, it is preferable that a test pattern that can sufficiently secure the failure detection rate of the cryptographic core 60 be back calculated by simulation, and that this test pattern be stored as an initial value in a storage unit such as a gate or a ROM in advance. Usually, in order to increase the failure detection rate of the cryptographic core 60, it is necessary to input and test a very large number of test patterns from the outside, but if the test pattern calculated back by simulation is used as an initial value, the number of times of the test is reduced. A high failure detection rate is secured without increasing. Note that the registers, flags, and the like may be inspected separately. Therefore, the non-contact type IC card incorporating the encryption device of the present invention can sufficiently cope with mass production.
[0084]
Further, according to the present invention, it is possible to avoid an attack on the cryptographic core 60 by inputting / outputting data from / to the external input / output terminal 80 for inspection provided on the IC chip. Subsequent processing becomes unnecessary.
[0085]
Further, since the encryption device of the present invention has the above-described configuration, even if the IC tester or the like is stolen by an unauthorized third party, it is impossible to analyze the encryption function.
[0086]
Note that the present invention is not limited to the above-described embodiment. For example, in the above-described embodiment, the elliptic curve encryption method has been described as the public key encryption method. However, the present invention can be easily applied to other public key encryption methods such as the RSA encryption method. Can be applied to
[0087]
In the above-described embodiment, the encryption device that performs the encryption process using the so-called public key encryption method has been described. However, the present invention can be applied to the encryption device using the common key encryption method.
[0088]
In the above-described embodiment, SHA-1 is used as a hash function. However, the present invention can be easily applied to other hash functions such as MD5 (Message Digest 5). .
[0089]
Furthermore, in the above-described embodiment, an application example of the encryption device has been described using the IC chip built in the FPGA and the non-contact type IC card. However, the present invention is not limited to any application requiring the same function. Of course, it can be applied to an apparatus or a device.
[0090]
As described above, it goes without saying that the present invention can be appropriately changed without departing from the spirit of the present invention.
[0091]
【The invention's effect】
As is clear from the above description, the encryption device according to the present invention stores the test data, the test parameter, the test random number, and the test key in the storage unit as initial values, and externally sets the test mode. When these instructions are input, these are read out, encrypted, and the result is output. If the inspector knows the expected value, which is the correct value of the output result, it can determine whether or not the encryption device has a failure by comparing the expected value with the output result. For this reason, it is possible to avoid an attack on the encryption device due to repeated input / output of test data and the like. Therefore, according to the present invention, it is possible to realize an encryption device that can reliably perform an inspection without risking security such as directly inputting inspection data or the like from the outside at the time of inspection.
[Brief description of the drawings]
FIG. 1 is a first example of an encryption device according to the present invention, and is a diagram illustrating a configuration of an inspection circuit.
FIG. 2 is a second example of the encryption device of the present invention, and is a diagram illustrating a configuration of a test circuit.
FIG. 3 is a third example of the encryption device of the present invention, and is a diagram illustrating a configuration of a test circuit.
FIG. 4 is a fourth example of the present invention and is a diagram illustrating a configuration of an FPGA in which an encryption device is incorporated.
FIG. 5 is a diagram illustrating a configuration of an IC chip of a non-contact type IC card in which an encryption device is incorporated according to a fifth example of the present invention.
6 is a block diagram functionally representing an IC chip of the non-contact type IC card shown in FIG.
FIG. 7 is a diagram showing a configuration of a test circuit of a conventional encryption device.
[Explanation of symbols]
10 CPU
20 RAM
30 ROM
40 EEPROM
50 analog blocks
60 cryptographic core
70 ALU RAM
80 External input / output terminal for test (test block)
90 Interface

Claims (12)

検査用データ、検査用パラメータ、検査用乱数及び検査用鍵を初期値として格納する記憶手段と、
暗号化処理を行う暗号化処理手段とを備え、
上記暗号化処理手段は、検査モードの命令が外部から与えられるのに応じて、上記記憶手段に記憶された上記検査用データ、上記検査用パラメータ、上記検査用乱数及び上記検査用鍵を用いて暗号化処理を行うことを特徴とする暗号化装置。
Storage means for storing test data, a test parameter, a test random number, and a test key as initial values;
Encryption means for performing encryption processing,
The encryption processing unit uses the inspection data, the inspection parameter, the inspection random number, and the inspection key stored in the storage unit in response to an inspection mode instruction being externally provided. An encryption device that performs an encryption process.
上記記憶手段は、上記検査用データ、上記検査用パラメータ、上記検査用乱数及び上記検査用鍵を用いて暗号化処理を行ったときに生成する正しい値である期待値をさらに格納し、
上記暗号化処理手段は、上記検査用データ、上記検査用パラメータ、上記検査用乱数及び上記検査用鍵を用いた暗号化処理の結果と上記期待値とが一致するか否かを判断して判断結果を出力することを特徴とする請求項1記載の暗号化装置。
The storage means further stores an expected value which is a correct value generated when an encryption process is performed using the inspection data, the inspection parameter, the inspection random number, and the inspection key,
The encryption processing means determines whether or not the result of the encryption processing using the inspection data, the inspection parameter, the inspection random number, and the inspection key matches the expected value. 2. The encryption device according to claim 1, wherein a result is output.
上記暗号化処理手段は、公開鍵暗号化方式による暗号化処理を行うことを特徴とする請求項1記載の暗号化装置。2. The encryption apparatus according to claim 1, wherein said encryption processing means performs an encryption process using a public key encryption method. 上記暗号化処理手段は、暗号化処理として署名生成処理を行うことを特徴とする請求項3記載の暗号化装置。4. The encryption device according to claim 3, wherein the encryption processing means performs a signature generation process as the encryption process. 上記暗号化処理手段は、上記署名生成処理により生成した上記署名の署名検証処理を行い、当該署名検証処理の結果を出力することを特徴とする請求項4記載の暗号化装置。5. The encryption apparatus according to claim 4, wherein the encryption processing unit performs a signature verification process on the signature generated by the signature generation process, and outputs a result of the signature verification process. 暗号化処理に用いるためのハッシュ値を生成するハッシュ値生成手段と、ハッシュ値生成手段によって生成したハッシュ値を格納するための第2の記憶手段とをさらに備え、上記暗号化処理手段は、上記第2の記憶手段に格納されたハッシュ値を読み出すことを特徴とする請求項1記載の暗号化装置。The apparatus further includes a hash value generation unit that generates a hash value for use in encryption processing, and a second storage unit that stores a hash value generated by the hash value generation unit. 2. The encryption device according to claim 1, wherein the hash value stored in the second storage unit is read. 上記初期値は、必要な故障検出率から逆算されたものであることを特徴とする請求項1記載の暗号化装置。2. The encryption apparatus according to claim 1, wherein the initial value is calculated from a required failure detection rate. 上記検査用データ、検査用パラメータ、検査用乱数及び検査用鍵は、実際の暗号化処理では運用されないことを特徴とする請求項1記載の暗号化装置。2. The encryption apparatus according to claim 1, wherein the inspection data, the inspection parameter, the inspection random number, and the inspection key are not used in actual encryption processing. 上記暗号化処理手段は、楕円曲線暗号化処理を行うことを特徴とする請求項1記載の暗号化装置。2. The encryption apparatus according to claim 1, wherein said encryption processing means performs an elliptic curve encryption process. 上記ハッシュ値生成手段は、SHA−1処理を行うことを特徴とする請求項6記載の暗号化装置。7. The encryption apparatus according to claim 6, wherein said hash value generation means performs SHA-1 processing. 通信機能を有する非接触型ICカードに内蔵されたICチップに組み込まれていることを特徴とする請求項1記載の暗号化装置。2. The encryption device according to claim 1, wherein the encryption device is incorporated in an IC chip built in a contactless IC card having a communication function. FPGAに組み込まれていることを特徴とする請求項1記載の暗号化装置。The encryption device according to claim 1, wherein the encryption device is incorporated in an FPGA.
JP2002249369A 2002-08-28 2002-08-28 Encryption device Withdrawn JP2004088632A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2002249369A JP2004088632A (en) 2002-08-28 2002-08-28 Encryption device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2002249369A JP2004088632A (en) 2002-08-28 2002-08-28 Encryption device

Publications (1)

Publication Number Publication Date
JP2004088632A true JP2004088632A (en) 2004-03-18

Family

ID=32056509

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2002249369A Withdrawn JP2004088632A (en) 2002-08-28 2002-08-28 Encryption device

Country Status (1)

Country Link
JP (1) JP2004088632A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2009105644A (en) * 2007-10-23 2009-05-14 Nec Corp Information processor, program, external encryption system, and external encrypting method
JP2018029267A (en) * 2016-08-18 2018-02-22 富士通株式会社 Programmable logic device, information processing apparatus, processing method, and processing program

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2009105644A (en) * 2007-10-23 2009-05-14 Nec Corp Information processor, program, external encryption system, and external encrypting method
JP2018029267A (en) * 2016-08-18 2018-02-22 富士通株式会社 Programmable logic device, information processing apparatus, processing method, and processing program

Similar Documents

Publication Publication Date Title
US10469256B2 (en) Cryptographic communication system and cryptographic communication method
US9100174B2 (en) Secure provisioning in an untrusted environment
US9100189B2 (en) Secure provisioning in an untrusted environment
US9129536B2 (en) Circuit for secure provisioning in an untrusted environment
JP5607546B2 (en) Method and apparatus for controlling system access during a protected mode of operation
CN104838385B (en) Use the device authentication of the key generation system based on the unclonable function of physics
JP4733924B2 (en) Integrated circuit certification
US9094205B2 (en) Secure provisioning in an untrusted environment
US6357004B1 (en) System and method for ensuring integrity throughout post-processing
US8528067B2 (en) Anytime validation for verification tokens
US9338004B2 (en) Method and system for smart card chip personalization
TWI518548B (en) Machine authenticity judgment system and machine authenticity judgment method
JPH09128507A (en) Mutual certifying method
EP1763720A2 (en) Systems and methods for securing a computer boot
JP2010527219A (en) Method and system for electronically securing electronic device security using functions that cannot be physically copied
CN102375941A (en) Method and system for validating chip validity by utilizing graphical chip
US8079078B2 (en) Encryption apparatus, program for use therewith, and method for use therewith
KR100972540B1 (en) Secure memory card with life cycle phases
US20170063821A1 (en) Secure protocol for chip authentication
US20060289656A1 (en) Portable electronic apparatus and data output method therefor
JP2004088632A (en) Encryption device
US7886163B2 (en) Authentication protocol with memory integrity verification
JP2010160765A (en) System lsi and debugging method thereof
JP2002525972A (en) Method for authentication of at least one subscriber in data exchange
AU2015200701B2 (en) Anytime validation for verification tokens

Legal Events

Date Code Title Description
RD04 Notification of resignation of power of attorney

Free format text: JAPANESE INTERMEDIATE CODE: A7424

Effective date: 20050527

RD02 Notification of acceptance of power of attorney

Free format text: JAPANESE INTERMEDIATE CODE: A7422

Effective date: 20050810

A300 Application deemed to be withdrawn because no request for examination was validly filed

Free format text: JAPANESE INTERMEDIATE CODE: A300

Effective date: 20051101