JP7101500B2 - Cryptographic device, encryption system, and encryption method - Google Patents

Cryptographic device, encryption system, and encryption method Download PDF

Info

Publication number
JP7101500B2
JP7101500B2 JP2018044143A JP2018044143A JP7101500B2 JP 7101500 B2 JP7101500 B2 JP 7101500B2 JP 2018044143 A JP2018044143 A JP 2018044143A JP 2018044143 A JP2018044143 A JP 2018044143A JP 7101500 B2 JP7101500 B2 JP 7101500B2
Authority
JP
Japan
Prior art keywords
signal
memory
address
encryption
flag
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
JP2018044143A
Other languages
Japanese (ja)
Other versions
JP2019161389A (en
Inventor
公則 篠崎
Original Assignee
岸本 珠子
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 岸本 珠子 filed Critical 岸本 珠子
Priority to JP2018044143A priority Critical patent/JP7101500B2/en
Publication of JP2019161389A publication Critical patent/JP2019161389A/en
Application granted granted Critical
Publication of JP7101500B2 publication Critical patent/JP7101500B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Description

本発明は、メモリに書き込む信号を暗号化する暗号化装置、暗号化システム、及び暗号化方法に関する。 The present invention relates to an encryption device, an encryption system, and an encryption method for encrypting a signal written in a memory.

従来、プログラムを暗号化する暗号化技術が知られている。例えば、特許文献1には、対象とするプログラムに対して新たなジャンプ命令を挿入し、ジャンプ命令挿入後のプログラムに対して暗号ブロック連鎖モードによる暗号化を行う暗号化技術が記載されている。 Conventionally, an encryption technique for encrypting a program is known. For example, Patent Document 1 describes an encryption technique in which a new jump instruction is inserted into a target program and the program after the jump instruction is inserted is encrypted in a cryptographic block chain mode.

特開2009-211292号公報Japanese Unexamined Patent Publication No. 2009-21192

CPU(Central Processing Unit)の実行対象とするプログラムを記憶するメモリに悪意のあるプログラムが書き込まれてしまうと、そのCPUは、その悪意のあるプログラムを実行してしまうことがある。 If a malicious program is written in a memory that stores a program to be executed by a CPU (Central Processing Unit), the CPU may execute the malicious program.

そこで、本発明は、CPUの実行対象とするプログラムを記憶するメモリに悪意のあるプログラムが書き込まれてしまったとしても、そのCPUによるその悪意のあるプログラムの実行を抑止し得る暗号化装置、暗号化システム、及び暗号化方法を提供することを目的とする。 Therefore, the present invention is an encryption device and encryption that can prevent the CPU from executing the malicious program even if the malicious program is written in the memory that stores the program to be executed by the CPU. It is an object of the present invention to provide an encryption system and an encryption method.

本発明の一態様に係る暗号化装置は、メモリに書き込む信号を暗号化する暗号化装置であって、記録媒体から出力された、CPUが実行する命令を含むプログラムを、前記メモリのアドレス単位で、暗号文と平文とが可逆的に1対1に対応する第1暗号化方式で暗号化する暗号化部と、前記メモリから読み出された信号を、前記メモリのアドレス単位で、前記第1暗号化方式の逆変換である第1復号化方式で復号化する復号化部と、を備える。 The encryption device according to one aspect of the present invention is an encryption device that encrypts a signal to be written in a memory, and a program including an instruction executed by a CPU output from a recording medium is stored in units of addresses of the memory. , The encryption unit that encrypts the encrypted text and the plain text reversibly by the first encryption method corresponding to one-to-one, and the signal read from the memory is the first in the memory address unit. It includes a decoding unit that decodes by the first decoding method, which is the reverse conversion of the encryption method.

また、本発明の一態様に係る暗号化システムは、CPUと、メモリと、記録媒体と、前記メモリに書き込む信号を暗号化する暗号化装置とを備え、前記暗号化装置は、前記記録媒体から出力された、前記CPUが実行する命令を含むプログラムを、前記メモリのアドレス単位で、暗号文と平文とが1対1に対応する第1暗号化方式で暗号化する暗号化部と、前記メモリから読み出された信号を、前記メモリのアドレス単位で、前記第1暗号化方式の逆変換である第1復号化方式で復号化する復号化部と、を含む。 Further, the encryption system according to one aspect of the present invention includes a CPU, a memory, a recording medium, and an encryption device that encrypts a signal written in the memory, and the encryption device is derived from the recording medium. The encryption unit that encrypts the output program including the instruction executed by the CPU by the first encryption method in which the encrypted text and the plain text have a one-to-one correspondence in the address unit of the memory, and the memory. Includes a decoding unit that decodes the signal read from the above in units of addresses of the memory by the first decryption method, which is the reverse conversion of the first encryption method.

また、本発明の一態様に係る暗号化方法は、メモリに書き込む信号を暗号化する暗号化方法であって、記録媒体から出力された、CPUが実行する命令を少なくとも含むプログラムを、前記メモリの単位で、暗号文と平文とが1対1に対応する第1暗号化方式で暗号化する暗号化ステップと、前記メモリから読み出された信号を、前記メモリのアドレス単位で、前記第1暗号化方式の逆変換である第1復号化方式で復号化する復号化ステップと、を含む。 Further, the encryption method according to one aspect of the present invention is an encryption method for encrypting a signal to be written in a memory, in which a program output from a recording medium and including at least an instruction executed by a CPU is included in the memory. The encryption step of encrypting by the first encryption method in which the encrypted text and the plain text have a one-to-one correspondence in units, and the first encryption of the signal read from the memory in the address unit of the memory. It includes a decoding step of decoding by a first decoding method, which is an inverse conversion of the encryption method.

本発明によれば、CPUの実行対象とするプログラムを記憶するメモリに悪意のあるプログラムが書き込まれてしまったとしても、そのCPUによるその悪意のあるプログラムの実行を抑止し得る。 According to the present invention, even if a malicious program is written in the memory for storing the program to be executed by the CPU, the execution of the malicious program by the CPU can be suppressed.

図1は、実施の形態1に係る暗号化システムの構成を示すブロック図である。FIG. 1 is a block diagram showing a configuration of an encryption system according to the first embodiment. 図2は、実施の形態1に係る暗号化装置構成を示すブロック図である。FIG. 2 is a block diagram showing an encryption device configuration according to the first embodiment. 図3Aは、第1暗号化方式における、暗号文と平文との関係を示す模式図である。FIG. 3A is a schematic diagram showing the relationship between the ciphertext and the plaintext in the first encryption method. 図3Bは、第2暗号化方式における、暗号文と平文との関係を示す模式図である。FIG. 3B is a schematic diagram showing the relationship between the ciphertext and the plaintext in the second encryption method. 図4Aは、第1復号化方式における、暗号文と平文との関係を示す模式図である。FIG. 4A is a schematic diagram showing the relationship between the ciphertext and the plaintext in the first decryption method. 図4Bは、第2復号化方式における、暗号文と平文との関係を示す模式図である。FIG. 4B is a schematic diagram showing the relationship between the ciphertext and the plaintext in the second decryption method. 図5は、ケース1における暗号化システム1の動作を示す模式図である。FIG. 5 is a schematic diagram showing the operation of the encryption system 1 in the case 1. 図6は、ケース2における暗号化システム1の動作を示す模式図である。FIG. 6 is a schematic diagram showing the operation of the encryption system 1 in the case 2. 図7は、ケース3における暗号化システム1の動作を示す模式図である。FIG. 7 is a schematic diagram showing the operation of the encryption system 1 in the case 3. 図8は、ケース4における暗号化システム1の動作を示す模式図である。FIG. 8 is a schematic diagram showing the operation of the encryption system 1 in the case 4. 図9は、ケース5における暗号化システム1の動作を示す模式図である。FIG. 9 is a schematic diagram showing the operation of the encryption system 1 in the case 5. 図10は、ケース6における暗号化システム1の動作を示す模式図である。FIG. 10 is a schematic diagram showing the operation of the encryption system 1 in the case 6.

(本発明の一態様を得るに至った経緯)
発明者は、CPUの実行対象とするプログラムを記憶するメモリに悪意のあるプログラムが書き込まれてしまったとしても、そのCPUによるその悪意のあるプログラムの実行を抑止し得る方法について検討した。その結果、発明者は、上記抑止には、CPUの実行対象となるプログラムを、一旦、直接CPUが実行できない形式の信号に変換(例えば、暗号化)してからメモリに記憶させておき、CPUがプログラムを実行する際には、その信号を逆変換(例えば、復号化)してCPUが実行できる形式のプログラムに戻してからそのプログラムをCPUに実行させることが有効である知見を得た。そして、発明者は、その知見に基づいて、本発明の一態様に係る暗号化装置に想到した。
(Background to Obtaining One Aspect of the Present Invention)
The inventor has investigated a method that can prevent the CPU from executing the malicious program even if the malicious program is written in the memory that stores the program to be executed by the CPU. As a result, for the above suppression, the inventor first converts (for example, encrypts) a program to be executed by the CPU into a signal in a format that cannot be directly executed by the CPU, and then stores the program in the memory. When executing a program, it is effective to reverse-convert (for example, decode) the signal to return it to a program in a format that can be executed by the CPU, and then let the CPU execute the program. Then, based on the knowledge, the inventor came up with the encryption device according to one aspect of the present invention.

すなわち、発明者が想到した本発明の一態様に係る暗号化装置は、メモリに書き込む信号を暗号化する暗号化装置であって、記録媒体から出力された、CPUが実行する命令を含むプログラムを、前記メモリのアドレス単位で、暗号文と平文とが可逆的に1対1に対応する第1暗号化方式で暗号化する暗号化部と、前記メモリから読み出された信号を、前記メモリのアドレス単位で、前記第1暗号化方式の逆変換である第1復号化方式で復号化する復号化部と、を備える。 That is, the encryption device according to one aspect of the present invention, which the inventor came up with, is an encryption device that encrypts a signal to be written in a memory, and includes a program output from a recording medium and including an instruction executed by a CPU. The encryption unit that encrypts the encrypted text and the plain text reversibly by the first encryption method corresponding to one-to-one in the address unit of the memory, and the signal read from the memory of the memory. Each address is provided with a decoding unit that decodes by the first decryption method, which is the reverse conversion of the first encryption method.

上記暗号化装置によると、メモリに悪意のあるプログラムが書き込まれてしまったとしても、上記暗号化装置は、メモリから読み出された悪意のあるプログラムに対して、第1復号化方式で復号化する。このため、CPUが、メモリから読み出された悪意のあるプログラムに対して第1復号化方式で復号化された信号を実行しようとしても、悪意のあるプログラムとして実行されることはない。 According to the above-mentioned encryption device, even if a malicious program is written in the memory, the above-mentioned encryption device decrypts the malicious program read from the memory by the first decryption method. do. Therefore, even if the CPU tries to execute the signal decoded by the first decoding method with respect to the malicious program read from the memory, it is not executed as the malicious program.

従って、上記暗号化装置によると、CPUの実行対象とするプログラムを記憶するメモリに、悪意のあるプログラムが書き込まれてしまったとしても、そのCPUによるその悪意のあるプログラムの実行を抑止し得る。 Therefore, according to the above-mentioned encryption device, even if a malicious program is written in the memory for storing the program to be executed by the CPU, the execution of the malicious program by the CPU can be suppressed.

また、上記暗号化装置は、例えば、特許文献1に記載された従来のプログラムを暗号化する暗号化技術に比べて、より平易な方法で、プログラムに対する暗号化を行う。 Further, the encryption device encrypts the program by a simpler method than, for example, the encryption technique for encrypting the conventional program described in Patent Document 1.

このため、上記暗号化装置によると、従来の暗号化技術を利用する場合よりも、より回路規模が少ない暗号化装置を実現し得る。 Therefore, according to the above-mentioned encryption device, it is possible to realize an encryption device having a smaller circuit scale than the case of using the conventional encryption technique.

以下、本発明の一態様に係る暗号化装置の具体例について、図面を参照しながら説明する。ここで示す実施の形態は、いずれも本発明の一具体例を示すものである。従って、以下の実施の形態で示される数値、形状、構成要素、構成要素の配置及び接続形態、並びに、ステップ(工程)及びステップの順序等は、一例であって本発明を限定するものではない。以下の実施の形態における構成要素のうち、独立請求項に記載されていない構成要素については、任意に付加可能な構成要素である。また、各図は、模式図であり、必ずしも厳密に図示されたものではない。 Hereinafter, a specific example of the encryption device according to one aspect of the present invention will be described with reference to the drawings. Each of the embodiments shown here shows a specific example of the present invention. Therefore, the numerical values, shapes, components, arrangement and connection forms of the components, steps (processes), order of steps, etc. shown in the following embodiments are examples and do not limit the present invention. .. Among the components in the following embodiments, the components not described in the independent claims are components that can be arbitrarily added. Further, each figure is a schematic view and is not necessarily exactly illustrated.

(実施の形態)
[1.構成]
図1は、本実施の形態に係る暗号化装置10を含む、本実施の形態に係る暗号化システム1の構成を示すブロック図である。
(Embodiment)
[1. Constitution]
FIG. 1 is a block diagram showing a configuration of an encryption system 1 according to the present embodiment, including the encryption device 10 according to the present embodiment.

図1に示されるように、暗号化システム1は、暗号化装置10と、メモリ20と、CPU30と、記録媒体40とを含んで構成される。 As shown in FIG. 1, the encryption system 1 includes an encryption device 10, a memory 20, a CPU 30, and a recording medium 40.

CPU30は、いわゆるプロセッサと呼ばれる情報処理装置であって、例えば、半導体集積回路によって実現される。CPU30は、例えば、CPUコアとキャッシュメモリとを含んで構成されてもよい。 The CPU 30 is an information processing device called a so-called processor, and is realized by, for example, a semiconductor integrated circuit. The CPU 30 may be configured to include, for example, a CPU core and a cache memory.

記録媒体40は、CPU30によって利用されるプログラム、データ等を記録する記録媒体である。記録媒体40は、CPU30によって利用されるプログラム、データ等を記録することができれば、どのような記録媒体であってもよい。記録媒体40は、例えば、ハードディスクドライブ(HDD:Hard Disk Drive)であってもよいし、ブルーレイディスク(登録商標)であってもよい。ここでは、記録媒体40が記憶するプログラムには、CPU30が実行する命令が、少なくとも1つ含まれている。 The recording medium 40 is a recording medium for recording programs, data, and the like used by the CPU 30. The recording medium 40 may be any recording medium as long as it can record programs, data, and the like used by the CPU 30. The recording medium 40 may be, for example, a hard disk drive (HDD) or a Blu-ray disc (registered trademark). Here, the program stored in the recording medium 40 includes at least one instruction executed by the CPU 30.

メモリ20は、CPU30のメインメモリとして利用されるメモリである。メモリ20は、例えば、半導体集積回路によって実現される。メモリ20は、CPU30のメインメモリとして利用されるものであれば、どのようなメモリであってもよい。メモリ20は、例えば、DRAM(Dynamic Random Access Memory)であってもよいし、SRAM(Static Random Access Memory)であってもよい。 The memory 20 is a memory used as the main memory of the CPU 30. The memory 20 is realized by, for example, a semiconductor integrated circuit. The memory 20 may be any memory as long as it is used as the main memory of the CPU 30. The memory 20 may be, for example, a DRAM (Dynamic Random Access Memory) or a SRAM (Static Random Access Memory).

メモリ20は、例えば、記録媒体40に記録されているプログラムがロードされるプログラム記憶領域として機能する。また、メモリ20は、例えば、CPUが一時的に利用するデータのワークエリアとして機能する。また、メモリ20は、例えば、記録媒体40に記録されているデータのディスクキャッシュとして機能する。 The memory 20 functions as, for example, a program storage area in which a program recorded on the recording medium 40 is loaded. Further, the memory 20 functions as, for example, a work area for data temporarily used by the CPU. Further, the memory 20 functions as, for example, a disk cache of data recorded on the recording medium 40.

暗号化装置10は、メモリ20に書き込む信号を暗号化し、メモリ20から読み出された信号を復号化する。暗号化装置10は、例えば、専用ハードウエアからなる半導体集積回路によって実現されてもよいし、プロセッサとメモリとを含み、メモリに記憶されるプログラムをプロセッサが実行することによって実現されてもよい。 The encryption device 10 encrypts the signal to be written in the memory 20 and decodes the signal read from the memory 20. The encryption device 10 may be realized by, for example, a semiconductor integrated circuit composed of dedicated hardware, or may be realized by the processor executing a program stored in the memory including a processor and a memory.

以下、暗号化装置10について、図面を用いて詳細に説明する。 Hereinafter, the encryption device 10 will be described in detail with reference to the drawings.

図2は、暗号化装置10の構成を示すブロック図である。 FIG. 2 is a block diagram showing the configuration of the encryption device 10.

図2に示されるように、暗号化装置10は、暗号化部11と、復号化部12と、フラグ記憶部13と、フラグ更新部14と、暗号化方式設定部15とを含んで構成される。 As shown in FIG. 2, the encryption device 10 includes an encryption unit 11, a decryption unit 12, a flag storage unit 13, a flag update unit 14, and an encryption method setting unit 15. To.

暗号化部11は、記録媒体40から出力された信号を、メモリ20のアドレス単位で、暗号文と平文とが可逆的に1対1に対応する第1暗号化方式で暗号化する。 The encryption unit 11 encrypts the signal output from the recording medium 40 by the first encryption method in which the ciphertext and the plaintext reversibly correspond to each other in the address unit of the memory 20.

図3Aは、第1暗号化方式における、暗号文と平文との関係を示す模式図である。 FIG. 3A is a schematic diagram showing the relationship between the ciphertext and the plaintext in the first encryption method.

ここでは、第1暗号化方式は、メモリ20のアドレス単位の循環シフト(ローテート)であるとする。しかしながら、第1暗号化方式は、メモリ20のアドレス単位で、暗号文と平文とが可逆的に1対1に対応する暗号化方式であれば、必ずしも、循環シフトである構成に限定される必要はない。例えば、奇数ビットとその1ビット上位ビット側の偶数ビットとがそれぞれ置換される暗号化方式であってもよい。また、ここでは、メモリ20のワード長が32ビットである場合の例となっているが、メモリ20のワード長は、必ずしも32ビットに限定される必要はない。例えば、メモリ20のワード長が16ビットである例もあり得る。 Here, it is assumed that the first encryption method is a circular shift (rotation) for each address of the memory 20. However, the first encryption method is not necessarily limited to a configuration that is a circular shift as long as it is an encryption method in which the ciphertext and the plaintext have a reversible one-to-one correspondence in the address unit of the memory 20. There is no. For example, an encryption method may be used in which the odd-numbered bits and the even-numbered bits on the one-bit upper bit side thereof are replaced with each other. Further, although the example here is a case where the word length of the memory 20 is 32 bits, the word length of the memory 20 is not necessarily limited to 32 bits. For example, the word length of the memory 20 may be 16 bits.

図3Aに示されるように、ここでは、第1暗号化方式は、メモリ20のアドレス単位である32ビット単位で行われる、左2ビットの循環シフトとなっている。 As shown in FIG. 3A, here, the first encryption method is a left 2-bit circular shift performed in units of 32 bits, which is an address unit of the memory 20.

以下では、説明をわかりやすくするために、第1暗号化前の信号である32ビットの値をXとした場合における、第1暗号化後の信号である32ビットの値をF(X)として表現する。 In the following, in order to make the explanation easier to understand, when the value of 32 bits which is the signal before the first encryption is X, the value of 32 bits which is the signal after the first encryption is F (X). express.

また、暗号化部11は、CPU30から出力された信号を、メモリ20のアドレス単位で、暗号文と平文とが可逆的に1対1に対応する、第1暗号化方式とは異なる第2暗号化方式で暗号化する。 Further, the encryption unit 11 has a second encryption method different from the first encryption method, in which the signal output from the CPU 30 has a one-to-one reversible correspondence between the ciphertext and the plaintext in the address unit of the memory 20. Encrypt with the encryption method.

図3Bは、第2暗号化方式における、暗号文と平文との関係を示す模式図である。 FIG. 3B is a schematic diagram showing the relationship between the ciphertext and the plaintext in the second encryption method.

ここでは、第2暗号化方式は、メモリ20のアドレス単位の循環シフト(ローテート)であるとする。しかしながら、第2暗号化方式は、メモリ20のアドレス単位で、暗号文と平文とが可逆的に1対1に対応する、第1暗号化方式とは異なる暗号化方式であれば、必ずしも、循環シフトである構成に限定される必要はない。例えば、ビットの並び順を反転させる暗号化方式であってもよい。また、ここでは、メモリ20のワード長が32ビットである場合の例となっているが、メモリ20のワード長は、必ずしも32ビットに限定される必要はない。例えば、メモリ20のワード長が16ビットである例もあり得る。 Here, it is assumed that the second encryption method is a circular shift (rotation) for each address of the memory 20. However, the second encryption method is not necessarily circular if it is an encryption method different from the first encryption method in which the ciphertext and the plaintext have a reversible one-to-one correspondence in the address unit of the memory 20. It does not have to be limited to a configuration that is a shift. For example, an encryption method may be used in which the order of the bits is reversed. Further, although the example here is a case where the word length of the memory 20 is 32 bits, the word length of the memory 20 is not necessarily limited to 32 bits. For example, the word length of the memory 20 may be 16 bits.

図3Bに示されるように、ここでは、第2暗号化方式は、メモリ20のアドレス単位である32ビット単位で行われる、左3ビットの循環シフトとなっている。 As shown in FIG. 3B, here, the second encryption method is a circular shift of the left 3 bits, which is performed in units of 32 bits, which is an address unit of the memory 20.

以下では、説明をわかりやすくするために、第2暗号化前の信号である32ビットの値をYとした場合における、第2暗号化後の信号である32ビットの値をG(Y)として表現する。 In the following, in order to make the explanation easier to understand, when the 32-bit value of the signal before the second encryption is Y, the 32-bit value of the signal after the second encryption is G (Y). express.

フラグ記憶部13は、メモリ20の各アドレスに対応する、1ビットからなる第1フラグと、1ビットからなる第2フラグとを記憶する。ここでは、第1フラグの論理値が1のときに第1フラグは活性状態であり、第1フラグの論理値が0のときに第1フラグは非活性状態であるとするが、この逆、すなわち、第1フラグの論理値が0のときに第1フラグは活性状態であり、第1フラグの論理値が1のときに第1フラグは非活性状態であるとしてもよい。また、同様に、ここでは、第2フラグの論理値が1のときに第2フラグは活性状態であり、第2フラグの論理値が0のときに第2フラグは非活性状態であるとするが、この逆、すなわち、第2フラグの論理値が0のときに第2フラグは活性状態であり、第2フラグの論理値が1のときに第2フラグは非活性状態であるとしてもよい。 The flag storage unit 13 stores a first flag consisting of one bit and a second flag consisting of one bit corresponding to each address of the memory 20. Here, it is assumed that the first flag is in the active state when the logical value of the first flag is 1, and the first flag is in the inactive state when the logical value of the first flag is 0, but vice versa. That is, when the logical value of the first flag is 0, the first flag may be in the active state, and when the logical value of the first flag is 1, the first flag may be in the inactive state. Similarly, here, it is assumed that the second flag is in the active state when the logical value of the second flag is 1, and the second flag is in the inactive state when the logical value of the second flag is 0. However, the opposite, that is, the second flag may be in the active state when the logical value of the second flag is 0, and the second flag may be in the inactive state when the logical value of the second flag is 1. ..

ここでは、第1フラグ及び第2フラグは、初期状態において非活性状態であるとする。 Here, it is assumed that the first flag and the second flag are inactive in the initial state.

なお、ここでは、フラグ記憶部13は、暗号化装置10の内部に含まれるとして説明するが、必ずしも暗号化装置10の内部に含まれる構成に限定される必要はない。例えば、フラグ記憶部13は、メモリ20の記憶領域の一部として実現されてもよい。 Although the flag storage unit 13 is described here as being included inside the encryption device 10, it is not necessarily limited to the configuration included inside the encryption device 10. For example, the flag storage unit 13 may be realized as a part of the storage area of the memory 20.

フラグ更新部14は、メモリ20の各アドレスに対応する第1フラグと第2フラグとを更新する。 The flag update unit 14 updates the first flag and the second flag corresponding to each address of the memory 20.

より具体的には、フラグ更新部14は、(1)記録媒体40から出力されたプログラムの、第1暗号化方式による暗号文がメモリ20に書き込まれる場合に、書き込まれるアドレスに対応する第1フラグを活性状態とする。また、フラグ更新部14は、(2)CPU30から出力された信号の、第2暗号化方式による暗号文がメモリ20に書き込まれる場合に、書き込まれるアドレスに対応する第2フラグを活性状態とする。また、フラグ更新部14は、(3)第2フラグが活性状態である場合において、記録媒体40から出力されたプログラムの、第1暗号化方式による暗号文がメモリ20に書き込まれるときに、書き込まれるアドレスに対応する第2フラグを非活性状態とする。そして、フラグ更新部14は、(4)第2フラグが活性状態である場合において、CPU30から出力された信号の、第2暗号化方式による暗号文がメモリ20に書き込まれるときに、書き込まれるアドレスに対応する第1フラグを非活性状態とする。 More specifically, the flag updating unit 14 is (1) a first unit corresponding to an address to be written when the ciphertext by the first encryption method of the program output from the recording medium 40 is written to the memory 20. Activates the flag. Further, the flag updating unit 14 activates (2) the second flag corresponding to the written address when the ciphertext by the second encryption method of the signal output from the CPU 30 is written to the memory 20. .. Further, the flag update unit 14 writes (3) when the ciphertext of the program output from the recording medium 40 by the first encryption method is written to the memory 20 when the second flag is in the active state. The second flag corresponding to the address is set to the inactive state. Then, the flag update unit 14 (4) is an address to be written when the ciphertext by the second encryption method of the signal output from the CPU 30 is written to the memory 20 when the second flag is in the active state. The first flag corresponding to is inactive.

復号化部12は、メモリ20から出力された信号を、メモリ20のアドレス単位で、第1暗号化方式の逆変換である第1復号化方式、又は第2暗号化方式の逆変換である第2復号化方式で復号化する。 The decoding unit 12 converts the signal output from the memory 20 into the first decoding method, which is the reverse conversion of the first encryption method, or the reverse conversion of the second encryption method, in units of addresses of the memory 20. 2 Decrypt by the decryption method.

図4Aは、第1復号化方式における、暗号文と平文との関係を示す模式図である。 FIG. 4A is a schematic diagram showing the relationship between the ciphertext and the plaintext in the first decryption method.

上述したように、第1復号化方式は、第1暗号化方式の逆変換である。このため、ここでは、第1復号化方式は、メモリ20のアドレス単位である32ビット単位で行われる、右2ビットの循環シフトとなっている。 As described above, the first decryption method is an inverse conversion of the first encryption method. Therefore, here, the first decoding method is a circular shift of two bits to the right, which is performed in units of 32 bits, which is an address unit of the memory 20.

以下では、説明をわかりやすくするために、第1復号化前の信号である32ビットの値をXとした場合における、第1復号化後の信号である32ビットの値をF-1(X)として表現することもある。 In the following, for the sake of clarity, the 32-bit value of the signal after the first decoding is F -1 (X) when the 32-bit value of the signal before the first decoding is X. ) May be expressed.

