JP2019121955A - Semiconductor device and generating method of encryption key - Google Patents

Semiconductor device and generating method of encryption key Download PDF

Info

Publication number
JP2019121955A
JP2019121955A JP2018001228A JP2018001228A JP2019121955A JP 2019121955 A JP2019121955 A JP 2019121955A JP 2018001228 A JP2018001228 A JP 2018001228A JP 2018001228 A JP2018001228 A JP 2018001228A JP 2019121955 A JP2019121955 A JP 2019121955A
Authority
JP
Japan
Prior art keywords
key
scramble
encryption key
encryption
data
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.)
Granted
Application number
JP2018001228A
Other languages
Japanese (ja)
Other versions
JP7057675B2 (en
Inventor
大輔 熊木
Daisuke Kumaki
大輔 熊木
俊彦 中村
Toshihiko Nakamura
俊彦 中村
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.)
Lapis Semiconductor Co Ltd
Original Assignee
Lapis Semiconductor Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Lapis Semiconductor Co Ltd filed Critical Lapis Semiconductor Co Ltd
Priority to JP2018001228A priority Critical patent/JP7057675B2/en
Publication of JP2019121955A publication Critical patent/JP2019121955A/en
Application granted granted Critical
Publication of JP7057675B2 publication Critical patent/JP7057675B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Abstract

To provide a semiconductor device capable of preventing data leakage due to unauthorized access, and a generating method of an encryption key.SOLUTION: A semiconductor device (key storage) 22 holds the result of scramble of a random number generated by an external random number generation unit by a scramble processing unit 214 by using a scramble key generated by a scramble key generation unit 213 in a storage RAM 215 as a scramble encryption key. Further, in response to a read request, the scramble encryption key is descrambled by using the scramble key to output the obtained encryption key. The key storage 22 holds a key obtained by scrambling the held scrambled encryption key by the scramble key every predetermined period as a new scrambled encryption key.SELECTED DRAWING: Figure 7

Description

本発明は、半導体装置、特にデータを暗号化するための暗号鍵を記憶する記憶部を含む半導体装置、及び暗号鍵の生成方法に関する。   The present invention relates to a semiconductor device, and more particularly to a semiconductor device including a storage unit that stores an encryption key for encrypting data, and an encryption key generation method.

現在、暗号鍵を用いてデータを暗号化し、暗号化された暗号化データに対してこの暗号鍵を用いた復号を施すことにより元のデータを復元する機能を備えたマイクロコンピュータを含む半導体装置が知られている(例えば、特許文献1参照)。   At present, there is a semiconductor device including a microcomputer having a function of decrypting data using an encryption key and decrypting the encrypted data using the encryption key to restore the original data. It is known (for example, refer to patent documents 1).

当該半導体装置には、暗号鍵を格納するメモリとして、EEPROM(Electrically Erasable Programmable Read-Only Memory)が設けられている。   In the semiconductor device, an EEPROM (Electrically Erasable Programmable Read-Only Memory) is provided as a memory for storing the encryption key.

特開2014−89640号公報JP, 2014-89640, A

ところで、暗号鍵は第三者に漏洩してはならないものであるが、外部からの物理攻撃或いは物理解析等の不正なアクセスにより、メモリに格納されている暗号鍵が不正に読み出されてしまう虞があった。この際、不正に取得した暗号鍵により上記した暗号化データが復号されてしまい、データの漏洩を招くことになる。   By the way, although the encryption key should not be leaked to a third party, the encryption key stored in the memory is illegally read out due to an external access such as a physical attack or physical analysis from outside. There was a fear. At this time, the above-described encrypted data is decrypted by the illegitimately obtained encryption key, which causes data leakage.

そこで、本発明は、不正なアクセスによるデータの漏洩を防ぐことが可能な半導体装置、及び暗号鍵の生成方法を提供することを目的とする。   Therefore, an object of the present invention is to provide a semiconductor device capable of preventing data leakage due to unauthorized access, and a method of generating an encryption key.

本発明に係る半導体装置は、暗号鍵を用いてデータを暗号化する半導体装置であって、乱数を生成する乱数生成部と、前記乱数をスクランブルキーを用いてスクランブルしたものをスクランブル暗号鍵として保持し、読出要求に応じて、前記スクランブル暗号鍵を前記スクランブルキーを用いてデスクランブルして得た暗号鍵を出力する鍵保持部と、を有し、前記鍵保持部は、保持した前記スクランブル暗号鍵を所定期間毎にスクランブルキーでスクランブルしたものを新たなスクランブル暗号鍵として保持する。   A semiconductor device according to the present invention is a semiconductor device that encrypts data using an encryption key, and holds a random number generation unit that generates a random number and a scrambled key that scrambles the random number using a scramble key. A key holding unit for outputting an encryption key obtained by descrambling the scramble encryption key using the scramble key in response to a read request, and the key holding unit holds the scramble encryption key held The key is scrambled with the scramble key at predetermined intervals and held as a new scramble encryption key.

また、本発明に係る暗号鍵の生成方法は、データの暗号化に用いる暗号鍵の生成方法であって、乱数をスクランブルキーでスクランブルしたものをスクランブル暗号鍵としてメモリに保持させると共に、前記スクランブル暗号鍵を所定期間毎にスクランブルキーでスクランブルしたものを新たなスクランブル暗号鍵として前記メモリに保持させ、読出要求に応じて、前記メモリに保持されている前記スクランブル暗号鍵を前記スクランブルキーを用いてデスクランブルすることにより前記暗号鍵を得る。   Further, a method of generating an encryption key according to the present invention is a method of generating an encryption key used to encrypt data, wherein a random number scrambled with a scramble key is held in a memory as a scramble encryption key, and the scramble encryption is performed. The key is scrambled with a scramble key at predetermined intervals and held in the memory as a new scramble encryption key, and the scramble encryption key held in the memory is de-multiplexed using the scramble key according to the read request. The encryption key is obtained by scrambling.

本発明では、鍵保持部が、乱数をスクランブルしたものをスクランブル暗号鍵として保持し、この保持したスクランブル暗号鍵自体を所定期間毎にスクランブルしたものを、新たなスクランブル暗号鍵として保持する。   In the present invention, the key holding unit holds the scrambled random number scrambled as a scramble encryption key, and holds the scrambled encryption key itself held scrambled for each predetermined period as a new scramble encryption key.

これにより、鍵保持部に保持されたスクランブル暗号鍵は、それ自体が所定期間毎に繰り返しスクランブルされるので、時間経過につれてその値が変化する。よって、たとえ外部からの不正なアクセスによって、鍵保持部に保持されているスクランブル暗号鍵が漏洩しても、このスクランブル暗号鍵からでは、暗号鍵自体を特定することが困難となる。したがって、不正なアクセスが行われても平文データの漏洩を防ぐことが可能となる。   As a result, the scramble encryption key held in the key holding unit is itself scrambled repeatedly at predetermined intervals, and its value changes as time passes. Therefore, even if the scramble encryption key held in the key holding unit leaks due to an unauthorized access from the outside, it is difficult to specify the encryption key itself from the scramble encryption key. Therefore, it is possible to prevent the leakage of plaintext data even if unauthorized access is performed.

