[go: up one dir, main page]

JP7057675B2 - Semiconductor device and encryption key generation method - Google Patents

Semiconductor device and encryption key generation method Download PDF

Info

Publication number
JP7057675B2
JP7057675B2 JP2018001228A JP2018001228A JP7057675B2 JP 7057675 B2 JP7057675 B2 JP 7057675B2 JP 2018001228 A JP2018001228 A JP 2018001228A JP 2018001228 A JP2018001228 A JP 2018001228A JP 7057675 B2 JP7057675 B2 JP 7057675B2
Authority
JP
Japan
Prior art keywords
key
scrambled
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.)
Active
Application number
JP2018001228A
Other languages
Japanese (ja)
Other versions
JP2019121955A (en
Inventor
大輔 熊木
俊彦 中村
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
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

Description

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

現在、暗号鍵を用いてデータを暗号化し、暗号化された暗号化データに対してこの暗号鍵を用いた復号を施すことにより元のデータを復元する機能を備えたマイクロコンピュータを含む半導体装置が知られている(例えば、特許文献1参照)。 Currently, semiconductor devices including microcomputers that have the function of encrypting data using an encryption key and restoring the original data by decrypting the encrypted encrypted data using this encryption key are available. It is known (see, for example, Patent Document 1).

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

特開2014-89640号公報Japanese Unexamined Patent Publication No. 2014-89640

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

本発明に係る半導体装置は、暗号鍵を用いてデータを暗号化する半導体装置であって、乱数を生成する乱数生成部と、時間経過につれて値が変化するスクランブルキーを生成するスクランブルキー生成部と、前記乱数を前記スクランブルキーを用いてスクランブルしたものをスクランブル暗号鍵として保持し、読出要求に応じて、前記スクランブル暗号鍵を前記スクランブルキーを用いてデスクランブルしたものを暗号鍵として出力する鍵保持部と、を有し、前記鍵保持部は、記スクランブル暗号鍵を前記スクランブルキーでスクランブルしたものを新たなスクランブル暗号鍵として保持する処理を所定期間毎に繰り返し行うThe semiconductor device according to the present invention is a semiconductor device that encrypts data using an encryption key, and includes a random number generation unit that generates a random number and a scramble key generation unit that generates a scramble key whose value changes with the passage of time. , The key holding that scrambles the random number using the scramble key is held as a scrambled encryption key, and outputs the scrambled encryption key descrambled using the scramble key as an encryption key in response to a read request. The key holding unit repeats the process of holding the scrambled encryption key scrambled with the scrambled key as a new scrambled encryption key at predetermined intervals .

また、本発明に係る暗号鍵の生成方法は、データの暗号化に用いる暗号鍵の生成方法であって、時間経過につれて値が変化するスクランブルキーを生成し、乱数を前記スクランブルキーでスクランブルしたものをスクランブル暗号鍵としてメモリに保持させると共に、前記スクランブル暗号鍵を前記スクランブルキーでスクランブルしたものを新たなスクランブル暗号鍵として前記メモリに保持させる処理を所定期間毎に繰り返し行いつつ、読出要求に応じて、前記メモリに保持されている前記スクランブル暗号鍵を前記スクランブルキーを用いてデスクランブルすることにより暗号鍵を得る。 Further, the method for generating an encryption key according to the present invention is a method for generating an encryption key used for encrypting data, in which a scramble key whose value changes with the passage of time is generated and a random number is scrambled with the scramble key. Is held in the memory as a scrambled encryption key, and the scrambled encryption key is retained in the memory as a new scrambled encryption key by repeating the process of holding the scrambled encryption key in the memory at predetermined intervals , in response to a read request. Then, the scrambled encryption key held in the memory is descrambled using the scrambled key to obtain an encryption key.

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

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

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

図1は、本発明に係る半導体装置に含まれるマイクロコンピュータ100の構成を示すブロック図である。 FIG. 1 is a block diagram showing a configuration of a microcomputer 100 included in the 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 a cryptographic 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, and a secure. It has a DMAC (direct memory access controller) 21 and a key storage 22.

更に、マイクロコンピュータ100は、2系統のデータバスBS1及びBS8を含む。マイクロコンピュータ100は、外部接続された機器とのデータ通信が可能であり、当該データバスBS1を介して各種データの送信又は受信を行う。 Further, the microcomputer 100 includes two data buses BS1 and BS8. The microcomputer 100 is capable of 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が接続されている。 The encryption processing unit 12, the random number generation unit 13, the CPU 14, the RAM 15, the ROM control unit 16, the ROM 17, the secure RAM 19, and the key storage 22 are connected to the data bus BS1.

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

暗号処理部12は、データバスBS1を介して受けた暗号化前の平文データ片を、暗号鍵を用いて暗号化することにより暗号化データ片を得て、これをデータバスBS1に送出する。また、暗号処理部12は、データバスBS1を介して受けた暗号化データ片を、この暗号鍵を用いて復号することにより、暗号化前の平文データ片を復元する。尚、暗号処理部12は、このような暗号化又は復号化処理を行うにあたり、その実行前に、キーストレージ22から暗号鍵を取得しておく。 The encryption processing unit 12 obtains an encrypted data piece by encrypting the unencrypted plaintext data piece received via the data bus BS1 with an encryption key, and sends the encrypted data piece to the data bus BS1. Further, the encryption processing unit 12 restores the plaintext data piece before encryption by decrypting the encrypted data piece received via the data bus BS1 using this encryption key. The encryption processing unit 12 acquires an encryption key from the key storage 22 before executing such an encryption or decryption process.

乱数生成部13は、所定の一定周期で乱数値が変化する乱数を生成し、これをデータバスBS8に送出する。 The random number generation unit 13 generates a random number whose random number value changes at a predetermined fixed cycle, and sends the random number 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 according to a program stored in the ROM 17.

RAM15は、データ書き込みが可能な記憶素子であり、CPU14によってデータの書込又は読出が行われる。 The RAM 15 is a storage element capable of writing data, 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, verifies whether or not the data is correctly written, erases the written data, and the like. 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からのデータ読出アクセスは受け付けない。 The secure RAM 19 stores data received via the data bus BS8 in response to a data write access from the secure DMAC21. Further, the secure RAM 19 reads the data stored in itself in response to the data read access from the secure DMAC 21, and sends the data to the data bus BS8. Further, the secure RAM 19 stores the data received via the data bus BS1 in response to the data write access from the 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を介して受けたデータを書き込む。 The secure ROM 20 reads the data stored in the secure ROM 20 in response to the data read access from the secure DMAC 21, and sends the data to the data bus BS8. Further, the secure ROM 20 writes the data received by the secure DMAC 21 via the data bus BS8 when the ROM control unit 16 makes a write request to the secure DMAC 21.

セキュアDMAC21は、データバスBS8を介して、暗号処理部12、乱数生成部13、セキュアRAM19、セキュアROM20、セキュアDMAC21、及びキーストレージ22間のデータ転送を行う。 The secure DMAC 21 transfers data between the encryption processing unit 12, the random number generation unit 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 scrambled encryption key obtained by scrambling the random numbers generated by the random number generation unit 13, and holds the scrambled encryption key. Further, the key storage 22 reads the held scrambled encryption key in response to the request to read the encryption key, and sends the descrambling applied to the scrambled encryption key to the data bus BS8 as the encryption key. ..

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

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

先ず、セキュア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 shown by the thick line arrow in FIG. The key storage 22 holds a scrambled random number as a scrambled encryption key.

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

次に、セキュアDMAC21は、セキュアRAM19に記憶されている暗号鍵を読み出し、これを図4の太線矢印に示すように、データバスBS8を介してセキュアROM20に転送する。これにより、セキュアROM20は、当該暗号鍵を書き込む。つまり、暗号処理部12で暗号化が行われる度にその暗号化で用いられた暗号鍵がセキュアROM20に追記される。よって、セキュアROM20には、使用した暗号鍵の履歴が残る。 Next, the secure DMAC 21 reads out the encryption key stored in the secure RAM 19 and transfers the encryption key to the secure ROM 20 via the data bus BS8 as shown by the thick arrow in FIG. As a result, the secure ROM 20 writes the encryption key. That is, every time the encryption processing unit 12 performs encryption, the encryption key used for the encryption is added to the secure ROM 20. Therefore, the 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 out the encryption key stored in the secure RAM 19 and transfers the encryption key to the encryption processing unit 12 via the data bus BS8 as shown by the thick line arrow in FIG. Further, the CPU 14 reads out the plaintext data piece stored in the RAM 15, and transfers the plaintext data piece to the encryption processing unit 12 via the data bus BS1 as shown by the thick line arrow in FIG. The encryption processing unit 12 generates an encrypted data piece by encrypting the transferred plaintext data using the transferred encryption key, and sends the encrypted data piece 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 shown by the thick arrow in FIG. As a result, the RAM 15 stores the transferred encrypted data piece.

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

尚、RAM15に記憶されている暗号化データ片を元の平文データ片に復号する場合には、CPU14が、この暗号化データ片をRAM15から読み出し、これをデータバスBS1を介して暗号処理部12に転送する。更に、セキュアDMAC21が、この平文データ片を暗号化する際に用いた暗号鍵をセキュアRAM19から読み出し、データバスBS8を介して暗号処理部12に転送する。よって、暗号処理部12は、転送された暗号化データ片を、転送された暗号鍵を用いて復号することにより平文データ片を得る。 When decrypting the encrypted data piece stored in the RAM 15 into the original plaintext data piece, the CPU 14 reads the encrypted data piece from the RAM 15 and reads the encrypted data piece from the RAM 15 via the data bus BS1 in the encryption processing unit 12. Transfer to. Further, the secure DMAC 21 reads the encryption key used for encrypting the plaintext data piece from the secure RAM 19 and transfers the encryption key 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 the encrypted data piece is transmitted to an external device connected to the microcomputer 100, the encryption key corresponding to the encrypted data piece is transmitted together with the encrypted data piece according to a predetermined algorithm.

ところで、キーストレージ22では、外部からの不正なアクセスによる暗号鍵の漏洩を防止する為に、以下の構成を採用している。 By the way, 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.

図7に示すように、キーストレージ22は、スクランブルキー生成部213、スクランブル処理部214、ストレージRAM215、レジスタ216、及びタイマ217を有する。 As shown in FIG. 7, the key storage 22 has 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 a random number whose random number value changes with the passage of time as a scramble key SKY, and supplies this to the scramble processing unit 214.

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

また、スクランブル処理部214は、タイムアウト信号Toutに応じて、ストレージRAM215に保持されているスクランブル暗号鍵SEKを読み出すと共に、スクランブルキー生成部213で生成されたスクランブルキーSKYを取り込む。ここで、スクランブル処理部214は、取り込んだスクランブルキーSKYを用いたスクランブル演算を、ストレージRAM215から読み出したスクランブル暗号鍵SEKに施すことにより、新たなスクランブル暗号鍵SEKを生成する。そして、スクランブル処理部214は、この新たなスクランブル暗号鍵データSEKを、スクランブルキーSKYと対応付けしてストレージRAM215に保持させる。 Further, the scramble processing unit 214 reads the scramble encryption key SEK held in the storage RAM 215 in response to the timeout signal Tout, and also 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 captured scramble key SKY on the scramble encryption key SEK read from the storage RAM 215. Then, the scramble processing unit 214 holds the new scrambled encryption key data SEK in the storage RAM 215 in association with the scramble key SKY.

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

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

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

以下に、図7に示す構成を有するキーストレージ22の内部で行われる暗号鍵の保持及び読出動作について説明する。 The operation of holding 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 encryption key holding operation performed in the key storage 22 according 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 in response to, for example, turning on the power.

先ず、キーストレージ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). As a result, 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 timeout signal Tout is supplied from the timer 217 (step S32). The timer 217 supplies the timeout signal Tout to the scramble processing unit 214 when the count number reaches a predetermined value.

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

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