また、第1復号化方式は、第1暗号化方式の逆変換であることから、
-1{F(X)} = X
となる。
Further, since the first decryption method is the inverse conversion of the first encryption method,
F -1 {F (X)} = X
Will be.

図4Bは、第2復号化方式における、暗号文と平文との関係を示す模式図である。 FIG. 4B is a schematic diagram showing the relationship between the ciphertext and the plaintext in the second decryption method.

上述したように、第2復号化方式は、第2暗号化方式の逆変換である。このため、ここでは、第2復号化方式は、メモリ20のアドレス単位である32ビット単位で行われる、右3ビットの循環シフトとなっている。 As described above, the second decryption method is an inverse conversion of the second encryption method. Therefore, here, the second decoding method is a circular shift of the right 3 bits, which is performed in units of 32 bits, which is an address unit of the memory 20.

以下では、説明をわかりやすくするために、第2復号化前の信号である32ビットの値をYとした場合における、第2復号化後の信号である32ビットの値をG-1(Y)として表現することもある。 In the following, for the sake of clarity, the 32-bit value of the signal after the second decoding is G -1 (Y) when the 32-bit value of the signal before the second decoding is Y. ) May be expressed.

また、第2復号化方式は、第2暗号化方式の逆変換であることから、
-1{G(Y)} = Y
となる。
Further, since the second decryption method is the inverse conversion of the second encryption method,
G -1 {G (Y)} = Y
Will be.

