JP2005275694A - Method and protection system for protecting program from internal analysis - Google Patents

Method and protection system for protecting program from internal analysis Download PDF

Info

Publication number
JP2005275694A
JP2005275694A JP2004086688A JP2004086688A JP2005275694A JP 2005275694 A JP2005275694 A JP 2005275694A JP 2004086688 A JP2004086688 A JP 2004086688A JP 2004086688 A JP2004086688 A JP 2004086688A JP 2005275694 A JP2005275694 A JP 2005275694A
Authority
JP
Japan
Prior art keywords
program
key
decryption key
encryption
encrypted
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.)
Pending
Application number
JP2004086688A
Other languages
Japanese (ja)
Inventor
Tatsuya Asazu
達也 浅図
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Hitachi Software Engineering Co Ltd
Original Assignee
Hitachi Software Engineering Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Hitachi Software Engineering Co Ltd filed Critical Hitachi Software Engineering Co Ltd
Priority to JP2004086688A priority Critical patent/JP2005275694A/en
Publication of JP2005275694A publication Critical patent/JP2005275694A/en
Pending legal-status Critical Current

Links

Images

Abstract

<P>PROBLEM TO BE SOLVED: To provide a technique for protection from internal analysis by hiding internal processing of a program executed in a text format from a user, and executing the program in a hidden form. <P>SOLUTION: A sending side system 1 sends a program PR1 enciphered by a first cipher key K1A, and a first decipher key K1B enciphered by a second cipher key K2A to a receiving side system 2, the receiving side system 2 extracts the first decipher key K1B by a second decipher key K2B hidden in an interior, the program PR1 is extracted by using the decipher key K1B, and the program PR1 is internally executed. <P>COPYRIGHT: (C)2006,JPO&NCIPI

Description

本発明は、プログラムを内部解析から保護する技術に関し、特に、テキスト形式のような非バイナリ系の言語で実行されるプログラムを第3者などによる内部解析から保護する技術に関する。   The present invention relates to a technique for protecting a program from internal analysis, and more particularly, to a technique for protecting a program executed in a non-binary language such as a text format from internal analysis by a third party.

従来、プログラムを内部解析から保護する方法として、例えば、特許文献1に記載の技術が知られている。この技術は、仮想オペレーションコードを実行する仮想機械を実装するためのコードを生成し、プログラムのソースコードを仮想オペレーションコードからなる仮想オブジェクトコードに変換し、仮想オブジェクトコードを暗号化し、この暗号化仮想オブジェクトコードを復号するコードを生成する。これにより、プログラムを内部解析から保護することができる。   Conventionally, as a method for protecting a program from internal analysis, for example, a technique described in Patent Document 1 is known. This technology generates code for implementing a virtual machine that executes virtual operation code, converts the source code of the program into virtual object code consisting of virtual operation code, encrypts the virtual object code, A code for decoding the object code is generated. As a result, the program can be protected from internal analysis.

特開2002−132364号公報JP 2002-132364 A

しかしながら、特開2002−132364号公報に記載の方法は、C言語などで代表されるコンパイラ型言語のプログラムを対象とした技術であり、インタプリタ型言語のプログラムや、Perlなどに代表されるようなスクリプト型プログラムなど、テキスト形式のままで実行されるプログラムの内部処理を隠蔽することはできない。すなわち、プログラム処理がテキスト形式のままで実行されると、簡単にその内部処理を解析することができてしまうという問題がある。   However, the method described in Japanese Patent Laid-Open No. 2002-132364 is a technique for a compiler language program represented by C language and the like, and is represented by an interpreter language program, Perl, and the like. It is impossible to hide the internal processing of a program that is executed in a text format such as a script type program. That is, if the program process is executed in the text format, the internal process can be easily analyzed.

本発明の目的は、テキスト形式のままで実行されるプログラムの内部処理を利用者から隠蔽し、隠蔽したままの形式でプログラムを実行することにより内部解析から保護する技術を提供することである。   An object of the present invention is to provide a technique for protecting internal processing of a program executed in a text format from the user by hiding the internal processing from the user and executing the program in the hidden format.

本発明の一観点によれば、プログラムを実行するプログラム処理系においてプログラムを内部解析から保護する方法であって、暗号化された暗号化プログラムを読み込むステップと、前記プログラム処理系内に隠蔽された復号鍵に基づいて前記暗号化プログラムを復号し復号済プログラムを得るステップとを有する方法が提供される。   According to one aspect of the present invention, there is provided a method for protecting a program from internal analysis in a program processing system that executes the program, the step of reading an encrypted program encrypted, and concealed in the program processing system And decrypting the encrypted program based on a decryption key to obtain a decrypted program.

また、プログラムを実行するプログラム処理系においてプログラムを内部解析から保護する方法であって、第1の暗号鍵を用いて暗号化した暗号化プログラムを読み込むステップと、前記第1の暗号鍵とともに第1の鍵セットを構成する第1の復号鍵を前記第1の暗号鍵とは異なる第2の暗号鍵により暗号化した暗号化復号鍵を読み込むステップと、プログラム処理系内に隠蔽され前記第2の暗号鍵とともに第2の鍵セットを構成する第2の復号鍵に基づいて前記暗号化復号鍵を復号し復号済の第1の復号鍵を得るステップと、前記復号済の第1の復号鍵により前記暗号化プログラムを復号し復号済プログラムを得るステップとを有する方法が提供される。   A method of protecting a program from internal analysis in a program processing system that executes the program, the step of reading an encrypted program encrypted using a first encryption key, and a first together with the first encryption key A step of reading an encryption / decryption key obtained by encrypting a first decryption key constituting the key set with a second encryption key different from the first encryption key; A step of decrypting the encrypted decryption key based on a second decryption key that constitutes a second key set together with the encryption key to obtain a decrypted first decryption key; and the decrypted first decryption key, And decrypting the encrypted program to obtain a decrypted program.