本発明に係る半導体装置の一例としてのマイクロコンピュータ100の構成を示すブロック図である。FIG. 1 is a block diagram showing a configuration of a microcomputer 100 as an example of a semiconductor device according to the present invention. データを暗号化する場合にマイクロコンピュータ100内で行われる第1段階でのデータ転送の状態を表すブロック図である。FIG. 6 is a block diagram showing a state of data transfer in a first step performed in microcomputer 100 when data is encrypted. データを暗号化する場合にマイクロコンピュータ100内で行われる第2段階でのデータ転送の状態を表すブロック図である。FIG. 7 is a block diagram showing a state of data transfer in a second step performed in microcomputer 100 when data is encrypted. データを暗号化する場合にマイクロコンピュータ100内で行われる第3段階でのデータ転送の状態を表すブロック図である。FIG. 16 is a block diagram showing the state of data transfer in the third step performed in microcomputer 100 when data is encrypted. データを暗号化する場合にマイクロコンピュータ100内で行われる第4段階でのデータ転送の状態を表すブロック図である。It is a block diagram showing the state of the data transfer in the 4th step performed in the microcomputer 100, when encrypting data. データを暗号化する場合にマイクロコンピュータ100内で行われる第5段階でのデータ転送の状態を表すブロック図である。FIG. 16 is a block diagram showing the state of data transfer in a fifth step performed in microcomputer 100 when data is encrypted. キーストレージ22の内部構成の一例を示すブロック図である。FIG. 2 is a block diagram showing an example of an internal configuration of a key storage 22. キーストレージ22内で行われる暗号鍵の保持動作の手順を表すフローチャートである。FIG. 10 is a flowchart showing a procedure of an encryption key holding operation performed in the key storage 22. FIG. キーストレージ22内で行われる暗号鍵の読出動作の手順を表すフローチャートである。FIG. 10 is a flowchart showing a procedure of an encryption key reading operation performed in the key storage 22. FIG. マイクロコンピュータ100の内部構成の変形例を示すブロック図である。FIG. 10 is a block diagram showing a modification of the internal configuration of the microcomputer 100. キーストレージ22の内部構成の他の一例を示すブロック図である。10 is a block diagram showing another example of the internal configuration of the key storage 22. FIG. データを暗号化する場合に図10に示すマイクロコンピュータ100内で行われる第1段階でのデータ転送の状態を表すブロック図である。FIG. 11 is a block diagram showing a state of data transfer at a first stage performed in the microcomputer 100 shown in FIG. 10 when data is encrypted. データを暗号化する場合に図10に示すマイクロコンピュータ100内で行われる第2段階でのデータ転送の状態を表すブロック図である。FIG. 11 is a block diagram showing a state of data transfer in a second stage performed in microcomputer 100 shown in FIG. 10 when data is encrypted. データを暗号化する場合に図10に示すマイクロコンピュータ100内で行われる第3段階でのデータ転送の状態を表すブロック図である。FIG. 11 is a block diagram showing a state of data transfer in a third step performed in microcomputer 100 shown in FIG. 10 when data is encrypted. データを暗号化する場合に図10に示すマイクロコンピュータ100内で行われる第4段階でのデータ転送の状態を表すブロック図である。FIG. 11 is a block diagram showing a state of data transfer in a fourth step performed in microcomputer 100 shown in FIG. 10 when data is encrypted. データを暗号化する場合に図10に示すマイクロコンピュータ100内で行われる第5段階でのデータ転送の状態を表すブロック図である。FIG. 11 is a block diagram showing a state of data transfer in a fifth step performed in microcomputer 100 shown in FIG. 10 when data is encrypted. データを暗号化する場合に図10に示すマイクロコンピュータ100内で行われる第6段階でのデータ転送の状態を表すブロック図である。FIG. 11 is a block diagram showing a state of data transfer in a sixth step performed in microcomputer 100 shown in FIG. 10 when data is encrypted.

図1は、本発明に係る半導体装置に含まれるマイクロコンピュータ100の構成を示すブロック図である。   FIG. 1 is a block diagram showing a configuration of a microcomputer 100 included in a semiconductor device according to the present invention.

マイクロコンピュータ100は、暗号処理部12、乱数生成部13、CPU(central processing unit)14、RAM(random access memory)15、ROM(read only memory)制御部16、ROM17、セキュアRAM19、セキュアROM20、セキュアDMAC(direct memory access controller)21、及びキーストレージ22を有する。   The microcomputer 100 includes an encryption processing unit 12, a random number generation unit 13, a CPU (central processing unit) 14, a RAM (random access memory) 15, a ROM (read only memory) control unit 16, a ROM 17, a secure RAM 19, a secure ROM 20, a secure It has a DMAC (direct memory access controller) 21 and a key storage 22.

更に、マイクロコンピュータ100は、2系統のデータバスBS1及びBS8を含む。マイクロコンピュータ100は、外部接続された機器とのデータ通信が可能であり、当該データバスBS1を介して各種データの送信又は受信を行う。   Further, microcomputer 100 includes two systems of data buses BS1 and BS8. The microcomputer 100 can perform data communication with an externally connected device, and transmits or receives various data via the data bus BS1.

データバスBS1には、暗号処理部12、乱数生成部13、CPU14、RAM15、ROM制御部16、ROM17、セキュアRAM19、及びキーストレージ22が接続されている。   To the data bus BS1, an encryption processing unit 12, a random number generation unit 13, a CPU 14, a RAM 15, a ROM control unit 16, a ROM 17, a secure RAM 19, and a key storage 22 are connected.

データバスBS8は、データバスBS1には接続されておらず、且つマイクロコンピュータ100の外部からのアクセス不可な独立したバスである。データバスBS8は、秘匿性を要求される乱数生成部13、セキュアRAM19、セキュアROM20、セキュアDMAC21及びキーストレージ22、並びに暗号処理部12に接続されている。   Data bus BS8 is an independent bus which is not connected to data bus BS1 and can not be accessed from the outside of microcomputer 100. The data bus BS8 is connected to the random number generation unit 13, the secure RAM 19, the secure ROM 20, the secure DMAC 21, the key storage 22, and the encryption processing unit 12 which are required to be confidential.

暗号処理部12は、データバスBS1を介して受けた暗号化前の平文データ片を、暗号鍵を用いて暗号化することにより暗号化データ片を得て、これをデータバスBS1に送出する。また、暗号処理部12は、データバスBS1を介して受けた暗号化データ片を、この暗号鍵を用いて復号することにより、暗号化前の平文データ片を復元する。尚、暗号処理部12は、このような暗号化又は復号化処理を行うにあたり、その実行前に、キーストレージ22から暗号鍵を取得しておく。   The cryptographic processor 12 encrypts a plaintext data piece before encryption received via the data bus BS1 using an encryption key to obtain an encrypted data piece, and sends it to the data bus BS1. Also, the encryption processing unit 12 decrypts the encrypted data piece received via the data bus BS1 using this encryption key, thereby restoring the plaintext data piece before encryption. The encryption processing unit 12 acquires the encryption key from the key storage 22 prior to the execution of such encryption or decryption processing.

乱数生成部13は、所定の一定周期で乱数値が変化する乱数を生成し、これをデータバスBS8に送出する。   The random number generation unit 13 generates a random number whose random number value changes at a predetermined constant cycle, and sends it to the data bus BS8.

CPU14は、このマイクロコンピュータ100の中央演算処理装置であり、ROM17に格納されているプログラムに従った各種の演算、或いはデータの転送を行う。   The CPU 14 is a central processing unit of the microcomputer 100, and performs various operations or data transfer in accordance with a program stored in the ROM 17.

RAM15は、データ書き込みが可能な記憶素子であり、CPU14によってデータの書込又は読出が行われる。   The RAM 15 is a storage element to which data can be written, and the CPU 14 writes or reads data.

ROM制御部16は、ROM17に対して、データの書き込み、又はデータが正しく書き込まれたか否かを確認するベリファイ、或いは書き込まれたデータの消去等を行う。また、ROM制御部16は、セキュアDMAC21に対して書き込み要求を行う。   The ROM control unit 16 writes data to the ROM 17, performs verification to confirm whether the data is correctly written, or erases the written data. Further, the ROM control unit 16 makes a write request to the secure DMAC 21.

ROM17には、CPU14が実行するプログラムを表すプログラムデータが書き込まれている。   Program data representing a program executed by the CPU 14 is written in the ROM 17.

セキュアRAM19は、セキュアDMAC21からのデータ書込アクセスに応じて、データバスBS8を介して受けたデータを記憶する。また、セキュアRAM19は、セキュアDMAC21からのデータ読出アクセスに応じて、自身に記憶されているデータを読み出し、これをデータバスBS8に送出する。また、セキュアRAM19は、CPU14からのデータ書込アクセスに応じて、データバスBS1を介して受けたデータを記憶する。尚、セキュアRAM19は、CPU14からのデータ読出アクセスは受け付けない。   Secure RAM 19 stores data received via data bus BS 8 in response to data write access from secure DMAC 21. Also, in response to the data read access from the secure DMAC 21, the secure RAM 19 reads the data stored therein and sends it to the data bus BS8. In addition, secure RAM 19 stores data received via data bus BS1 in response to a data write access from CPU 14. The secure RAM 19 does not accept data read access from the CPU 14.

セキュアROM20は、セキュアDMAC21からのデータ読出アクセスに応じて、自身に格納されているデータを読み出し、これをデータバスBS8に送出する。また、セキュアROM20は、ROM制御部16がセキュアDMAC21へ書き込み要求を行った際に、セキュアDMAC21がデータバスBS8を介して受けたデータを書き込む。   In response to the data read access from secure DMAC 21, secure ROM 20 reads the data stored therein and sends it to data bus BS8. Also, when the ROM control unit 16 makes a write request to the secure DMAC 21, the secure ROM 20 writes the data received by the secure DMAC 21 via the data bus BS8.