より具体的には、復号化部12は、(1)メモリ20から信号が読み出された場合において、当該信号のアドレスに対応する第1フラグが活性状態で、かつ、当該アドレスに対応する第2フラグが非活性状態であるときに、当該信号を、第1復号化方式で復号化する。また、復号化部12は、(2)メモリ20から信号が読み出された場合において、当該信号のアドレスに対応する第1フラグが活性状態で、かつ、当該アドレスに対応する第2フラグが活性状態であるときに、当該信号の読み出し先がCPU30であれば、当該信号を第1復号化方式で復号化し、当該信号の読み出し先が記録媒体40であれば、当該信号を第2復号化方式で復号化する。そして、復号化部12は、(3)メモリ20から信号が読み出された場合において、当該信号のアドレスに対応する第1フラグが非活性状態で、かつ、当該アドレスに対応する第2フラグが活性状態であるときに、当該信号を、第2復号化方式で復号化する。 More specifically, in the decoding unit 12, (1) when the signal is read from the memory 20, the first flag corresponding to the address of the signal is active and the first flag corresponding to the address is active. 2 When the flag is in the inactive state, the signal is decoded by the first decoding method. Further, in the decoding unit 12, (2) when the signal is read from the memory 20, the first flag corresponding to the address of the signal is active and the second flag corresponding to the address is active. In the state, if the read destination of the signal is the CPU 30, the signal is decoded by the first decoding method, and if the read destination of the signal is the recording medium 40, the signal is decoded by the second decoding method. Decrypt with. Then, in the decoding unit 12, (3) when the signal is read from the memory 20, the first flag corresponding to the address of the signal is inactive, and the second flag corresponding to the address is set. When in the active state, the signal is decoded by the second decoding method.

暗号化方式設定部15は、外部からの操作を受け付け、受け付けた操作に応じて、第1暗号化方式及び第1復号化方式、又は、第2暗号化方式及び第2復号化方式を設定する。 The encryption method setting unit 15 receives an operation from the outside and sets the first encryption method and the first decryption method, or the second encryption method and the second decryption method according to the accepted operation. ..

暗号化方式設定部15は、例えば、タッチパネルを含み、暗号化装置10を利用するユーザからのタッチ操作を受け付けることで外部からの操作を受け付けるとしてもよい。また、暗号化方式設定部15は、例えば、外部機器(例えば、スマートフォン)と通信可能な通信回路を含み、外部機器による操作信号を受信することで外部からの操作を受け付けるとしてもよい。また、暗号化方式設定部15は、例えば、ディップスイッチを含み、暗号化装置10を利用するユーザからのスイッチ切り替え操作を受け付けることで外部からの操作を受け付けるとしてもよい。 For example, the encryption method setting unit 15 may include a touch panel and accept an operation from the outside by accepting a touch operation from a user who uses the encryption device 10. Further, the encryption method setting unit 15 may include, for example, a communication circuit capable of communicating with an external device (for example, a smartphone), and may accept an operation from the outside by receiving an operation signal from the external device. Further, the encryption method setting unit 15 may include, for example, a DIP switch and accept an operation from the outside by accepting a switch switching operation from a user who uses the encryption device 10.

但し、暗号化方式設定部15が受け付ける操作には、CPU30による操作が含まれないことが望ましい。これは、CPU30による悪意のある操作を受け付けてしまうことにより発生し得る、暗号化システム1におけるセキュリティホールを未然に防止するためである。 However, it is desirable that the operation accepted by the encryption method setting unit 15 does not include the operation by the CPU 30. This is to prevent a security hole in the encryption system 1 that may occur by accepting a malicious operation by the CPU 30.

以下、上記構成の暗号化システム1が行う動作について、図面を参照しながら説明する。 Hereinafter, the operation performed by the encryption system 1 having the above configuration will be described with reference to the drawings.

[2.動作]
まず、記録媒体40からメモリ20にロードされたプログラムを、CPU30が実行しようとする場合(以下、「ケース1」と呼ぶ。)における暗号化システム1の動作について説明する。
[2. motion]
First, the operation of the encryption system 1 when the CPU 30 tries to execute the program loaded from the recording medium 40 into the memory 20 (hereinafter, referred to as “case 1”) will be described.

図5は、ケース1における暗号化システム1の動作を示す模式図である。 FIG. 5 is a schematic diagram showing the operation of the encryption system 1 in the case 1.

図5に示されるように、記録媒体40から値がXとなる信号(プログラム)が出力されると、暗号化部11は、その信号に対して第1暗号化方式による暗号化を行い、値がF(X)となる信号を生成する。そして、メモリ20の書き込みアドレス(以下、「アドレスA」と呼ぶ。)に、値がF(X)となる信号が書き込まれる。一方で、フラグ更新部14は、そのアドレスAに対応する第1フラグ、第2フラグを、初期状態である(0、0)から(1、0)に更新する。 As shown in FIG. 5, when a signal (program) having a value of X is output from the recording medium 40, the encryption unit 11 encrypts the signal by the first encryption method, and the value is obtained. Generates a signal of F (X). Then, a signal having a value of F (X) is written to the write address of the memory 20 (hereinafter, referred to as “address A”). On the other hand, the flag updating unit 14 updates the first flag and the second flag corresponding to the address A from the initial state (0,0) to (1,0).

その後、CPU30によって利用されるために、メモリ20のアドレスAから、値がF(X)となる信号が読み出されると、復号化部12は、アドレスAに対応する第1フラグ、第2フラグが(1、0)であるため、その信号に対して、第1復号化方式による復号化を行い、値がF-1{F(X)}、すなわち、Xとなる信号を生成する。このため、CPU30は、元々記録媒体40に記録されていた状態に復元された信号(プログラム)を利用することとなる。 After that, when a signal having a value of F (X) is read from the address A of the memory 20 for use by the CPU 30, the decoding unit 12 sets the first flag and the second flag corresponding to the address A. Since it is (1, 0), the signal is decoded by the first decoding method, and a signal having a value of F -1 {F (X)}, that is, X is generated. Therefore, the CPU 30 uses the signal (program) restored to the state originally recorded on the recording medium 40.