次に、スクランブル処理部214は、上記したように取り込んだスクランブルキーを用いて、取り込んだスクランブル暗号鍵にスクランブル演算を施すことにより、新たなスクランブル暗号鍵SEKを生成する(ステップS34)。 Next, the scramble processing unit 214 generates a new scrambled encryption key SEK by performing a scramble operation on the captured scrambled encryption key using the captured scrambled key 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 holds them in the storage RAM 215 (step S35).

次に、タイマ217は、レジスタ216から動作停止信号STPが供給されたか否かを判定する(ステップS36)。 Next, the timer 217 determines whether or not 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 the operation of counting the pulse 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, the scrambled encryption key obtained by scrambling the encryption key is held in the storage RAM 215, and the scrambled encryption key itself held at predetermined intervals is held in the storage RAM 215 as a new scrambled encryption key. The predetermined period, that is, the period from the time when the timer 217 starts counting from the initial value to the time when the timeout signal Tout is transmitted is shorter than the random number change cycle (constant cycle) in the random number generation unit 13. This makes it possible to scramble a single random number generated by the random number generation unit 13 a plurality of times.

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

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

図9は、セキュアDMAC21からデータバスBS8を介して受けた暗号鍵の読出し要求に応じて、キーストレージ22内で行われる暗号鍵の読出動作の手順を表すフローチャートである。 FIG. 9 is a flowchart 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 out a desired scrambled encryption key from the storage RAM 215 (step S41), and subsequently reads out the scrambled key associated with the scrambled encryption key (step S42).