セキュアDMAC21は、データバスBS8を介して、暗号処理部12、乱数生成部13、セキュアRAM19、セキュアROM20、セキュアDMAC21、及びキーストレージ22間のデータ転送を行う。   The secure DMAC 21 performs data transfer between the cryptographic processor 12, the random number generator 13, the secure RAM 19, the secure ROM 20, the secure DMAC 21, and the key storage 22 via the data bus BS8.

キーストレージ22は、乱数生成部13で生成された乱数をスクランブルしたスクランブル暗号鍵を生成し、これを保持する。また、キーストレージ22は、暗号鍵の読出要求に応じて、保持されているスクランブル暗号鍵を読み出し、このスクランブル暗号鍵に施されているスクランブルを解除したものを暗号鍵としてデータバスBS8に送出する。   The key storage 22 generates a scramble encryption key in which the random number generated by the random number generation unit 13 is scrambled, and holds this. Further, the key storage 22 reads the held scramble encryption key in response to the read request for the encryption key, and sends out the scrambled key applied to the scramble encryption key as the encryption key to the data bus BS8. .

上記した構成により、マイクロコンピュータ100は、ROM17に格納されているプログラムに従って、上記した暗号鍵を用いた平文データの暗号化及び復号化処理を含む各種のデータ処理を行う。   According to the above configuration, the microcomputer 100 performs various data processing including encryption and decryption processing of plaintext data using the above encryption key in accordance with the program stored in the ROM 17.

以下に、RAM15に記憶されている平文データを暗号化する際の動作を、図2〜図6を参照して説明する。   The operation of encrypting the plaintext data stored in the RAM 15 will be described below with reference to FIGS.

先ず、セキュアDMAC21が、乱数生成部13で生成された乱数を、図2の太線矢印に示すように、データバスBS8を介してキーストレージ22に転送する。キーストレージ22は、転送された乱数をスクランブルしたものを、スクランブル暗号鍵として保持する。   First, the secure DMAC 21 transfers the random number generated by the random number generation unit 13 to the key storage 22 via the data bus BS8, as indicated by the thick arrow in FIG. The key storage 22 holds the scrambled random number transferred as a scramble encryption key.

次に、セキュアDMAC21は、キーストレージ22に対して暗号鍵の読出要求を行い、これによりキーストレージ22から送出された暗号鍵を図3の太線矢印に示すように、データバスBS8を介してセキュアRAM19に転送する。これにより、セキュアRAM19は、当該暗号鍵を記憶する。   Next, the secure DMAC 21 issues a read request for the encryption key to the key storage 22. As a result, the encryption key sent from the key storage 22 is secured via the data bus BS8 as shown by the thick arrow in FIG. It transfers to RAM19. Thereby, the secure RAM 19 stores the encryption key.

次に、セキュアDMAC21は、セキュアRAM19に記憶されている暗号鍵を読み出し、これを図4の太線矢印に示すように、データバスBS8を介してセキュアROM20に転送する。これにより、セキュアROM20は、当該暗号鍵を書き込む。つまり、暗号処理部12で暗号化が行われる度にその暗号化で用いられた暗号鍵がセキュアROM20に追記される。よって、セキュアROM20には、使用した暗号鍵の履歴が残る。   Next, the secure DMAC 21 reads the encryption key stored in the secure RAM 19 and transfers it to the secure ROM 20 via the data bus BS8, as shown by the thick arrow in FIG. Thereby, the secure ROM 20 writes the encryption key. That is, each time encryption is performed by the encryption processing unit 12, the encryption key used in the encryption is additionally written to the secure ROM 20. Therefore, a history of the used encryption key remains in the secure ROM 20.

次に、セキュアDMAC21は、セキュアRAM19に記憶されている暗号鍵を読み出し、これを図5の太線矢印に示すように、データバスBS8を介して暗号処理部12に転送する。更に、CPU14が、RAM15に記憶されている平文データ片を読み出し、これを図5の太線矢印に示すように、データバスBS1を介して暗号処理部12に転送する。暗号処理部12は、転送された平文データを、転送された暗号鍵を用いて暗号化することにより暗号化データ片を生成し、これをデータバスBS1に送出する。   Next, the secure DMAC 21 reads the encryption key stored in the secure RAM 19 and transfers it to the encryption processing unit 12 via the data bus BS8, as indicated by the thick arrow in FIG. Further, the CPU 14 reads the plaintext data piece stored in the RAM 15 and transfers it to the encryption processing unit 12 via the data bus BS1 as shown by the thick arrow in FIG. The encryption processing unit 12 encrypts the transferred plaintext data using the transferred encryption key to generate an encrypted data piece, and sends it to the data bus BS1.

次に、CPU14が、暗号処理部12で生成された暗号化データ片を、図6の太線矢印にて示すように、データバスBS1を介してRAM15に転送する。これにより、RAM15は、転送された暗号化データ片を記憶する。   Next, the CPU 14 transfers the encrypted data piece generated by the encryption processing unit 12 to the RAM 15 via the data bus BS1 as indicated by the thick arrow in FIG. Thereby, the RAM 15 stores the transferred encrypted data piece.

このように、平文データの暗号化を行うにあたり、マイクロコンピュータ100内では、先ず、図2に示すように、セキュアDMAC21が、乱数生成部13で生成された乱数をキーストレージ22に転送する。この際、キーストレージ22では、当該乱数をスクランブル化したものをスクランブル暗号鍵として保持する。そして、セキュアDMAC21が、当該キーストレージ22からスクランブルが解除された暗号鍵を読み出し、当該暗号鍵を図3及び図4に示すようにセキュアRAM19及びセキュアROM20に記憶させてから、図5に示すように暗号処理部12に転送する。   As described above, in encryption of plaintext data, in the microcomputer 100, the secure DMAC 21 first transfers the random number generated by the random number generation unit 13 to the key storage 22 as shown in FIG. At this time, the key storage 22 holds the scrambled random number as a scramble encryption key. Then, after the secure DMAC 21 reads out the scrambled encryption key from the key storage 22 and stores the encryption key in the secure RAM 19 and the secure ROM 20 as shown in FIGS. 3 and 4, as shown in FIG. To the cryptographic processor 12.

尚、RAM15に記憶されている暗号化データ片を元の平文データ片に復号する場合には、CPU14が、この暗号化データ片をRAM15から読み出し、これをデータバスBS1を介して暗号処理部12に転送する。更に、セキュアDMAC21が、この平文データ片を暗号化する際に用いた暗号鍵をセキュアRAM19から読み出し、データバスBS8を介して暗号処理部12に転送する。よって、暗号処理部12は、転送された暗号化データ片を、転送された暗号鍵を用いて復号することにより平文データ片を得る。   When the encrypted data piece stored in the RAM 15 is to be decrypted into the original plaintext data piece, the CPU 14 reads the encrypted data piece from the RAM 15 and sends it to the encryption processing unit 12 via the data bus BS1. Transfer to Furthermore, the secure DMAC 21 reads out from the secure RAM 19 the encryption key used when encrypting the plaintext data piece, and transfers it to the encryption processing unit 12 via the data bus BS8. Therefore, the encryption processing unit 12 obtains a plaintext data piece by decrypting the transferred encrypted data piece using the transferred encryption key.

また、暗号化データ片をマイクロコンピュータ100に接続されている外部機器に送信する場合には、所定のアルゴリズムに従って当該暗号化データ片と共にこの暗号化データ片に対応した暗号鍵を送信する。   Further, when transmitting the encrypted data piece to an external device connected to the microcomputer 100, the encryption data corresponding to the encrypted data piece is transmitted together with the encrypted data piece according to a predetermined algorithm.

ところで、キーストレージ22では、外部からの不正なアクセスによる暗号鍵の漏洩を防止する為に、以下の構成を採用している。   The key storage 22 adopts the following configuration in order to prevent leakage of the encryption key due to unauthorized access from the outside.

図7は、キーストレージ22の内部構成の一例を示すブロック図である。   FIG. 7 is a block diagram showing an example of the internal configuration of the key storage 22. As shown in FIG.