このように、ケース1において、CPU30は、記録媒体40からメモリ20にロードされたプログラムを、正しく実行することができる。 As described above, in Case 1, the CPU 30 can correctly execute the program loaded from the recording medium 40 into the memory 20.

次に、記録媒体40からメモリ20のディスクキャッシュ領域に書き込まれたデータを、値を更新することなく、記録媒体40へライトバックしようとする場合(以下、「ケース2」呼ぶ。)における暗号化システム1の動作について説明する。 Next, encryption in the case where the data written from the recording medium 40 to the disk cache area of the memory 20 is to be written back to the recording medium 40 without updating the value (hereinafter referred to as "case 2"). The operation of the system 1 will be described.

図6は、ケース2における暗号化システム1の動作を示す模式図である。 FIG. 6 is a schematic diagram showing the operation of the encryption system 1 in the case 2.

図6に示されるように、記録媒体40から値がXとなる信号(データ)が出力されると、暗号化部11は、その信号に対して第1暗号化方式による暗号化を行い、値がF(X)となる信号を生成する。そして、メモリ20の書き込みアドレス(以下、「アドレスB」と呼ぶ。)に、値がF(X)となる信号が書き込まれる。一方で、フラグ更新部14は、そのアドレスBに対応する第1フラグ、第2フラグを、初期状態である(0、0)から(1、0)に更新する。 As shown in FIG. 6, when a signal (data) having a value of X is output from the recording medium 40, the encryption unit 11 encrypts the signal by the first encryption method, and the value is obtained. Generates a signal of F (X). Then, a signal having a value of F (X) is written to the write address of the memory 20 (hereinafter, referred to as “address B”). On the other hand, the flag updating unit 14 updates the first flag and the second flag corresponding to the address B from the initial state (0,0) to (1,0).

その後、記録媒体40にライトバックするために、メモリ20のアドレスAから、値がF(X)となる信号が読み出されると、復号化部12は、アドレスAに対応する第1フラグ、第2フラグが(1、0)であるため、その信号に対して、第1復号化方式による復号化を行い、値がF-1{F(X)}、すなわち、Xとなる信号を生成する。これにより、記録媒体40は、元々記録媒体40に記録されていた状態に復元された信号(データ)がライトバックされることとなる。 After that, when a signal having a value of F (X) is read from the address A of the memory 20 in order to write back to the recording medium 40, the decoding unit 12 receives the first flag and the second flag corresponding to the address A. Since the flag is (1, 0), the signal is decoded by the first decoding method, and a signal having a value of F -1 {F (X)}, that is, X is generated. As a result, the recording medium 40 is written back with the signal (data) restored to the state originally recorded on the recording medium 40.

このように、ケース2において、記録媒体40は、正しくライトバックされることとなる。 As described above, in the case 2, the recording medium 40 is correctly written back.

次に、記録媒体40からメモリ20のディスクキャッシュ領域に書き込まれたデータを、CPU30が値を更新した後に、記録媒体40へライトバックしようとする場合(以下、「ケース3」呼ぶ。)における暗号化システム1の動作について説明する。 Next, the encryption in the case where the data written from the recording medium 40 to the disk cache area of the memory 20 is to be written back to the recording medium 40 after the CPU 30 updates the value (hereinafter referred to as “case 3”). The operation of the system 1 will be described.

図7は、ケース3における暗号化システム1の動作を示す模式図である。 FIG. 7 is a schematic diagram showing the operation of the encryption system 1 in the case 3.

図7に示されるように、記録媒体40から値がXとなる信号(データ)が出力されると、暗号化部11は、その信号に対して第1暗号化方式による暗号化を行い、値がF(X)となる信号を生成する。そして、メモリ20の書き込みアドレス(以下、「アドレスC」と呼ぶ。)に、値がF(X)となる信号が書き込まれる。一方で、フラグ更新部14は、そのアドレスCに対応する第1フラグ、第2フラグを、初期状態である(0、0)から(1、0)に更新する。 As shown in FIG. 7, when a signal (data) having a value of X is output from the recording medium 40, the encryption unit 11 encrypts the signal by the first encryption method, and the value is obtained. Generates a signal of F (X). Then, a signal having a value of F (X) is written to the write address of the memory 20 (hereinafter, referred to as “address C”). On the other hand, the flag updating unit 14 updates the first flag and the second flag corresponding to the address C from the initial state (0,0) to (1,0).

その後、CPU30から値がYとなる信号(データ)が出力されると、暗号化部11は、その信号に対して第2暗号化方式による暗号化を行い、値がG(Y)となる信号を生成する。そして、アドレスCに、値がG(Y)となる信号が書き込まれる。すなわち、値がG(Y)となる信号で上書き更新される。一方で、フラグ更新部14は、そのアドレスCに対応する第1フラグ、第2フラグを(1、0)から(1、1)に更新する。 After that, when a signal (data) having a value of Y is output from the CPU 30, the encryption unit 11 encrypts the signal by the second encryption method, and the signal has a value of G (Y). To generate. Then, a signal having a value of G (Y) is written to the address C. That is, it is overwritten and updated with a signal whose value is G (Y). On the other hand, the flag updating unit 14 updates the first flag and the second flag corresponding to the address C from (1, 0) to (1, 1).

その後、記録媒体40にライトバックするために、メモリ20のアドレスCから、値がG(Y)となる信号が読み出されると、復号化部12は、アドレスCに対応する第1フラグ、第2フラグが(1、1)であり、読み出し先が記録媒体40であるため、その信号に対して、第2復号化方式による復号化を行い、値がG-1{G(Y)}、すなわち、Yとなる信号を生成する。これにより、記録媒体40は、元々CPU30から出力された状態に復元された信号(データ)がライトバックされることとなる。 After that, when a signal having a value of G (Y) is read from the address C of the memory 20 in order to write back to the recording medium 40, the decoding unit 12 receives the first flag and the second flag corresponding to the address C. Since the flag is (1, 1) and the read destination is the recording medium 40, the signal is decoded by the second decoding method, and the value is G -1 {G (Y)}, that is. , Y to generate a signal. As a result, the recording medium 40 is written back with the signal (data) restored to the state originally output from the CPU 30.

このように、ケース3において、記録媒体40は、正しくライトバックされることとなる。 As described above, in the case 3, the recording medium 40 is correctly written back.

次に、記録媒体40からメモリ20にロードされたプログラムを、CPU30が不正なプログラムに書き換えた後に、CPU30がその不正なプログラムを実行しようとする場合(以下、「ケース4」と呼ぶ。)における暗号化システム1の動作について説明する。 Next, in a case where the CPU 30 attempts to execute the illegal program after the CPU 30 rewrites the program loaded from the recording medium 40 into the memory 20 into an invalid program (hereinafter referred to as "case 4"). The operation of the encryption system 1 will be described.

図8は、ケース4における暗号化システム1の動作を示す模式図である。 FIG. 8 is a schematic diagram showing the operation of the encryption system 1 in the case 4.

図8に示されるように、記録媒体40から値がXとなる信号(プログラム)が出力されると、暗号化部11は、その信号に対して第1暗号化方式による暗号化を行い、値がF(X)となる信号を生成する。そして、メモリ20の書き込みアドレス(以下、「アドレスD」と呼ぶ。)に、値がF(X)となる信号が書き込まれる。一方で、フラグ更新部14は、そのアドレスDに対応する第1フラグ、第2フラグを、初期状態である(0、0)から(1、0)に更新する。 As shown in FIG. 8, when a signal (program) having a value of X is output from the recording medium 40, the encryption unit 11 encrypts the signal by the first encryption method, and the value is obtained. Generates a signal of F (X). Then, a signal having a value of F (X) is written to the write address of the memory 20 (hereinafter, referred to as “address D”). On the other hand, the flag updating unit 14 updates the first flag and the second flag corresponding to the address D from the initial state (0,0) to (1,0).

その後、CPU30から値がYとなる信号(不正なプログラム)が出力されると、暗号化部11は、その信号に対して第2暗号化方式による暗号化を行い、値がG(Y)となる信号を生成する。そして、アドレスDに、値がG(Y)となる信号が書き込まれる。すなわち、値がG(Y)となる信号で上書き更新される。一方で、フラグ更新部14は、そのアドレスDに対応する第1フラグ、第2フラグを(1、0)から(1、1)に更新する。 After that, when a signal (illegal program) having a value of Y is output from the CPU 30, the encryption unit 11 encrypts the signal by the second encryption method, and the value becomes G (Y). Generates a signal that Then, a signal having a value of G (Y) is written to the address D. That is, it is overwritten and updated with a signal whose value is G (Y). On the other hand, the flag updating unit 14 updates the first flag and the second flag corresponding to the address D from (1, 0) to (1, 1).

その後、CPU30によって利用されるために、メモリ20のアドレスDから、値がG(Y)となる信号が読み出されると、復号化部12は、アドレスDに対応する第1フラグ、第2フラグが(1、1)であり、読み出し先がCPU30であるため、その信号に対して、第1復号化方式による復号化を行い、値がF-1{G(Y)}となる信号を生成する。 After that, when a signal having a value of G (Y) is read from the address D of the memory 20 for use by the CPU 30, the decoding unit 12 sets the first flag and the second flag corresponding to the address D. (1, 1), and since the read destination is the CPU 30, the signal is decoded by the first decoding method, and a signal having a value of F -1 {G (Y)} is generated. ..

このF-1{G(Y)}となる信号は、値がYとなる不正なプログラムとは異なる信号である。これにより、CPU30は、値がYとなる不正なプログラムを実行しない。 The signal of F -1 {G (Y)} is a signal different from that of an invalid program having a value of Y. As a result, the CPU 30 does not execute an illegal program whose value is Y.

このように、ケース4において、CPU30は、不正なプログラムを実行しない。 Thus, in Case 4, the CPU 30 does not execute the malicious program.

なお、このとき、値がF-1{G(Y)}となる信号が、CPU30によって実行されることのない信号であることが望ましい。すなわち、CPU30の命令セットと第1暗号化方式と第2暗号化方式との関係は、CPU30によって実行可能な任意のプログラムが、第2暗号化方式によって暗号化された後に第1復号化方式によって復号化された場合に、復号化された信号が、CPU30によって実行不能な信号となる関係であることが望ましい。 At this time, it is desirable that the signal whose value is F -1 {G (Y)} is a signal that is not executed by the CPU 30. That is, the relationship between the instruction set of the CPU 30 and the first encryption method and the second encryption method is that any program that can be executed by the CPU 30 is encrypted by the second encryption method and then by the first decryption method. When decoded, it is desirable that the decoded signal becomes a signal that cannot be executed by the CPU 30.

次に、CPU30がメモリ20に不正なプログラムを書き込んだ後に、その不正なプログラムを記録媒体40からメモリ20にロードされたプログラムで更新し、さらにその後、CPU30がその更新されたプログラムを実行しようとする場合(以下、「ケース5」と呼ぶ。)における暗号化システム1の動作について説明する。 Next, after the CPU 30 writes an invalid program in the memory 20, the malicious program is updated by the program loaded from the recording medium 40 into the memory 20, and then the CPU 30 attempts to execute the updated program. The operation of the encryption system 1 in this case (hereinafter referred to as "case 5") will be described.

図9は、ケース5における暗号化システム1の動作を示す模式図である。 FIG. 9 is a schematic diagram showing the operation of the encryption system 1 in the case 5.