次に、スクランブル処理部214は、読み出されたスクランブル暗号鍵に対してスクランブルキーを用いたデスクランブル演算を施してスクランブルを解除することにより、暗号鍵を復元する(ステップS43)。 Next, the scramble processing unit 214 restores the encryption key by performing a descramble operation using the scramble key on the read scramble encryption key to descramble it (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 a scrambled random number generated by the random number generation unit 13 as a scrambled encryption key. After that, the key storage 22 scrambles the held scrambled encryption key itself at predetermined intervals and holds it as a new scrambled encryption key (S32 to S36).

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

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

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

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

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

図10は、かかる点に鑑みて為されたマイクロコンピュータ100の内部構成の変形例を示すブロック図である。 FIG. 10 is a block diagram showing a modified example of the internal configuration of the microcomputer 100 made in view of this 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, 19 to 22). The bus master enable signal BSE is, for example, a binary signal representing one of a logic level 1 representing an enable state and a logic level 0 representing an disabled state.

バスマスタイネーブル信号BSEがディスエーブル状態を表す場合には、暗号処理部12、CPU14、RAM15、ROM制御部16及びROM17がデータバスBS1に接続される。尚、この際、乱数生成部13、セキュアRAM19、セキュアROM20、セキュアDMAC21、及びキーストレージ22は、データバスBS1との接続が遮断される。 When the bus master enable signal BSE represents an disabled 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 represents the enable state, the encryption processing unit 12, the random number generation unit 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 above points, the configurations of the modules (12 to 17, 19 to 22) included in the microcomputer 100 shown in FIG. 10 are the same as those shown in FIG.

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