図7に示すように、キーストレージ22は、スクランブルキー生成部213、スクランブル処理部214、ストレージRAM215、レジスタ216、及びタイマ217を有する。   As shown in FIG. 7, the key storage 22 includes a scramble key generation unit 213, a scramble processing unit 214, a storage RAM 215, a register 216, and a timer 217.

スクランブルキー生成部213は、時間経過につれて乱数値が変化する乱数をスクランブルキーSKYとして生成し、これをスクランブル処理部214に供給する。   The scramble key generation unit 213 generates, as the scramble key SKY, a random number whose random number value changes as time passes, and supplies this to the scramble processing unit 214.

スクランブル処理部214は、乱数生成部13で生成された乱数をデータバスBS8を介して受けたときにスクランブルキーSKYを取り込み、このスクランブルキーSKYを用いたスクランブル演算(例えば排他的論理和)を、上記した乱数に施す。そして、スクランブル処理部214は、当該スクランブル演算によって得られた結果をスクランブル暗号鍵SEKとし、上記したスクランブルキーSKYと対応付けしてストレージRAM215に保持させる。   When the scramble processing unit 214 receives the random number generated by the random number generation unit 13 via the data bus BS8, the scramble processing unit 214 takes in the scramble key SKY, and performs a scramble operation (for example, exclusive OR) using the scramble key SKY. Apply to the above random number. Then, the scramble processing unit 214 sets the result obtained by the scramble operation as the scramble encryption key SEK, and causes the storage RAM 215 to hold the result in association with the scramble key SKY.

また、スクランブル処理部214は、タイムアウト信号Toutに応じて、ストレージRAM215に保持されているスクランブル暗号鍵SEKを読み出すと共に、スクランブルキー生成部213で生成されたスクランブルキーSKYを取り込む。ここで、スクランブル処理部214は、取り込んだスクランブルキーSKYを用いたスクランブル演算を、ストレージRAM215から読み出したスクランブル暗号鍵SEKに施すことにより、新たなスクランブル暗号鍵SEKを生成する。そして、スクランブル処理部214は、この新たなスクランブル暗号鍵データSEKを、スクランブルキーSKYと対応付けしてストレージRAM215に保持させる。   In addition, the scramble processing unit 214 reads the scramble encryption key SEK held in the storage RAM 215 in response to the time-out signal Tout, and takes in the scramble key SKY generated by the scramble key generation unit 213. Here, the scramble processing unit 214 generates a new scramble encryption key SEK by performing a scramble operation using the acquired scramble key SKY on the scramble encryption key SEK read from the storage RAM 215. Then, the scramble processing unit 214 causes the storage RAM 215 to hold the new scramble encryption key data SEK in association with the scramble key SKY.

また、スクランブル処理部214は、暗号鍵の読出要求に応じて、先ず、ストレージRAM215に保持されているスクランブル暗号鍵SEKと、このスクランブル暗号鍵SEKに対応付けされているスクランブルキーSKYと、を読み出す。次に、スクランブル処理部214は、スクランブルキーSKYを用いて、スクランブル暗号鍵SEKにデスクランブル演算を施すことにより暗号鍵を復元し、当該暗号鍵をデータバスBS8に送出する。   Further, the scramble processing unit 214 first reads out the scramble encryption key SEK held in the storage RAM 215 and the scramble key SKY associated with the scramble encryption key SEK in response to the read request for the encryption key. . Next, the scramble processing unit 214 uses the scramble key SKY to perform a descrambling operation on the scramble encryption key SEK to restore the encryption key, and sends the encryption key to the data bus BS8.

レジスタ216は、データバスBS1を介して受けた動作開始信号又は動作停止信号を保持する。レジスタ216は、動作開始信号を保持した場合には、タイマ217のカウント動作を開始させる動作開始信号STをタイマ217に供給する。一方、動作停止信号を保持した場合には、レジスタ216は、タイマ217のカウント動作を停止させる動作停止信号STPをタイマ217に供給する。   Register 216 holds an operation start signal or an operation stop signal received via data bus BS1. When the register 216 holds the operation start signal, the register 216 supplies the timer 217 with an operation start signal ST for starting the counting operation of the timer 217. On the other hand, when holding the operation stop signal, the register 216 supplies the timer 217 with the operation stop signal STP for stopping the counting operation of the timer 217.

タイマ217は、クロック信号を受け、動作開始信号STが供給された場合に、当該クロック信号のパルス数のカウントを開始する。ここで、タイマ217は、カウント数が所定値に到達したときに、タイムアウト信号Toutをスクランブル処理部214に供給する。タイムアウト信号Toutをスクランブル処理部214に供給した後、引き続き、タイマ217は、初期値(例えばゼロ)からクロック信号のパルス数のカウントを継続する。すなわち、タイマ217は、所定期間毎に、タイムアウト信号Toutをスクランブル処理部214に供給する。尚、タイマ217は、動作停止信号STPを受けた場合には、上記したカウント動作を停止する。   The timer 217 receives the clock signal, and starts counting the number of pulses of the clock signal when the operation start signal ST is supplied. Here, the timer 217 supplies the time-out signal Tout to the scramble processing unit 214 when the count number reaches the predetermined value. After supplying the timeout signal Tout to the scramble processing unit 214, the timer 217 continues to count the number of pulses of the clock signal from an initial value (for example, zero). That is, the timer 217 supplies the time-out signal Tout to the scramble processing unit 214 every predetermined period. When the timer 217 receives the operation stop signal STP, the timer 217 stops the counting operation described above.

以下に、図7に示す構成を有するキーストレージ22の内部で行われる暗号鍵の保持及び読出動作について説明する。   The operation of storing and reading the encryption key performed inside the key storage 22 having the configuration shown in FIG. 7 will be described below.

図8は、CPU14からデータバスBS1を介して受けた動作開始信号に応じて、キーストレージ22内で行われる暗号鍵の保持動作の手順を表すフローチャートである。尚、CPU14は、例えば電源投入に応じて、動作開始信号をデータバスBS1を介してキーストレージ22に供給する。   FIG. 8 is a flowchart showing the procedure of the operation of holding the encryption key performed in the key storage 22 in response to the operation start signal received from the CPU 14 via the data bus BS1. The CPU 14 supplies an operation start signal to the key storage 22 via the data bus BS1, for example, in response to power on.

先ず、キーストレージ22のレジスタ216が、動作開始信号STをタイマ217に供給することにより、当該タイマ217のカウント動作を開始させる(ステップS31)。これにより、タイマ217は、初期値からクロック信号のパルス数のカウントを行う。   First, the register 216 of the key storage 22 supplies the operation start signal ST to the timer 217 to start the counting operation of the timer 217 (step S31). Thus, the timer 217 counts the number of pulses of the clock signal from the initial value.

この間、スクランブル処理部214は、タイマ217からタイムアウト信号Toutが供給されたか否かを判定する(ステップS32)。尚、タイマ217は、そのカウント数が所定値に達したらタイムアウト信号Toutをスクランブル処理部214に供給する。   During this time, the scramble processing unit 214 determines whether or not the time-out signal Tout is supplied from the timer 217 (step S32). The timer 217 supplies a time-out signal Tout to the scramble processing unit 214 when the count number reaches a predetermined value.

ステップS32においてタイムアウト信号Toutが供給されていないと判定した場合、スクランブル処理部214は、引き続きタイムアウト信号Toutが供給されたか否かの判定を行う。   If it is determined in step S32 that the timeout signal Tout is not supplied, the scramble processing unit 214 continues to determine whether the timeout signal Tout is supplied.

ステップS32でタイムアウト信号Toutが供給されたと判定した場合、スクランブル処理部214は、ストレージRAM215に保持されているスクランブル暗号鍵を読み出してこれを取り込むと共に、スクランブルキーSKYを取り込む(ステップS33)。   If it is determined in step S32 that the time-out signal Tout has been supplied, the scramble processing unit 214 reads the scramble encryption key held in the storage RAM 215 and takes it in, and takes in the scramble key SKY (step S33).

次に、スクランブル処理部214は、上記したように取り込んだスクランブルキーを用いて、取り込んだスクランブル暗号鍵にスクランブル演算を施すことにより、新たなスクランブル暗号鍵SEKを生成する(ステップS34)。   Next, the scramble processing unit 214 generates a new scramble encryption key SEK by performing a scramble operation on the acquired scramble encryption key using the scramble key acquired as described above (step S34).