本発明の他の観点によれば、第1のプログラムを暗号化する第1の暗号化処理によって得られる暗号化プログラムと、第1の復号鍵を暗号化する第2の暗号化処理によって得られる暗号化復号鍵と、復号および実行処理系を実現する第2のプログラムであって、その内部に前記暗号化復号鍵を復号する第2の復号鍵を有し、該第2の復号鍵によって前記暗号化復号鍵を復号し、得られた復号済みの前記第1の復号鍵により前記暗号化プログラムを復号し、得られて復号済みの第1のプログラムにより処理を実行する第2のプログラムとを有するシステムが提供される。   According to another aspect of the present invention, the encryption program obtained by the first encryption process for encrypting the first program and the second encryption process for encrypting the first decryption key are obtained. An encryption / decryption key and a second program for realizing a decryption / execution processing system, the second program having a second decryption key for decrypting the encryption / decryption key, and the second decryption key A second program for decrypting an encrypted decryption key, decrypting the encrypted program with the obtained decrypted first decryption key, and executing a process with the obtained first decrypted program A system is provided.

また、プログラムを内部解析から保護する機構を有するシステムであって、暗号化された暗号化プログラムを出力する暗号化プログラム出力手段と、プログラムを実行するプログラム処理系であって、その内部に隠蔽された状態の復号鍵と、受け取った前記暗号化プログラムを前記復号鍵に基づいて復号する復号化手段と、を有するプログラム処理系とを備えたシステムが提供される。   The system has a mechanism for protecting the program from internal analysis, and includes an encrypted program output means for outputting the encrypted program and a program processing system for executing the program, which are concealed inside the system. There is provided a system comprising a program processing system having a decryption key in a state in which the decryption key is received and decryption means for decrypting the received encrypted program based on the decryption key.

また、プログラムを内部解析から保護する機構を有するシステムであって、前記プログラムを暗号化し暗号化プログラムを作成する第1の暗号鍵と、該第1の暗号鍵とともに第1の鍵セットを構成する第1の復号鍵と、前記第1の復号鍵を暗号化し暗号化復号鍵を作成する第2の暗号鍵と、プログラムを実行するプログラム処理系内に隠蔽され前記暗号化復号鍵を復号する第2の復号鍵と、を含む第2の鍵セットと、 前記暗号化プログラムと前記暗号化復号鍵とを取得して前記第2の復号鍵により前記暗号化復号鍵を復号して得た復号済復号鍵を用いて前記暗号化プログラムを復号し復号済プログラムを作成し、該復号済プログラムにより処理を実行するプログラム処理系とを備えたシステムが提供される。   A system having a mechanism for protecting a program from internal analysis, the first encryption key for encrypting the program to create an encrypted program, and a first key set together with the first encryption key A first decryption key; a second encryption key that encrypts the first decryption key to create an encrypted decryption key; and a second decryption key that is concealed in a program processing system that executes a program and decrypts the encrypted decryption key A decryption key obtained by obtaining the second decryption key, the encryption program and the decryption key, and decrypting the decryption key with the second decryption key A system is provided that includes a program processing system that decrypts the encrypted program using a decryption key, creates a decrypted program, and executes processing by the decrypted program.

以上、本発明によれば、プログラムの内部処理を隠蔽し、第3者による内部解析からプログラムの内容を保護し、そのままの形態でプログラムを実行できるようになるという利点がある。   As described above, according to the present invention, there is an advantage that the internal processing of the program is hidden, the contents of the program are protected from the internal analysis by a third party, and the program can be executed as it is.

本明細書において、送信側とは、プログラムを暗号化し送信する側を指す。受信側とは、プログラムを受信して復号し実行する側を指す。   In this specification, the transmission side refers to the side that encrypts and transmits the program. The receiving side refers to the side that receives, decodes and executes the program.

以下、本発明の実施の形態によるプログラムを内部解析から保護するための構成について図面を参照しつつ説明を行う。図1は本実施の形態によるプログラムを内部解析から保護する保護システムの構成例を示す図である。図1に示すように実施の形態による保護システムは、暗号送信側システム1と、受信側システム2及びその間をつなぐネットワーク3と、を含んで構成される。送信側システム1は、送信するプログラムを作成する際などに使用する入力装置11及び出力装置12と、処理部13と、で構成される。処理部13には、第1鍵セット生成部131と、暗号化処理部132と、送信部133と、第2暗号鍵保持部134と、が含まれる。受信側システム2は、入力装置21と、出力装置22と、処理部23と、を有しており、処理部23は復号処理部231と、復号済プログラム実行部232と、受信部233と、第2復号鍵保持部234と、を含む。送信側システム1の第1鍵セット生成部131、暗号化処理部132、送信部133、受信側システムの復号処理部231、復号済プログラム実行部232、受信部233は、それぞれプログラムとして実装され、送信側システム1の第2暗号鍵保持部134、受信側システム2の第2復号鍵保持部234は、図示しない記憶装置内に生成される。処理部13及び処理部23には、その他プログラム実行のための中央処理装置なども含まれるが、自明であるため図示はしていない。また、本実施の形態では受信側システム2が1つの場合についてのみ説明を行うが複数の受信側システム2が存在してもよい。   Hereinafter, a configuration for protecting a program according to an embodiment of the present invention from internal analysis will be described with reference to the drawings. FIG. 1 is a diagram showing a configuration example of a protection system for protecting a program according to the present embodiment from internal analysis. As shown in FIG. 1, the protection system according to the embodiment includes an encryption transmission side system 1, a reception side system 2, and a network 3 that connects the reception side system 2. The transmission-side system 1 includes an input device 11 and an output device 12 that are used when creating a program to be transmitted, and a processing unit 13. The processing unit 13 includes a first key set generation unit 131, an encryption processing unit 132, a transmission unit 133, and a second encryption key holding unit 134. The reception-side system 2 includes an input device 21, an output device 22, and a processing unit 23. The processing unit 23 includes a decryption processing unit 231, a decrypted program execution unit 232, a reception unit 233, A second decryption key holding unit 234. The first key set generation unit 131, the encryption processing unit 132, the transmission unit 133, the decryption processing unit 231, the decrypted program execution unit 232, and the reception unit 233 of the transmission side system 1 are each implemented as a program. The second encryption key holding unit 134 of the transmission side system 1 and the second decryption key holding unit 234 of the reception side system 2 are generated in a storage device (not shown). The processing unit 13 and the processing unit 23 include other central processing units for program execution, but are not shown because they are obvious. In this embodiment, only the case where there is one receiving system 2 will be described, but a plurality of receiving systems 2 may exist.