バス接続部21は、バスマスタイネーブル信号BSEを受け、当該バスマスタイネーブル信号BSEがイネーブル状態を表す場合には、スクランブル処理部214及びレジスタ216をデータバスBS1に接続する。一方、バスマスタイネーブル信号BSEがディスエーブル状態を表す場合には、バス接続部21は、スクランブル処理部214及びレジスタ216と、データバスBS1との接続を遮断する。 The bus connection unit 21 receives the bus master enable signal BSE, and when the bus master enable signal BSE represents an enable state, the bus master enable signal BSE connects the scramble processing unit 214 and the register 216 to the data bus BS1. On the other hand, when the bus master enable signal BSE represents an disabled 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と接続されている。 It should be noted that the bus connection to other modules (12 to 17, 19 to 21) other than the key storage 22 also switches the connection state (connection or disconnection) with the data bus BS1 as described above according to the bus master enable signal BSE. The part is included. However, the encryption processing unit 12 is always connected to the data bus BS1 regardless of the contents of the bus master enable signal BSE (enabled state, disable state).

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

先ず、バスマスタイネーブル信号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 enabled state. As a result, among the modules (12 to 17, 19 to 22), the encryption processing unit 12, the random number generation unit 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 line arrow in FIG. At this time, the key storage 22 holds a scrambled random number as a scrambled encryption key.

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

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