次に、スクランブル処理部214は、ステップS34で生成したスクランブル暗号鍵SEKと、スクランブル演算で用いたスクランブルキーSKYと、を対応付けしてストレージRAM215に保持させる(ステップS35)。   Next, the scramble processing unit 214 associates the scramble encryption key SEK generated in step S34 with the scramble key SKY used in the scramble operation and causes the storage RAM 215 to hold the scramble encryption key SEK (step S35).

次に、タイマ217は、レジスタ216から動作停止信号STPが供給されたか否かを判定する(ステップS36)。   Next, the timer 217 determines whether the operation stop signal STP is supplied from the register 216 (step S36).

ステップS36において動作停止信号STPが供給されていないと判定された場合、タイマ217は、クロック信号のパルスのカウント動作を継続する。これにより、スクランブル処理部214は、上記したステップS32に戻り、前述したステップS32〜S35の動作を再び実行する。   If it is determined in step S36 that the operation stop signal STP is not supplied, the timer 217 continues counting the pulses of the clock signal. As a result, the scramble processing unit 214 returns to step S32 described above, and executes the operations of steps S32 to S35 described above again.

よって、暗号鍵をスクランブルしたスクランブル暗号鍵がストレージRAM215に保持され、この保持したスクランブル暗号鍵自体を所定期間毎にスクランブルしたものが、新たなスクランブル暗号鍵としてストレージRAM215に保持される。尚、この所定期間、つまりタイマ217が初期値からカウントを開始した時点から、タイムアウト信号Toutを送出するまでに費やされる期間は、乱数生成部13における乱数の変化周期(一定周期)よりも短い。これにより、乱数生成部13で生成された1つの乱数に対して、複数回のスクランブルを施すことが可能となる。   Therefore, a scrambled encryption key obtained by scrambling the encryption key is held in the storage RAM 215, and the held scrambled encryption key itself is scrambled for each predetermined period, and is held in the storage RAM 215 as a new scrambled encryption key. The predetermined period, that is, the period from when the timer 217 starts counting from the initial value to when transmitting the time-out signal Tout, is shorter than the change period (fixed period) of the random number in the random number generation unit 13. As a result, one random number generated by the random number generation unit 13 can be scrambled a plurality of times.

ここで、CPU14は、キーストレージ22の動作を停止させる場合には、その旨を促す動作停止信号をデータバスBS1を介してキーストレージ22に供給する。かかる動作停止信号を受けると、キーストレージ22のレジスタ216は当該動作停止信号を保持し、動作停止信号STPをタイマ217に供給する。これにより、キーストレージ22による暗号鍵の保持動作が停止する。   Here, when the operation of the key storage 22 is to be stopped, the CPU 14 supplies an operation stop signal to that effect to the key storage 22 via the data bus BS1. When the operation stop signal is received, the register 216 of the key storage 22 holds the operation stop signal and supplies the operation stop signal STP to the timer 217. Thereby, the operation of holding the encryption key by the key storage 22 is stopped.

尚、スクランブル処理部214は、電源遮断に応じて、ストレージRAM215に保持されている全てのスクランブル暗号鍵及びスクランブルキーを読み出し、データバスBS8に送出する。この際、セキュアDMAC21は、データバスBS8に送出された、全てのスクランブル暗号鍵及びスクランブルキーをセキュアROM20に転送する。よって、マイクロコンピュータ100の電源遮断に応じて、セキュアROM20には、ストレージRAM215に保持されていた全てのスクランブル暗号鍵及びスクランブルキーが書き込まれる。   Incidentally, the scramble processing unit 214 reads out all scramble encryption keys and scramble keys held in the storage RAM 215 in response to the power-off, and sends them to the data bus BS8. At this time, the secure DMAC 21 transfers all the scramble encryption keys and scramble keys sent to the data bus BS 8 to the secure ROM 20. Therefore, in response to the power-off of the microcomputer 100, all the scramble encryption keys and scramble keys held in the storage RAM 215 are written in the secure ROM 20.

図9は、セキュアDMAC21からデータバスBS8を介して受けた暗号鍵の読出し要求に応じて、キーストレージ22内で行われる暗号鍵の読出動作の手順を表すフローチャートである。   FIG. 9 is a flow chart showing the procedure of the encryption key reading operation performed in the key storage 22 in response to the encryption key reading request received from the secure DMAC 21 via the data bus BS8.

先ず、スクランブル処理部214は、ストレージRAM215から、所望とするスクランブル暗号鍵を読み出し(ステップS41)、引き続き、このスクランブル暗号鍵に対応付けされているスクランブルキーを読み出す(ステップS42)。   First, the scramble processing unit 214 reads a desired scramble encryption key from the storage RAM 215 (step S41), and subsequently reads a scramble key associated with the scramble encryption key (step S42).

次に、スクランブル処理部214は、読み出されたスクランブル暗号鍵に対してスクランブルキーを用いたデスクランブル演算を施してスクランブルを解除することにより、暗号鍵を復元する(ステップS43)。   Next, the scramble processing unit 214 restores the encryption key by performing a descrambling operation using the scramble key on the read scramble encryption key to cancel the scrambling (step S43).

そして、スクランブル処理部214は、復元した暗号鍵をデータバスBS8を介して送信する(ステップS44)。   Then, the scramble processing unit 214 transmits the restored encryption key via the data bus BS8 (step S44).

以上のように、キーストレージ22は、乱数生成部13で生成された乱数をスクランブルしたものをスクランブル暗号鍵として保持する。その後、キーストレージ22は、保持したスクランブル暗号鍵自体を所定期間毎にスクランブルしたものを、新たなスクランブル暗号鍵として保持する(S32〜S36)。   As described above, the key storage 22 holds the scrambled random number generated by the random number generation unit 13 as the scramble encryption key. Thereafter, the key storage 22 holds, as a new scramble encryption key, one obtained by scrambling the held scramble encryption key itself for each predetermined period (S32 to S36).

また、キーストレージ22は、暗号鍵の読出要求に応じて、先ず、保持したスクランブル暗号鍵を読み出し(S41)、引き続きこのスクランブル暗号鍵に対応したスクランブルキーを読み出す(S42)。そして、キーストレージ22は、スクランブルキーを用いてスクランブル暗号鍵をデスクランブルすることにより、暗号鍵を復元し(S43)、これを出力する。   Further, the key storage 22 first reads the held scramble encryption key in response to the request for reading the encryption key (S41), and subsequently reads the scramble key corresponding to the scramble encryption key (S42). Then, the key storage 22 descrambles the scramble encryption key using the scramble key to restore the encryption key (S43), and outputs this.

このように、キーストレージ22に保持されているスクランブル暗号鍵は、それ自体が所定期間毎に繰り返しスクランブルされているので、その値は時間経過につれて変化している。よって、外部からの不正なアクセスによって、キーストレージ22に保持されているスクランブル暗号鍵が漏洩しても、このスクランブル暗号鍵からでは、暗号鍵自体を特定することはできない。また、用いられた暗号鍵が書き込まれるセキュアRAM19及びセキュアROM20は、マイクロコンピュータ100の外部からのアクセスが可能なデータバスBS1ではなく、外部アクセスが不可能なデータバスBS8を介して暗号鍵の読み出しが行われる。   As such, since the scramble encryption key held in the key storage 22 is itself repeatedly scrambled at predetermined intervals, its value changes as time passes. Therefore, even if the scramble encryption key held in the key storage 22 leaks due to unauthorized access from the outside, the encryption key itself can not be identified from the scramble encryption key. Also, the secure RAM 19 and the secure ROM 20 in which the used encryption key is written are not the data bus BS1 accessible from the outside of the microcomputer 100, but read out of the encryption key via the data bus BS8 incapable of external access. Is done.

したがって、不正なアクセスが行われても、マイクロコンピュータ100で運用されている平文データの漏洩を防ぐことが可能となる。   Therefore, even if unauthorized access is performed, it is possible to prevent the leakage of plaintext data operated by the microcomputer 100.

尚、図1に示すマイクロコンピュータ100では、CPU14に接続されており且つ外部アクセス可能なデータバスBS1とは別に、CPU14に接続されておらず且つ外部アクセス不可なデータバスBS8を用いることで秘匿性の高い暗号鍵の運用を行っている。   In the microcomputer 100 shown in FIG. 1, secrecy is achieved by using the data bus BS8 which is not connected to the CPU 14 and which is not connected to the CPU 14 separately from the externally accessible data bus BS1. Operation of high encryption keys.