図9に示されるように、CPU30から値がYとなる信号(不正なプログラム)が出力されると、暗号化部11は、その信号に対して第2暗号化方式による暗号化を行い、値がG(Y)となる信号を生成する。そして、メモリ20の書き込みアドレス(以下、「アドレスE」と呼ぶ。)に、値がG(Y)となる信号が書き込まれる。一方で、フラグ更新部14は、そのアドレスEに対応する第1フラグ、第2フラグを、初期状態である(0、0)から(0、1)に更新する。 As shown in FIG. 9, when a signal (illegal program) having a value of Y is output from the CPU 30, the encryption unit 11 encrypts the signal by the second encryption method, and the value is obtained. Generates a signal of G (Y). Then, a signal having a value of G (Y) is written to the write address of the memory 20 (hereinafter, referred to as “address E”). On the other hand, the flag updating unit 14 updates the first flag and the second flag corresponding to the address E from the initial state (0, 0) to (0, 1).

その後、記録媒体40から値がXとなる信号(プログラム)が出力されると、暗号化部11は、その信号に対して第1暗号化方式による暗号化を行い、値がF(X)となる信号を生成する。そして、アドレスEに、値がF(X)となる信号が書き込まれる。すなわち、値がF(X)となる信号で上書き更新される。一方で、フラグ更新部14は、そのアドレスEに対応する第1フラグ、第2フラグを(0、1)から(1、0)に更新する。 After that, when a signal (program) having a value of X is output from the recording medium 40, the encryption unit 11 encrypts the signal by the first encryption method, and the value becomes F (X). Generates a signal that Then, a signal having a value of F (X) is written to the address E. That is, it is overwritten and updated with a signal whose value is F (X). On the other hand, the flag updating unit 14 updates the first flag and the second flag corresponding to the address E from (0, 1) to (1, 0).

その後、CPU30によって利用されるために、メモリ20のアドレスEから、値がF(X)となる信号が読み出されると、復号化部12は、アドレスEに対応する第1フラグ、第2フラグが(1、0)であり、読み出し先がCPU30であるため、その信号に対して、第1復号化方式による復号化を行い、値がF-1{F(X)}、すなわち、Xとなる信号を生成する。 After that, when a signal having a value of F (X) is read from the address E of the memory 20 for use by the CPU 30, the decoding unit 12 sets the first flag and the second flag corresponding to the address E. Since it is (1, 0) and the read destination is the CPU 30, the signal is decoded by the first decoding method, and the value becomes F -1 {F (X)}, that is, X. Generate a signal.

このように、ケース5において、CPU30は、記録媒体40からメモリ20にロードされたプログラムを、正しく実行することができる。 As described above, in the case 5, the CPU 30 can correctly execute the program loaded from the recording medium 40 into the memory 20.