次に、セキュアDMAC21は、セキュアRAM19に記憶されている暗号鍵を読み出し、これを図15の太線矢印に示すように、データバスBS1を介して暗号処理部12に転送する。 Next, the secure DMAC 21 reads out the encryption key stored in the secure RAM 19 and transfers the encryption key to the encryption processing unit 12 via the data bus BS1 as shown by the thick line 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. As a result, among the modules (12 to 17, 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 out the plaintext data piece stored in the RAM 15, and transfers the plaintext data piece to the encryption processing unit 12 via the data bus BS1 as shown by the thick line arrow in FIG. The encryption processing unit 12 generates an 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 indicates the encrypted data piece generated by the encryption processing unit 12 as shown by the thick arrow in FIG. Transfer to RAM 15 via the data bus BS1. As a result, 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 the microcomputer 100, the data bus BS8 becomes unnecessary. Therefore, as compared with the case where the configuration shown in FIG. 1 is adopted, the area for constructing the microcomputer 100 It is possible to reduce the area.

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

要するに、データの暗号化機能を備えたマイクロコンピュータ100としては、以下の乱数生成部、及び鍵保持部を含むものであれば良い。 In short, the microcomputer 100 having a data encryption function may include 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 scrambled encryption key (SEK). At this time, the key holding unit (22) holds the scrambled encryption key scrambled with the scrambled key at predetermined intervals as a new scrambled encryption key. Further, the key holding unit (22) outputs the scrambled encryption key held by the scrambled key as an encryption key in response to a read request.

12 暗号処理部
13 乱数生成部
22 キーストレージ
213 スクランブルキー生成部
214 スクランブル処理部
215 ストレージRAM
12 Cryptographic processing unit 13 Random number generation unit 22 Key storage 213 Scramble key generation unit 214 Scramble processing unit 215 Storage RAM

Claims (8)

暗号鍵を用いてデータを暗号化する半導体装置であって、
乱数を生成する乱数生成部と、
時間経過につれて値が変化するスクランブルキーを生成するスクランブルキー生成部と、
前記乱数を前記スクランブルキーを用いてスクランブルしたものをスクランブル暗号鍵として保持し、読出要求に応じて、前記スクランブル暗号鍵を前記スクランブルキーを用いてデスクランブルしたものを暗号鍵として出力する鍵保持部と、を有し、
前記鍵保持部は、
記スクランブル暗号鍵を前記スクランブルキーでスクランブルしたものを新たなスクランブル暗号鍵として保持する処理を所定期間毎に繰り返し行うことを特徴とする半導体装置。
A semiconductor device that encrypts data using an encryption key.
A random number generator that generates random numbers, and a random number generator
A scramble key generator that generates a scramble key whose value changes over time,
A key holding unit that holds the random number scrambled using the scramble key as a scrambled encryption key, and outputs the scrambled encryption key descrambled using the scrambled key as an encryption key in response to a read request. And have
The key holder is
A semiconductor device characterized in that a process of holding a scrambled encryption key scrambled with the scrambled key as a new scrambled encryption key is repeated at predetermined intervals .
前記鍵保持部は
モリと、
前記乱数を前記スクランブルキーでスクランブルしたものを前記スクランブル暗号鍵として前記メモリに保持させると共に、前記所定期間毎に、前記スクランブルキー生成部が生成した前記スクランブルキー、及び前記メモリに保持されている前記スクランブル暗号鍵を取り込み、取り込んだ前記スクランブル暗号鍵を、取り込んだ前記スクランブルキーでスクランブルしたものを新たなスクランブル暗号鍵として前記メモリに保持させるスクランブル処理部と、を含むことを特徴とする請求項1に記載の半導体装置。
The key holder is
With memory
The random number scrambled with the scramble key is held in the memory as the scramble encryption key, and the scramble key generated by the scramble key generation unit and the scramble key held in the memory are held every predetermined period. Claim 1 is characterized by including a scramble processing unit that captures the scrambled encryption key, scrambles the captured scrambled encryption key with the captured scrambled key, and holds the scrambled encryption key in the memory as a new scrambled encryption key. The semiconductor device described in.
前記乱数生成部は、所定の一定周期で乱数値が変化する前記乱数を生成し、
前記所定期間は前記一定周期よりも短いことを特徴とする請求項1又は2に記載の半導体装置。
The random number generation unit generates the random number whose random number value changes at a predetermined fixed cycle, and generates the random number.
The semiconductor device according to claim 1 or 2, wherein the predetermined period is shorter than the fixed period.
プログラムが格納されているROMと、
前記プログラムに従った制御を行うCPUと、
RAMと、
暗号鍵に基づきデータを暗号化する暗号処理部と、
前記鍵保持部に対して書込及び読出制御を行うDMAC(direct memory access controller)と、を含むことを特徴とする請求項1~3のいずれか1に記載の半導体装置。
The ROM where the program is stored and
A CPU that controls according to the program
RAM and
An encryption processing unit that encrypts data based on the encryption key,
The semiconductor device according to any one of claims 1 to 3, further comprising a DMAC (direct memory access controller) that controls writing and reading to 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 are included.
Plaintext data pieces are 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 by the read request to the encryption processing unit via the second data bus.
The encryption processing unit generates an encrypted data piece in which the plaintext data piece received via the first data bus is encrypted with the encryption key received via the second data bus. The semiconductor device according to claim 4, wherein the data is sent to the data bus of 1.
第1のデータバスを含み、
イネーブル又はディスエーブルを表すバスマスタイネーブル信号を受け、
前記バスマスタイネーブル信号が前記イネーブルを表す場合には前記乱数生成部、前記鍵保持部、前記DMAC及び前記暗号処理部が前記第1のデータバスと接続され、前記バ
スマスタイネーブル信号が前記ディスエーブルを表す場合には前記ROM、前記CPU、前記RAM、及び前記暗号処理部が前記第1のデータバスと接続されることを特徴とする請求項4に記載の半導体装置。
Including the first data bus
Receives a bus master enable signal indicating enable or disable
When the bus master enable signal represents 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 represents the disable. The semiconductor device according to claim 4, wherein in the case, the ROM, the CPU, the RAM, and the encryption processing unit are connected to the first data bus.
前記RAMには平文データ片が記憶されており、
前記バスマスタイネーブル信号を前記ディスエーブルを表す状態に設定した状態で、前記CPUが、前記RAMに記憶されている前記平文データ片を前記第1のデータバスを介して前記暗号処理部に転送し、
前記バスマスタイネーブル信号を前記イネーブルを表す状態に設定した状態で、前記DMACが、前記読出要求によって前記鍵保持部から読み出した前記暗号鍵を、前記第1のデータバスを介して前記暗号処理部に転送し、
前記暗号処理部は、前記第1のデータバスを介して受けた前記平文データ片を、前記第1のデータバスを介して受けた前記暗号鍵で暗号化した暗号化データ片を生成することを特徴とする請求項6に記載の半導体装置。
Plaintext data pieces are 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 transfers the encryption key read from the key holding unit by the read request to the encryption processing unit via the first data bus. Transfer and
The encryption processing unit generates an encrypted data piece in which the plaintext data piece received via the first data bus is encrypted with the encryption key received via the first data bus. The semiconductor device according to claim 6, which is characterized.
データの暗号化に用いる暗号鍵の生成方法であって、
時間経過につれて値が変化するスクランブルキーを生成し、
乱数を前記スクランブルキーでスクランブルしたものをスクランブル暗号鍵としてメモリに保持させると共に、前記スクランブル暗号鍵を前記スクランブルキーでスクランブルしたものを新たなスクランブル暗号鍵として前記メモリに保持させる処理を所定期間毎に繰り返し行いつつ
読出要求に応じて、前記メモリに保持されている前記スクランブル暗号鍵を前記スクランブルキーを用いてデスクランブルすることにより暗号鍵を得ることを特徴とする暗号鍵の生成方法。
A method of generating an encryption key used to encrypt data.
Generates a scramble key whose value changes over time,
A process of holding a random number scrambled with the scramble key in the memory as a scrambled encryption key and holding the scrambled encryption key scrambled with the scrambled key in the memory as a new scrambled encryption key is performed every predetermined period. While doing it repeatedly
A method for generating an encryption key, which comprises obtaining an encryption key by descrambled the scrambled encryption key held in the memory in response to a read request using the scrambled key.
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 JP2019121955A (en) 2019-07-22
JP7057675B2 true 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)