しかしながら、マイクロコンピュータ100で用いるデータバスとしては、データバスBS1だけであっても、秘匿性の高い暗号鍵の運用を行うことが可能である。   However, even with only the data bus BS1 as the data bus used in the microcomputer 100, it is possible to operate an encryption key with high confidentiality.

図10は、かかる点に鑑みて為されたマイクロコンピュータ100の内部構成の変形例を示すブロック図である。   FIG. 10 is a block diagram showing a modification of the internal configuration of microcomputer 100 made in view of the above point.

図10に示されるマイクロコンピュータ100では、図1に示される構成中から、データバスBS8を省くと共に、バスマスタイネーブル信号BSEを各モジュール(12〜17、19〜22)に供給している。バスマスタイネーブル信号BSEは、例えばイネーブル状態を表す論理レベル1、及びディスエーブル状態を表す論理レベル0のうちの一方を表す2値信号である。   In the microcomputer 100 shown in FIG. 10, the data bus BS8 is omitted from the configuration shown in FIG. 1, and the bus master enable signal BSE is supplied to each module (12 to 17 and 19 to 22). The bus master enable signal BSE is, for example, a binary signal representing one of logic level 1 representing an enable state and logic level 0 representing a disable state.

バスマスタイネーブル信号BSEがディスエーブル状態を表す場合には、暗号処理部12、CPU14、RAM15、ROM制御部16及びROM17がデータバスBS1に接続される。尚、この際、乱数生成部13、セキュアRAM19、セキュアROM20、セキュアDMAC21、及びキーストレージ22は、データバスBS1との接続が遮断される。   When the bus master enable signal BSE indicates the disable state, the encryption processing unit 12, the CPU 14, the RAM 15, the ROM control unit 16 and the ROM 17 are connected to the data bus BS1. At this time, the random number generation unit 13, the secure RAM 19, the secure ROM 20, the secure DMAC 21, and the key storage 22 are disconnected from the data bus BS1.

一方、バスマスタイネーブル信号BSEがイネーブル状態を表す場合には、暗号処理部12、乱数生成部13、セキュアRAM19、セキュアROM20、セキュアDMAC21、及びキーストレージ22がデータバスBS1に接続される。尚、バスマスタイネーブル信号BSEがイネーブル状態を表す場合には、CPU14、RAM15、ROM制御部16及びROM17は、データバスBS1との接続が遮断される。   On the other hand, when the bus master enable signal BSE indicates the enabled state, the cryptographic processor 12, the random number generator 13, the secure RAM 19, the secure ROM 20, the secure DMAC 21, and the key storage 22 are connected to the data bus BS1. When the bus master enable signal BSE indicates the enable state, the CPU 14, the RAM 15, the ROM control unit 16 and the ROM 17 are disconnected from the data bus BS1.

上記した点を除き、図10に示されるマイクロコンピュータ100に含まれる各モジュール(12〜17、19〜22)の構成は、図1に示されるものと同一である。   Except for the points described above, the configuration of each module (12 to 17 and 19 to 22) included in the microcomputer 100 shown in FIG. 10 is the same as that shown in FIG.

図11は、図10に示される構成のマイクロコンピュータ100で用いられるキーストレージ22の内部構成を示すブロック図である。図11に示す構成では、バス接続部210を新たに設けた点を除く他の構成及びその動作は、図7〜図9で説明したものと同一である。   FIG. 11 is a block diagram showing an internal configuration of key storage 22 used in microcomputer 100 having the configuration shown in FIG. In the configuration shown in FIG. 11, the other configuration and the operation thereof are the same as those described with reference to FIGS. 7 to 9 except that the bus connection unit 210 is newly provided.

バス接続部21は、バスマスタイネーブル信号BSEを受け、当該バスマスタイネーブル信号BSEがイネーブル状態を表す場合には、スクランブル処理部214及びレジスタ216をデータバスBS1に接続する。一方、バスマスタイネーブル信号BSEがディスエーブル状態を表す場合には、バス接続部21は、スクランブル処理部214及びレジスタ216と、データバスBS1との接続を遮断する。   The bus connection unit 21 receives the bus master enable signal BSE, and connects the scramble processing unit 214 and the register 216 to the data bus BS1 when the bus master enable signal BSE indicates the enable state. On the other hand, when the bus master enable signal BSE indicates the disable state, the bus connection unit 21 cuts off the connection between the scramble processing unit 214 and the register 216 and the data bus BS1.

尚、キーストレージ22以外の他のモジュール(12〜17、19〜21)にも、バスマスタイネーブル信号BSEに応じて、データバスBS1との接続状態(接続又は遮断)を上述したように切り替えるバス接続部が含まれている。ただし、暗号処理部12については、バスマスタイネーブル信号BSEの内容(イネーブル状態、ディスエイーブル状態)に拘わらず、常にデータバスBS1と接続されている。   In addition, the other modules (12 to 17 and 19 to 21) other than the key storage 22 are also switched in the connection state (connection or disconnection) with the data bus BS1 according to the bus master enable signal BSE as described above. Department is included. However, the encryption processing unit 12 is always connected to the data bus BS1 regardless of the contents (enable state, disable state) of the bus master enable signal BSE.

以下に、図10及び図11に示される構成を有するマイクロコンピュータ100において、RAM15に記憶されている平文データ片を暗号化する際の動作を、図12〜図17を参照して説明する。   In the following, in the microcomputer 100 having the configuration shown in FIG. 10 and FIG. 11, the operation in encrypting the plaintext data piece stored in the RAM 15 will be described with reference to FIG. 12 to FIG.

先ず、バスマスタイネーブル信号BSEをイネーブル状態に設定する。これにより、各モジュール(12〜17、19〜22)のうちで、暗号処理部12、乱数生成部13、セキュアRAM19、セキュアROM20、セキュアDMAC21、及びキーストレージ22が、データバスBS1に接続される。ここで、セキュアDMAC21が、乱数生成部13で生成された乱数を、図12の太線矢印に示すように、データバスBS1を介してキーストレージ22に転送する。この際、キーストレージ22は、転送された乱数をスクランブルしたものを、スクランブル暗号鍵として保持する。   First, the bus master enable signal BSE is set to the enable state. Thus, among the modules (12 to 17 and 19 to 22), the cryptographic processor 12, the random number generator 13, the secure RAM 19, the secure ROM 20, the secure DMAC 21, and the key storage 22 are connected to the data bus BS1. . Here, the secure DMAC 21 transfers the random number generated by the random number generation unit 13 to the key storage 22 via the data bus BS1 as shown by the thick arrow in FIG. At this time, the key storage 22 holds the scrambled random number transferred as a scramble encryption key.

次に、セキュアDMAC21は、キーストレージ22に対して暗号鍵の読出要求を行い、これによりキーストレージ22から読み出された暗号鍵を、図13の太線矢印に示すように、データバスBS1を介してセキュアRAM19に転送する。これにより、セキュアRAM19は、当該暗号鍵を記憶する。   Next, the secure DMAC 21 requests the key storage 22 to read out the encryption key, whereby the encryption key read from the key storage 22 is transmitted via the data bus BS1 as shown by the thick arrow in FIG. Transfer to the secure RAM 19. Thereby, the secure RAM 19 stores the encryption key.

次に、セキュアDMAC21は、上記したようにセキュアRAM19に記憶した暗号鍵を読み出し、これを図14の太線矢印に示すように、データバスBS1を介してセキュアROM20に転送する。これにより、セキュアROM20は、当該暗号鍵を書き込む。つまり、セキュアROM20には、暗号処理部12で暗号処理が行われる度に、その暗号処理で用いられた暗号鍵がセキュアROM20に追記される。よって、セキュアROM20には、使用した暗号鍵の履歴が残る。   Next, the secure DMAC 21 reads the encryption key stored in the secure RAM 19 as described above, and transfers it to the secure ROM 20 via the data bus BS1 as shown by the thick arrow in FIG. Thereby, the secure ROM 20 writes the encryption key. That is, every time encryption processing is performed by the encryption processing unit 12, the encryption ROM used in the encryption processing is additionally written to the secure ROM 20 in the secure ROM 20. Therefore, a history of the used encryption key remains in the secure ROM 20.

次に、セキュアDMAC21は、セキュアRAM19に記憶されている暗号鍵を読み出し、これを図15の太線矢印に示すように、データバスBS1を介して暗号処理部12に転送する。   Next, the secure DMAC 21 reads the encryption key stored in the secure RAM 19 and transfers it to the encryption processing unit 12 via the data bus BS1 as shown by the thick arrow in FIG.

