JP7101500B2 - Cryptographic device, encryption system, and encryption method - Google Patents
Cryptographic device, encryption system, and encryption method Download PDFInfo
- 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
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,
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.
(本発明の一態様を得るに至った経緯)
発明者は、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
このため、上記暗号化装置によると、従来の暗号化技術を利用する場合よりも、より回路規模が少ない暗号化装置を実現し得る。 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
図1に示されるように、暗号化システム1は、暗号化装置10と、メモリ20と、CPU30と、記録媒体40とを含んで構成される。
As shown in FIG. 1, the
CPU30は、いわゆるプロセッサと呼ばれる情報処理装置であって、例えば、半導体集積回路によって実現される。CPU30は、例えば、CPUコアとキャッシュメモリとを含んで構成されてもよい。
The
記録媒体40は、CPU30によって利用されるプログラム、データ等を記録する記録媒体である。記録媒体40は、CPU30によって利用されるプログラム、データ等を記録することができれば、どのような記録媒体であってもよい。記録媒体40は、例えば、ハードディスクドライブ(HDD:Hard Disk Drive)であってもよいし、ブルーレイディスク(登録商標)であってもよい。ここでは、記録媒体40が記憶するプログラムには、CPU30が実行する命令が、少なくとも1つ含まれている。
The
メモリ20は、CPU30のメインメモリとして利用されるメモリである。メモリ20は、例えば、半導体集積回路によって実現される。メモリ20は、CPU30のメインメモリとして利用されるものであれば、どのようなメモリであってもよい。メモリ20は、例えば、DRAM(Dynamic Random Access Memory)であってもよいし、SRAM(Static Random Access Memory)であってもよい。
The
メモリ20は、例えば、記録媒体40に記録されているプログラムがロードされるプログラム記憶領域として機能する。また、メモリ20は、例えば、CPUが一時的に利用するデータのワークエリアとして機能する。また、メモリ20は、例えば、記録媒体40に記録されているデータのディスクキャッシュとして機能する。
The
暗号化装置10は、メモリ20に書き込む信号を暗号化し、メモリ20から読み出された信号を復号化する。暗号化装置10は、例えば、専用ハードウエアからなる半導体集積回路によって実現されてもよいし、プロセッサとメモリとを含み、メモリに記憶されるプログラムをプロセッサが実行することによって実現されてもよい。
The
以下、暗号化装置10について、図面を用いて詳細に説明する。
Hereinafter, the
図2は、暗号化装置10の構成を示すブロック図である。
FIG. 2 is a block diagram showing the configuration of the
図2に示されるように、暗号化装置10は、暗号化部11と、復号化部12と、フラグ記憶部13と、フラグ更新部14と、暗号化方式設定部15とを含んで構成される。
As shown in FIG. 2, the
暗号化部11は、記録媒体40から出力された信号を、メモリ20のアドレス単位で、暗号文と平文とが可逆的に1対1に対応する第1暗号化方式で暗号化する。
The
図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
図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
以下では、説明をわかりやすくするために、第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
図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
図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
以下では、説明をわかりやすくするために、第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
ここでは、第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
フラグ更新部14は、メモリ20の各アドレスに対応する第1フラグと第2フラグとを更新する。
The flag update unit 14 updates the first flag and the second flag corresponding to each address of the
より具体的には、フラグ更新部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
復号化部12は、メモリ20から出力された信号を、メモリ20のアドレス単位で、第1暗号化方式の逆変換である第1復号化方式、又は第2暗号化方式の逆変換である第2復号化方式で復号化する。
The
図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
以下では、説明をわかりやすくするために、第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暗号化方式の逆変換であることから、
F-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
以下では、説明をわかりやすくするために、第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暗号化方式の逆変換であることから、
G-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
暗号化方式設定部15は、外部からの操作を受け付け、受け付けた操作に応じて、第1暗号化方式及び第1復号化方式、又は、第2暗号化方式及び第2復号化方式を設定する。
The encryption
暗号化方式設定部15は、例えば、タッチパネルを含み、暗号化装置10を利用するユーザからのタッチ操作を受け付けることで外部からの操作を受け付けるとしてもよい。また、暗号化方式設定部15は、例えば、外部機器(例えば、スマートフォン)と通信可能な通信回路を含み、外部機器による操作信号を受信することで外部からの操作を受け付けるとしてもよい。また、暗号化方式設定部15は、例えば、ディップスイッチを含み、暗号化装置10を利用するユーザからのスイッチ切り替え操作を受け付けることで外部からの操作を受け付けるとしてもよい。
For example, the encryption
但し、暗号化方式設定部15が受け付ける操作には、CPU30による操作が含まれないことが望ましい。これは、CPU30による悪意のある操作を受け付けてしまうことにより発生し得る、暗号化システム1におけるセキュリティホールを未然に防止するためである。
However, it is desirable that the operation accepted by the encryption
以下、上記構成の暗号化システム1が行う動作について、図面を参照しながら説明する。
Hereinafter, the operation performed by the
[2.動作]
まず、記録媒体40からメモリ20にロードされたプログラムを、CPU30が実行しようとする場合(以下、「ケース1」と呼ぶ。)における暗号化システム1の動作について説明する。
[2. motion]
First, the operation of the
図5は、ケース1における暗号化システム1の動作を示す模式図である。
FIG. 5 is a schematic diagram showing the operation of the
図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
その後、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
このように、ケース1において、CPU30は、記録媒体40からメモリ20にロードされたプログラムを、正しく実行することができる。
As described above, in
次に、記録媒体40からメモリ20のディスクキャッシュ領域に書き込まれたデータを、値を更新することなく、記録媒体40へライトバックしようとする場合(以下、「ケース2」呼ぶ。)における暗号化システム1の動作について説明する。
Next, encryption in the case where the data written from the
図6は、ケース2における暗号化システム1の動作を示す模式図である。
FIG. 6 is a schematic diagram showing the operation of the
図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
その後、記録媒体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
このように、ケース2において、記録媒体40は、正しくライトバックされることとなる。
As described above, in the case 2, the
次に、記録媒体40からメモリ20のディスクキャッシュ領域に書き込まれたデータを、CPU30が値を更新した後に、記録媒体40へライトバックしようとする場合(以下、「ケース3」呼ぶ。)における暗号化システム1の動作について説明する。
Next, the encryption in the case where the data written from the
図7は、ケース3における暗号化システム1の動作を示す模式図である。
FIG. 7 is a schematic diagram showing the operation of the
図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
その後、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
その後、記録媒体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
このように、ケース3において、記録媒体40は、正しくライトバックされることとなる。
As described above, in the case 3, the
次に、記録媒体40からメモリ20にロードされたプログラムを、CPU30が不正なプログラムに書き換えた後に、CPU30がその不正なプログラムを実行しようとする場合(以下、「ケース4」と呼ぶ。)における暗号化システム1の動作について説明する。
Next, in a case where the
図8は、ケース4における暗号化システム1の動作を示す模式図である。
FIG. 8 is a schematic diagram showing the operation of the
図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
その後、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
その後、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
この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
このように、ケース4において、CPU30は、不正なプログラムを実行しない。
Thus, in Case 4, the
なお、このとき、値が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
次に、CPU30がメモリ20に不正なプログラムを書き込んだ後に、その不正なプログラムを記録媒体40からメモリ20にロードされたプログラムで更新し、さらにその後、CPU30がその更新されたプログラムを実行しようとする場合(以下、「ケース5」と呼ぶ。)における暗号化システム1の動作について説明する。
Next, after the
図9は、ケース5における暗号化システム1の動作を示す模式図である。
FIG. 9 is a schematic diagram showing the operation of the
図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
その後、記録媒体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
その後、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
このように、ケース5において、CPU30は、記録媒体40からメモリ20にロードされたプログラムを、正しく実行することができる。
As described above, in the case 5, the
次に、記録媒体40からメモリ20にロードされたプログラムを、CPU30が初期化した後に、CPU30によって、ワークエリアとしてデータが書き込まれ、さらにその後、CPU30によってそのデータ利用しようとする場合(以下、「ケース6」と呼ぶ。)における暗号化システム1の動作について説明する。
Next, when the program loaded from the
図10は、ケース6における暗号化システム1の動作を示す模式図である。
FIG. 10 is a schematic diagram showing the operation of the
図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
その後、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
その後、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
その後、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
このように、ケース6において、CPU30は、ワークエリアとして書き込まれたデータを、正しく利用することができる。
As described above, in the case 6, the
[3.効果]
上記構成の暗号化装置10によると、ケース4、ケース5に示されるように、CPU30の実行対象とするプログラムを記憶するメモリ20に悪意のあるプログラムが書き込まれてしまったとしても、そのCPUに30よるその悪意のあるプログラムの実行を抑止し得る。
[3. effect]
According to the
また、上記構成の暗号化装置10によると、ケース1、ケース2、ケース3、ケース6に示されるように、CPU30の実行対象とするプログラムを記憶するメモリ20に悪意のあるプログラムが書き込まれない場合には、CPU30は、正常な動作を行う。
Further, according to the
(補足)
以上のように、本出願において開示する技術の例示として、実施の形態について説明した。しかしながら本発明による技術は、これらに限定されず、適宜、変更、置き換え、付加、省略等を行った実施の形態にも適用可能である。
(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
これに対して、本変形例では、変形例に係る暗号化部は、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
ここでは、第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)として表現すると
G-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
暗号化部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
また、この変形例に係る暗号化装置によると、暗号化装置10と同様に、ケース1、ケース2、ケース3、ケース6に示されるように、CPU30の実行対象とするプログラムを記憶するメモリ20に悪意のあるプログラムが書き込まれない場合には、CPU30は、正常な動作を行う。
Further, according to the encryption device according to this modification, as shown in
以下、ケース1~ケース6のそれぞれについて、暗号化装置10の替わりに上記変形例に係る暗号化装置を備える、変形例に係る暗号化システムの行う動作について説明する。
Hereinafter, in each of the
ケース1、ケース2の場合には、第2暗号化方式による暗号化、及び第2復号化方式による復号化は行われない。このため、変形例に係る暗号化システムは、暗号化システム1と同様の動作を行う。
In the cases of
ケース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
その後、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
その後、記録媒体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
このように、ケース3において、記録媒体40は、正しくライトバックされることとなる。
As described above, in the case 3, the
ケース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
その後、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
その後、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
この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
このように、ケース4において、CPU30は、不正なプログラムを実行しない。
Thus, in Case 4, the
なお、このとき、値が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
ケース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
その後、記録媒体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
その後、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
このように、ケース5において、CPU30は、記録媒体40からメモリ20にロードされたプログラムを、正しく実行することができる。
As described above, in the case 5, the
ケース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
その後、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
その後、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
その後、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
このように、ケース6において、CPU30は、ワークエリアとして書き込まれたデータを、正しく利用することができる。
As described above, in the case 6, the
本発明は、メモリに書き込む信号を暗号化する暗号化装置、暗号化システム、及び暗号化方法に広く利用可能である。 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
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に記載の暗号化装置。 The encryption device according to claim 1, wherein the first encryption method is a circular shift in units of addresses.
請求項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.
請求項1に記載の暗号化装置。 The encryption device according to claim 1 , wherein the second encryption method is a circular shift in units of addresses.
請求項1又は4に記載の暗号化装置。 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、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.
請求項6に記載の暗号化装置。 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が実行する命令を含むプログラムを、前記メモリのアドレス単位で、暗号文と平文とが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.
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)
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 |
-
2018
- 2018-03-12 JP JP2018044143A patent/JP7101500B2/en active Active
Patent Citations (5)
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 |