図2は、本実施の形態によるプログラムを内部解析から保護する保護システムの処理手順を示すブロック図である。本実施の形態によるプログラムを内部解析から保護するシステムでは、公開鍵暗号系の鍵セットを2セット利用する。尚、公開鍵暗号系には、素因数分解を利用した系、楕円曲線を利用した系など様々な種類の系が存在するが、その種類は問わない。   FIG. 2 is a block diagram showing a processing procedure of a protection system that protects a program according to the present embodiment from internal analysis. In the system for protecting the program from the internal analysis according to the present embodiment, two sets of public key cryptosystem key sets are used. There are various types of public key cryptosystems such as a system using prime factorization and a system using elliptic curves, but the type is not limited.

第1鍵セットK1は、送信側システム1が提供するプログラムPR1に関するセキュリティの管理を行うために設けられ、送信側システム1において任意のパスフレーズを設定し準備することができる。この第1鍵セットK1は暗号通信の安全性を高めるため、プログラムの送付の度に毎回作りなおすようにすることが望ましい。一方、第2鍵セットK2は、暗号化されたプログラム(暗号化プログラム)PR2を復号処理しプログラムに基づく処理を実行するための受信側システム2で利用するものであり、送信側システム1には、第2鍵セットK2のうち暗号鍵K2Aのみが開示される。第2鍵セットK2のうちの復号鍵K2Bは、受信側システム2の内部にのみ保持されており、受信側システム2の利用者が参照することはできない。本実施の形態では第2の鍵セットは受信側システム2毎に固定でユニークなものであることにするが、受信側システムにも第2鍵セット生成部を実装し、送信側からプログラム送信の通知がある毎に第2の鍵セットを生成し暗号鍵を送信側システムに提供するようにしてもよい。   The first key set K1 is provided for managing security related to the program PR1 provided by the transmission side system 1, and can set and prepare an arbitrary passphrase in the transmission side system 1. This first key set K1 is preferably regenerated every time a program is sent in order to increase the security of cryptographic communication. On the other hand, the second key set K2 is used in the receiving system 2 for decrypting the encrypted program (encrypted program) PR2 and executing processing based on the program. Only the encryption key K2A in the second key set K2 is disclosed. The decryption key K2B in the second key set K2 is held only in the receiving system 2 and cannot be referred to by the user of the receiving system 2. In the present embodiment, the second key set is fixed and unique for each receiving-side system 2, but the receiving-side system is also equipped with a second key set generation unit, so that the program can be transmitted from the sending side. A second key set may be generated each time there is a notification, and an encryption key may be provided to the transmitting system.

以下、図2と図1とを参照して上記プログラムを内部解析から保護するシステムにおける処理の流れについて説明を行う。まず送信側利用者が、入力装置11などを使用して受信側システムに送信するプログラムPR1を作成する。プログラムPR1は、内部解析を保護する必要性のあるプログラムであり、その内容はPerlなどのスクリプト言語やオペレーティングシステムが提供するコマンドを羅列したテキスト形式のバッチ処理プログラムであるため、そのままではその内部処理はプログラムを渡される受信側システムの利用者も簡単に参照することができてしまう。次に、第1鍵セット生成部131がプログラムPR1を保護・管理するための鍵セットK1を生成する。鍵セットK1は第1の暗号鍵K1Aと第1の復号鍵K1Bとからなる公開鍵暗号系の鍵セットである。次に、暗号化処理S1において暗号化処理部132が第1の暗号鍵K1Aを用いてプログラムPR1を暗号化し、暗号化プログラムPR2を作成する。   The flow of processing in the system that protects the program from internal analysis will be described below with reference to FIGS. First, the transmission side user creates a program PR1 to be transmitted to the reception side system using the input device 11 or the like. The program PR1 is a program that needs to protect internal analysis, and its contents are a batch processing program in a text format that lists commands provided by a script language such as Perl or an operating system. Can be easily referred to by the user of the receiving system to which the program is passed. Next, the first key set generation unit 131 generates a key set K1 for protecting and managing the program PR1. The key set K1 is a public key cryptosystem key set composed of a first encryption key K1A and a first decryption key K1B. Next, in the encryption process S1, the encryption processing unit 132 encrypts the program PR1 using the first encryption key K1A to create an encryption program PR2.

次いで、暗号化処理S2において受信側システム2が提供し(換言すれば受信側システム2内に隠蔽された復号鍵K2Bとセットになった)第2暗号鍵保持部134に格納されている第2の暗号鍵K2Aを用いて暗号化処理部132が復号鍵K1Bを暗号化し、暗号化復号鍵K1Cを作成する。このようにして作成された暗号化プログラムPR2と暗号化復号鍵K1Cが送信部133からネットワーク3を経由して受信側システム2に送信される。   Next, in the encryption process S2, the second system stored in the second encryption key holding unit 134 provided by the receiving system 2 (in other words, set with the decryption key K2B concealed in the receiving system 2). The encryption processing unit 132 encrypts the decryption key K1B using the encryption key K2A and creates the encrypted decryption key K1C. The encryption program PR2 and the encryption / decryption key K1C created in this way are transmitted from the transmission unit 133 to the reception-side system 2 via the network 3.