次に、記録媒体40からメモリ20にロードされたプログラムを、CPU30が初期化した後に、CPU30によって、ワークエリアとしてデータが書き込まれ、さらにその後、CPU30によってそのデータ利用しようとする場合(以下、「ケース6」と呼ぶ。)における暗号化システム1の動作について説明する。 Next, when the program loaded from the recording medium 40 into the memory 20 is initialized by the CPU 30, data is written as a work area by the CPU 30, and then the data is to be used by the CPU 30 (hereinafter, "" The operation of the encryption system 1 in (referred to as case 6) will be described.

図10は、ケース6における暗号化システム1の動作を示す模式図である。 FIG. 10 is a schematic diagram showing the operation of the encryption system 1 in the case 6.

図10に示されるように、記録媒体40から値がXとなる信号(プログラム)が出力されると、暗号化部11は、その信号に対して第1暗号化方式による暗号化を行い、値がF(X)となる信号を生成する。そして、メモリ20の書き込みアドレス(以下、「アドレスF」と呼ぶ。)に、値がF(X)となる信号が書き込まれる。一方で、フラグ更新部14は、そのアドレスFに対応する第1フラグ、第2フラグを、初期状態である(0、0)から(1、0)に更新する。 As shown in FIG. 10, when a signal (program) having a value of X is output from the recording medium 40, the encryption unit 11 encrypts the signal by the first encryption method, and the value is obtained. Generates a signal of F (X). Then, a signal having a value of F (X) is written to the write address of the memory 20 (hereinafter, referred to as “address F”). On the other hand, the flag updating unit 14 updates the first flag and the second flag corresponding to the address F from the initial state (0,0) to (1,0).

その後、CPU30から値がYとなる信号(初期化データ)が出力されると、暗号化部11は、その信号に対して第2暗号化方式による暗号化を行い、値がG(Y)となる信号を生成する。そして、アドレスFに、値がG(Y)となる信号が書き込まれる。すなわち、値がG(Y)となる信号で上書き更新される。一方で、フラグ更新部14は、そのアドレスFに対応する第1フラグ、第2フラグを(1、0)から(1、1)に更新する。 After that, when a signal (initialization data) having a value of Y is output from the CPU 30, the encryption unit 11 encrypts the signal by the second encryption method, and the value becomes G (Y). Generates a signal that Then, a signal having a value of G (Y) is written to the address F. That is, it is overwritten and updated with a signal whose value is G (Y). On the other hand, the flag updating unit 14 updates the first flag and the second flag corresponding to the address F from (1, 0) to (1, 1).

その後、CPU30から値がZとなる信号(ワークデータ)が出力されると、暗号化部11は、その信号に対して第2暗号化方式による暗号化を行い、値がG(Z)となる信号を生成する。そして、アドレスFに、値がG(Z)となる信号が書き込まれる。すなわち、値がG(Z)となる信号で上書き更新される。一方で、フラグ更新部14は、そのアドレスFに対応する第1フラグ、第2フラグを(1、1)から(0、1)に更新する。 After that, when a signal (work data) having a value of Z is output from the CPU 30, the encryption unit 11 encrypts the signal by the second encryption method, and the value becomes G (Z). Generate a signal. Then, a signal having a value of G (Z) is written to the address F. That is, it is overwritten and updated with a signal whose value is G (Z). On the other hand, the flag updating unit 14 updates the first flag and the second flag corresponding to the address F from (1, 1) to (0, 1).

その後、CPU30によって利用されるために、メモリ20のアドレスFから、値がG(Z)となる信号が読み出されると、復号化部12は、アドレスFに対応する第1フラグ、第2フラグが(0、1)であり、読み出し先がCPU30であるため、その信号に対して、第2復号化方式による復号化を行い、値がG-1{G(Z)}、すなわち、Zとなる信号を生成する。 After that, when a signal having a value of G (Z) is read from the address F of the memory 20 for use by the CPU 30, the decoding unit 12 sets the first flag and the second flag corresponding to the address F. (0, 1), and since the read destination is the CPU 30, the signal is decoded by the second decoding method, and the value becomes G -1 {G (Z)}, that is, Z. Generate a signal.

このように、ケース6において、CPU30は、ワークエリアとして書き込まれたデータを、正しく利用することができる。 As described above, in the case 6, the CPU 30 can correctly use the data written as the work area.

[3.効果]
上記構成の暗号化装置10によると、ケース4、ケース5に示されるように、CPU30の実行対象とするプログラムを記憶するメモリ20に悪意のあるプログラムが書き込まれてしまったとしても、そのCPUに30よるその悪意のあるプログラムの実行を抑止し得る。
[3. effect]
According to the encryption device 10 having the above configuration, as shown in Cases 4 and 5, even if a malicious program is written in the memory 20 that stores the program to be executed by the CPU 30, the CPU has the malicious program written in the memory 20. 30 can deter the execution of the malicious program.

また、上記構成の暗号化装置10によると、ケース1、ケース2、ケース3、ケース6に示されるように、CPU30の実行対象とするプログラムを記憶するメモリ20に悪意のあるプログラムが書き込まれない場合には、CPU30は、正常な動作を行う。 Further, according to the encryption device 10 having the above configuration, as shown in Case 1, Case 2, Case 3, and Case 6, a malicious program is not written in the memory 20 that stores the program to be executed by the CPU 30. In that case, the CPU 30 operates normally.

(補足)
以上のように、本出願において開示する技術の例示として、実施の形態について説明した。しかしながら本発明による技術は、これらに限定されず、適宜、変更、置き換え、付加、省略等を行った実施の形態にも適用可能である。
(supplement)
As described above, embodiments have been described as an example of the techniques disclosed in this application. However, the technique according to the present invention is not limited to these, and can be applied to embodiments in which changes, replacements, additions, omissions, etc. are made as appropriate.

以下に、本発明における変形例の一例について説明する。 Hereinafter, an example of a modification of the present invention will be described.

実施の形態では、暗号化部11は、CPU30から出力された信号を、メモリ20のアドレス単位で、暗号文と平文とが可逆的に1対1に対応する、第1暗号化方式とは異なる第2暗号化方式で暗号化する構成の例であるとして説明した。 In the embodiment, the encryption unit 11 is different from the first encryption method in which the signal output from the CPU 30 has a reversible one-to-one correspondence between the ciphertext and the plaintext in the address unit of the memory 20. It has been described as an example of a configuration in which encryption is performed by the second encryption method.

これに対して、本変形例では、変形例に係る暗号化部は、CPU30から出力された信号に対して、何も変換を行わない構成の例となっている。言い換えれば、変形例に係る暗号化部は、第2暗号化方式として、暗号文と平文とが等しくなる変換を行う構成の例となっている。 On the other hand, in this modification, the encryption unit according to the modification is an example of a configuration in which no conversion is performed on the signal output from the CPU 30. In other words, the encryption unit according to the modified example is an example of a configuration in which the ciphertext and the plaintext are converted to be equal as the second encryption method.

ここでは、第2暗号化方式は、暗号文と平文とが等しいため、第2暗号化前の信号である32ビットの値をYとした場合における、第2暗号化後の信号である32ビットの値をG(Y)として表現すると、
G(Y) = Y
となる。
Here, in the second encryption method, since the ciphertext and the plaintext are equal, the 32-bit signal after the second encryption is obtained when the value of the 32-bit signal before the second encryption is Y. When the value of is expressed as G (Y),
G (Y) = Y
Will be.

また、ここでは、第2復号化方式は、第2暗号化方式の逆変換であるため、第2復号化前の信号である32ビットの値をYとした場合における、第2復号化後の信号である32ビットの値をG-1(Y)として表現すると
-1(Y) = Y
となる。
Further, here, since the second decoding method is the inverse conversion of the second encryption method, the value of 32 bits, which is the signal before the second decoding, is set to Y, and the value after the second decoding is set to Y. When the value of 32 bits, which is a signal, is expressed as G -1 (Y), G -1 (Y) = Y.
Will be.

すなわち、本変形例では、変形例に係る復号化部は、(1)メモリ20から信号が読み出された場合において、当該信号のアドレスに対応する第1フラグが活性状態で、かつ、当該アドレスに対応する第2フラグが非活性状態であるときに、当該信号を、第1復号化方式で復号化する。また、変形例に係る復号化部は、(2)メモリ20から信号が読み出された場合において、当該信号のアドレスに対応する第1フラグが活性状態で、かつ、当該アドレスに対応する第2フラグが活性状態であるときに、当該信号の読み出し先がCPU30であれば、当該信号を第1復号化方式で復号化し、当該信号の読み出し先が記録媒体40であれば、当該信号に対して何も変換しない。そして、実施の形態に係る復号化部は、(3)メモリ20から信号が読み出された場合において、当該信号のアドレスに対応する第1フラグが非活性状態で、かつ、当該アドレスに対応する第2フラグが活性状態であるときに、当該信号に対して何も変換しない。 That is, in this modification, in the decoding unit according to the modification, (1) when the signal is read from the memory 20, the first flag corresponding to the address of the signal is active and the address is the address. When the second flag corresponding to is in the inactive state, the signal is decoded by the first decoding method. Further, in the decoding unit according to the modified example, (2) when the signal is read from the memory 20, the first flag corresponding to the address of the signal is active and the second flag corresponding to the address is active. When the flag is in the active state, if the read destination of the signal is the CPU 30, the signal is decoded by the first decoding method, and if the read destination of the signal is the recording medium 40, the signal is decoded. Does not convert anything. Then, in the decoding unit according to the embodiment, (3) when the signal is read from the memory 20, the first flag corresponding to the address of the signal is inactive and corresponds to the address. When the second flag is in the active state, nothing is converted for the signal.

暗号化部11の替わりに上記変形例に係る暗号化部を備え、復号化部12の替わりに上記変形例に係る復号化部を備える変形例に係る暗号化装置によると、暗号化装置10と同様に、ケース4、ケース5に示されるように、CPU30の実行対象とするプログラムを記憶するメモリ20に悪意のあるプログラムが書き込まれてしまったとしても、そのCPUに30よるその悪意のあるプログラムの実行を抑止し得る。 According to the encryption device according to the modification, which includes the encryption unit according to the modification instead of the encryption unit 11 and the decryption unit according to the modification instead of the decryption unit 12, the encryption device 10 Similarly, as shown in Cases 4 and 5, even if a malicious program is written in the memory 20 that stores the program to be executed by the CPU 30, the malicious program by 30 is written to the CPU. Can be suppressed.

また、この変形例に係る暗号化装置によると、暗号化装置10と同様に、ケース1、ケース2、ケース3、ケース6に示されるように、CPU30の実行対象とするプログラムを記憶するメモリ20に悪意のあるプログラムが書き込まれない場合には、CPU30は、正常な動作を行う。 Further, according to the encryption device according to this modification, as shown in Case 1, Case 2, Case 3, and Case 6, the memory 20 that stores the program to be executed by the CPU 30 is stored, as in the case of the encryption device 10. If no malicious program is written to the CPU 30, the CPU 30 operates normally.

以下、ケース1~ケース6のそれぞれについて、暗号化装置10の替わりに上記変形例に係る暗号化装置を備える、変形例に係る暗号化システムの行う動作について説明する。 Hereinafter, in each of the cases 1 to 6, the operation performed by the encryption system according to the modification, which includes the encryption device according to the modification instead of the encryption device 10, will be described.

ケース1、ケース2の場合には、第2暗号化方式による暗号化、及び第2復号化方式による復号化は行われない。このため、変形例に係る暗号化システムは、暗号化システム1と同様の動作を行う。 In the cases of Case 1 and Case 2, encryption by the second encryption method and decryption by the second decryption method are not performed. Therefore, the encryption system according to the modified example operates in the same manner as the encryption system 1.

ケース3の場合には、記録媒体40から値がXとなる信号(データ)が出力されると、変形例に係る暗号化部は、その信号に対して第1暗号化方式による暗号化を行い、値がF(X)となる信号を生成する。そして、メモリ20の書き込みアドレスCに、値がF(X)となる信号が書き込まれる。一方で、フラグ更新部14は、そのアドレスCに対応する第1フラグ、第2フラグを、初期状態である(0、0)から(1、0)に更新する。 In the case of Case 3, when a signal (data) having a value of X is output from the recording medium 40, the encryption unit according to the modified example encrypts the signal by the first encryption method. , Generates a signal with a value of F (X). Then, a signal having a value of F (X) is written to the write address C of the memory 20. On the other hand, the flag updating unit 14 updates the first flag and the second flag corresponding to the address C from the initial state (0,0) to (1,0).

その後、CPU30から値がYとなる信号(データ)が出力されると、変形例に係る暗号化部は、暗号化を行わない。そして、アドレスCに、値がYとなる信号が書き込まれる。すなわち、値がYとなる信号で上書き更新される。一方で、フラグ更新部14は、そのアドレスCに対応する第1フラグ、第2フラグを(1、0)から(1、1)に更新する。 After that, when a signal (data) having a value of Y is output from the CPU 30, the encryption unit according to the modified example does not perform encryption. Then, a signal having a value of Y is written to the address C. That is, it is overwritten and updated with a signal whose value is Y. On the other hand, the flag updating unit 14 updates the first flag and the second flag corresponding to the address C from (1, 0) to (1, 1).

その後、記録媒体40にライトバックするために、メモリ20のアドレスCから、値がYとなる信号が読み出されると、変形例に係る復号化部は、アドレスCに対応する第1フラグ、第2フラグが(1、1)であり、読み出し先が記録媒体40であるため、その信号に対して、復号化を行わない。これにより、記録媒体40は、元々CPU30から出力された値がYとなる信号(データ)がライトバックされることとなる。 After that, when a signal having a value of Y is read from the address C of the memory 20 in order to write back to the recording medium 40, the decoding unit according to the modified example has the first flag and the second flag corresponding to the address C. Since the flag is (1, 1) and the read destination is the recording medium 40, the signal is not decoded. As a result, the recording medium 40 is written back with a signal (data) whose value originally output from the CPU 30 is Y.

このように、ケース3において、記録媒体40は、正しくライトバックされることとなる。 As described above, in the case 3, the recording medium 40 is correctly written back.

ケース4の場合には、記録媒体40から値がXとなる信号(プログラム)が出力されると、変形例に係る暗号化部は、その信号に対して第1暗号化方式による暗号化を行い、値がF(X)となる信号を生成する。そして、メモリ20の書き込みアドレスDに、値がF(X)となる信号が書き込まれる。一方で、フラグ更新部14は、そのアドレスDに対応する第1フラグ、第2フラグを、初期状態である(0、0)から(1、0)に更新する。 In the case of Case 4, when a signal (program) having a value of X is output from the recording medium 40, the encryption unit according to the modified example encrypts the signal by the first encryption method. , Generates a signal with a value of F (X). Then, a signal having a value of F (X) is written to the write address D of the memory 20. On the other hand, the flag updating unit 14 updates the first flag and the second flag corresponding to the address D from the initial state (0,0) to (1,0).

その後、CPU30から値がYとなる信号(不正なプログラム)が出力されると、変形例に係る暗号化部は、暗号化を行わない。そして、アドレスDに、値がYとなる信号が書き込まれる。すなわち、値がYとなる信号で上書き更新される。一方で、フラグ更新部14は、そのアドレスDに対応する第1フラグ、第2フラグを(1、0)から(1、1)に更新する。 After that, when a signal (illegal program) having a value of Y is output from the CPU 30, the encryption unit according to the modified example does not perform encryption. Then, a signal having a value of Y is written to the address D. That is, it is overwritten and updated with a signal whose value is Y. On the other hand, the flag updating unit 14 updates the first flag and the second flag corresponding to the address D from (1, 0) to (1, 1).

その後、CPU30によって利用されるために、メモリ20のアドレスDから、値がYとなる信号が読み出されると、変形例に係る復号化部は、アドレスDに対応する第1フラグ、第2フラグが(1、1)であり、読み出し先がCPU30であるため、その信号に対して、第1復号化方式による復号化を行い、値がF-1(Y)となる信号を生成する。 After that, when a signal having a value of Y is read from the address D of the memory 20 for use by the CPU 30, the decoding unit according to the modification sets the first flag and the second flag corresponding to the address D. Since the reading destination is the CPU 30 in (1), the signal is decoded by the first decoding method, and a signal having a value of F -1 (Y) is generated.

このF-1(Y)となる信号は、値がYとなる不正なプログラムとは異なる信号である。これにより、CPU30は、値がYとなる不正なプログラムを実行しない。 The signal of F -1 (Y) is a signal different from that of an invalid program having a value of Y. As a result, the CPU 30 does not execute an illegal program whose value is Y.

このように、ケース4において、CPU30は、不正なプログラムを実行しない。 Thus, in Case 4, the CPU 30 does not execute the malicious program.

なお、このとき、値がF-1(Y)となる信号が、CPU30によって実行されることのない信号であることが望ましい。すなわち、CPU30の命令セットと第1暗号化方式との関係は、CPU30によって実行可能な任意のプログラムが、第1復号化方式によって復号化された場合に、復号化された信号が、CPU30によって実行不能な信号となる関係であることが望ましい。 At this time, it is desirable that the signal having a value of F -1 (Y) is a signal that is not executed by the CPU 30. That is, the relationship between the instruction set of the CPU 30 and the first encryption method is that when an arbitrary program that can be executed by the CPU 30 is decoded by the first decryption method, the decoded signal is executed by the CPU 30. It is desirable that the relationship results in an impossible signal.

ケース5の場合には、CPU30から値がYとなる信号(不正なプログラム)が出力されると、変形例に係る暗号化部は、暗号化を行わない。そして、メモリ20の書き込みアドレスEに、値がYとなる信号が書き込まれる。一方で、フラグ更新部14は、そのアドレスEに対応する第1フラグ、第2フラグを、初期状態である(0、0)から(0、1)に更新する。 In the case of Case 5, when a signal (illegal program) having a value of Y is output from the CPU 30, the encryption unit according to the modified example does not perform encryption. Then, a signal having a value of Y is written to the write address E of the memory 20. On the other hand, the flag updating unit 14 updates the first flag and the second flag corresponding to the address E from the initial state (0, 0) to (0, 1).

その後、記録媒体40から値がXとなる信号(プログラム)が出力されると、変形例に係る暗号化部は、その信号に対して第1暗号化方式による暗号化を行い、値がF(X)となる信号を生成する。そして、アドレスEに、値がF(X)となる信号が書き込まれる。すなわち、値がF(X)となる信号で上書き更新される。一方で、フラグ更新部14は、そのアドレスEに対応する第1フラグ、第2フラグを(0、1)から(1、0)に更新する。 After that, when a signal (program) having a value of X is output from the recording medium 40, the encryption unit according to the modified example encrypts the signal by the first encryption method, and the value is F ( X) is generated. Then, a signal having a value of F (X) is written to the address E. That is, it is overwritten and updated with a signal whose value is F (X). On the other hand, the flag updating unit 14 updates the first flag and the second flag corresponding to the address E from (0, 1) to (1, 0).

その後、CPU30によって利用されるために、メモリ20のアドレスEから、値がF(X)となる信号が読み出されると、変形例に係る復号化部は、アドレスEに対応する第1フラグ、第2フラグが(1、0)であり、読み出し先がCPU30であるため、その信号に対して、第1復号化方式による復号化を行い、値がF-1{F(X)}、すなわち、Xとなる信号を生成する。 After that, when a signal having a value of F (X) is read from the address E of the memory 20 for use by the CPU 30, the decoding unit according to the modified example has the first flag corresponding to the address E, the first flag. Since the 2 flag is (1, 0) and the read destination is the CPU 30, the signal is decoded by the first decoding method, and the value is F -1 {F (X)}, that is, Generate a signal that becomes X.

このように、ケース5において、CPU30は、記録媒体40からメモリ20にロードされたプログラムを、正しく実行することができる。 As described above, in the case 5, the CPU 30 can correctly execute the program loaded from the recording medium 40 into the memory 20.

ケース6の場合には、記録媒体40から値がXとなる信号(プログラム)が出力されると、変形例に係る暗号化部は、その信号に対して第1暗号化方式による暗号化を行い、値がF(X)となる信号を生成する。そして、メモリ20の書き込みアドレスFに、値がF(X)となる信号が書き込まれる。一方で、フラグ更新部14は、そのアドレスFに対応する第1フラグ、第2フラグを、初期状態である(0、0)から(1、0)に更新する。 In the case of Case 6, when a signal (program) having a value of X is output from the recording medium 40, the encryption unit according to the modified example encrypts the signal by the first encryption method. , Generates a signal with a value of F (X). Then, a signal having a value of F (X) is written to the write address F of the memory 20. On the other hand, the flag updating unit 14 updates the first flag and the second flag corresponding to the address F from the initial state (0,0) to (1,0).

その後、CPU30から値がYとなる信号(初期化データ)が出力されると、変形例に係る暗号化部は、暗号化を行わない。そして、アドレスFに、値がYとなる信号が書き込まれる。すなわち、値がYとなる信号で上書き更新される。一方で、フラグ更新部14は、そのアドレスFに対応する第1フラグ、第2フラグを(1、0)から(1、1)に更新する。 After that, when a signal (initialization data) having a value of Y is output from the CPU 30, the encryption unit according to the modified example does not perform encryption. Then, a signal having a value of Y is written to the address F. That is, it is overwritten and updated with a signal whose value is Y. On the other hand, the flag updating unit 14 updates the first flag and the second flag corresponding to the address F from (1, 0) to (1, 1).

その後、CPU30から値がZとなる信号(ワークデータ)が出力されると、変形例に係る暗号化部11は、暗号化を行わない。そして、アドレスFに、値がZとなる信号が書き込まれる。すなわち、値がZとなる信号で上書き更新される。一方で、フラグ更新部14は、そのアドレスFに対応する第1フラグ、第2フラグを(1、1)から(0、1)に更新する。 After that, when a signal (work data) having a value of Z is output from the CPU 30, the encryption unit 11 according to the modified example does not perform encryption. Then, a signal having a value of Z is written to the address F. That is, it is overwritten and updated with a signal whose value is Z. On the other hand, the flag updating unit 14 updates the first flag and the second flag corresponding to the address F from (1, 1) to (0, 1).

その後、CPU30によって利用されるために、メモリ20のアドレスFから、値がZとなる信号が読み出されると、復号化部12は、アドレスFに対応する第1フラグ、第2フラグが(0、1)であり、読み出し先がCPU30であるため、復号化を行わない。 After that, when a signal having a value Z is read from the address F of the memory 20 for use by the CPU 30, the decoding unit 12 sets the first flag and the second flag (0,) corresponding to the address F. 1), and since the read destination is the CPU 30, decoding is not performed.