次に、図16に示すように、バスマスタイネーブル信号BSEをディスエーブル状態に設定する。これにより、モジュール(12〜17、19〜22)のうちで、暗号処理部12、CPU14、RAM15、ROM制御部16及びROM17がデータバスBS1に接続される。ここで、CPU14が、RAM15に記憶されている平文データ片を読み出し、これを図16の太線矢印に示すように、データバスBS1を介して暗号処理部12に転送する。暗号処理部12は、転送された平文データを、転送された暗号鍵を用いて暗号化することにより暗号化データ片を生成する。   Next, as shown in FIG. 16, the bus master enable signal BSE is set to the disabled state. Thereby, among the modules (12 to 17 and 19 to 22), the encryption processing unit 12, the CPU 14, the RAM 15, the ROM control unit 16 and the ROM 17 are connected to the data bus BS1. Here, the CPU 14 reads the plaintext data piece stored in the RAM 15 and transfers it to the cryptographic processor 12 via the data bus BS1, as shown by the thick arrow in FIG. The encryption processing unit 12 generates the encrypted data piece by encrypting the transferred plaintext data using the transferred encryption key.

そして、図17に示すように、バスマスタイネーブル信号BSEを再びイネーブル状態に設定し、セキュアDMAC21が、暗号処理部12で生成された暗号化データ片を、図17の太線矢印にて示すように、データバスBS1を介してRAM15に転送する。これにより、RAM15は、転送された暗号化データ片を記憶する。   Then, as shown in FIG. 17, the bus master enable signal BSE is set to the enable state again, and the secure DMAC 21 causes the encrypted data pieces generated by the cryptographic processing unit 12 to be indicated by thick arrows in FIG. It transfers to RAM15 via data bus BS1. Thereby, the RAM 15 stores the transferred encrypted data piece.

このように、マイクロコンピュータ100として図10に示す構成を採用した場合には、データバスBS8が不要となるので、図1に示す構成を採用した場合に比べて、マイクロコンピュータ100を構築する領域の面積を縮小化することが可能となる。   As described above, when the configuration shown in FIG. 10 is adopted as microcomputer 100, data bus BS8 becomes unnecessary, and therefore, compared with the case where the configuration shown in FIG. It is possible to reduce the area.

尚、上記実施例では、ストレージRAM215を含むキーストレージ22、つまり揮発性の半導体メモリを、スクランブル化した暗号鍵を保持する鍵保持部としているが、当該鍵保持部としては不揮発性のメモリ、或いは磁気又は光学式記録媒体であっても良い。   In the above embodiment, the key storage 22 including the storage RAM 215, that is, the volatile semiconductor memory is used as a key holding unit for holding the scrambled encryption key, but the key holding unit is a nonvolatile memory or It may be a magnetic or optical recording medium.

要するに、データの暗号化機能を備えたマイクロコンピュータ100としては、以下の乱数生成部、及び鍵保持部を含むものであれば良い。   In short, as the microcomputer 100 provided with the data encryption function, any microcomputer may be used as long as it includes the following random number generation unit and key holding unit.

すなわち、鍵保持部(22)は、乱数生成部(13)で生成された乱数をスクランブルキー(SKY)でスクランブルしたものをスクランブル暗号鍵(SEK)として保持する。この際、鍵保持部(22)は、スクランブル暗号鍵を所定期間毎にスクランブルキーでスクランブルしたものを新たなスクランブル暗号鍵として保持する。また、鍵保持部(22)は、読出要求に応じて、保持したスクランブル暗号鍵をスクランブルキーを用いてデスクランブルしたものを暗号鍵として出力する。   That is, the key holding unit (22) holds the random number generated by the random number generation unit (13) scrambled with the scramble key (SKY) as the scramble encryption key (SEK). At this time, the key holding unit (22) holds the scrambled encryption key scrambled by the scramble key every predetermined period as a new scrambled encryption key. In addition, the key holding unit (22) outputs, in response to the read request, the scrambled encryption key held and descrambled using the scramble key as the encryption key.

12 暗号処理部
13 乱数生成部
22 キーストレージ
213 スクランブルキー生成部
214 スクランブル処理部
215 ストレージRAM
12 cryptographic processor 13 random number generator 22 key storage 213 scramble key generator 214 scramble processor 215 storage RAM

Claims (8)

暗号鍵を用いてデータを暗号化する半導体装置であって、
乱数を生成する乱数生成部と、
前記乱数をスクランブルキーを用いてスクランブルしたものをスクランブル暗号鍵として保持し、読出要求に応じて、前記スクランブル暗号鍵を前記スクランブルキーを用いてデスクランブルして得た暗号鍵を出力する鍵保持部と、を有し、
前記鍵保持部は、
保持した前記スクランブル暗号鍵を所定期間毎にスクランブルキーでスクランブルしたものを新たなスクランブル暗号鍵として保持することを特徴とする半導体装置。
A semiconductor device that encrypts data using an encryption key,
A random number generation unit that generates random numbers;
A key holding unit which holds the scrambled random number scrambled using a scramble key as a scramble encryption key, and outputs an encryption key obtained by descrambling the scramble encryption key using the scramble key according to the read request And
The key holding unit is
A semiconductor device characterized in that a scrambled key obtained by scrambling the held scrambled encryption key with a scramble key at predetermined intervals is held as a new scrambled encryption key.
前記鍵保持部は、
時間経過につれて値が変化する乱数を前記スクランブルキーとして生成するスクランブルキー生成部と、
メモリと、
前記乱数を前記スクランブルキーでスクランブルしたものを前記スクランブル暗号鍵として前記メモリに保持させると共に、前記所定期間毎に、前記スクランブルキー生成部が生成した前記スクランブルキー、及び前記メモリに保持されている前記スクランブル暗号鍵を取り込み、取り込んだ前記スクランブル暗号鍵を、取り込んだ前記スクランブルキーでスクランブルしたものを新たなスクランブル暗号鍵として前記メモリに保持させるスクランブル処理部と、を含むことを特徴とする請求項1に記載の半導体装置。
The key holding unit is
A scramble key generation unit that generates a random number whose value changes as time passes, as the scramble key;
With memory
The random number scrambled by the scramble key is held as the scramble encryption key in the memory, and the scramble key generated by the scramble key generation unit is stored in the memory for each predetermined period. A scramble processing unit for capturing a scramble encryption key, and scrambled the captured scramble encryption key with the captured scramble key, and holding the scrambled encryption key in the memory as a new scramble encryption key. The semiconductor device according to claim 1.
前記乱数生成部は、所定の一定周期で乱数値が変化する前記乱数を生成し、
前記所定期間は前記一定周期よりも短いことを特徴とする請求項1又は2に記載の半導体装置。
The random number generation unit generates the random number whose random number value changes at a predetermined constant cycle,
The semiconductor device according to claim 1, wherein the predetermined period is shorter than the predetermined period.
プログラムが格納されているROMと、
前記プログラムに従った制御を行うCPUと、
RAMと、
暗号鍵に基づきデータを暗号化する暗号処理部と、
前記鍵保持部に対して書込及び読出制御を行うDMAC(direct memory access controller)と、を含むことを特徴とする請求項1〜3のいずれか1に記載の半導体装置。
The ROM where the program is stored,
A CPU that performs control according to the program;
RAM,
An encryption processing unit that encrypts data based on an encryption key;
The semiconductor device according to any one of claims 1 to 3, further comprising: a direct memory access controller (DMAC) that performs write and read control on the key holding unit.
前記ROM、前記CPU、前記RAM、及び前記暗号処理部が接続されている第1のデータバスと、
前記乱数生成部、前記鍵保持部、前記DMAC及び前記暗号処理部が接続されている第2のデータバスと、を含み、
前記RAMには平文データ片が記憶されており、
前記CPUは、前記RAMに記憶されている前記平文データ片を、前記第1のデータバスを介して前記暗号処理部に転送し、
前記DMACは、前記読出要求によって前記鍵保持部から読み出された前記暗号鍵を、前記第2のデータバスを介して前記暗号処理部に転送し、
前記暗号処理部は、前記第1のデータバスを介して受けた前記平文データ片を、前記第2のデータバスを介して受けた前記暗号鍵で暗号化した暗号化データ片を生成する前記第1のデータバスに送出することを特徴とする請求項4に記載の半導体装置。
A first data bus to which the ROM, the CPU, the RAM, and the encryption processing unit are connected;
The random number generation unit, the key holding unit, the DMAC, and a second data bus to which the encryption processing unit is connected;
A plaintext data piece is stored in the RAM,
The CPU transfers the plaintext data piece stored in the RAM to the encryption processing unit via the first data bus.
The DMAC transfers the encryption key read from the key holding unit in response to the read request to the encryption processing unit via the second data bus.
The encryption processing unit generates an encrypted data piece obtained by encrypting the plaintext data piece received via the first data bus with the encryption key received via the second data bus. 5. The semiconductor device according to claim 4, wherein the data is sent to a data bus of 1.
第1のデータバスを含み、
イネーブル又はディスエーブルを表すバスマスタイネーブル信号を受け、
前記バスマスタイネーブル信号が前記イネーブルを表す場合には前記乱数生成部、前記鍵保持部、前記DMAC及び前記暗号処理部が前記第1のデータバスと接続され、前記バスマスタイネーブル信号が前記ディスエーブルを表す場合には前記ROM、前記CPU、前記RAM、及び前記暗号処理部が前記第1のデータバスと接続されることを特徴とする請求項4に記載の半導体装置。
Including the first data bus,
Receive a bus master enable signal representing enable or disable;
When the bus master enable signal indicates the enable, the random number generation unit, the key holding unit, the DMAC, and the encryption processing unit are connected to the first data bus, and the bus master enable signal indicates the disable. 5. The semiconductor device according to claim 4, wherein the ROM, the CPU, the RAM, and the encryption processing unit are connected to the first data bus in this case.
前記RAMには平文データ片が記憶されており、
前記バスマスタイネーブル信号を前記ディスエーブルを表す状態に設定した状態で、前記CPUが、前記RAMに記憶されている前記平文データ片を前記第1のデータバスを介して前記暗号処理部に転送し、
前記バスマスタイネーブル信号を前記イネーブルを表す状態に設定した状態で、前記DMACが、前記読出要求によって前記鍵保持部から読み出した前記暗号鍵を、前記第1のデータバスを介して前記暗号処理部に転送し、
前記暗号処理部は、前記第1のデータバスを介して受けた前記平文データ片を、前記第1のデータバスを介して受けた前記暗号鍵で暗号化した暗号化データ片を生成することを特徴とする請求項6に記載の半導体装置。
A plaintext data piece is stored in the RAM,
With the bus master enable signal set to a state representing the disable, the CPU transfers the plaintext data piece stored in the RAM to the encryption processing unit via the first data bus,
With the bus master enable signal set to a state representing the enable, the DMAC sends the encryption key read from the key holding unit by the read request to the encryption processing unit via the first data bus. Transfer
The encryption processing unit may generate an encrypted data piece obtained by encrypting the plaintext data piece received via the first data bus with the encryption key received via the first data bus. The semiconductor device according to claim 6, characterized in that
データの暗号化に用いる暗号鍵の生成方法であって、
乱数をスクランブルキーでスクランブルしたものをスクランブル暗号鍵としてメモリに保持させると共に、前記スクランブル暗号鍵を所定期間毎にスクランブルキーでスクランブルしたものを新たなスクランブル暗号鍵として前記メモリに保持させ、
読出要求に応じて、前記メモリに保持されている前記スクランブル暗号鍵を前記スクランブルキーを用いてデスクランブルすることにより前記暗号鍵を得ることを特徴とする暗号鍵の生成方法。
A method of generating an encryption key used for data encryption, comprising:
A random number scrambled by a scramble key is held as a scramble encryption key in a memory, and a scrambled key scrambled by a scramble key every predetermined period is held as a new scramble encryption key in the memory.
A method of generating an encryption key, comprising obtaining the encryption key by descrambling the scramble encryption key held in the memory using the scramble key in response to a read request.
JP2018001228A 2018-01-09 2018-01-09 Semiconductor device and encryption key generation method Active JP7057675B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2018001228A JP7057675B2 (en) 2018-01-09 2018-01-09 Semiconductor device and encryption key generation method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2018001228A JP7057675B2 (en) 2018-01-09 2018-01-09 Semiconductor device and encryption key generation method