次に、暗号化プログラム2を実行する受信側システム2について説明する。まず、復号処理S3において、復号処理部231が、受信部233が受信した暗号化復号鍵K1Cを、第2復号鍵保持部234に格納されている第2の復号鍵K2Bにより復号し、復号鍵K1D(=第1の復号鍵K1B)を抽出する。尚、この処理において復号できなかった場合は、受け取った暗号化復号鍵K1Cが不正なものと判断され、その旨を受信側システム2の出力装置に表示して処理を終了する。次に、復号処理S4において、復号処理部231が、受信部233が受信した暗号化プログラムPR2を復号処理S3で抽出した復号鍵K1D(=第1の復号鍵K1B)を用いて復号し、復号済プログラムPR3(=プログラムPR1)を得る。この処理において復号に失敗した場合は、受け取った暗号化復号鍵K1Cが不正なものと判断され、その旨を受信側システム2の出力装置に表示して処理を終了する。最後に実行処理S5において、復号済プログラム実行部232で復号済プログラムPR3(=プログラムPR1)の処理を実行する。復号済プログラムPR3の処理を実行する際には、プログラムの種類に応じてインタプリタコマンドなどを呼び出す必要があるが、この場合オペレーティングシステムが提供するプロセス間通信機能や、プロセス間パイプ機能などを利用して、復号済プログラムPR3をファイルシステム上に一時ファイルとして作成しないようにするなどの対処が必要である。   Next, the receiving system 2 that executes the encryption program 2 will be described. First, in the decryption process S3, the decryption processing unit 231 decrypts the encrypted decryption key K1C received by the reception unit 233 with the second decryption key K2B stored in the second decryption key holding unit 234, and the decryption key K1D (= first decryption key K1B) is extracted. If the decryption cannot be performed in this process, it is determined that the received encryption / decryption key K1C is invalid, and a message to that effect is displayed on the output device of the receiving system 2, and the process ends. Next, in the decryption process S4, the decryption processing unit 231 decrypts the encrypted program PR2 received by the reception unit 233 using the decryption key K1D (= first decryption key K1B) extracted in the decryption process S3, and decrypts it. A completed program PR3 (= program PR1) is obtained. If decryption fails in this process, it is determined that the received encryption / decryption key K1C is invalid, and this is displayed on the output device of the receiving system 2 and the process ends. Finally, in the execution process S5, the decrypted program execution unit 232 executes the process of the decrypted program PR3 (= program PR1). When executing the processing of the decrypted program PR3, it is necessary to call an interpreter command or the like according to the type of the program. In this case, an interprocess communication function provided by the operating system, an interprocess pipe function, or the like is used. Thus, it is necessary to take measures such as preventing the decrypted program PR3 from being created as a temporary file on the file system.

以上に説明したように、暗号化プログラムPR2と暗号化復号鍵K1Cが送信側システムから受信側システムに渡され、受信側システムは、暗号化復号鍵K1Cを用いて暗号化プログラムPR2を復号することにより、受信側システム2の内部において復号済プログラムPR3を実行させることができる。復号済プログラムPR3は受信側システム2の内部において実行されるため、受信側システムの利用者は復号済みプログラムPR3の内容を参照することはできない。すなわち、受信側システムの利用者からは隠蔽された状態でプログラムが実行される。加えて、暗号化プログラムPR2の復号鍵K1Bは、受信側システムの保持する第2の複合鍵K2Bとセットになった第2の暗号鍵K2Aで暗号化され暗号化復号鍵K1Cとして送信されるため、第2の復号鍵K2Bを保持する受信側システムのみで暗号化プログラムPR2の復号/実行が可能となり、いわば2重の保護を図ることができる。   As described above, the encryption program PR2 and the encryption / decryption key K1C are passed from the transmission side system to the reception side system, and the reception side system decrypts the encryption program PR2 using the encryption / decryption key K1C. Thus, the decrypted program PR3 can be executed inside the receiving system 2. Since the decrypted program PR3 is executed in the receiving system 2, the user of the receiving system cannot refer to the contents of the decrypted program PR3. That is, the program is executed while being hidden from the user of the receiving system. In addition, the decryption key K1B of the encryption program PR2 is encrypted with the second encryption key K2A that is paired with the second composite key K2B held by the receiving system, and is transmitted as the encryption / decryption key K1C. The encryption program PR2 can be decrypted / executed only by the receiving system that holds the second decryption key K2B, so that double protection can be achieved.