このように、ケース6において、CPU30は、ワークエリアとして書き込まれたデータを、正しく利用することができる。 As described above, in the case 6, the CPU 30 can correctly use the data written as the work area.

本発明は、メモリに書き込む信号を暗号化する暗号化装置、暗号化システム、及び暗号化方法に広く利用可能である。 The present invention can be widely used in an encryption device, an encryption system, and an encryption method for encrypting a signal written in a memory.

1 暗号化システム
10 暗号化装置
11 暗号化部
12 復号化部
13 フラグ記憶部
14 フラグ更新部
15 暗号化方式設定部
20 メモリ
30 CPU
40 記録媒体
1 Encryption system 10 Encryption device 11 Encryption unit 12 Decryption unit 13 Flag storage unit 14 Flag update unit 15 Encryption method setting unit 20 Memory 30 CPU
40 Recording medium

Claims (9)

メモリに書き込むプログラムを暗号化する暗号化装置であって、
記録媒体から出力された、CPUが実行する命令を含むプログラムを、前記メモリのアドレス単位で、暗号文と平文とが可逆的に1対1に対応する第1暗号化方式で暗号化する暗号化部と、
前記メモリから読み出された信号を、前記メモリのアドレス単位で、前記第1暗号化方式の逆変換である第1復号化方式で復号化する復号化部と、を備え
さらに、前記メモリの各アドレスに対応する第1フラグと第2フラグとを更新するフラグ更新部とを備え、
前記暗号化部は、さらに、CPUから出力された信号を、前記メモリのアドレス単位で、暗号文と平文とが可逆的に1対1に対応する、前記第1暗号化方式とは異なる第2暗号化方式で暗号化し、
前記フラグ更新部は、(1)前記記録媒体から出力された前記プログラムの、前記第1暗号化方式による暗号文が前記メモリに書き込まれる場合に、書き込まれるアドレスに対応する前記第1フラグを活性状態とし、(2)前記CPUから出力された信号の、前記第2暗号化方式による暗号文が前記メモリに書き込まれる場合に、書き込まれるアドレスに対応する前記第2フラグを活性状態とし(3)前記第2フラグが活性状態である場合において、前記記録媒体から出力された前記プログラムの、前記第1暗号化方式による暗号文が前記メモリに書き込まれるときに、書き込まれるアドレスに対応する前記第2フラグを非活性状態とし、(4)前記第2フラグが活性状態である場合において、前記CPUから出力された信号の、前記第2暗号化方式による暗号文が前記メモリに書き込まれるときに、書き込まれるアドレスに対応する前記第1フラグを非活性状態とし、
前記復号化部は、(1)前記メモリから信号が読み出された場合において、当該信号のアドレスに対応する前記第1フラグが活性状態で、かつ、当該アドレスに対応する前記第2フラグが非活性状態であるときに、当該信号を、前記第1復号化方式で復号化し、(2)前記メモリから信号が読み出された場合において、当該信号のアドレスに対応する前記第1フラグが活性状態で、かつ、当該アドレスに対応する前記第2フラグが活性状態であるときに、当該信号の読み出し先が前記CPUであれば、当該信号を第1復号化方式で復号化し、当該信号の読み出し先が前記記録媒体であれば、当該信号を、前記第2暗号化方式の逆変換である第2復号化方式で復号化し、(3)前記メモリから信号が読み出された場合において、当該信号のアドレスに対応する前記第1フラグが非活性状態で、かつ、当該アドレスに対応する前記第2フラグが活性状態であるときに、当該信号を、前記第2復号化方式で復号化する
暗号化装置。
An encryption device that encrypts programs that are written to memory.
Encryption that encrypts the program output from the recording medium, including the instructions executed by the CPU, by the first encryption method, which has a one-to-one correspondence between the ciphertext and the plaintext in units of the memory addresses. Department and
A decoding unit for decoding a signal read from the memory by the first decoding method, which is an inverse conversion of the first encryption method, is provided for each address of the memory.
Further, it is provided with a flag update unit for updating the first flag and the second flag corresponding to each address of the memory.
Further, the encryption unit is different from the first encryption method in which the signal output from the CPU has a one-to-one correspondence between the ciphertext and the plaintext in the address unit of the memory. Encrypt with encryption method,
The flag updater activates (1) the first flag corresponding to the address to be written when the encrypted text of the program output from the recording medium by the first encryption method is written to the memory. (2) When the ciphertext by the second encryption method of the signal output from the CPU is written to the memory, the second flag corresponding to the written address is set to the active state (3). When the second flag is in the active state, the second code corresponding to the address to be written when the encryption text of the program output from the recording medium by the first encryption method is written to the memory. The flag is set to the inactive state, and (4) when the second flag is in the active state, the signal output from the CPU is written when the encrypted text by the second encryption method is written to the memory. The first flag corresponding to the address is set to the inactive state.
In the decoding unit, (1) when a signal is read from the memory, the first flag corresponding to the address of the signal is in the active state, and the second flag corresponding to the address is not. When the signal is decoded by the first decoding method while in the active state, (2) when the signal is read from the memory, the first flag corresponding to the address of the signal is in the active state. If the read destination of the signal is the CPU when the second flag corresponding to the address is in the active state, the signal is decoded by the first decoding method and the read destination of the signal is read. If is the recording medium, the signal is decoded by the second decoding method, which is the reverse conversion of the second encryption method, and (3) when the signal is read out from the memory, the signal of the signal is decoded. When the first flag corresponding to the address is inactive and the second flag corresponding to the address is active, the signal is decoded by the second decoding method.
Cryptographic device.
前記第1暗号化方式は、前記アドレス単位の循環シフトである
請求項1に記載の暗号化装置。
The encryption device according to claim 1, wherein the first encryption method is a circular shift in units of addresses.
前記CPUの命令セットと前記第1暗号化方式との関係は、前記CPUによって実行可能な、前記命令セットに準拠する任意の前記プログラムが、前記第1暗号化方式の逆変換である前記第1復号化方式によって復号化された場合に、復号化された信号が、前記CPUによって実行不能な信号となる関係である
請求項1又は2に記載の暗号化装置。
The relationship between the instruction set of the CPU and the first encryption method is that any program conforming to the instruction set, which can be executed by the CPU, is the inverse conversion of the first encryption method . The encryption device according to claim 1 or 2, wherein the decrypted signal becomes a signal that cannot be executed by the CPU when the decryption method is used.
前記第2暗号化方式は、前記アドレス単位の循環シフトである
請求項に記載の暗号化装置。
The encryption device according to claim 1 , wherein the second encryption method is a circular shift in units of addresses.
前記CPUの命令セットと前記第1暗号化方式と前記第2暗号化方式との関係は、前記CPUによって実行可能な、前記命令セットに準拠する任意の前記プログラムが、前記第2暗号化方式によって暗号化された後に前記第1暗号化方式の逆変換である前記第1復号化方式によって復号化された場合に、復号化された信号が、前記CPUによって実行不能な信号となる関係である
請求項又はに記載の暗号化装置。
The relationship between the instruction set of the CPU, the first encryption method, and the second encryption method is such that any program conforming to the instruction set, which can be executed by the CPU, can be executed by the second encryption method. A claim that the decoded signal becomes a signal that cannot be executed by the CPU when it is encrypted and then decoded by the first decoding method , which is the reverse conversion of the first encryption method. Item 4. The encryption device according to Item 1 .
さらに、外部からの操作を受け付け、当該操作に応じて、前記第1暗号化方式及び前記第1復号化方式、又は、前記第2暗号化方式及び前記第2復号化方式を設定する暗号化方式設定部を備える
請求項1、4~5のいずれか1項に記載の暗号化装置。
Further, an encryption method that accepts an operation from the outside and sets the first encryption method and the first decryption method, or the second encryption method and the second decryption method according to the operation. The encryption device according to any one of claims 1, 4 to 5 , further comprising a setting unit.
前記暗号化方式設定部が受け付ける操作には、前記CPUによる操作が含まれない
請求項に記載の暗号化装置。
The encryption device according to claim 6 , wherein the operation accepted by the encryption method setting unit does not include the operation by the CPU.
CPUと、メモリと、記録媒体と、前記メモリに書き込むプログラムを暗号化する暗号化装置とを備え、
前記暗号化装置は、
前記記録媒体から出力された、前記CPUが実行する命令を含むプログラムを、前記メモリのアドレス単位で、暗号文と平文とが1対1に対応する第1暗号化方式で暗号化する暗号化部と、
前記メモリから読み出された信号を、前記メモリのアドレス単位で、前記第1暗号化方式の逆変換である第1復号化方式で復号化する復号化部と、を含み、
さらに、前記メモリの各アドレスに対応する第1フラグと第2フラグとを更新するフラグ更新部とを含み、
前記暗号化部は、さらに、CPUから出力された信号を、前記メモリのアドレス単位で、暗号文と平文とが可逆的に1対1に対応する、前記第1暗号化方式とは異なる第2暗号化方式で暗号化し、
前記フラグ更新部は、(1)前記記録媒体から出力された前記プログラムの、前記第1暗号化方式による暗号文が前記メモリに書き込まれる場合に、書き込まれるアドレスに対応する前記第1フラグを活性状態とし、(2)前記CPUから出力された信号の、前記第2暗号化方式による暗号文が前記メモリに書き込まれる場合に、書き込まれるアドレスに対応する前記第2フラグを活性状態とし(3)前記第2フラグが活性状態である場合において、前記記録媒体から出力された前記プログラムの、前記第1暗号化方式による暗号文が前記メモリに書き込まれるときに、書き込まれるアドレスに対応する前記第2フラグを非活性状態とし、(4)前記第2フラグが活性状態である場合において、前記CPUから出力された信号の、前記第2暗号化方式による暗号文が前記メモリに書き込まれるときに、書き込まれるアドレスに対応する前記第1フラグを非活性状態とし、
前記復号化部は、(1)前記メモリから信号が読み出された場合において、当該信号のアドレスに対応する前記第1フラグが活性状態で、かつ、当該アドレスに対応する前記第2フラグが非活性状態であるときに、当該信号を、前記第1復号化方式で復号化し、(2)前記メモリから信号が読み出された場合において、当該信号のアドレスに対応する前記第1フラグが活性状態で、かつ、当該アドレスに対応する前記第2フラグが活性状態であるときに、当該信号の読み出し先が前記CPUであれば、当該信号を第1復号化方式で復号化し、当該信号の読み出し先が前記記録媒体であれば、当該信号を、前記第2暗号化方式の逆変換である第2復号化方式で復号化し、(3)前記メモリから信号が読み出された場合において、当該信号のアドレスに対応する前記第1フラグが非活性状態で、かつ、当該アドレスに対応する前記第2フラグが活性状態であるときに、当該信号を、前記第2復号化方式で復号化する
暗号化システム。
It includes a CPU, a memory, a recording medium, and an encryption device that encrypts a program written in the memory.
The encryption device is
An encryption unit that encrypts a program output from the recording medium and including an instruction executed by the CPU by the first encryption method in which the ciphertext and the plaintext have a one-to-one correspondence with each address of the memory. When,
A decoding unit that decodes a signal read from the memory by the first decoding method, which is an inverse conversion of the first encryption method, for each address of the memory.
Further, it includes a flag update unit for updating the first flag and the second flag corresponding to each address of the memory.
Further, the encryption unit is different from the first encryption method in which the signal output from the CPU has a one-to-one correspondence between the ciphertext and the plaintext in the address unit of the memory. Encrypt with encryption method,
The flag updater activates (1) the first flag corresponding to the address to be written when the encrypted text of the program output from the recording medium by the first encryption method is written to the memory. (2) When the ciphertext by the second encryption method of the signal output from the CPU is written to the memory, the second flag corresponding to the written address is set to the active state (3). When the second flag is in the active state, the second code corresponding to the address to be written when the encryption text by the first encryption method of the program output from the recording medium is written to the memory. The flag is set to the inactive state, and (4) when the second flag is in the active state, the signal output from the CPU is written when the encrypted text by the second encryption method is written to the memory. The first flag corresponding to the address is set to the inactive state.
In the decoding unit, (1) when a signal is read from the memory, the first flag corresponding to the address of the signal is in the active state, and the second flag corresponding to the address is not. When the signal is decoded by the first decoding method while in the active state, (2) when the signal is read from the memory, the first flag corresponding to the address of the signal is in the active state. If the read destination of the signal is the CPU when the second flag corresponding to the address is in the active state, the signal is decoded by the first decoding method and the read destination of the signal is read. If is the recording medium, the signal is decoded by the second decoding method, which is the reverse conversion of the second encryption method, and (3) when the signal is read out from the memory, the signal of the signal is decoded. When the first flag corresponding to the address is inactive and the second flag corresponding to the address is active, the signal is decoded by the second decoding method.
Cryptographic system.
メモリに書き込むプログラムを暗号化する暗号化方法であって、
記録媒体から出力された、CPUが実行する命令を少なくとも含むプログラムを、前記メモリのアドレス単位で、暗号文と平文とが1対1に対応する第1暗号化方式で暗号化する暗号化ステップと、
前記メモリから読み出された信号を、前記メモリのアドレス単位で、前記第1暗号化方式の逆変換である第1復号化方式で復号化する復号化ステップと、を含み、
さらに、前記メモリの各アドレスに対応する第1フラグと第2フラグとを更新するフラグ更新ステップとを含み、
前記暗号化ステップでは、さらに、CPUから出力された信号を、前記メモリのアドレス単位で、暗号文と平文とが可逆的に1対1に対応する、前記第1暗号化方式とは異なる第2暗号化方式で暗号化し、
前記フラグ更新ステップでは、(1)前記記録媒体から出力された前記プログラムの、前記第1暗号化方式による暗号文が前記メモリに書き込まれる場合に、書き込まれるアドレスに対応する前記第1フラグを活性状態とし、(2)前記CPUから出力された信号の、前記第2暗号化方式による暗号文が前記メモリに書き込まれる場合に、書き込まれるアドレスに対応する前記第2フラグを活性状態とし(3)前記第2フラグが活性状態である場合において、前記記録媒体から出力された前記プログラムの、前記第1暗号化方式による暗号文が前記メモリに書き込まれるときに、書き込まれるアドレスに対応する前記第2フラグを非活性状態とし、(4)前記第2フラグが活性状態である場合において、前記CPUから出力された信号の、前記第2暗号化方式による暗号文が前記メモリに書き込まれるときに、書き込まれるアドレスに対応する前記第1フラグを非活性状態とし、
前記復号化ステップでは、(1)前記メモリから信号が読み出された場合において、当該信号のアドレスに対応する前記第1フラグが活性状態で、かつ、当該アドレスに対応する前記第2フラグが非活性状態であるときに、当該信号を、前記第1復号化方式で復号化し、(2)前記メモリから信号が読み出された場合において、当該信号のアドレスに対応する前記第1フラグが活性状態で、かつ、当該アドレスに対応する前記第2フラグが活性状態であるときに、当該信号の読み出し先が前記CPUであれば、当該信号を第1復号化方式で復号化し、当該信号の読み出し先が前記記録媒体であれば、当該信号を、前記第2暗号化方式の逆変換である第2復号化方式で復号化し、(3)前記メモリから信号が読み出された場合において、当該信号のアドレスに対応する前記第1フラグが非活性状態で、かつ、当該アドレスに対応する前記第2フラグが活性状態であるときに、当該信号を、前記第2復号化方式で復号化する
暗号化方法。
An encryption method that encrypts a program that writes to memory.
An encryption step of encrypting a program output from a recording medium including at least an instruction executed by a CPU by a first encryption method in which a ciphertext and a plaintext have a one-to-one correspondence for each address of the memory. ,
A decoding step of decoding a signal read from the memory by the first decoding method, which is an inverse conversion of the first encryption method, is included in the address unit of the memory.
Further, it includes a flag update step for updating the first flag and the second flag corresponding to each address of the memory.
In the encryption step, further, the signal output from the CPU has a one-to-one correspondence between the ciphertext and the plaintext in the address unit of the memory, which is different from the first encryption method. Encrypt with encryption method,
In the flag update step, (1) when the encryption text of the program output from the recording medium by the first encryption method is written to the memory, the first flag corresponding to the written address is activated. (2) When the ciphertext by the second encryption method of the signal output from the CPU is written to the memory, the second flag corresponding to the written address is set to the active state (3). When the second flag is in the active state, the second code corresponding to the address to be written when the encryption text by the first encryption method of the program output from the recording medium is written to the memory. The flag is set to the inactive state, and (4) when the second flag is in the active state, the signal output from the CPU is written when the encrypted text by the second encryption method is written to the memory. The first flag corresponding to the address is set to the inactive state.
In the decoding step, (1) when the signal is read from the memory, the first flag corresponding to the address of the signal is in the active state, and the second flag corresponding to the address is not. When the signal is decoded by the first decoding method while in the active state, (2) when the signal is read from the memory, the first flag corresponding to the address of the signal is in the active state. If the read destination of the signal is the CPU when the second flag corresponding to the address is in the active state, the signal is decoded by the first decoding method and the read destination of the signal is read. If is the recording medium, the signal is decoded by the second decoding method, which is the reverse conversion of the second encryption method, and (3) when the signal is read out from the memory, the signal of the signal is decoded. When the first flag corresponding to the address is inactive and the second flag corresponding to the address is active, the signal is decoded by the second decoding method.
Encryption method.
JP2018044143A 2018-03-12 2018-03-12 Cryptographic device, encryption system, and encryption method Active JP7101500B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2018044143A JP7101500B2 (en) 2018-03-12 2018-03-12 Cryptographic device, encryption system, and encryption method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2018044143A JP7101500B2 (en) 2018-03-12 2018-03-12 Cryptographic device, encryption system, and encryption method