Families Citing this family (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
CN114422143B (en) * 2022-01-13 2023-06-20 中国平安人寿保险股份有限公司 Data dynamic encryption method, device, equipment and medium based on artificial intelligence

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2000023137A (en) 1998-07-02 2000-01-21 Matsushita Electric Ind Co Ltd Broadcast system and broadcast transceiver
JP2000049770A (en) 1998-07-31 2000-02-18 Hitachi Ltd Encryption communication method, encryption algorithm sharing management method, encryption algorithm conversion method, network communication system
JP2005303370A (en) 2004-04-06 2005-10-27 Sony Corp Semiconductor chip, boot program, semiconductor chip program, storage medium, terminal device, and information processing method

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP3549657B2 (en) * 1996-01-26 2004-08-04 株式会社野村総合研究所 Private key retention management method

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2000023137A (en) 1998-07-02 2000-01-21 Matsushita Electric Ind Co Ltd Broadcast system and broadcast transceiver
JP2000049770A (en) 1998-07-31 2000-02-18 Hitachi Ltd Encryption communication method, encryption algorithm sharing management method, encryption algorithm conversion method, network communication system
JP2005303370A (en) 2004-04-06 2005-10-27 Sony Corp Semiconductor chip, boot program, semiconductor chip program, storage medium, terminal device, and information processing method

Also Published As

Publication number Publication date
JP2019121955A (en) 2019-07-22

Similar Documents

Publication Publication Date Title
CN108599930B (en) Firmware encryption and decryption system and method
KR101303278B1 (en) FPGA apparatus and method for protecting bitstream
JP3975677B2 (en) Information processing device
US20170046281A1 (en) Address dependent data encryption
JP5159916B2 (en) host
JP6265783B2 (en) Encryption / decryption system, control method therefor, and program
JP5050114B1 (en) Information recording device
KR20140063863A (en) Host device, semiconductor memory device, and authentication method
EP1662697A1 (en) Method and apparatus for security over multiple interfaces
KR100849956B1 (en) Semiconductor device and its scrambled data transfer method
TWI401583B (en) Data scramble and reverse-scranble method, data processing method, and controller and storage system thereof
US9444622B2 (en) Computing platform with system key
JP7057675B2 (en) Semiconductor device and encryption key generation method
JP2009071838A (en) Security feature in electronic device
CN110932853B (en) Key management device and key management method based on trusted module
US7752407B1 (en) Security RAM block
EP1258796A2 (en) Copy protection method and system for a field-programmable gate array
US8015416B2 (en) Memory information protection system and methods
JPH104403A (en) Encryption device, decryption device and method thereof
US20250028834A1 (en) Storage device and method of providing firmware image
JP7032926B2 (en) Semiconductor device and encryption key control method
JP2007336446A (en) Data encryption device
JP6636006B2 (en) Encryption / decryption system, control method thereof, and program
JP6203532B2 (en) Semiconductor memory device and data processing system
JP2007193800A (en) Apparatus and method for improving security level of card authentication system

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

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250