図3は、図2に示す受信側システム2での処理の流れを示すフローチャート図である(図1及び図2も参照して説明を行う)。まず、ステップP1において、受信した暗号化復号鍵K1Cをメモリ上に読み込む。次に、ステップP2において、受信側システム2自身が保持する復号鍵K2Bを用いて、読み込んだ暗号化復号鍵K1Cの復号を行う。ステップP2において暗号化復号鍵K1Cの復号に失敗した場合は鍵が適正なものではないと判断され、ステップP9においてエラーメッセージを表示し処理を終了する。ステップP2において暗号化復号鍵K1Cの復号に成功した場合は、ステップP3に進む。ステップP3において、受信した暗号化プログラムPR2をメモリ上に読み込む。次いで、ステップP4において、ステップP2で得られた復号鍵K1Dを利用して読み込んだ暗号化プログラムPR2の復号を行う。ステップP2の場合と同様に、復号に失敗した場合はステップP9に進みエラーメッセージを表示して処理を終了する。   FIG. 3 is a flowchart showing the flow of processing in the receiving system 2 shown in FIG. 2 (will be described with reference to FIGS. 1 and 2). First, in step P1, the received encryption / decryption key K1C is read into the memory. Next, in step P2, the read encryption / decryption key K1C is decrypted using the decryption key K2B held by the receiving system 2 itself. If the decryption of the encryption / decryption key K1C fails in step P2, it is determined that the key is not appropriate, and an error message is displayed in step P9, and the process is terminated. If the decryption of the encryption / decryption key K1C is successful in step P2, the process proceeds to step P3. In step P3, the received encryption program PR2 is read into the memory. Next, in step P4, the encrypted program PR2 read using the decryption key K1D obtained in step P2 is decrypted. As in the case of Step P2, when decoding fails, the process proceeds to Step P9, an error message is displayed, and the process is terminated.

ステップP4において、暗号化プログラムPR2の復号に成功した場合には、ステップP5に進み、復号済プログラムPR3を実行するために必要な子プロセスを生成し、次いで、ステップP6において、復号済プログラムPR3を実行するために必要な処理系を子プロセス内で起動する。ここで、復号したプログラムを実行するために必要な処理系とは、同プログラムがPerl言語で記述されていればPerl、シェルスクリプトで記述されていればそのシェルである。通常、テキスト形式で記載されたプログラムは、プログラム内又はプログラムファイル名などに、そのプログラムを実行するのに必要な処理系に関する情報が埋め込まれている。受信側システム2では、その情報に基づいて、実行に必要となる処理系を起動する。尚、実装方法にも依存するが、必要であれば対象のプログラム中にコメント行などで起動に必要な処理系に関する記述を埋め込んでおき、実行時に本処理系がその情報を元に必要な処理系を起動するようにすることも可能である。   If the decryption of the encrypted program PR2 is successful in step P4, the process proceeds to step P5 to generate a child process necessary for executing the decrypted program PR3. Next, in step P6, the decrypted program PR3 is Starts the processing system necessary for execution in the child process. Here, the processing system necessary for executing the decrypted program is Perl if the program is described in Perl language, and the shell if the program is described in shell script. Usually, in a program written in a text format, information related to a processing system necessary for executing the program is embedded in the program or a program file name. The receiving system 2 starts a processing system necessary for execution based on the information. Although it depends on the implementation method, if necessary, a description related to the processing system required for activation is embedded in the target program by a comment line or the like, and this processing system performs necessary processing based on the information at the time of execution. It is also possible to activate the system.

次に、ステップP7において、例えば、処理を実行しているオペレーティングシステムがサポートするプロセス間通信機能を利用し、復号済プログラムPR3を子プロセスに送信し、ステップP8において、そのプログラムPR3を実行する。インタプリタ型言語やスクリプト型言語は、多くが標準入力からのプログラムコードの入力をサポートしているため、それらの処理系については復号したプログラムコードを子プロセスの標準出力に直接送信することでプログラムの実行が自動的に開始される。標準入力からのプログラムコードの入力をサポートしていない処理系では、一時ファイルなどを作成してプログラムコードの受け渡しが必要になる。この場合は一時ファイルの作成場所を考慮する必要がある。例えば、可能であればメモリ上に仮想一時ファイルを作成し、これを利用してプログラムコードを受け渡すのが好ましい。メモリ上での一時ファイルの作成をサポートしていないオペレーティングシステム環境では、ファイルシステム中で一般ユーザのアクセスできない(すなわち参照できない)場所に一時ファイルを作成するなどの工夫が必要となる。   Next, in step P7, for example, the interprocess communication function supported by the operating system executing the process is used to transmit the decrypted program PR3 to the child process, and in step P8, the program PR3 is executed. Many interpreted languages and script languages support the input of program code from the standard input, so for those processors, the decrypted program code is sent directly to the standard output of the child process. Execution starts automatically. In a processing system that does not support program code input from the standard input, it is necessary to create a temporary file and transfer the program code. In this case, it is necessary to consider the location of the temporary file. For example, if possible, it is preferable to create a virtual temporary file on the memory and use it to deliver the program code. In an operating system environment that does not support the creation of a temporary file in memory, it is necessary to devise such as creating a temporary file in a place where a general user cannot access (that is, cannot be referred to) in the file system.

図4は実際のオペレーティングシステム環境において、システムの利用者側から見た実行例を示す模式的な図である。図4においては、オペレーティングシステム環境としてUNIXを、また対象プログラムとしてshのシェルスクリプトを例に説明を行う。尚、ファイルを暗号化するための公開鍵暗号化プログラムは任意であるが、ここでは仮にpkcというコマンドが存在するものとする。コマンドpkcは、「pkc−encrypt 鍵ファイル対象ファイル」の書式で、鍵ファイルを利用して対象ファイルを暗号化し、その結果を標準出力に出力する。   FIG. 4 is a schematic diagram showing an execution example viewed from the system user side in an actual operating system environment. In FIG. 4, a description will be given taking UNIX as an operating system environment and sh shell script as an example of a target program. The public key encryption program for encrypting the file is arbitrary, but it is assumed here that a command pkc exists. The command pkc encrypts the target file using the key file in the format of “pkc-encrypt key file target file”, and outputs the result to the standard output.