Publications (2)

Publication Number Publication Date
JP2019161389A JP2019161389A (en) 2019-09-19
JP7101500B2 true JP7101500B2 (en) 2022-07-15

Family

ID=67994982

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2018044143A Active JP7101500B2 (en) 2018-03-12 2018-03-12 Cryptographic device, encryption system, and encryption method

Country Status (1)

Country Link
JP (1) JP7101500B2 (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2010039576A (en) 2008-07-31 2010-02-18 Mutsumi Ogawa Memory management method
JP2010193341A (en) 2009-02-20 2010-09-02 Fujitsu Semiconductor Ltd Information processing apparatus and tamper preventing circuit
JP2012004661A (en) 2010-06-14 2012-01-05 Fujitsu Semiconductor Ltd Processor and processor system
JP2012234362A (en) 2011-04-28 2012-11-29 Fujitsu Ltd Information processing device, secure module, information processing method and information processing program
US20170364688A1 (en) 2016-06-20 2017-12-21 Intel Corporation Technologies for trusted i/o protection of i/o data with header information

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2010039576A (en) 2008-07-31 2010-02-18 Mutsumi Ogawa Memory management method
JP2010193341A (en) 2009-02-20 2010-09-02 Fujitsu Semiconductor Ltd Information processing apparatus and tamper preventing circuit
JP2012004661A (en) 2010-06-14 2012-01-05 Fujitsu Semiconductor Ltd Processor and processor system
JP2012234362A (en) 2011-04-28 2012-11-29 Fujitsu Ltd Information processing device, secure module, information processing method and information processing program
US20170364688A1 (en) 2016-06-20 2017-12-21 Intel Corporation Technologies for trusted i/o protection of i/o data with header information

Also Published As

Publication number Publication date
JP2019161389A (en) 2019-09-19

Similar Documents

Publication Publication Date Title
JP4500306B2 (en) Apparatus and method for memory encryption with reduced decryption latency
JP4767985B2 (en) Executing AES encryption or decryption in multiple modes with a single instruction
JP4551802B2 (en) Processor, memory, computer system, and data transfer method
JP6046360B2 (en) Sensitive data encryption and storage
US20160078252A1 (en) Address dependent data encryption
JP2010509690A (en) Method and system for ensuring security of storage device
JP4758904B2 (en) Confidential information processing method
JP2006085676A (en) Encryption instruction processing apparatus
WO2019120293A1 (en) Off-chip memory address scrambling apparatus and method for system on chip
TW201918923A (en) Secure logic system and method for operating a secure logic system
JP2023510311A (en) memory-based encryption
KR101496975B1 (en) Solid-state-disk and input/output method thereof
JP2007501481A (en) Recording medium having encryption instruction information
JPH06243046A (en) Information protection method and information media
JP7101500B2 (en) Cryptographic device, encryption system, and encryption method
KR20180059217A (en) Apparatus and method for secure processing of memory data
WO2019087309A1 (en) Information processing device, method for controlling information processing device, and program
JP2009175880A (en) Information processing apparatus and program
CN109902492B (en) Method for writing encryption information set in integrated circuit external memory and integrated circuit
KR20060030838A (en) Apparatus and method for storing data securly
JP5395838B2 (en) Multi-core system
JP2005172866A (en) Encryption/decryption system
JP6012355B2 (en) Control device, control system, data storage method and program
JP6521499B2 (en) Cryptographic processing apparatus, semiconductor memory and memory system
JP2008283660A (en) Optical storage media and corresponding cryptography for data encryption thereof

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20210212

A711 Notification of change in applicant

Free format text: JAPANESE INTERMEDIATE CODE: A712

Effective date: 20210212

Free format text: JAPANESE INTERMEDIATE CODE: A711

Effective date: 20210212

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20210301

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A821

Effective date: 20210215

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20211130

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20211214

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20220202

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: 20220614

R150 Certificate of patent or registration of utility model

Ref document number: 7101500

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150