Publications (2)

Publication Number Publication Date
JP2019121955A true JP2019121955A (en) 2019-07-22
JP7057675B2 JP7057675B2 (en) 2022-04-20

Family

ID=67307995

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2018001228A Active JP7057675B2 (en) 2018-01-09 2018-01-09 Semiconductor device and encryption key generation method

Country Status (1)

Country Link
JP (1) JP7057675B2 (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111159097A (en) * 2019-12-09 2020-05-15 中山大学 On-chip access protection system and method
CN114422143A (en) * 2022-01-13 2022-04-29 中国平安人寿保险股份有限公司 Artificial intelligence based dynamic data encryption method, device, equipment and medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH09205419A (en) * 1996-01-26 1997-08-05 Nri & Ncc Co Ltd Method for storing and managing secret key
JP2000023137A (en) * 1998-07-02 2000-01-21 Matsushita Electric Ind Co Ltd Broadcasting system and broadcasting transmitter- receiver
JP2000049770A (en) * 1998-07-31 2000-02-18 Hitachi Ltd Cipher communication method, cipher algorithm shared management method, cipher algorithm conversion method and network communication system
JP2005303370A (en) * 2004-04-06 2005-10-27 Sony Corp Semiconductor chip, start program, semiconductor chip program, storage medium, terminal, and information processing method

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH09205419A (en) * 1996-01-26 1997-08-05 Nri & Ncc Co Ltd Method for storing and managing secret key
JP2000023137A (en) * 1998-07-02 2000-01-21 Matsushita Electric Ind Co Ltd Broadcasting system and broadcasting transmitter- receiver
JP2000049770A (en) * 1998-07-31 2000-02-18 Hitachi Ltd Cipher communication method, cipher algorithm shared management method, cipher algorithm conversion method and network communication system
JP2005303370A (en) * 2004-04-06 2005-10-27 Sony Corp Semiconductor chip, start program, semiconductor chip program, storage medium, terminal, and information processing method

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111159097A (en) * 2019-12-09 2020-05-15 中山大学 On-chip access protection system and method
CN114422143A (en) * 2022-01-13 2022-04-29 中国平安人寿保险股份有限公司 Artificial intelligence based dynamic data encryption method, device, equipment and medium
CN114422143B (en) * 2022-01-13 2023-06-20 中国平安人寿保险股份有限公司 Data dynamic encryption method, device, equipment and medium based on artificial intelligence

Also Published As

Publication number Publication date
JP7057675B2 (en) 2022-04-20

Similar Documents

Publication Publication Date Title
US9483664B2 (en) Address dependent data encryption
CN106599735B (en) Data protection device, method and storage controller
KR102013841B1 (en) Method of managing key for secure storage of data, and and apparatus there-of
US20190384938A1 (en) Storage apparatus and method for address scrambling
KR100445406B1 (en) Apparatus for encrypting the data and method therefor
JP7225220B2 (en) Storage data encryption/decryption device and method
KR101546204B1 (en) Host device, semiconductor memory device, and authentication method
KR101303278B1 (en) FPGA apparatus and method for protecting bitstream
CN110490008B (en) Security device and security chip
JP6265783B2 (en) Encryption / decryption system, control method therefor, and program
CN114785503B (en) Cipher card, root key protection method thereof and computer readable storage medium
CN112887077B (en) SSD main control chip random cache confidentiality method and circuit
TWI401583B (en) Data scramble and reverse-scranble method, data processing method, and controller and storage system thereof
CN111488630A (en) Storage device capable of configuring safe storage area and operation method thereof
US20100067689A1 (en) Computing platform with system key
JP7057675B2 (en) Semiconductor device and encryption key generation method
JP2007336446A (en) Data encryption apparatus
JP6636006B2 (en) Encryption / decryption system, control method thereof, and program
JP6203532B2 (en) Semiconductor memory device and data processing system
JP7032926B2 (en) Semiconductor device and encryption key control method
KR20220000537A (en) System and method for transmitting and receiving data based on vehicle network
JP7170588B2 (en) Data processing method and data processing system
JP2017108293A (en) Semiconductor integrated circuit device and data processing apparatus
CN113688407A (en) Data management method and related device
KR20210016764A (en) System on chip

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20201130

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20210730

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20210817

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20211015

TRDD Decision of grant or rejection written
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20220315

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20220408

R150 Certificate of patent or registration of utility model

Ref document number: 7057675

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150