以下、図4に関して図2も参照して説明する。図4に示すように、送信側システム1は、まず処理の対象となるプログラム(シェルスクリプト)F1(=PR1)をエディタなどにより作成する。次いで、暗号化のために用意した第1の暗号鍵ファイルF3(=K1A)を利用してプログラムF1を暗号化する(コマンドラインC1)。コマンドラインC1は、”sample.sh”で示されるプログラムF1(=プログラムPR1)を第1の暗号鍵”key1.pub”によって暗号化し”sample.sh.enc”で示される暗号化プログラムファイルF2(=PR2)を生成する旨のコマンドである。   Hereinafter, FIG. 4 will be described with reference to FIG. As shown in FIG. 4, the transmission-side system 1 first creates a program (shell script) F1 (= PR1) to be processed by an editor or the like. Next, the program F1 is encrypted using the first encryption key file F3 (= K1A) prepared for encryption (command line C1). The command line C1 encrypts the program F1 (= program PR1) indicated by “sample.sh” with the first encryption key “key1.pub”, and indicates an encrypted program file F2 (“sample.sh.enc”). = PR2).

次に、送信側システム1は第1の暗号鍵ファイルF3と対となる第1の復号鍵ファイルF4(=K1B)を、受信側システム2が保持する第2の復号鍵F7(=K2B)と対をなす第2の暗号鍵ファイルF6(=K2A)を利用して復号化する(コマンドラインC2)。コマンドラインC2は、”key1.sec”で示される第1の復号鍵F4(=K1B)を第2の暗号鍵”key2.pub”によって暗号化し”key1.sec.enc”で示される暗号化復号鍵ファイルF5(=K1C)を生成する旨のコマンドである。   Next, the transmission side system 1 uses the first decryption key file F4 (= K1B) paired with the first encryption key file F3, and the second decryption key F7 (= K2B) held by the reception side system 2. Decryption is performed using the paired second encryption key file F6 (= K2A) (command line C2). The command line C2 encrypts the first decryption key F4 (= K1B) indicated by “key1.sec” with the second encryption key “key2.pub” and performs encryption / decryption indicated by “key1.sec.enc”. This is a command for generating the key file F5 (= K1C).

受信側は暗号化されたプログラムファイルF2(=PR2)を実行するために、コマンドラインC3を実行する。コマンドラインC3は、受信側システム2が内部に保持する第2の復号鍵F7(=K2B)を利用して暗号化秘密鍵ファイルF5(=K1C)を復号し、その結果得られる復号鍵K1D(=第1の復号鍵K1B)を利用して暗号化プログラムファイルF2(=PR2)を復号し、復号済みプログラムPR3を実行するコマンド"runcmd"を記したコマンドラインである。ここでは暗号化複合鍵ファイルF5(key1.sec.enc)と暗号化プログラムファイルF2(sample.sh.enc)はコマンド"runcmd"の内部で読み込まれ処理されることとしている。この時、受信側システムの出力装置にはコマンド名”runcmd”は表示されるが、その内容(F1)は表示されない。受信側システム利用者には内部処理を隠蔽した状態で復号/実行処理が行われるため、プログラムF1(プログラム1)の内容を隠蔽し保護することができる。   The receiving side executes the command line C3 in order to execute the encrypted program file F2 (= PR2). The command line C3 decrypts the encrypted private key file F5 (= K1C) using the second decryption key F7 (= K2B) held in the receiving system 2 inside, and the decryption key K1D ( = A command line describing a command “runcmd” for decrypting the encrypted program file F2 (= PR2) using the first decryption key K1B) and executing the decrypted program PR3. Here, it is assumed that the encrypted composite key file F5 (key1.sec.enc) and the encrypted program file F2 (sample.sh.enc) are read and processed within the command “runcmd”. At this time, the command name “runcmd” is displayed on the output device of the receiving system, but the content (F1) is not displayed. Since the decryption / execution process is performed while the internal process is concealed for the receiving-side system user, the contents of the program F1 (program 1) can be concealed and protected.

以上に説明したように、送信側はテキスト形式など見ただけで内容がわかってしまう状態で実行される形態のプログラムを送信時に暗号化し、受信側システムの内部で復号/実行することにより、そのプログラムの処理を隠蔽することができ受信側システム利用者及び第3者の内部処理解析から保護することができる。   As explained above, the transmission side encrypts a program that is executed in a state where the contents are understood only by looking at the text format etc. at the time of transmission, and decrypts / executes it inside the reception side system, so that The processing of the program can be concealed and can be protected from internal processing analysis of the receiving system user and the third party.

また、受信側システム2による暗号化プログラムPR2を実行するには、該受信側システム2が第2の復号鍵K2Bを保持していることが必須となるため、特定の受信者にのみ安全に対象となるプログラム機能を提供することができる。   Further, in order to execute the encryption program PR2 by the receiving side system 2, it is essential that the receiving side system 2 holds the second decryption key K2B. It is possible to provide a program function.

本発明の一実施の形態のプログラムを内部解析から保護するシステムを説明するシステム構成図である。It is a system configuration figure explaining a system which protects a program of one embodiment of the present invention from internal analysis. 本発明の一実施の形態のプログラムを内部解析から保護する方法を説明するブロック図である。It is a block diagram explaining the method of protecting the program of one embodiment of this invention from internal analysis. 受信側システムのプログラムフローを説明するブロック図である。It is a block diagram explaining the program flow of a receiving side system. オペレーティングシステム環境での実行例を示す図である。It is a figure which shows the example of execution in an operating system environment.

符号の説明Explanation of symbols

1…送信側システム、11…送信側システムの入力装置、12…送信側システムの出力装置、13…送信側システムの処理部、131…第1鍵セット生成部、132…暗号化処理部、133…送信部、134…第2暗号鍵保持部、2…受信側システム、21…受信側システムの入力装置、22…受信側システムの出力装置、23…受信側システムの処理部、231…復号処理部、232…復号済プログラム実行部、233…受信部、234…第2復号鍵保持部、3…ネットワーク、PR1…プログラム、PR2…暗号化プログラム、PR3…復号済プログラム、K1…利用者の鍵セット、K1A…K1の暗号鍵、K1B…K1の復号鍵、K1C…K1BをK2Aで暗号化した鍵データ、K1D…K1CをK2Bで復号した鍵データ(内容はK1Bと等しい)、K2…暗号化/送信処理系の鍵セット、K2A…K2の暗号鍵、K2B…K2の復号鍵、S1…暗号化ステップ、S2…暗号化ステップ、S3…復号ステップ、S4…復号ステップ、S5…実行ステップ、P1〜P9…復号/実行処理系の処理ステップ、F1…サンプルプログラム (シェルスクリプト)、F2…サンプルプログラムF1を暗号化したデータファイル、F3…利用者の公開鍵ファイル、F4…利用者の秘密鍵ファイル、F5…秘密鍵ファイルF4を暗号化したデータファイル、F6…暗号/実行処理系の公開鍵ファイル、F7…復号/実行処理系の秘密鍵ファイル、F8…復号/実行処理系のプログラム本体(コマンド名: runcmd)、C1〜C3…コマンドライン例。 DESCRIPTION OF SYMBOLS 1 ... Transmission side system, 11 ... Input device of transmission side system, 12 ... Output device of transmission side system, 13 ... Processing part of transmission side system, 131 ... First key set generation part, 132 ... Encryption processing part, 133 DESCRIPTION OF SYMBOLS ... Transmission part, 134 ... 2nd encryption key holding part, 2 ... Reception side system, 21 ... Input device of reception side system, 22 ... Output device of reception side system, 23 ... Processing part of reception side system, 231 ... Decryption processing , 232 ... Decrypted program execution unit, 233 ... Reception unit, 234 ... Second decryption key holding unit, 3 ... Network, PR1 ... Program, PR2 ... Encryption program, PR3 ... Decrypted program, K1 ... User key Set, K1A ... K1 encryption key, K1B ... K1 decryption key, K1C ... K1B key data encrypted with K2A, K1D ... K1C key data decrypted with K2B (contents are K B2), K2 ... key set for encryption / transmission processing system, K2A ... encryption key for K2, K2B ... decryption key for K2, S1 ... encryption step, S2 ... encryption step, S3 ... decryption step, S4 ... Decryption step, S5 ... execution step, P1 to P9 ... decryption / execution processing system processing step, F1 ... sample program (shell script), F2 ... data file encrypted with sample program F1, F3 ... user public key file F4: User private key file, F5: Data file obtained by encrypting the private key file F4, F6: Public key file for the encryption / execution processing system, F7: Private key file for the decryption / execution processing system, F8: Decryption / Execution processing system program body (command name: runcmd), C1-C3... Command line example.

Claims (5)

プログラムを実行するプログラム処理系においてプログラムを内部解析から保護する方法であって、
暗号化された暗号化プログラムを読み込むステップと、
前記プログラム処理系内に隠蔽された復号鍵に基づいて前記暗号化プログラムを復号し復号済プログラムを得るステップと
を有する方法。
A method of protecting a program from internal analysis in a program processing system that executes the program,
Loading an encrypted encryption program;
And decrypting the encrypted program based on a decryption key concealed in the program processing system to obtain a decrypted program.
プログラムを実行するプログラム処理系においてプログラムを内部解析から保護する方法であって、
第1の暗号鍵を用いて暗号化した暗号化プログラムを読み込むステップと、
前記第1の暗号鍵とともに第1の鍵セットを構成する第1の復号鍵を前記第1の暗号鍵とは異なる第2の暗号鍵により暗号化した暗号化復号鍵を読み込むステップと、
プログラム処理系内に隠蔽され前記第2の暗号鍵とともに第2の鍵セットを構成する第2の復号鍵に基づいて前記暗号化復号鍵を復号し復号済の第1の復号鍵を得るステップと、
前記復号済の第1の復号鍵により前記暗号化プログラムを復号し復号済プログラムを得るステップと
を有する方法。
A method of protecting a program from internal analysis in a program processing system that executes the program,
Reading an encryption program encrypted using the first encryption key;
Reading an encrypted decryption key obtained by encrypting a first decryption key that constitutes a first key set together with the first encryption key with a second encryption key different from the first encryption key;
Decrypting the encrypted decryption key based on a second decryption key that is concealed in the program processing system and forms a second key set together with the second encryption key, and obtaining a decrypted first decryption key; ,
And decrypting the encrypted program with the decrypted first decryption key to obtain a decrypted program.
第1のプログラムを暗号化する第1の暗号化処理によって得られる暗号化プログラムと、
第1の復号鍵を暗号化する第2の暗号化処理によって得られる暗号化復号鍵と、
復号および実行処理系を実現する処理系であって、その内部に前記暗号化復号鍵を復号する第2の復号鍵を有し、該第2の復号鍵によって前記暗号化復号鍵を復号し、得られた復号済みの前記第1の復号鍵により前記暗号化プログラムを復号し、得られた復号済みの第1のプログラムにより処理を実行する処理系と
を有するシステム。
An encryption program obtained by a first encryption process for encrypting the first program;
An encryption / decryption key obtained by a second encryption process for encrypting the first decryption key;
A processing system that realizes a decryption and execution processing system, having a second decryption key for decrypting the encrypted decryption key therein, decrypting the encrypted decryption key with the second decryption key; A processing system that decrypts the encrypted program with the obtained first decryption key that has been decrypted, and that executes a process with the obtained first program that has been decrypted;
プログラムを内部解析から保護する機構を有するシステムであって、
暗号化された暗号化プログラムを出力する暗号化プログラム出力手段と、
プログラムを実行するプログラム処理系であって、その内部に隠蔽された状態の復号鍵と、受け取った前記暗号化プログラムを、該復号鍵に基づいて復号する復号化手段と、を有するプログラム処理系と
を備えたシステム。
A system having a mechanism for protecting a program from internal analysis,
An encryption program output means for outputting an encrypted encryption program;
A program processing system for executing a program, comprising: a decryption key concealed inside; and a decryption means for decrypting the received encrypted program based on the decryption key; With system.
プログラムを内部解析から保護する機構を有するシステムであって、
前記プログラムを暗号化し暗号化プログラムを作成する第1の暗号鍵と、該第1の暗号鍵とともに第1の鍵セットを構成する第1の復号鍵と、
前記第1の復号鍵を暗号化し暗号化復号鍵を作成する第2の暗号鍵と、プログラムを実行するプログラム処理系内に隠蔽され前記暗号化復号鍵を復号する第2の復号鍵と、を含む第2の鍵セットと、
前記暗号化プログラムと前記暗号化復号鍵とを取得して前記第2の復号鍵により前記暗号化復号鍵を復号して得た第1の復号鍵を用いて前記暗号化プログラムを復号し復号済プログラムを作成し、該復号済プログラムにより処理を実行するプログラム処理系と
を備えたシステム。
A system having a mechanism for protecting a program from internal analysis,
A first encryption key for encrypting the program and creating an encrypted program; and a first decryption key constituting a first key set together with the first encryption key;
A second encryption key that encrypts the first decryption key and creates an encrypted decryption key; and a second decryption key that is concealed in a program processing system that executes a program and decrypts the encrypted decryption key. A second key set comprising:
The encrypted program and the encrypted decryption key are obtained, and the encrypted program is decrypted using the first decryption key obtained by decrypting the encrypted decryption key with the second decryption key. A system comprising a program processing system for creating a program and executing processing by the decrypted program.
JP2004086688A 2004-03-24 2004-03-24 Method and protection system for protecting program from internal analysis Pending JP2005275694A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2004086688A JP2005275694A (en) 2004-03-24 2004-03-24 Method and protection system for protecting program from internal analysis

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2004086688A JP2005275694A (en) 2004-03-24 2004-03-24 Method and protection system for protecting program from internal analysis

Publications (1)

Publication Number Publication Date
JP2005275694A true JP2005275694A (en) 2005-10-06

Family

ID=35175324

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2004086688A Pending JP2005275694A (en) 2004-03-24 2004-03-24 Method and protection system for protecting program from internal analysis

Country Status (1)

Country Link
JP (1) JP2005275694A (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2006238154A (en) * 2005-02-25 2006-09-07 Sony Corp Data processing method
JP2007179317A (en) * 2005-12-28 2007-07-12 Nec Electronics Corp Microcomputer, program writing method to microcomputer, and writing processing system
JP2008071177A (en) * 2006-09-14 2008-03-27 Fujitsu Ltd Information processor, control method, and program for making computer execute same method
JP2010528511A (en) * 2007-05-23 2010-08-19 シーメンス アクチエンゲゼルシヤフト Software encryption method, software decryption method, software encryption device, and software decryption device

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2006238154A (en) * 2005-02-25 2006-09-07 Sony Corp Data processing method
JP2007179317A (en) * 2005-12-28 2007-07-12 Nec Electronics Corp Microcomputer, program writing method to microcomputer, and writing processing system
JP2008071177A (en) * 2006-09-14 2008-03-27 Fujitsu Ltd Information processor, control method, and program for making computer execute same method
JP2010528511A (en) * 2007-05-23 2010-08-19 シーメンス アクチエンゲゼルシヤフト Software encryption method, software decryption method, software encryption device, and software decryption device

Similar Documents

Publication Publication Date Title
JP6573600B2 (en) A method performed by at least one server for processing data packets from a first computing device to a second computing device to allow end-to-end encrypted communication
CN105009597A (en) Master key encryption functions for transmitter-receiver pairing as countermeasure to thwart key recovery attacks
JP2013501394A (en) Collaborative agent encryption and decryption
CN111656345B (en) Software module enabling encryption in container files
CN111131278A (en) Data processing method and device, computer storage medium and electronic equipment
JP2016158189A (en) Change direction with key control system and change direction with key control method
KR20170097509A (en) Operation method based on white-box cryptography and security apparatus for performing the method
CN111262852B (en) Business card signing and issuing method and system based on block chain
JP2000347566A (en) Contents administration device, contents user terminal, and computer-readable recording medium recording program thereon
JP2008306395A (en) Information processor, information processing method
JPS63278438A (en) Cryptographic system by secret cryptograph procedure
JPH11136234A (en) User authentication system and user authentication method
JP3537959B2 (en) Information decryption device
KR102315632B1 (en) System and method for generating scalable group key based on homomorphic encryption with trust server
JP2005275694A (en) Method and protection system for protecting program from internal analysis
JP4668028B2 (en) Transfer source software, transfer request terminal, transfer source pack generation device, and program set
JP2017021144A (en) Translation system and translation method
CN115396179A (en) Data transmission method, device, medium and equipment based on block chain
JP5431191B2 (en) Authenticated stream cipher encryption apparatus, authenticated stream cipher decryption apparatus, encryption method, decryption method, and program
JP2000305849A (en) Transmitter and its method, receiver and its method and communication system
KR101445483B1 (en) Method and system for secure data transfer using conditional proxy re-encryption
JP5415020B2 (en) Stream cipher encryption apparatus, decryption apparatus, MAC generation apparatus, stream cipher encryption method, decryption method, MAC generation method, and program
JP4974863B2 (en) File management system, file management method and program
Singh et al. Peer to peer secure communication in mobile environment: A novel approach
JP2005202048A (en) Cipher communication system, encryption device and decryption device used for the system, encrypting method and decrypting method, encrypting program and decrypting program, and recording medium