JP5404463B2 - Control device and management device - Google Patents

Control device and management device Download PDF

Info

Publication number
JP5404463B2
JP5404463B2 JP2010028793A JP2010028793A JP5404463B2 JP 5404463 B2 JP5404463 B2 JP 5404463B2 JP 2010028793 A JP2010028793 A JP 2010028793A JP 2010028793 A JP2010028793 A JP 2010028793A JP 5404463 B2 JP5404463 B2 JP 5404463B2
Authority
JP
Japan
Prior art keywords
program
authentication
unit
control program
processing unit
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.)
Expired - Fee Related
Application number
JP2010028793A
Other languages
Japanese (ja)
Other versions
JP2011165041A (en
Inventor
昭浩 三浦
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Mitsubishi Electric Corp
Original Assignee
Mitsubishi Electric Corp
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 Mitsubishi Electric Corp filed Critical Mitsubishi Electric Corp
Priority to JP2010028793A priority Critical patent/JP5404463B2/en
Priority to TW099118839A priority patent/TWI435192B/en
Priority to CN201010237224.6A priority patent/CN102156840B/en
Priority to KR1020100079652A priority patent/KR101252918B1/en
Publication of JP2011165041A publication Critical patent/JP2011165041A/en
Application granted granted Critical
Publication of JP5404463B2 publication Critical patent/JP5404463B2/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/30Authentication, i.e. establishing the identity or authorisation of security principals
    • G06F21/44Program or device authentication
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/62Protecting access to data via a platform, e.g. using keys or access control rules

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Computer Hardware Design (AREA)
  • Software Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Health & Medical Sciences (AREA)
  • Bioethics (AREA)
  • General Health & Medical Sciences (AREA)
  • Programmable Controllers (AREA)

Description

本発明は、プログラムの不正使用を防止する技術に関する。
より具体的には、本発明は、例えば、FA(Factory Automation)システムにおいてPLC(Programmable Logic Controller)に格納されている制御プログラム(ラダープログラム)の不正使用を防止する技術に関する。
The present invention relates to a technique for preventing unauthorized use of a program.
More specifically, the present invention relates to a technique for preventing unauthorized use of a control program (ladder program) stored in a PLC (Programmable Logic Controller) in, for example, an FA (Factory Automation) system.

一般にFAシステムでは、他社(他人)に公開したくない制御プログラム(ラダープログラム)などの保護資産に対する不正アクセスを防止する手段としては、パスワードを利用する方法や保護資産を暗号化する方法が取られている。
しかし、パスワードを利用する方法では、例えば制御プログラムに対してパスワードを設定してアクセス制御しても、その制御プログラムに複数の開発者がアクセスすることになる場合は複数の開発者間で共通のパスワードを設定しているため他人に推測されやすいパスワードを付けるなど脆弱性についての課題がある。
また、制御プログラムとパスワード等といった認証に用いる情報とを別々に管理し、認証処理も制御プログラムとは別に実現されているため、制御プログラムとの関連付けが外されると制御プログラムに対するアクセス制御ができなくなる。
このため、保護したいデータそのものを暗号化する方法などが取られているが、暗号化には鍵を管理するために特別なハードウェアが必要となり、装置が複雑で高価になるという課題がある。
また、FAシステムにおける制御プログラム(ラダープログラム)では、デバイスのON/OFF状態に応じて制御機器への制御信号をON/OFFするものであり、制御プログラムの実行中に暗号化や復号化の処理を実行することができない。
これにより、暗号化を使わずに制御プログラムの改ざんやモニタを防ぐ方法として、モニタ装置からの制御プログラムに対するアクセス要求に対してあらかじめ設定されたアクセス権限により応答を制限する方法がある(例えば、特許文献1)。
In general, in FA systems, as means for preventing unauthorized access to protected assets such as control programs (ladder programs) that you do not want to be disclosed to other companies (others), you can use passwords or encrypt protected assets. ing.
However, in the method of using a password, for example, even when a password is set for a control program and access control is performed, if multiple developers access the control program, it is common among multiple developers. Since a password is set, there are issues regarding vulnerabilities, such as attaching a password that is easily guessed by others.
In addition, since the control program and information used for authentication such as passwords are managed separately, and the authentication process is also implemented separately from the control program, access control to the control program can be performed when the association with the control program is removed. Disappear.
For this reason, a method of encrypting the data itself to be protected is taken, but the encryption requires special hardware for managing the key, and there is a problem that the apparatus becomes complicated and expensive.
In addition, the control program (ladder program) in the FA system turns on / off the control signal to the control device according to the ON / OFF state of the device, and performs encryption and decryption processing during execution of the control program. Can not run.
Thus, as a method for preventing falsification and monitoring of the control program without using encryption, there is a method of limiting a response with an access authority set in advance to an access request for the control program from the monitor device (for example, a patent) Reference 1).

特開2005−135165号公報JP 2005-135165 A

このように各制御プログラムに対してあらかじめ設定されたアクセス権限によりモニタ装置からのアクセス要求への応答を制限する方法では、モニタ装置からのアクセス制御を行うことが目的であり、制御プログラムを特定のPLC上でのみ実行可能にするための制御を行っているわけではない。
このため、読み出し権限を持っているとPLCからモニタ装置に制御プログラムを読み出すことができ、かつ読み出した制御プログラムは別のPLCへ書込むことができるので、コピーした先のPLCにて制御プログラムの不正利用が可能となる課題がある。
In this way, in the method of limiting the response to the access request from the monitor device by the access authority set in advance for each control program, the purpose is to perform the access control from the monitor device. Control for enabling execution only on the PLC is not performed.
For this reason, if the user has read authority, the control program can be read from the PLC to the monitor device, and the read control program can be written to another PLC. There is a problem that can be used illegally.

本発明は、上記課題を鑑みてなされたものであって、その主たる目的は、特定の制御装置にのみ使用が許可されている制御プログラム(ラダープログラム)が、特定の制御装置上でしか動作できないようにするための制御プログラムの不正利用防止機能を実現することである。   The present invention has been made in view of the above problems, and a main purpose of the present invention is that a control program (ladder program) that is permitted to be used only by a specific control device can operate only on the specific control device. It is to realize a function for preventing unauthorized use of a control program for doing so.

本発明に係る制御装置は、
前記制御装置にユニークに設定されている固有識別情報を記憶する固有識別情報記憶部と、
前記制御装置の制御処理の対象となる対象デバイスのデバイス番号が含まれ、前記制御装置以外の装置による使用が許可されていないラダープログラムを主プログラムとして入力するプログラム入力部と、
前記固有識別情報に基づいて、前記制御装置以外の装置による主プログラムの使用を防止するラダープログラムを認証プログラムとして生成する認証プログラム生成部と、
主プログラムと認証プログラムとを合成して合成プログラムとするプログラム合成部と、
前記合成プログラムを記憶するプログラム記憶部とを有し、
前記認証プログラム生成部は、
対象デバイスのデバイス番号を疑似するデバイス番号であって、認証のために用いられる複数の認証用デバイスのデバイス番号を認証用デバイス番号として管理し、
前記固有識別情報に基づいて、1つ以上の認証用デバイス番号を選択し、
選択した選択認証用デバイス番号が含まれるラダープログラムであって、前記合成プログラムとして前記主プログラムとともに実行される際に前記認証プログラム生成部の選択動作から独立して前記固有識別情報に基づいて前記選択認証用デバイス番号が正確に選択され前記選択認証用デバイス番号に対応する選択認証用デバイスの各々に対して所定の設定処理が行われれば正常に動作して前記主プログラムが正常に動作し、前記合成プログラムとして前記主プログラムとともに実行される際に前記選択認証用デバイスの各々に対して前記設定処理が行われない場合には正常に動作せず前記主プログラムの動作が停止するラダープログラムを認証プログラムとして生成することを特徴とする。
The control device according to the present invention includes:
A unique identification information storage unit for storing unique identification information uniquely set in the control device;
A program input unit that includes a device number of a target device to be controlled by the control device, and that inputs a ladder program that is not permitted to be used by a device other than the control device as a main program;
Based on the unique identification information, an authentication program generating unit that generates a ladder program that prevents use of the main program by a device other than the control device as an authentication program;
A program synthesis unit that synthesizes the main program and the authentication program into a synthesis program;
A program storage unit for storing the synthesis program,
The authentication program generator is
It is a device number that simulates the device number of the target device, and manages device numbers of a plurality of authentication devices used for authentication as authentication device numbers,
Based on the unique identification information, one or more authentication device numbers are selected,
A ladder program including the selected selection authentication device number, wherein the selection is performed based on the unique identification information independently from a selection operation of the authentication program generation unit when the synthesis program is executed together with the main program. If the authentication device number is correctly selected and a predetermined setting process is performed on each of the selected authentication devices corresponding to the selected authentication device number, the main program operates normally and the main program operates normally. If the setting process is not performed for each of the selective authentication devices as a synthesis program together with the main program, a ladder program that does not operate normally and stops the operation of the main program is authenticated. It is characterized by producing | generating as.

本発明では、主プログラムの格納の際に、制御装置にユニークに設定されている固有識別情報に基づき選択した選択認証用デバイス番号が含まれるラダープログラムを認証プログラムとして生成し、認証プログラムを主プログラムに合成し、主プログラムの実行の際に固有識別情報に基づき正しく選択認証用デバイス番号が選択され、選択認証用デバイスに設定処理が行われていれば主プログラムが正常に動作し、設定処理が行われていない場合は認証プログラムによって主プログラムが停止する。
このため、制御装置では正常に主プログラムを使用することができる一方で、主プログラムの使用が許可されていない装置では、主プログラムを使用することができず、主プログラムの不正使用を防止することができる。
In the present invention, when storing the main program, a ladder program including the selected authentication device number selected based on the unique identification information uniquely set in the control device is generated as the authentication program, and the authentication program is generated as the main program. If the selection authentication device number is correctly selected based on the unique identification information when the main program is executed, and the setting processing is performed on the selection authentication device, the main program operates normally and the setting processing is performed. If not, the main program is stopped by the authentication program.
For this reason, while the main program can be used normally in the control device, the main program cannot be used in a device that is not permitted to use the main program, thereby preventing unauthorized use of the main program. Can do.

実施の形態1に係るシステム構成例を示す図。FIG. 3 is a diagram illustrating an example of a system configuration according to the first embodiment. 実施の形態1に係る動作例を示すフローチャート図。FIG. 4 is a flowchart showing an operation example according to the first embodiment. 実施の形態1に係る動作例を示すフローチャート図。FIG. 4 is a flowchart showing an operation example according to the first embodiment. 実施の形態1に係る認証ラダーの例を示す図。FIG. 3 shows an example of an authentication ladder according to the first embodiment. 実施の形態1に係る専用デバイスの設定例を示す図。FIG. 3 is a diagram illustrating an example of setting a dedicated device according to the first embodiment. 実施の形態2に係るシステム構成例を示す図。FIG. 4 is a diagram illustrating an example of a system configuration according to a second embodiment. 実施の形態3に係るシステム構成例を示す図。FIG. 10 is a diagram showing a system configuration example according to the third embodiment. 実施の形態4に係るシステム構成例を示す図。FIG. 10 is a diagram illustrating an example of a system configuration according to a fourth embodiment. 実施の形態5に係るシステム構成例を示す図。FIG. 10 is a diagram showing a system configuration example according to a fifth embodiment.

実施の形態1〜5では、FAシステムにおいてPLCに格納されている制御プログラム(ラダープログラム)の不正コピーによりPLCの模造品が製造されるのを防ぐ技術を説明する。
より具体的には、制御プログラムをPLCに書込む際に、PLCを個体識別するためのシリアルIDとエンジニアリング環境にて生成した乱数を用いて認証情報を生成し、PLCと制御プログラムとの関連付けを行うと共に、生成した認証情報から制御プログラムに挿入可能な認証ラダーを自動生成して制御プログラム中に挿入する。
そして、制御プログラムの実行時に、挿入した認証ラダーにて関連付けを行ったPLC上での実行であることを確認することで制御プログラムを不正に別のPLCにコピーして模造品が製造されるなどの不正利用されることを防止する。
In the first to fifth embodiments, techniques for preventing imitation of a PLC from being manufactured by unauthorized copying of a control program (ladder program) stored in the PLC in the FA system will be described.
More specifically, when writing the control program to the PLC, authentication information is generated using a serial ID for identifying the PLC and a random number generated in the engineering environment, and the association between the PLC and the control program is performed. In addition, an authentication ladder that can be inserted into the control program is automatically generated from the generated authentication information and inserted into the control program.
Then, when executing the control program, the control program is illegally copied to another PLC by confirming that the control program is executed on the PLC associated with the inserted authentication ladder, and a counterfeit product is manufactured. To prevent unauthorized use of.

ここで、認証ラダーとは、主プログラムたる制御プログラムに挿入されるラダープログラムであり、認証プログラムの例である。
より具体的には、制御プログラムの実行時に特定のデバイス番号に該当する専用デバイスがONになっていることを確認するために制御プログラムに挿入されるラダープログラムが認証ラダーである。
実施の形態1〜5では、PLCのシリアルIDとエンジニアリング環境側で生成した乱数を入力としてハッシュ関数(一方向性関数)にて認証情報(ハッシュ値)を生成し、この認証情報に基づいて専用デバイスのON/OFFをチェックするためのデバイス番号を決定する。この認証情報に基づいて決定されたデバイス番号が含まれるラダープログラムが認証ラダーである。
ここで生成した認証情報は、PLCのシリアルIDを入力としてハッシュ関数により生成しているため、PLC毎に生成される認証情報は異なる。
また、制御プログラムは、入力機器や出力機器といったPLCの制御処理の対象となる対象デバイスのデバイス番号が含まれるラダープログラムであり、指定されたPLC以外の装置による使用が許されない。
制御プログラムは主プログラムの例である。
制御プログラムに認証ラダーが挿入された後のプログラムを合成プログラムともいう。
また、専用デバイスとは、PLC内に設けた制御プログラムで使用するデータやON/OFF信号を記憶するためのメモリであり、PLCのファームウェアからのみ設定できるものとし、エンジニアリング環境を用いてもユーザには設定できないものとする。
専用デバイスは、対象デバイスとは異なり、制御プログラムの不正使用を防止するために特別に設けられたデバイスである。専用デバイスには、対象デバイスのデバイス番号を疑似するデバイス番号を設定する。なお、専用デバイスは認証用デバイスの例であり、専用デバイスのデバイス番号は認証用デバイス番号の例である。
また、ユーザがエンジニアリング環境を用いてPLCの制御プログラムを作成する際、制御プログラムやパラメータ、および認証情報などを管理するためのプロジェクトをPLCごとに作成する。
Here, the authentication ladder is a ladder program inserted into a control program as a main program, and is an example of an authentication program.
More specifically, the ladder program that is inserted into the control program to confirm that the dedicated device corresponding to the specific device number is ON when the control program is executed is the authentication ladder.
In the first to fifth embodiments, authentication information (hash value) is generated by a hash function (one-way function) using the PLC serial ID and a random number generated on the engineering environment side as input, and dedicated authentication is performed based on the authentication information. A device number for checking ON / OFF of the device is determined. A ladder program including a device number determined based on the authentication information is an authentication ladder.
Since the authentication information generated here is generated by a hash function using the PLC serial ID as an input, the authentication information generated for each PLC is different.
The control program is a ladder program including the device number of the target device that is the target of the PLC control process, such as an input device or an output device, and is not allowed to be used by a device other than the designated PLC.
The control program is an example of a main program.
The program after the authentication ladder is inserted into the control program is also called a synthesis program.
The dedicated device is a memory for storing data and ON / OFF signals used in the control program provided in the PLC, and can be set only from the PLC firmware. Cannot be set.
Unlike the target device, the dedicated device is a device specially provided to prevent unauthorized use of the control program. A device number that simulates the device number of the target device is set in the dedicated device. The dedicated device is an example of an authentication device, and the device number of the dedicated device is an example of an authentication device number.
When a user creates a PLC control program using an engineering environment, a project for managing the control program, parameters, authentication information, and the like is created for each PLC.

以上を踏まえ、以下にて、実施の形態1〜5の各々を説明する。   Based on the above, each of the first to fifth embodiments will be described below.

実施の形態1.
図1は、本実施の形態に係る不正利用防止システムのシステム構成例を示す。
図1に示す不正利用防止システムは、PLCに格納した制御プログラムを特定のPLC上でのみ実行可能にするためのFA機器制御プログラムの不正利用防止システムである。
本実施の形態に係る不正利用防止システムは、エンジニアリング環境側PC(Personal Computer)100とPLC(Programmable Logic Controller)200に大別される。
エンジニアリング環境側PC100は、CPU(Central Processing Unit)、ROM(Read Only Memory)、RAM(Random Access Memory)、磁気ディスク装置、通信ボード等を備えるコンピュータである。
この場合、エンジニアリング環境側PC100の内部要素として示している機能(「〜部」)を実現するプログラムを例えば磁気ディスク装置に格納し、CPUがこれらプログラムを適宜読み出すことで、各機能を実行する。
PLC200は、ラダープログラムである制御プログラムを記憶し、CPUが制御プログラムを実行して、機器の制御を行う。
エンジニアリング環境側PC100は管理装置の例であり、PLC200は制御装置の例である。
なお、エンジニアリング環境側PC100及びPLC200の内部構成については後述する。
Embodiment 1 FIG.
FIG. 1 shows a system configuration example of an unauthorized use prevention system according to the present embodiment.
The unauthorized use prevention system shown in FIG. 1 is an unauthorized use prevention system for an FA device control program for enabling a control program stored in a PLC to be executed only on a specific PLC.
The unauthorized use prevention system according to the present embodiment is roughly divided into an engineering environment side PC (Personal Computer) 100 and a PLC (Programmable Logic Controller) 200.
The engineering environment side PC 100 is a computer including a CPU (Central Processing Unit), a ROM (Read Only Memory), a RAM (Random Access Memory), a magnetic disk device, a communication board, and the like.
In this case, each function is executed by storing a program that realizes a function (“˜part”) shown as an internal element of the engineering environment side PC 100 in, for example, a magnetic disk device, and the CPU reads the program as appropriate.
The PLC 200 stores a control program that is a ladder program, and the CPU executes the control program to control the device.
The engineering environment side PC 100 is an example of a management apparatus, and the PLC 200 is an example of a control apparatus.
The internal configurations of the engineering environment side PC 100 and the PLC 200 will be described later.

また、図2は本実施の形態に係る動作例を示すフローチャートである。
図2は、具体的には、制御プログラムをPLCに書込む際にセキュリティ設定を行い、制御プログラムとPLCを関連付ける際の処理フローを示す。
図2の処理フローの詳細は後述する。
FIG. 2 is a flowchart showing an operation example according to the present embodiment.
Specifically, FIG. 2 shows a processing flow when security setting is performed when the control program is written in the PLC and the control program is associated with the PLC.
Details of the processing flow of FIG. 2 will be described later.

また、図3はPLCにて認証ラダーを生成し、生成した認証ラダーを制御プログラムに挿入してPLCに制御プログラムを格納する際の処理フローを示す。
図3の処理フローの詳細は後述する。
FIG. 3 shows a processing flow when an authentication ladder is generated by the PLC, the generated authentication ladder is inserted into the control program, and the control program is stored in the PLC.
Details of the processing flow of FIG. 3 will be described later.

図4は認証ラダー生成用乱数とPLCのシリアルIDから生成した認証情報に基づいて自動生成した認証ラダーの例である。
図4の詳細は後述する。
FIG. 4 is an example of an authentication ladder that is automatically generated based on authentication information generated from an authentication ladder generation random number and a PLC serial ID.
Details of FIG. 4 will be described later.

図5はPLCの電源投入時にファームウェアの初期化処理にて認証情報に基づいて専用デバイスを設定した際の例である。
図5の詳細は後述する。
FIG. 5 shows an example in which a dedicated device is set based on the authentication information in the firmware initialization process when the PLC is powered on.
Details of FIG. 5 will be described later.

次に、図1を用いて、PLCに格納した制御プログラムの実行時に許可されたPLC上での実行であることを確認するFA機器制御プログラムの不正利用防止システムを構成する要素を説明する。   Next, with reference to FIG. 1, description will be given of elements constituting an unauthorized use prevention system for an FA device control program that confirms execution on a PLC that is permitted when the control program stored in the PLC is executed.

まず、エンジニアリング環境側PC100の構成要素を説明する。   First, components of the engineering environment side PC 100 will be described.

1は、エンジニアリング環境側PC100においてユーザがキーボードやマウス等を用いてPLCの制御プログラム作成やパラメータ設定を行うための入力部である。   Reference numeral 1 denotes an input unit used by the user on the engineering environment side PC 100 to create a PLC control program and set parameters using a keyboard, a mouse, or the like.

2は、ユーザがPLCの制御プログラムを作成する制御プログラム作成部である。   Reference numeral 2 denotes a control program creation unit that creates a PLC control program.

3は、制御プログラム作成部2にて作成した制御プログラムを格納するための制御プログラム記憶部である。   Reference numeral 3 denotes a control program storage unit for storing the control program created by the control program creation unit 2.

4は、制御プログラム記憶部3に格納した制御プログラムのPLCへの書込みやPLCからの読出しなどのPLCに対するアクセス要求をPLCに送信するアクセス要求送信処理部である。   Reference numeral 4 denotes an access request transmission processing unit that transmits an access request to the PLC such as writing to the PLC of the control program stored in the control program storage unit 3 and reading from the PLC.

5は、入力部1によりユーザからの制御プログラムの書込み指示を受けて制御プログラム記憶部3に格納されている制御プログラムを読み出してアクセス要求送信処理部4にPLCへの書込み要求を行う制御プログラム書込み要求部である。   5 is a control program write that receives a control program write instruction from the user by the input unit 1 and reads the control program stored in the control program storage unit 3 and makes a write request to the PLC to the access request transmission processing unit 4 It is a request part.

6aは、エンジニアリング環境側PC100にて作成した制御プログラムに対してセキュリティ設定を無効から有効にするためのセキュリティ設定部である。   Reference numeral 6a denotes a security setting unit for enabling the security setting for the control program created by the engineering environment side PC 100 from invalid.

7は、乱数を生成する乱数生成処理部である。
より具体的には、乱数生成処理部7は、セキュリティ設定部6のセキュリティ設定を無効から有効に設定したときにプロジェクト(FA機器単位で作成する制御プログラムやパラメータ設定などから構成される情報)で固有であり、認証ラダーの生成時の入力として使用する乱数やエンジニアリング環境とPLC間で認証を行う際のチャレンジ&レスポンス認証用の乱数(チャレンジ値)を生成する。
Reference numeral 7 denotes a random number generation processing unit that generates random numbers.
More specifically, the random number generation processing unit 7 is a project (information composed of control programs and parameter settings created for each FA device) when the security setting of the security setting unit 6 is set from invalid to valid. A random number that is unique and used as an input when generating an authentication ladder and a random number (challenge value) for challenge and response authentication when performing authentication between the engineering environment and the PLC are generated.

8aは、セキュリティ設定を有効にした際に制御プログラムの書込み先であるPLCと制御プログラムとの関連付けを行い、認証ラダーを生成するために乱数生成処理部7にて生成した乱数を格納する認証ラダー生成用乱数記憶部である。   8a is an authentication ladder that stores the random number generated by the random number generation processing unit 7 in order to associate the PLC to which the control program is written with the control program when the security setting is enabled and to generate an authentication ladder This is a random number storage unit for generation.

9aは、セキュリティ設定を有効した際に制御プログラムの書込み先であるPLCから読み取ったPLCを個体識別するためのシリアルID(例えば、製造番号など)を格納するシリアルID記憶部である。   A serial ID storage unit 9a stores a serial ID (for example, a manufacturing number) for individually identifying the PLC read from the PLC to which the control program is written when the security setting is validated.

10aは、エンジニアリング環境側PC100側で生成した認証情報とPLC200で生成した認証情報を比較して認証を行う認証処理部である。
より具体的には、認証処理部10aは、乱数生成処理部7に対して乱数の生成の要求や、セキュリティ設定部6aのセキュリティ設定が有効の場合にPLCに対する制御プログラムの書込み/読取りを行う際にアクセス先のPLCが関連付けられているPLCであることを確認するためにその都度乱数生成処理部7で生成した乱数と認証ラダー生成用乱数記憶部8aに格納されている乱数とシリアルID記憶部9aに格納されているシリアルIDを入力としてハッシュ関数にて生成したハッシュ値を認証情報とし、その認証情報とPLC側で生成した認証情報を比較して認証を行う。
An authentication processing unit 10a performs authentication by comparing authentication information generated on the engineering environment side PC 100 side with authentication information generated by the PLC 200.
More specifically, when the authentication processing unit 10a requests the random number generation processing unit 7 to generate a random number, or writes / reads a control program to / from the PLC when the security setting of the security setting unit 6a is valid. The random number generated by the random number generation processing unit 7 each time and the random number stored in the authentication ladder generation random number storage unit 8a and the serial ID storage unit to confirm that the access destination PLC is associated with the PLC. Authentication is performed by comparing the authentication information generated on the PLC side with the hash value generated by the hash function using the serial ID stored in 9a as input.

次に、PLC200の構成要素を説明する。   Next, components of the PLC 200 will be described.

9bは、PLCメーカが製品出荷時に設定しユーザには書き換えることのできないPLCを個体識別するためのシリアルID(例えば、製造番号など)を格納するシリアルID記憶部である。
シリアルIDは、PLC200にユニークに設定されており、固有識別情報の例である。
そして、シリアルID記憶部9bは、固有識別情報記憶部の例である。
A serial ID storage unit 9b stores a serial ID (for example, a manufacturing number) for individual identification of a PLC that is set by a PLC maker at the time of product shipment and cannot be rewritten by the user.
The serial ID is uniquely set in the PLC 200 and is an example of unique identification information.
The serial ID storage unit 9b is an example of a unique identification information storage unit.

6bは、制御プログラムに対するアクセス制限を行うためのセキュリティ設定を有効にするためのセキュリティ設定部である。
セキュリティ設定部6bは、エンジニアリング環境側のセキュリティ設定の有効化と同期してエンジニアリング環境側からのセキュリティ設定の有効化要求を受けてPLCに格納する制御プログラムに対するアクセス制限を行う。
Reference numeral 6b denotes a security setting unit for enabling security settings for restricting access to the control program.
The security setting unit 6b restricts access to the control program stored in the PLC in response to the request for enabling the security setting from the engineering environment side in synchronization with the enabling of the security setting on the engineering environment side.

8bは、セキュリティ設定の有効化の要求と一緒に送信されてきた乱数を格納する認証ラダー生成用乱数記憶部である。
認証ラダー生成用乱数記憶部8bに格納される乱数は、エンジニアリング環境側PC100の乱数生成処理部7にて生成され、認証ラダー生成用乱数記憶部8aに格納された乱数と同じ乱数である。
認証ラダー生成用乱数記憶部8bは、乱数記憶部の例である。
Reference numeral 8b denotes a random number storage unit for generating an authentication ladder that stores a random number transmitted together with a request for validation of security settings.
The random number stored in the authentication ladder generation random number storage unit 8b is the same random number as the random number generated by the random number generation processing unit 7 of the engineering environment side PC 100 and stored in the authentication ladder generation random number storage unit 8a.
The authentication ladder generation random number storage unit 8b is an example of a random number storage unit.

11は、エンジニアリング環境のアクセス要求送信処理部4から送信されてきたアクセス要求をPLC側で受け付けて要求内容に応じた処理を実行するアクセス要求受信処理部である。
また、アクセス要求受信処理部11は、エンジニアリング環境側PC100から制御プログラム書込み要求とともに、制御プログラム(ラダープログラム)を入力する。
制御プログラムは、前述のようにPLC200の制御処理の対象となる対象デバイスのデバイス番号が含まれるラダープログラムであり、指定されたPLC以外の装置による使用が許されない。制御プログラムは主プログラムの例である。
また、アクセス要求受信処理部11はプログラム入力部の例である。
Reference numeral 11 denotes an access request reception processing unit that receives an access request transmitted from the access request transmission processing unit 4 in the engineering environment on the PLC side and executes processing according to the request content.
The access request reception processing unit 11 inputs a control program (ladder program) together with a control program write request from the engineering environment side PC 100.
As described above, the control program is a ladder program that includes the device number of the target device to be controlled by the PLC 200, and is not allowed to be used by a device other than the designated PLC. The control program is an example of a main program.
The access request reception processing unit 11 is an example of a program input unit.

10bは、ハッシュ演算(一方向演算)を行う認証処理部である。
認証処理部10bは、認証ラダー生成用乱数記憶部8bに格納されている乱数とシリアルID記憶部9bに格納されているシリアルID、および認証情報の生成要求時に一緒に送付されてきた乱数(チャレンジ値)を入力としてハッシュ関数を用いてハッシュ値(レスポンス)を生成する。
より具体的には、認証処理部10bは、セキュリティ設定部6bのセキュリティ設定が有効になっている場合において、認証ラダー(認証プログラム)の生成に先立ち、エンジニアリング環境からの認証要求を受け付けたアクセス要求受信処理部11からの認証情報の生成要求に応じて、ハッシュ値(レスポンス値)を生成する。
認証処理部10bは、一方向演算部の例である。
An authentication processing unit 10b performs hash calculation (one-way calculation).
The authentication processing unit 10b receives the random number stored in the authentication ladder generation random number storage unit 8b, the serial ID stored in the serial ID storage unit 9b, and the random number (challenge sent together with the authentication information generation request). Value) as an input and generate a hash value (response) using a hash function.
More specifically, the authentication processing unit 10b receives an authentication request from the engineering environment prior to generating the authentication ladder (authentication program) when the security setting of the security setting unit 6b is valid. A hash value (response value) is generated in response to the authentication information generation request from the reception processing unit 11.
The authentication processing unit 10b is an example of a one-way calculation unit.

12は、アクセス要求受信処理部11からの制御プログラムの書込み要求を受け付けた際に、セキュリティ設定部6bのセキュリティ設定を確認してセキュリティ設定が有効の場合は認証ラダーを挿入する処理に進み、無効の場合は認証ラダーを含まないままの状態で制御プログラムをPLC内に書込む処理に進むことを指示する制御プログラム書込み処理部である。   12, when receiving a control program write request from the access request reception processing unit 11, confirms the security setting of the security setting unit 6 b and proceeds to processing for inserting an authentication ladder if the security setting is valid. In this case, the control program write processing unit instructs to proceed to the process of writing the control program in the PLC without including the authentication ladder.

13は、認証ラダー(認証プログラム)を生成する認証ラダー自動生成処理部である。
認証ラダーは、制御プログラムに直接挿入可能なラダープログラムであり、PLC200以外の装置による制御プログラムの使用を防止するためのラダープログラムである。
認証ラダー自動生成処理部13は、制御プログラムを実行用制御プログラム記憶部15に格納する際に、認証処理部10bにて生成したハッシュ値に基づいて専用デバイス(認証用デバイス)中の特定のデバイスの番号を選択し、選択した特定のデバイスの番号(選択認証用デバイス番号)が含まれる認証ラダーを生成する。
そして、認証ラダー挿入処理部14により認証ラダーは制御プログラムと合成されて、実行用制御プログラム記憶部15に格納される。
また、詳細は後述するが、制御プログラム実行制御部16が制御プログラムと認証ラダーを実行する前に、認証ラダー自動生成処理部13による認証ラダーの生成とは独立して、認証処理部10bがシリアルIDと乱数に基づいてハッシュ値を生成し、専用デバイス設定部17がハッシュ値に基づき特定の専用デバイスのデバイス番号を選択し、選択したデバイス番号に対応する専用デバイスに対して所定の設定処理(当該専用デバイスをOFF状態からON状態にする設定処理)を行う。
専用デバイス設定部17により、認証ラダーに含まれる専用デバイスのデバイス番号と同じデバイス番号が正確に選択され、当該デバイス番号に対応する専用デバイスに対して設定処理が行われている場合には、制御プログラム実行制御部16が制御プログラムと認証ラダーを実行した際に認証ラダーが正常に動作し、この結果、制御プログラムが正常に動作する。一方、正しいデバイス番号が選択されず、その結果、正しい専用デバイスに対して設定処理が行われていない場合には、制御プログラム実行制御部16が制御プログラムと認証ラダーを実行した際に認証ラダーが正常に動作せず、この結果、制御プログラムの動作が停止する。
認証ラダー自動生成処理部13は、認証プログラム生成部の例である。
なお、認証ラダー自動生成処理部13は、選択したデバイス番号のすべてが含まれ制御プログラムの先頭に配置されることになる認証ラダー(先頭認証プログラム)と、選択したデバイス番号のいずれかが含まれ制御プログラムの複数の挿入位置に挿入されることになる2以上の認証ラダー(挿入認証プログラム)の少なくともいずれかを生成する。
例えば、図4(a)は、制御プログラムの先頭に配置される認証ラダーの例であり、図4(b)は、制御プログラムの途中の挿入位置に挿入される認証ラダーの例である。
An authentication ladder automatic generation processing unit 13 generates an authentication ladder (authentication program).
The authentication ladder is a ladder program that can be directly inserted into the control program, and is a ladder program for preventing the use of the control program by devices other than the PLC 200.
When the authentication ladder automatic generation processing unit 13 stores the control program in the execution control program storage unit 15, a specific device in the dedicated device (authentication device) based on the hash value generated by the authentication processing unit 10b Then, an authentication ladder including the number of the selected specific device (selection authentication device number) is generated.
The authentication ladder is then combined with the control program by the authentication ladder insertion processing unit 14 and stored in the execution control program storage unit 15.
Although details will be described later, before the control program execution control unit 16 executes the control program and the authentication ladder, the authentication processing unit 10b serially operates independently of the generation of the authentication ladder by the authentication ladder automatic generation processing unit 13. A hash value is generated based on the ID and the random number, the dedicated device setting unit 17 selects a device number of a specific dedicated device based on the hash value, and a predetermined setting process (for a dedicated device corresponding to the selected device number ( The setting process for changing the dedicated device from the OFF state to the ON state is performed.
When the dedicated device setting unit 17 accurately selects the same device number as the device number of the dedicated device included in the authentication ladder, and the setting process is performed for the dedicated device corresponding to the device number, control is performed. When the program execution control unit 16 executes the control program and the authentication ladder, the authentication ladder operates normally, and as a result, the control program operates normally. On the other hand, if the correct device number is not selected and, as a result, the setting process is not performed for the correct dedicated device, the authentication ladder is displayed when the control program execution control unit 16 executes the control program and the authentication ladder. As a result, the operation of the control program stops.
The authentication ladder automatic generation processing unit 13 is an example of an authentication program generation unit.
Note that the authentication ladder automatic generation processing unit 13 includes all of the selected device numbers and includes either an authentication ladder (first authentication program) to be arranged at the top of the control program and the selected device number. At least one of two or more authentication ladders (insertion authentication programs) to be inserted at a plurality of insertion positions of the control program is generated.
For example, FIG. 4A is an example of an authentication ladder arranged at the head of the control program, and FIG. 4B is an example of an authentication ladder inserted at an insertion position in the middle of the control program.

14は、認証ラダー自動生成処理部13にて自動生成した認証ラダーを制御プログラムと合成する認証ラダー挿入処理部である。
認証ラダー挿入処理部14は、制御プログラムの先頭に配置される認証ラダーの場合(図4(a)に例示した認証ラダーの場合)は制御プログラムの先頭に配置し、制御プログラムの途中の挿入位置に挿入する認証ラダーの場合(図4(b)に例示した認証ラダーの場合)は指定された挿入位置に挿入する。
認証ラダー挿入処理部14は、プログラム合成部の例である。
なお、制御プログラムと認証ラダーが合成された後のプログラムを合成プログラムとも呼ぶ。
An authentication ladder insertion processing unit 14 synthesizes the authentication ladder automatically generated by the authentication ladder automatic generation processing unit 13 with the control program.
The authentication ladder insertion processing unit 14 is placed at the head of the control program in the case of the authentication ladder placed at the head of the control program (in the case of the authentication ladder illustrated in FIG. 4A), and is inserted in the middle of the control program. In the case of the authentication ladder to be inserted into (in the case of the authentication ladder illustrated in FIG. 4B), it is inserted at the designated insertion position.
The authentication ladder insertion processing unit 14 is an example of a program synthesis unit.
The program after the control program and the authentication ladder are combined is also referred to as a combined program.

15は、エンジニアリング環境側で作成した制御プログラムもしくは認証ラダー挿入処理部14にて認証ラダーが合成された後の制御プログラム(合成プログラム)を格納する実行用制御プログラム記憶部である。
実行用制御プログラム記憶部15は、プログラム記憶部の例である。
An execution control program storage unit 15 stores a control program created on the engineering environment side or a control program (synthesis program) after the authentication ladder is synthesized by the authentication ladder insertion processing unit 14.
The execution control program storage unit 15 is an example of a program storage unit.

16は、PLC200が実行モードになった場合に実行用制御プログラム記憶部15に格納された制御プログラムを実行する制御プログラム実行制御部である。
制御プログラム実行制御部16は、プログラム実行部の例である。
Reference numeral 16 denotes a control program execution control unit that executes a control program stored in the execution control program storage unit 15 when the PLC 200 enters an execution mode.
The control program execution control unit 16 is an example of a program execution unit.

17は、PLCの電源投入時にPLC内のファームウェアの初期化処理にて認証ラダー生成用乱数記憶部8bに格納された乱数とシリアルID記憶部9bに格納されたシリアルIDから生成されたハッシュ値から専用デバイスのデバイス番号を抽出し、抽出したデバイス番号に該当する専用デバイスをONに設定する専用デバイス設定部である。
専用デバイス設定部17は、設定処理部の例である。
17 is a hash value generated from the random number stored in the authentication ladder generation random number storage unit 8b and the serial ID stored in the serial ID storage unit 9b in the initialization process of the firmware in the PLC when the PLC is turned on. It is a dedicated device setting unit that extracts the device number of the dedicated device and sets the dedicated device corresponding to the extracted device number to ON.
The dedicated device setting unit 17 is an example of a setting processing unit.

次に、図1、図2、図3を用いて、エンジニアリング環境上の制御プログラム(ラダープログラム)をPLCへ書込む際の動作を説明する。   Next, an operation when a control program (ladder program) on the engineering environment is written to the PLC will be described with reference to FIGS.

まず、エンジニアリング環境側PC100上で制御プログラムを作成する手順について説明する。   First, a procedure for creating a control program on the engineering environment side PC 100 will be described.

ユーザは、エンジニアリング環境側PC100の入力部1と制御プログラム作成部2を用いて制御プログラムの作成を行い、作成した制御プログラムを制御プログラム記憶部3に格納する。   The user creates a control program using the input unit 1 and the control program creation unit 2 of the engineering environment side PC 100, and stores the created control program in the control program storage unit 3.

次に、エンジニアリング環境側PC100上で作成した制御プログラムをPLC200に書込む際の初回登録時の手順を説明する。   Next, a procedure at the time of initial registration when writing a control program created on the engineering environment side PC 100 to the PLC 200 will be described.

ユーザはエンジニアリング環境側PC100とPLC200をUSB(Universal Serial Bus)ケーブル等にてネットワーク接続する。
次に、アクセス要求送信処理部4とアクセス要求受信処理部11を用いてエンジニアリング環境とPLC間のデータ送受信を行う。
ユーザが入力部1を用いて制御プログラム記憶部3に格納されている制御プログラムのPLCへの書込み指示をすると(図2のS201)、制御プログラム書込み要求部5は制御プログラム記憶部3から制御プログラムを読出す(S202)。
制御プログラム書込み要求部5はセキュリティ設定部6aに対してセキュリティ設定が有効か無効かを確認する(S203)。
セキュリティ設定が無効になっている場合は、制御プログラム書込み要求部5はユーザにセキュリティ設定を有効にするかどうかを問い合わせる。
ユーザから無効のままとする指示を受けた場合は、制御プログラム書込み要求部5はアクセス要求送信処理部4に制御プログラムの書込み処理を指示する(S209)。
The user connects the engineering environment side PC 100 and the PLC 200 to the network using a USB (Universal Serial Bus) cable or the like.
Next, data transmission / reception between the engineering environment and the PLC is performed using the access request transmission processing unit 4 and the access request reception processing unit 11.
When the user instructs to write the control program stored in the control program storage unit 3 to the PLC using the input unit 1 (S201 in FIG. 2), the control program write request unit 5 sends the control program from the control program storage unit 3 to the control program. Is read (S202).
The control program write request unit 5 checks whether the security setting is valid or invalid with respect to the security setting unit 6a (S203).
If the security setting is disabled, the control program write request unit 5 inquires of the user whether to enable the security setting.
When receiving an instruction to remain invalid from the user, the control program write request unit 5 instructs the access request transmission processing unit 4 to write the control program (S209).

ユーザがセキュリティ設定を有効にするとの指示を受けた場合は、制御プログラム書込み要求部5はセキュリティ設定部6aを有効に設定し(S204)、認証処理部10aに対して制御プログラムとPLCの関連付けに用いる認証ラダー生成用乱数の生成を要求する。
乱数生成の要求を受けた認証処理部10aは乱数生成処理部7に対して乱数生成を要求する。
乱数生成処理部7は、乱数を生成し(S205)、乱数を認証処理部10aに渡す。
認証処理部10aは、受け取った乱数を制御プログラム書込み要求部5に返す。
制御プログラム書込み要求部5は、認証処理部10aから受け取った乱数を認証ラダー生成用乱数記憶部8aに格納し(S206)、また、アクセス要求送信処理部4に対して認証ラダー生成用乱数を付けてPLCのセキュリティ設定を有効にする要求を出す。
アクセス要求送信処理部4はPLCのセキュリティ設定を有効にする要求を受け取ると、PLC200のアクセス要求受信処理部11に対してセキュリティ設定の有効化を要求すると共に認証ラダー生成用乱数も一緒に送信して制御プログラムとPLCの関連付けも要求する(S207)。なお、この時点では、制御プログラムはPLC200に送信しない。
When the user receives an instruction to enable the security setting, the control program write request unit 5 sets the security setting unit 6a to be effective (S204), and associates the control program with the PLC to the authentication processing unit 10a. Requests generation of random number for generating authentication ladder to be used.
Upon receiving the request for random number generation, the authentication processing unit 10a requests the random number generation processing unit 7 to generate random numbers.
The random number generation processing unit 7 generates a random number (S205) and passes the random number to the authentication processing unit 10a.
The authentication processing unit 10a returns the received random number to the control program write request unit 5.
The control program write request unit 5 stores the random number received from the authentication processing unit 10a in the authentication ladder generation random number storage unit 8a (S206), and adds an authentication ladder generation random number to the access request transmission processing unit 4. Request to enable the PLC security settings.
When the access request transmission processing unit 4 receives the request to validate the security setting of the PLC, the access request transmission processing unit 4 requests the access request reception processing unit 11 of the PLC 200 to validate the security setting and also transmits a random number for generating an authentication ladder. The control program is also requested to associate with the PLC (S207). At this time, the control program is not transmitted to the PLC 200.

PLC200において、アクセス要求受信処理部11は、セキュリティ設定の有効化の要求を受けるとセキュリティ設定部6bを有効に設定し(S210)、認証処理部10bに対してエンジニアリング環境側PC100で生成した認証ラダー生成用乱数の格納を要求すると共にPLCのシリアルIDの取得を要求する。
認証処理部10bは、認証ラダー生成用乱数を認証ラダー生成用乱数記憶部8bに格納し(S211)、シリアルID記憶部9bに格納されているPLC200を個体識別するためのシリアルIDを読出してアクセス要求受信処理部11に返す。
このシリアルIDはPLCを出荷する際にPLCの製造メーカが任意に設定する情報であり、ユーザが設定/変更ができない情報である。
アクセス要求受信処理部11は、認証処理部10bからシリアルIDを受け取ると、セキュリティ設定の有効化の要求に対する応答に受け取ったシリアルIDを付加してアクセス要求送信処理部4に返す(S212)。
In the PLC 200, the access request reception processing unit 11 sets the security setting unit 6b to be valid when receiving a request for validation of security settings (S210), and the authentication ladder generated by the engineering environment side PC 100 for the authentication processing unit 10b. Requests the generation of a random number for generation and requests the acquisition of the serial ID of the PLC.
The authentication processing unit 10b stores the authentication ladder generation random number in the authentication ladder generation random number storage unit 8b (S211), and reads and accesses the serial ID for individual identification of the PLC 200 stored in the serial ID storage unit 9b. It returns to the request reception processing unit 11.
This serial ID is information that is arbitrarily set by the manufacturer of the PLC when shipping the PLC, and is information that cannot be set / changed by the user.
Upon receiving the serial ID from the authentication processing unit 10b, the access request reception processing unit 11 adds the received serial ID to the response to the security setting validation request and returns it to the access request transmission processing unit 4 (S212).

エンジニアリング環境側PC100において、アクセス要求送信処理部4は、アクセス要求受信処理部11からの応答を受け取ると、応答に付加されてきたPLC200のシリアルIDを制御プログラム書込み要求部5に返し、制御プログラム書込み要求部5はそれをシリアルID記憶部9aに格納する(S208)。
本実施の形態では、認証ラダー生成用乱数記憶部8a、8bに格納されている認証ラダー生成用乱数とシリアルID記憶部9a、9bに格納されているPLCのシリアルIDにより制御プログラムとPLC間を関連付け、この2つの情報からハッシュ関数を用いて生成したものを認証情報とする。
制御プログラム書込み要求部5は、アクセス要求送信処理部4に制御プログラムの書込み処理を要求し、アクセス要求送信処理部4は書込み要求と制御プログラムをPLCのアクセス要求受信処理部11に送信する(S209)(図3のS301)。
In the engineering environment side PC 100, when receiving the response from the access request reception processing unit 11, the access request transmission processing unit 4 returns the serial ID of the PLC 200 added to the response to the control program write request unit 5 to write the control program. The request unit 5 stores it in the serial ID storage unit 9a (S208).
In the present embodiment, between the control program and the PLC based on the authentication ladder generation random number stored in the authentication ladder generation random number storage units 8a and 8b and the PLC serial ID stored in the serial ID storage units 9a and 9b. The information generated using the hash function from these two pieces of information is used as authentication information.
The control program write request unit 5 requests the access request transmission processing unit 4 to write the control program, and the access request transmission processing unit 4 transmits the write request and the control program to the access request reception processing unit 11 of the PLC (S209). (S301 in FIG. 3).

PLC200において、アクセス要求受信処理部11は、制御プログラムの書込み要求を受け取ると制御プログラム書込み処理部12に制御プログラムの書込みを指示する。
制御プログラム書込み処理部12は、制御プログラムの書込み指示を受けるとセキュリティ設定部6bのセキュリティ設定を確認し(S302)、無効になっていた場合は受け取った制御プログラムをそのままの状態で実行用制御プログラム記憶部15に格納する(S309)。
In the PLC 200, the access request reception processing unit 11 instructs the control program write processing unit 12 to write the control program upon receiving a control program write request.
When receiving the control program write instruction, the control program write processing unit 12 checks the security setting of the security setting unit 6b (S302). If the control program write processing unit 12 has been invalidated, the control program write processing unit 12 executes the received control program as it is. The data is stored in the storage unit 15 (S309).

セキュリティ設定が有効になっていた場合には、制御プログラム書込み処理部12は認証ラダー自動生成処理部13に認証ラダーの生成を指示する。
認証ラダー自動生成処理部13は、制御プログラム書込み処理部12からの認証ラダーの生成指示を受けて認証処理部10bに対して認証情報の生成を指示する。
認証処理部10bは、認証ラダー生成用乱数記憶部8bに格納されている乱数とシリアルID記憶部9bに格納されているシリアルIDを読出し(S304、S305)、乱数とシリアルIDに対してハッシュ関数(一方向性関数)を用いて認証情報(ハッシュ値)を生成し(S306)、生成した認証情報(ハッシュ値)を認証ラダー自動生成処理部13に返す。
認証ラダー自動生成処理部13は、認証処理部10bから受け取った認証情報を元に認証ラダー(認証を目的としたラダープログラム)を自動生成し(S307)、認証ラダー挿入処理部14に対して自動生成した認証ラダーの制御プログラムへの挿入を指示する。
認証ラダー挿入処理部14は、ユーザがエンジニアリング環境側PC100を用いて作成した制御プログラムの特定の位置に認証ラダー自動生成処理部13にて生成した認証ラダーを挿入する(S308)。
認証ラダー挿入処理部14は、認証ラダーを挿入した制御プログラム(合成プログラム)を実行用制御プログラム記憶部15に格納して(S309)、制御プログラムの書込み処理が完了する。
When the security setting is valid, the control program writing processing unit 12 instructs the authentication ladder automatic generation processing unit 13 to generate an authentication ladder.
Upon receiving an authentication ladder generation instruction from the control program writing processing unit 12, the authentication ladder automatic generation processing unit 13 instructs the authentication processing unit 10b to generate authentication information.
The authentication processing unit 10b reads the random number stored in the authentication ladder generation random number storage unit 8b and the serial ID stored in the serial ID storage unit 9b (S304, S305), and performs a hash function on the random number and the serial ID. Authentication information (hash value) is generated using (one-way function) (S306), and the generated authentication information (hash value) is returned to the authentication ladder automatic generation processing unit 13.
The authentication ladder automatic generation processing unit 13 automatically generates an authentication ladder (ladder program for the purpose of authentication) based on the authentication information received from the authentication processing unit 10b (S307), and automatically generates an authentication ladder insertion processing unit 14. Instructs the generated authentication ladder to be inserted into the control program.
The authentication ladder insertion processing unit 14 inserts the authentication ladder generated by the authentication ladder automatic generation processing unit 13 at a specific position of the control program created by the user using the engineering environment side PC 100 (S308).
The authentication ladder insertion processing unit 14 stores the control program (synthesis program) in which the authentication ladder is inserted in the execution control program storage unit 15 (S309), and the control program writing process is completed.

なお、本実施の形態では、認証情報の生成にエンジニアリング環境側PC100で生成した乱数とPLC200のシリアルIDの2つを入力としているが、この2つの信号以外に例えばPLC200に搭載されているCPU(Central Processing Unit)のCPUタイプと組み合わせて認証情報を生成しても良い。
このCPUタイプはエンジニアリング環境上で制御プログラムの書込み先であるPLC200を選択した際に確定するエンジニアリング環境内で扱う情報であり、PLC200側もあらかじめ内部的に保持している情報であるため通信路(エンジニアリング環境とPLC間)上には流れない情報であり、認証情報が推測されにくくなる。
In the present embodiment, the authentication information is generated by inputting the random number generated by the PC 100 on the engineering environment side and the serial ID of the PLC 200, but in addition to these two signals, for example, a CPU ( Authentication information may be generated in combination with a CPU type of Central Processing Unit.
This CPU type is information that is handled in the engineering environment that is determined when the PLC 200 to which the control program is written is selected in the engineering environment. This is information that does not flow on the engineering environment and the PLC), and authentication information is difficult to guess.

次に、図4、図5を用いて、認証情報に基づいた認証ラダーの生成と挿入、およびPLCの電源投入時に実行する初期化処理での専用デバイスの設定方法について説明する。   Next, using FIG. 4 and FIG. 5, a method for setting a dedicated device in the initialization process executed when the authentication ladder is generated and inserted based on the authentication information and the PLC is powered on will be described.

ここでは、PLC200のシリアルIDを例えば「009910987654321」、認証ラダー生成用乱数を例えば「1234567890」とした場合の認証ラダーの生成方法を説明する。
また、認証処理部10bにて認証ラダー生成用乱数とシリアルIDを入力としてハッシュ関数により生成した認証情報を例えば「EA082DFE1CBA7816」とする。
ハッシュ関数により生成した認証情報は、PLC200のシリアルIDを利用して生成するため、別のPLCではシリアルIDが異なるために同じ認証情報が生成されることはない。
認証ラダー自動生成処理部13では、生成した認証情報を1バイトで区切り、区切った値を専用デバイスのデバイス番号に見立てる。
例えば、最初の1バイトの「EA」を専用デバイスのデバイス番号(10進表示)に見立てるとA234になる。ここで「A」は、専用デバイスを意味することとする。
同様に、2バイト目、3バイト目を専用デバイスのデバイス番号に見立てると、A8、A45、A254、A28、(以下省略)となる。
このように選択されたデバイス番号は、選択認証用デバイス番号に相当する。
また、PLC200の対象デバイスのデバイス番号には「X」等が用いられ、制御プログラムには「X50」のように対象デバイスのデバイス番号が示されるが、これに近似させて認証ラダーでは専用デバイスのデバイス番号を「A234」のようにする。このように、認証ラダーでは、対象デバイスのデバイス番号を疑似するデバイス番号が用いられる。
Here, a description will be given of a method for generating an authentication ladder when the serial ID of the PLC 200 is, for example, “009910987654321” and the authentication ladder generation random number is, for example, “12345567890”.
Also, authentication information generated by the hash function using the authentication ladder generation random number and the serial ID in the authentication processing unit 10b as input is, for example, “EA082DFE1CBA7816”.
Since the authentication information generated by the hash function is generated using the serial ID of the PLC 200, the same authentication information is not generated because the serial ID is different in another PLC.
The authentication ladder automatic generation processing unit 13 delimits the generated authentication information with 1 byte, and regards the delimited value as the device number of the dedicated device.
For example, if the first one byte “EA” is regarded as the device number (decimal display) of the dedicated device, A234 is obtained. Here, “A” means a dedicated device.
Similarly, when the second byte and the third byte are regarded as the device number of the dedicated device, they are A8, A45, A254, A28 (hereinafter omitted).
The device number selected in this way corresponds to a selection authentication device number.
In addition, “X” or the like is used as the device number of the target device of the PLC 200, and the device number of the target device is shown in the control program as “X50”. The device number is set to “A234”. Thus, in the authentication ladder, a device number that simulates the device number of the target device is used.

認証ラダー自動生成処理部13では、これらの情報を元に図4に示すような認証ラダー(ラダープログラム)を生成する。
図4(a)は、選択されたすべてのデバイス番号(A234、A8、A45、A254等)が含まれ、制御プログラムの先頭に配置されることになる認証ラダーの例である。
図4(a)の認証ラダーは、実行時に専用デバイス(A234やA8などに対応する専用デバイス)のON/OFFの状態を確認して、1つでもOFF状態の専用デバイスがあった場合は制御プログラムの実行を停止するためのデバイス(図4(a)の例ではE99)をONに設定する。
PLCでは制御プログラムに対して1度のみの実行や定周期ごとの実行等といった実行タイプを定義することができるので、この認証ラダーは制御プログラムの実行時に1度だけ実施するように設定する。
The authentication ladder automatic generation processing unit 13 generates an authentication ladder (ladder program) as shown in FIG. 4 based on these pieces of information.
FIG. 4A is an example of an authentication ladder that includes all the selected device numbers (A234, A8, A45, A254, etc.) and is placed at the top of the control program.
The authentication ladder in FIG. 4A checks the ON / OFF state of a dedicated device (a dedicated device corresponding to A234, A8, etc.) at the time of execution, and controls if there is even one dedicated device in the OFF state. A device for stopping execution of the program (E99 in the example of FIG. 4A) is set to ON.
In the PLC, an execution type such as execution only once or execution every fixed period can be defined for the control program. Therefore, the authentication ladder is set to be executed only once when the control program is executed.

また、認証ラダー自動生成処理部13は、上記で生成した認証ラダーの専用デバイスのデバイス番号を制御プログラムのステップ数に見立てて、制御プログラムのそのステップ数の箇所に認証ラダーを挿入する。
図4(b)に示すように、例えば上記の例において専用デバイスA234の場合は、デバイス番号234をステップ数として見立てて、制御プログラムの234ステップ目に認証ラダーを挿入する。
ただし、挿入する際はデバイス番号をソートしてから数の小さい順に認証ラダーを制御プログラムの該当するステップ数目に挿入する。
これにより、制御プログラムの実行中でも制御プログラムが関連付けたPLC上で実行していることを確認することができる。
例えば、認証ラダーを別のPLCに書込んで実行した際に専用デバイスのA234がOFFだった場合には、図4(b)に示す例では挿入した認証ラダーの出力部の命令が実行されないことになる(図中の右側に記載のY0がONに設定されない)。
このため、制御プログラムが正常に動作できず、PLCに接続されたFA機器も正常に制御できなくなるので制御プログラムの不正利用を防止することができる。
図4の例では認証ラダー自動生成処理部13にて生成した認証ラダーを説明しやすくするためにラダープログラム形式で表現しているが、実際にPLC200上で生成される認証ラダーは実行コード形式で生成される。
Further, the authentication ladder automatic generation processing unit 13 inserts the authentication ladder at a position corresponding to the number of steps of the control program, based on the device number of the dedicated device of the authentication ladder generated above as the number of steps of the control program.
As shown in FIG. 4B, in the case of the dedicated device A 234 in the above example, for example, the device number 234 is regarded as the number of steps, and the authentication ladder is inserted at the 234 step of the control program.
However, when inserting, the authentication ladder is inserted into the corresponding step number of the control program in ascending order after the device numbers are sorted.
Thereby, it is possible to confirm that the control program is being executed on the associated PLC even while the control program is being executed.
For example, when A234 of the dedicated device is OFF when the authentication ladder is written in another PLC and executed, the instruction of the output part of the inserted authentication ladder is not executed in the example shown in FIG. 4B. (Y0 described on the right side in the figure is not set to ON).
For this reason, since the control program cannot operate normally and the FA device connected to the PLC cannot be controlled normally, unauthorized use of the control program can be prevented.
In the example of FIG. 4, the authentication ladder generated by the authentication ladder automatic generation processing unit 13 is expressed in a ladder program format for easy explanation, but the authentication ladder actually generated on the PLC 200 is in an execution code format. Generated.

次に、PLC200の電源投入時にファームウェアの初期化処理にて専用デバイスを設定する際の動作について説明する。   Next, an operation for setting a dedicated device in the firmware initialization process when the power of the PLC 200 is turned on will be described.

ファームウェアの初期化処理にて専用デバイス設定部17は、専用デバイスを0クリアし、PLC200のセキュリティ設定部6bが有効になっているかどうかを確認する。
セキュリティ設定が無効だった場合には専用デバイスに対する設定は何もしない。
セキュリティ設定が有効だった場合には、専用デバイス設定部17は認証処理部10bに対して認証情報の生成を要求し、その要求を受けた認証処理部10bが認証ラダー生成用乱数記憶部8bに格納されている乱数とシリアルID記憶部9bに格納されているPLCのシリアルIDからハッシュ関数を用いて認証情報(ハッシュ値)を生成する。
専用デバイス設定部17は、認証処理部10bにて生成した認証情報(ハッシュ値)を受け取り、認証ラダー自動生成処理部13にて専用デバイスのデバイス番号を生成した様に認証情報を1バイトで区切って、区切った1バイトの値をデバイス番号に見立て、そのデバイス番号に該当する専用デバイスをONに設定する。
図5に示す例では、A234、A8、A45、A254、A28の専用デバイスをONに設定した場合である。
ファームウェアでの初期化処理が終了し、PLC200が実行モード(制御プログラムの実行)になった場合は、制御プログラム実行制御部16が実行用制御プログラム記憶部15に格納されている制御プログラムを実行し、制御プログラムの先頭に配置した認証ラダー(図4(a))によって、上記初期化処理にて設定した専用デバイスの特定のデバイスのON/OFF状態を確認し、一つでも確認対象となっていた専用デバイスがOFFになっていた場合は、制御プログラムが不正コピーされたPLC上での動作であることを判断し、制御プログラムの実行を停止することができる。
また、制御プログラムの実行中でも制御プログラム中に挿入した認証ラダー(図4(b))により制御プログラムの不正利用を確認し、不正利用を確認した際は制御プログラムは正常動作しないために制御プログラムの不正コピーによる模造品上での利用を防止することができる。
また、認証ラダーをPLCが自動生成し制御プログラムの実行時に認証ラダーが実行されて不正利用を判断しているので、ユーザには意識させること無く制御プログラムの不正利用を防止することができる。
In the initialization process of the firmware, the dedicated device setting unit 17 clears the dedicated device to 0 and confirms whether the security setting unit 6b of the PLC 200 is enabled.
If the security setting is invalid, nothing is set for the dedicated device.
When the security setting is valid, the dedicated device setting unit 17 requests the authentication processing unit 10b to generate authentication information, and the authentication processing unit 10b that receives the request stores the authentication ladder generation random number storage unit 8b. Authentication information (hash value) is generated from the stored random number and the serial ID of the PLC stored in the serial ID storage unit 9b using a hash function.
The dedicated device setting unit 17 receives the authentication information (hash value) generated by the authentication processing unit 10b, and divides the authentication information into 1 byte as if the authentication ladder automatic generation processing unit 13 generated the device number of the dedicated device. Then, the delimited 1-byte value is regarded as a device number, and a dedicated device corresponding to the device number is set to ON.
In the example shown in FIG. 5, the dedicated devices A234, A8, A45, A254, and A28 are set to ON.
When the initialization process in the firmware is finished and the PLC 200 enters the execution mode (execution of the control program), the control program execution control unit 16 executes the control program stored in the execution control program storage unit 15. The ON / OFF state of a specific device of the dedicated device set in the initialization process is confirmed by the authentication ladder (FIG. 4A) arranged at the head of the control program, and even one of them is a confirmation target. If the dedicated device is turned off, it can be determined that the control program is operating on the illegally copied PLC, and the execution of the control program can be stopped.
Further, even when the control program is being executed, the unauthorized use of the control program is confirmed by the authentication ladder (FIG. 4B) inserted in the control program, and when the unauthorized use is confirmed, the control program does not operate normally. Use on counterfeit goods by illegal copying can be prevented.
Further, since the PLC automatically generates an authentication ladder and the authentication ladder is executed when the control program is executed to determine unauthorized use, unauthorized use of the control program can be prevented without making the user aware of it.

制御プログラムの使用が許可されているPLC200が制御プログラムを使用する場合は、認証ラダー生成時に用いられたシリアルID及び乱数と同じシリアルID及び乱数が用いられるので、初期化処理において正しいデバイス番号(認証ラダーに含まれているデバイス番号と同じデバイス番号)が選択され、専用デバイスが正しく設定されるはずである。
このため、制御プログラムの使用が許可されているPLC200では、常に制御プログラムを正常に動作させることができる。
一方で、制御プログラムの使用が許可されていない装置(PLC200以外の装置)では、認証ラダー生成時にPLC200で用いられたシリアルID及び乱数を知りえないので、初期化処理において正しいデバイス番号が選択されることはなく、従って、専用デバイスが正しく設定されることはない。
このため、制御プログラムの使用が許可されていない装置では、制御プログラムの動作が停止し、制御プログラムを使用することができない。
When the PLC 200 that is permitted to use the control program uses the control program, the same serial ID and random number as the serial ID and random number used when generating the authentication ladder are used. The device number that is the same as the device number included in the ladder) is selected, and the dedicated device should be set correctly.
For this reason, in the PLC 200 that is permitted to use the control program, the control program can always operate normally.
On the other hand, a device that is not permitted to use the control program (a device other than the PLC 200) cannot know the serial ID and random number used in the PLC 200 when generating the authentication ladder, so the correct device number is selected in the initialization process. Therefore, the dedicated device is not set correctly.
For this reason, in an apparatus that is not permitted to use the control program, the operation of the control program stops and the control program cannot be used.

このように、本実施の形態によれば、PLCに格納される制御プログラムに対して、PLCのシリアルIDと制御プログラムを作成した際にエンジニアリング環境側で生成した乱数から認証情報を生成し、生成した認証情報から制御プログラムに直接挿入が可能な認証ラダーを自動生成して、制御プログラムの実行時にあらかじめ関連付けたPLC上での実行であることを確認することで、ユーザに意識させることなく制御プログラムとPLC間で認証を行い、認証結果に応じて制御プログラムの実行を停止することにより制御プログラムの不正利用を防止することができる。   As described above, according to the present embodiment, the authentication information is generated from the random number generated on the engineering environment side when creating the PLC serial ID and the control program for the control program stored in the PLC. By automatically generating an authentication ladder that can be directly inserted into the control program from the authenticated information and confirming that it is executed on the PLC that is associated in advance when the control program is executed, the control program can be made without making the user aware of it. And unauthorized use of the control program can be prevented by stopping the execution of the control program according to the authentication result.

以上、本実施の形態では、
FA(Factory Automation)機器を制御する制御プログラム(ラダープログラム)を他のFA機器へ不正にコピーされてもコピー先のFA機器上では制御プログラムが正常に動作しないようにするためのFA機器制御プログラムの不正利用防止システムにおいて、
FA機器に対する制御プログラムやパラメータ等の設定や確認を行うためのエンジニアリング環境(アプリケーション)と制御プログラムに基づいて入力機器の指令信号のON/OFFに応じて出力機器をON/OFFすることによりシーケンス制御(あらかじめ定められた順序・条件に従い、対象を思い通りに動作させること)を行うPLC(Programmable Logic Controller)により実現する制御プログラムの不正利用を防止するための装置であって、
エンジニアリング環境に対してユーザが制御プログラムの作成やパラメータ等の入力および機能の実行を指示するための入力部と、
ユーザが前記入力部を用いてPLC上で実行される制御プログラム(ラダープログラム)を作成する制御プログラム作成部と、
前記制御プログラム作成部にて作成したPLC用の制御プログラムを格納するための制御プログラム記憶部と、
エンジニアリング環境からPLCに対して制御プログラムやパラメータ等の書込み/読出しを要求し且つその応答を受け取るためのアクセス要求送信処理部と、
前記制御プログラム記憶部に格納した制御プログラムをPLCに書込むための処理を行う制御プログラム書込み要求部と、
エンジニアリング環境上にて作成した制御プログラムに対するセキュリティ機能を有効にする場合にのみ設定するセキュリティ設定部と、
PLCにて認証ラダーを生成する際に用いる乱数や制御プログラムとPLC間で認証を行う際に利用する乱数を生成するための乱数生成処理部と、
前記制御プログラム書込み要求部からの乱数生成要求を受けて前記乱数生成処理部に対して乱数の生成を依頼したり制御プログラムとPLCとの間で認証を行うために乱数やPLCを個体識別するための情報からハッシュ関数(一方向関数)を用いて認証情報を生成したりする認証処理部と、
前記乱数生成処理部にて生成したPLCにて認証ラダーを生成する際に用いる乱数を格納するための認証ラダー生成用乱数記憶部と、
前記制御プログラム記憶部に格納した制御プログラムをPLCに初回書込みを実施した際にPLCから抽出したPLCを個体識別するためのシリアルID(製造番号など)を格納するシリアルID記憶部と、
エンジニアリング環境からのアクセス要求を受付けそのアクセス要求に応じて各処理部へ要求内容を転送するためのアクセス要求受信処理部と、
PLCに格納した制御プログラムに対するセキュリティ機能を有効する場合にのみ設定するセキュリティ設定部と、
認証ラダーを生成するためにエンジニアリング環境側で生成され送信されてきた乱数を格納するための認証ラダー生成用乱数記憶部と、
PLCを個体識別するためのシリアルIDを格納するシリアルID記憶部と、前記アクセス要求受信処理部からの制御プログラムの書込み要求を受けて制御プログラムの書込みを行う制御プログラム書込み処理部と、
前記セキュリティ設定部のセキュリティ機能が有効に設定されている場合に前記認証ラダー生成用乱数記憶部に格納されている乱数と前記シリアルID記憶部に格納されているシリアルIDからエンジニアリング環境側の前記認証処理部と同じアルゴリズムを用いて認証情報を生成するハッシュ値生成処理部と、
PLCに制御プログラムを書込む際に前記ハッシュ値生成処理部にて生成したハッシュ値に基づいて認証ラダーを自動生成する認証ラダー自動生成処理部と、
前記認証ラダー自動生成処理部にて生成した認証ラダーをエンジニアリング環境から送信されてきた制御プログラムに挿入する認証ラダー挿入処理部と、
前記セキュリティ設定部のセキュリティ機能が無効に設定されている場合はエンジニアリング環境から送信されてきた制御プログラムをそのまま格納するかセキュリティ機能が有効に設定されている場合は前記認証ラダー挿入処理部にて認証ラダーが挿入された制御プログラムを格納する実行用制御プログラム記憶部と、
PLCが実行モードになった場合に前記実行用制御プログラム記憶部に格納した制御プログラムを実行する制御プログラム実行制御部と、
PLCの電源投入時にPLCに搭載されているファームウェアが実行する初期化処理にて認証ラダー生成用乱数とシリアルIDから前記認証処理部にて生成したハッシュ値に基づいてPLC内の専用デバイスの設定を行う専用デバイス設定部を設けたFA機器制御プログラムの不正利用防止システムを説明した。
As described above, in the present embodiment,
FA device control program for preventing a control program from operating normally on a copy-destination FA device even if a control program (ladder program) for controlling an FA (Factory Automation) device is illegally copied to another FA device In the unauthorized use prevention system,
Sequence control by turning ON / OFF the output device according to the ON / OFF of the command signal of the input device based on the engineering environment (application) for setting and checking the control program and parameters etc. for the FA device and the control program An apparatus for preventing unauthorized use of a control program realized by a PLC (Programmable Logic Controller) that performs (according to a predetermined order and condition).
An input unit for the user to instruct the engineering environment to create a control program, input parameters, etc. and execute functions;
A control program creation unit for creating a control program (ladder program) executed on the PLC by the user using the input unit;
A control program storage unit for storing a control program for PLC created by the control program creation unit;
An access request transmission processing unit for requesting writing / reading of a control program and parameters to the PLC from the engineering environment and receiving a response;
A control program write request unit for performing processing for writing the control program stored in the control program storage unit to the PLC;
A security setting section that is set only when the security function for the control program created in the engineering environment is enabled,
A random number generation processing unit for generating a random number used when generating an authentication ladder in the PLC and a random number used when performing authentication between the control program and the PLC;
In order to request random number generation from the random number generation processing unit upon receiving a random number generation request from the control program write request unit, or to individually identify a random number or PLC in order to perform authentication between the control program and the PLC An authentication processing unit that generates authentication information using a hash function (one-way function) from the information of
A random number storage unit for generating an authentication ladder for storing a random number used when generating an authentication ladder in the PLC generated by the random number generation processing unit;
A serial ID storage unit for storing a serial ID (such as a serial number) for individually identifying the PLC extracted from the PLC when the control program stored in the control program storage unit is first written to the PLC;
An access request reception processing unit for receiving an access request from the engineering environment and transferring the request content to each processing unit in accordance with the access request;
A security setting section that is set only when the security function for the control program stored in the PLC is enabled;
A random number storage unit for generating an authentication ladder for storing a random number generated and transmitted on the engineering environment side to generate an authentication ladder;
A serial ID storage unit for storing a serial ID for individual identification of a PLC, a control program write processing unit for writing a control program in response to a write request for a control program from the access request reception processing unit,
When the security function of the security setting unit is enabled, the authentication on the engineering environment side from the random number stored in the authentication ladder generation random number storage unit and the serial ID stored in the serial ID storage unit A hash value generation processing unit that generates authentication information using the same algorithm as the processing unit;
An authentication ladder automatic generation processing unit that automatically generates an authentication ladder based on the hash value generated by the hash value generation processing unit when the control program is written in the PLC;
An authentication ladder insertion processing unit for inserting the authentication ladder generated by the authentication ladder automatic generation processing unit into the control program transmitted from the engineering environment;
When the security function of the security setting unit is disabled, the control program transmitted from the engineering environment is stored as it is, or when the security function is enabled, authentication is performed by the authentication ladder insertion processing unit. An execution control program storage unit for storing the control program in which the ladder is inserted;
A control program execution control unit that executes a control program stored in the execution control program storage unit when the PLC enters an execution mode;
The dedicated device in the PLC is set based on the hash value generated by the authentication processing unit from the random number for generating the authentication ladder and the serial ID in the initialization process executed by the firmware installed in the PLC when the PLC is turned on. A system for preventing unauthorized use of an FA device control program provided with a dedicated device setting unit has been described.

実施の形態2.
本実施の形態では、エンジニアリング環境にて作成した制御プログラムの規模や性能面の影響を考慮して認証ラダー自動生成処理部13にて自動生成する認証ラダーの数を調整する機能を説明する。
Embodiment 2. FIG.
In the present embodiment, a function for adjusting the number of authentication ladders automatically generated by the authentication ladder automatic generation processing unit 13 in consideration of the scale and performance of the control program created in the engineering environment will be described.

図6は、制御プログラムの規模や性能面への影響を考慮して自動挿入する認証ラダーの数を調整するFA機器制御プログラムの不正利用防止システムの機能構成である。   FIG. 6 shows the functional configuration of the FA device control program unauthorized use prevention system that adjusts the number of authentication ladders to be automatically inserted in consideration of the influence on the scale and performance of the control program.

エンジニアリング環境側PC100の内部構成は、図1のものと同様であるため、説明を省略する。   The internal configuration of the engineering environment side PC 100 is the same as that shown in FIG.

PLC200においては、本実施の形態では、実行制約時間記憶部18、認証ラダー性能確認部19、認証ラダー挿入判断部20が追加されている。
これら以外の要素は、図1に示したものと同様である。
In the PLC 200, an execution constraint time storage unit 18, an authentication ladder performance confirmation unit 19, and an authentication ladder insertion determination unit 20 are added in the present embodiment.
The other elements are the same as those shown in FIG.

実行制約時間記憶部18は、ユーザによって設定された制御プログラムを実行した際の制約時間を格納する。
つまり、実行制約時間記憶部18は、制御プログラムと認証ラダーが合成された後のプログラム(合成プログラム)の実行所要時間の許容範囲を制約時間(許容時間)として記憶する。
実行制約時間記憶部18は、許容時間記憶部の例である。
The execution constraint time storage unit 18 stores the constraint time when the control program set by the user is executed.
That is, the execution constraint time storage unit 18 stores the allowable range of the required execution time of the program (synthesis program) after the control program and the authentication ladder are combined as the constraint time (allowable time).
The execution constraint time storage unit 18 is an example of an allowable time storage unit.

認証ラダー性能確認部19は、実行制約時間記憶部18に格納した制約時間と制御プログラムの実行時間の差を算出し、認証ラダーを挿入可能な空き時間を確認する。
つまり、認証ラダー性能確認部19は、制御プログラムの実行時間を予測し、予測した制御プログラムの実行時間(予測所要時間)と制約時間との差を空き時間として算出する。
認証ラダー性能確認部19は、所要時間予測部の例である。
The authentication ladder performance confirmation unit 19 calculates the difference between the constraint time stored in the execution constraint time storage unit 18 and the execution time of the control program, and confirms the free time in which the authentication ladder can be inserted.
That is, the authentication ladder performance confirmation unit 19 predicts the execution time of the control program, and calculates the difference between the predicted execution time of the control program (predicted required time) and the constraint time as a free time.
The authentication ladder performance confirmation unit 19 is an example of a required time prediction unit.

認証ラダー挿入判断部20は、エンジニアリング環境側PC100からPLC200へ書込み要求された制御プログラムの規模(例えばステップ数)や認証ラダー性能確認部19にて算出した空き時間に応じて挿入する認証ラダーの数を判断する。
つまり、認証ラダー挿入判断部20は、認証ラダー性能確認部19により算出された空き時間(制御プログラムの実行時間と制約時間との差)に基づき、認証ラダーに含めるデバイス番号の個数を決定する。
この場合、認証ラダー自動生成処理部13は、認証ラダー挿入判断部20により決定された個数分の認証用デバイス番号を選択して認証ラダーを生成する。
また、認証ラダー挿入判断部20は、制御プログラムのプログラムサイズが所定サイズ以上であるか否かを判断し、制御プログラムのプログラムサイズが所定サイズ未満であれば、認証ラダー自動生成処理部13に対して認証ラダーの生成の保留させ、制御プログラムのプログラムサイズが所定サイズ以上であれば、認証ラダー自動生成処理部13に対して認証ラダーの生成を指示する。
認証ラダー挿入判断部20は、個数決定部及びプログラムサイズ判断部の例である。
The authentication ladder insertion determination unit 20 inserts the authentication ladder according to the scale (for example, the number of steps) of the control program requested to be written from the engineering environment side PC 100 to the PLC 200 and the free time calculated by the authentication ladder performance confirmation unit 19. Judging.
That is, the authentication ladder insertion determination unit 20 determines the number of device numbers included in the authentication ladder based on the idle time (difference between the control program execution time and the constraint time) calculated by the authentication ladder performance confirmation unit 19.
In this case, the authentication ladder automatic generation processing unit 13 generates authentication ladders by selecting the number of authentication device numbers determined by the authentication ladder insertion determination unit 20.
The authentication ladder insertion determining unit 20 determines whether the program size of the control program is equal to or larger than a predetermined size. If the program size of the control program is less than the predetermined size, the authentication ladder automatic generation processing unit 13 is notified. Then, the generation of the authentication ladder is suspended, and if the program size of the control program is equal to or larger than the predetermined size, the authentication ladder automatic generation processing unit 13 is instructed to generate the authentication ladder.
The authentication ladder insertion determining unit 20 is an example of a number determining unit and a program size determining unit.

次に、制御プログラムをPLC200に書込む処理において、制御プログラムの規模や性能面への影響を考慮して挿入する認証ラダーの数を判断する際の動作について説明する。   Next, an operation for determining the number of authentication ladders to be inserted in consideration of the influence on the scale and performance of the control program in the process of writing the control program to the PLC 200 will be described.

実行制約時間記憶部18に格納される制約時間は、エンジニアリング環境側PC100にてユーザによって設定され、制御プログラムの書込みと同様にエンジニアリング環境側PC100からパラメータの書込み要求にて実行制約時間記憶部18に格納される。
この制約時間とは、ユーザが指定した時間以内に制御プログラムの実行が完了しなければならない時間であり、例えば、制御プログラムの実行タイプを定周期とした場合などで指定した周期内に制御プログラムの実行が完了しなければならない時間である。
制御プログラム書込み処理部12は、制御プログラムの書込み要求を受けると認証ラダー性能確認部19に制御プログラムの書込み要求を通知する。
The constraint time stored in the execution constraint time storage unit 18 is set by the user in the engineering environment side PC 100, and in the execution constraint time storage unit 18 in response to a parameter write request from the engineering environment side PC 100 in the same manner as the control program writing. Stored.
This restricted time is the time that the execution of the control program must be completed within the time specified by the user. For example, when the execution type of the control program is set to a fixed period, the control program is executed within the specified period. This is the time that execution must complete.
When receiving the control program write request, the control program write processing unit 12 notifies the authentication ladder performance confirmation unit 19 of the control program write request.

認証ラダー性能確認部19は、実行制約時間記憶部18に格納されている制約時間を抽出すると共に制御プログラム中の命令数から予想実行時間を算出し、実行制約時間記憶部18から抽出した制約時間との差を確認する。
制御プログラムの各種命令に対して実行時間(目安)が決まっているため、認証ラダー性能確認部19は予想実行時間を算出することが可能である。
認証ラダー性能確認部19は、この制約時間と予想実行時間との差により認証ラダーが挿入可能な空き時間を確認し、その空き時間を認証ラダー挿入判断部20に渡す。
The authentication ladder performance confirmation unit 19 extracts the constraint time stored in the execution constraint time storage unit 18, calculates the expected execution time from the number of instructions in the control program, and extracts the constraint time extracted from the execution constraint time storage unit 18. Check the difference with.
Since the execution time (reference) is determined for various instructions of the control program, the authentication ladder performance confirmation unit 19 can calculate the expected execution time.
The authentication ladder performance confirmation unit 19 confirms a free time in which the authentication ladder can be inserted based on the difference between the restriction time and the expected execution time, and passes the free time to the authentication ladder insertion determination unit 20.

認証ラダー挿入判断部20は、書込み要求を受けた制御プログラムの規模を確認し、もし規模が小さい場合は認証ラダーの挿入は取り止めて(認証ラダー自動生成処理部13に対して認証ラダーの生成を保留させ)、認証ラダーを挿入する前の状態の制御プログラムを実行用制御プログラム記憶部15に格納する。
例えば、悪意を持ったユーザがダミーの制御プログラムの書込み要求を実施して、認証ラダーが挿入された制御プログラムをエンジニアリング環境側に読み取られて、制御プログラムに挿入した認証ラダーの生成方法などが容易に解析されないようにするためである。
認証ラダーの挿入を取り止める基準としては、例えば、認証ラダーを生成する際に認証情報を1バイトで区切っているため、制御プログラムのステップ数が256ステップ以下の場合は制御プログラムに認証ラダーの挿入するのを取り止めることが考えられる。
The authentication ladder insertion determination unit 20 confirms the scale of the control program that has received the write request. If the scale is small, the authentication ladder insertion determination unit 20 cancels the insertion of the authentication ladder. The control program in the state before the authentication ladder is inserted is stored in the execution control program storage unit 15.
For example, a malicious user can write a dummy control program, read the control program with the authentication ladder inserted into the engineering environment, and easily create the authentication ladder inserted into the control program. This is to prevent analysis.
As a standard for canceling the insertion of the authentication ladder, for example, the authentication information is divided by 1 byte when generating the authentication ladder. It is conceivable to cancel this.

十分な規模の制御プログラムの場合は、認証ラダー挿入判断部20は、認証ラダー性能確認部19にて算出した空き時間をもとに挿入可能な認証ラダーの数を判断する。
また、制御プログラムの規模が大きい場合は、制御プログラムの挿入位置が前半部分(255ステップまで)に集中してしまうため、認証ラダー挿入判断部20は、認証ラダーが制御プログラムの全体に挿入されるようにするために、ステップ数の算出方法を制御プログラムの規模に応じて決定する。
例えば実施の形態1では認証情報を1バイトで区切った値をステップ数と見なしたが、認証情報を制御プログラムの規模に応じて2バイト、3バイトで区切った値をステップ数と見なす方法が考えられる。
このように、認証ラダー挿入判断部20は、図4(b)に例示した認証ラダーを制御プログラムに挿入する場合に、所定の挿入位置決定アルゴリズム(例えば、実施の形態1で示した認証情報を1バイト単位で区切るアルゴリズム)に従って決定される挿入位置が制御プログラムの特定部分に集中する場合は、当該挿入位置決定アルゴリズム以外のアルゴリズムであって、認証ラダーの挿入位置が制御プログラム内でより分散するアルゴリズム(例えば、認証情報を2バイト単位、3バイト単位で区切るアルゴリズム)に従って挿入位置を決定する。
In the case of a sufficiently large control program, the authentication ladder insertion determination unit 20 determines the number of authentication ladders that can be inserted based on the free time calculated by the authentication ladder performance confirmation unit 19.
Further, when the control program is large, the insertion position of the control program is concentrated in the first half (up to 255 steps), so that the authentication ladder insertion determining unit 20 inserts the authentication ladder into the entire control program. In order to do so, the calculation method of the number of steps is determined according to the scale of the control program.
For example, in Embodiment 1, the value obtained by dividing authentication information by 1 byte is regarded as the number of steps, but there is a method in which the value obtained by dividing authentication information by 2 bytes and 3 bytes according to the size of the control program is regarded as the number of steps. Conceivable.
As described above, when inserting the authentication ladder illustrated in FIG. 4B into the control program, the authentication ladder insertion determining unit 20 uses the predetermined insertion position determination algorithm (for example, the authentication information shown in the first embodiment). If the insertion position determined according to the algorithm divided in units of 1 byte is concentrated on a specific part of the control program, the insertion position of the authentication ladder is more dispersed in the control program than the insertion position determination algorithm. The insertion position is determined according to an algorithm (for example, an algorithm that divides authentication information in units of 2 bytes or 3 bytes).

また、認証ラダー挿入判断部20は、制御プログラムに挿入可能な認証ラダーの数と認証ラダーを挿入するステップ数の算出アルゴリズムを認証ラダー自動生成処理部13に通知する。
認証ラダー自動生成処理部13は、認証ラダー挿入判断部20から指示されたアルゴリズムに従って、認証ラダー挿入判断部20から指示された個数分のデバイス番号の認証ラダーを生成する。
なお、認証ラダー自動生成処理部13による認証ラダーの生成手順自体は、実施の形態1と同等である。
Further, the authentication ladder insertion determination unit 20 notifies the authentication ladder automatic generation processing unit 13 of the calculation algorithm for the number of authentication ladders that can be inserted into the control program and the number of steps for inserting the authentication ladder.
The authentication ladder automatic generation processing unit 13 generates authentication ladders for the number of device numbers instructed from the authentication ladder insertion determination unit 20 according to the algorithm instructed from the authentication ladder insertion determination unit 20.
Note that the authentication ladder generation procedure itself by the authentication ladder automatic generation processing unit 13 is the same as that of the first embodiment.

このように、本実施の形態によれば、制御プログラムの実行時の性能面への影響を考慮して認証ラダーの挿入する数を調整することで制御プログラムの実動作を妨げることなく制御プログラムの不正利用を防止することができる。
また、認証ラダーを制御プログラムの規模に応じて挿入する位置を変更することで、悪意を持ったユーザによる解析を困難にすることができ、実行中の制御プログラムの広い範囲で不正利用を検出することができる。
As described above, according to the present embodiment, the number of authentication ladders inserted is adjusted in consideration of the influence on the performance aspect at the time of execution of the control program, so that the control program can be executed without disturbing the actual operation of the control program. Unauthorized use can be prevented.
In addition, by changing the position where the authentication ladder is inserted according to the scale of the control program, it is possible to make it difficult for a malicious user to analyze, and to detect unauthorized use in a wide range of running control programs. be able to.

以上、本実施の形態では、
認証ラダー自動生成処理部にて認証ラダーを生成する際に性能面への影響を考慮するためにユーザによって設定された制御プログラムの実行時間の制約時間を格納する実行制約時間記憶部と、
前記実行制約時間記憶部に格納した制約時間とユーザが作成した制御プログラムの実行時間との差を算出し認証ラダーを挿入可能な空き時間を確認する認証ラダー性能確認部と、
認証ラダーを自動生成する際に制御プログラムの規模と前記認証ラダー性能確認部にて算出した空き時間に応じて挿入する認証ラダーの数を判断する認証ラダー挿入判断部を設けたFA機器制御プログラムの不正利用防止システムを説明した。
As described above, in the present embodiment,
An execution constraint time storage unit that stores the constraint time of the execution time of the control program set by the user in order to consider the impact on performance when generating the authentication ladder in the authentication ladder automatic generation processing unit;
An authentication ladder performance confirmation unit that calculates the difference between the constraint time stored in the execution constraint time storage unit and the execution time of the control program created by the user and confirms the free time in which the authentication ladder can be inserted;
An FA device control program provided with an authentication ladder insertion determination unit that determines the number of authentication ladders to be inserted according to the size of the control program and the free time calculated by the authentication ladder performance confirmation unit when automatically generating an authentication ladder Explained the unauthorized use prevention system.

実施の形態3.
本実施の形態では、PLCから読み出した制御プログラムに挿入されている認証ラダーをユーザに見せないようにするために認証ラダーをフィルタリングすると共に、ユーザが編集した後の制御プログラムに対して認証情報に基づいて算出したステップ数に合わせて認証ラダーの挿入位置を調整する機能を説明する。
Embodiment 3 FIG.
In the present embodiment, the authentication ladder is filtered in order to prevent the authentication ladder inserted in the control program read from the PLC from being shown to the user, and the authentication information is added to the control program after being edited by the user. A function for adjusting the insertion position of the authentication ladder in accordance with the number of steps calculated based on the above will be described.

図7は、本実施の形態に係る不正利用防止システムの機能構成を示す。
図7に示す不正利用防止システムは、制御プログラムに挿入された認証ラダーをユーザに見せないようにするために認証ラダーをフィルタリング処理し、制御プログラムの編集後に認証ラダーの挿入位置を調整する。
FIG. 7 shows a functional configuration of the unauthorized use prevention system according to the present embodiment.
The unauthorized use prevention system shown in FIG. 7 filters the authentication ladder so as not to show the authentication ladder inserted in the control program to the user, and adjusts the insertion position of the authentication ladder after editing the control program.

エンジニアリング環境側PC100では、制御プログラム読出し要求部21、認証ラダーフィルタリング処理部22、認証ラダー挿入位置調整処理部23及び表示部30が追加されている。
他の要素は、図1で示したものと同様である。
なお、本実施の形態では、アクセス要求送信処理部4は、認証ラダーが挿入されている制御プログラム(合成プログラム)をPLC200から入力する。
本実施の形態では、アクセス要求送信処理部4はプログラム入力部の例となる。
なお、実施の形態1と同様に、制御プログラムはPLC200以外での使用は許可されていない。
また、認証ラダーは、実施の形態1で示したものと同様である。
また、認証ラダー生成用乱数記憶部8aは、実施の形態1で説明した認証ラダー生成用乱数を記憶しており、乱数記憶部の例である。
また、シリアルID記憶部9aは、実施の形態1で説明したPLC200のシリアルIDを記憶しており、固有識別情報記憶部の例である。
In the engineering environment side PC 100, a control program read request unit 21, an authentication ladder filtering processing unit 22, an authentication ladder insertion position adjustment processing unit 23, and a display unit 30 are added.
Other elements are the same as those shown in FIG.
In the present embodiment, the access request transmission processing unit 4 inputs from the PLC 200 a control program (synthesizing program) in which an authentication ladder is inserted.
In the present embodiment, the access request transmission processing unit 4 is an example of a program input unit.
As in the first embodiment, the control program is not permitted to be used outside the PLC 200.
The authentication ladder is the same as that shown in the first embodiment.
The authentication ladder generation random number storage unit 8a stores the authentication ladder generation random number described in the first embodiment, and is an example of a random number storage unit.
The serial ID storage unit 9a stores the serial ID of the PLC 200 described in the first embodiment, and is an example of a unique identification information storage unit.

制御プログラム読出し要求部21は、ユーザからの制御プログラムの読出し指示を受けてアクセス要求送信処理部4に対して制御プログラムの読出しを要求する。   Upon receiving a control program read instruction from the user, the control program read request unit 21 requests the access request transmission processing unit 4 to read the control program.

認証ラダーフィルタリング処理部22は、PLC200から読み出した制御プログラム内の認証ラダーの挿入位置を認証処理部10aにて生成した認証情報に基づいて特定し、制御プログラム作成部2にて制御プログラムを表示部30に表示する際にユーザには認証ラダーを見せないようにするために制御プログラムのフィルタリング(非表示設定)を行う。
つまり、認証ラダーフィルタリング処理部22は、認証ラダー生成用乱数記憶部8aの乱数とシリアルID記憶部9aのシリアルIDに対するハッシュ値である認証情報に基づき、PLC200の認証ラダーの挿入位置決定アルゴリズムと同じアルゴリズムに従い、それぞれの認証ラダーの位置を判別して、それぞれの認証ラダーに対して非表示設定を行う。
認証ラダーフィルタリング処理部22は非表示設定部の例である。
The authentication ladder filtering processing unit 22 identifies the insertion position of the authentication ladder in the control program read from the PLC 200 based on the authentication information generated by the authentication processing unit 10a, and the control program creating unit 2 displays the control program. Filtering (non-display setting) of the control program is performed so that the authentication ladder is not shown to the user when displayed on the screen 30.
In other words, the authentication ladder filtering processing unit 22 is the same as the insertion position determination algorithm of the authentication ladder of the PLC 200 based on the authentication information which is a hash value for the random number of the authentication ladder generation random number storage unit 8a and the serial ID of the serial ID storage unit 9a. According to the algorithm, the position of each authentication ladder is determined, and the non-display setting is performed for each authentication ladder.
The authentication ladder filtering processing unit 22 is an example of a non-display setting unit.

表示部30は、認証ラダーフィルタリング処理部22による非表示設定に基づき、認証ラダーは表示せずに、制御プログラムのみを表示する。   The display unit 30 displays only the control program without displaying the authentication ladder, based on the non-display setting by the authentication ladder filtering processing unit 22.

認証ラダー挿入位置調整処理部23は、制御プログラム作成部2で制御プログラムの編集が行われた後に認証情報に基づいて算出した認証ラダーの挿入位置(ステップ数)を元のステップ数の位置に挿入されるように調整する。
つまり、認証ラダー挿入位置調整処理部23は、制御プログラムが編集されて制御プログラムが更新された結果、いずれかの認証ラダーの配置が変動した場合に、当該認証ラダーの位置を変動前の位置に戻す。
例えば、図4(b)の例において、ユーザが制御プログラムを編集した結果、234ステップ目にあったA234が1つ後ろの235ステップ目の位置にずれた場合は、認証ラダー挿入位置調整処理部23は、A234を元の234ステップ目の位置に戻す(X50の前の位置にする)。
認証ラダー挿入位置調整処理部23は、位置調整部の例である。
The authentication ladder insertion position adjustment processing unit 23 inserts the insertion position (number of steps) of the authentication ladder calculated based on the authentication information after the control program is edited by the control program creation unit 2 into the original number of steps. Adjust to be.
That is, the authentication ladder insertion position adjustment processing unit 23 changes the position of the authentication ladder to the position before the change when the arrangement of any authentication ladder changes as a result of the control program being edited and the control program updated. return.
For example, in the example of FIG. 4B, when the user edits the control program and A234 at the 234th step shifts to the position of the 235th step behind, the authentication ladder insertion position adjustment processing unit 23 returns A234 to the original position of the 234th step (the position before X50).
The authentication ladder insertion position adjustment processing unit 23 is an example of a position adjustment unit.

PLC200では、制御プログラム読出し処理部24が追加されている。
制御プログラム読出し処理部24は、実行用制御プログラム記憶部15から制御プログラム(合成プログラム)を読み出す。
また、本実施の形態では、アクセス要求受信処理部11は、制御プログラム読出し処理部24により読み出された制御プログラムをエンジニアリング環境側PC100に出力する。
本実施の形態では、アクセス要求受信処理部11及び制御プログラム読出し処理部24は、プログラム出力部に相当する。
In the PLC 200, a control program read processing unit 24 is added.
The control program read processing unit 24 reads a control program (synthesis program) from the execution control program storage unit 15.
In the present embodiment, the access request reception processing unit 11 outputs the control program read by the control program reading processing unit 24 to the engineering environment side PC 100.
In the present embodiment, the access request reception processing unit 11 and the control program read processing unit 24 correspond to a program output unit.

なお、図7では、PLC200において本実施の形態に係る動作に直接関係のない要素の図示を省略している。
しかし、PLC200には、制御プログラム書込み処理部12、認証ラダー自動生成処理部13、認証ラダー挿入処理部14、制御プログラム実行制御部16、専用デバイス設定部17等の実施の形態1及び実施の形態2で説明した要素が含まれているものとする。
In FIG. 7, elements that are not directly related to the operation according to the present embodiment in the PLC 200 are omitted.
However, the PLC 200 includes the control program writing processing unit 12, the authentication ladder automatic generation processing unit 13, the authentication ladder insertion processing unit 14, the control program execution control unit 16, the dedicated device setting unit 17, and the like in the first embodiment and the first embodiment. It is assumed that the elements described in 2 are included.

次に、セキュリティ設定部6aのセキュリティ設定が有効となっている場合に制御プログラムの読出し要求を出した場合に実行される認証について説明する。   Next, authentication executed when a control program read request is issued when the security setting of the security setting unit 6a is valid will be described.

入力部1からPLC200に格納されている制御プログラムの読出し要求を制御プログラム読出し要求部21が受けると、セキュリティ設定部6aのセキュリティ設定を確認して、セキュリティ設定が有効である場合にPLC200との間でチャレンジ&レスポンス認証を実施するために認証処理部10aにチャレンジ値(乱数)の生成を要求する。
認証処理部10aは、乱数の生成を乱数生成処理部7に要求し、受け取った乱数を制御プログラム読出し要求部21に返す。
制御プログラム読出し要求部21は、アクセス要求送信処理部4に対してPLC200との間でチャレンジ&レスポンス認証を行うよう要求する。
アクセス要求送信処理部4は、アクセス要求受信処理部に対して認証要求とチャレンジ値(乱数)を送信する。
When the control program read request unit 21 receives a control program read request stored in the PLC 200 from the input unit 1, the security setting of the security setting unit 6a is confirmed, and if the security setting is valid, In order to perform challenge and response authentication, the authentication processing unit 10a is requested to generate a challenge value (random number).
The authentication processing unit 10 a requests the random number generation processing unit 7 to generate a random number and returns the received random number to the control program read request unit 21.
The control program read request unit 21 requests the access request transmission processing unit 4 to perform challenge and response authentication with the PLC 200.
The access request transmission processing unit 4 transmits an authentication request and a challenge value (random number) to the access request reception processing unit.

認証要求を受け取ったアクセス要求受信処理部11は、認証処理部10bに対して受け取ったチャレンジ値を渡してレスポンス値の生成を指示する。
認証処理部10aは、レスポンス値の生成要求を受けて認証ラダー生成用乱数記憶部8bに格納されている乱数とシリアルID記憶部9bに格納されているシリアルID、およびチャレンジ値として受け取った乱数を入力としてハッシュ関数にてレスポンス値(ハッシュ値)を生成し、生成したレスポンス値をアクセス要求受信処理部11に返す。
アクセス要求受信処理部11は、受け取ったレスポンス値をアクセス要求送信処理部4に返し、レスポンス値を受け取ったアクセス要求送信処理部4はレスポンス値を制御プログラム読出し要求部21に返す。
Upon receiving the authentication request, the access request reception processing unit 11 passes the received challenge value to the authentication processing unit 10b and instructs generation of a response value.
Upon receiving the response value generation request, the authentication processing unit 10a receives the random number stored in the authentication ladder generation random number storage unit 8b, the serial ID stored in the serial ID storage unit 9b, and the random number received as the challenge value. A response value (hash value) is generated by a hash function as an input, and the generated response value is returned to the access request reception processing unit 11.
The access request reception processing unit 11 returns the received response value to the access request transmission processing unit 4, and the access request transmission processing unit 4 that has received the response value returns the response value to the control program read request unit 21.

制御プログラム読出し要求部21は、認証処理部10aに対して受け取ったレスポンス値を渡し、認証処理部10aはPLC200と同じアルゴリズムを用いて認証ラダー生成用乱数記憶部8aに格納されている乱数とシリアルID記憶部9aに格納されているシリアルIDと先ほど生成したチャレンジ値を入力としてハッシュ関数にてハッシュ値を生成し、レスポンス値と比較し、比較結果を制御プログラム読出し要求部に通知する。
制御プログラム読出し要求部21は、比較結果が不一致だった場合は制御プログラムの読出し処理を中止し、ユーザに対してPLCからの制御プログラムの読出しができないことを通知する。
比較結果が一致した場合は、制御プログラム読出し要求部21はアクセス要求送信処理部4に対して制御プログラムの読出し要求を指示する。
The control program read request unit 21 passes the received response value to the authentication processing unit 10a, and the authentication processing unit 10a uses the same algorithm as the PLC 200 to store the random number and serial number stored in the authentication ladder generation random number storage unit 8a. Using the serial ID stored in the ID storage unit 9a and the challenge value generated earlier as input, a hash value is generated by a hash function, compared with the response value, and the comparison result is notified to the control program read request unit.
If the comparison result does not match, the control program read request unit 21 stops the control program read process and notifies the user that the control program cannot be read from the PLC.
If the comparison results match, the control program read request unit 21 instructs the access request transmission processing unit 4 to read the control program.

アクセス要求受信処理部11は、制御プログラムの読出し要求を受けると制御プログラム読出し処理部24に制御プログラムの読出しを指示する。
制御プログラム読出し処理部24は、実行用制御プログラム記憶部15から制御プログラムを読出し、アクセス要求受信処理部11に返す。
制御プログラム読出し要求部21は、PLC200から読み出した制御プログラムを制御プログラム記憶部3に格納する。
この様にセキュリティ設定が有効になっている場合には、制御プログラムとPLCとの関連付けの情報を用いて認証を行い、同じ関連付けの情報を持っていないプロジェクトとPLC間では制御プログラムの書込みや読出し処理はできないように制御する。
これは、PLCに格納されている制御プログラムを容易に外部へ読み出されて不正コピーを作成されないようにするためである。
なお、本実施の形態では制御プログラムの読出し時に認証処理を実施しているが、制御プログラムの書込み処理を実施する場合も同様に認証処理を行うこととする。
また、本実施の形態ではエンジニアリング環境側からのみ認証要求を行っているが、PLC200側でも実行用制御プログラム記憶部15に対するアクセス要求があった場合にエンジニアリング環境側PC100側へ認証を要求してもよい。
When the access request reception processing unit 11 receives a control program read request, the access request reception processing unit 11 instructs the control program read processing unit 24 to read the control program.
The control program read processing unit 24 reads the control program from the execution control program storage unit 15 and returns it to the access request reception processing unit 11.
The control program read request unit 21 stores the control program read from the PLC 200 in the control program storage unit 3.
When the security setting is valid in this way, authentication is performed using information on the association between the control program and the PLC, and writing and reading of the control program between the project and the PLC that do not have the same association information. Control so that processing is not possible.
This is to prevent the control program stored in the PLC from being easily read out to create an unauthorized copy.
In the present embodiment, the authentication process is performed when the control program is read. However, the authentication process is also performed when the control program write process is performed.
In this embodiment, the authentication request is made only from the engineering environment side. However, even if the PLC 200 side requests access to the execution control program storage unit 15, the engineering environment side PC 100 side requests authentication. Good.

次にPLCから読み出した制御プログラムに挿入されている認証ラダーをユーザに見せないようにするためにフィルタリングする処理について説明する。   Next, a process for filtering in order to prevent the authentication ladder inserted in the control program read from the PLC from being shown to the user will be described.

ユーザが入力部1を用いて制御プログラム記憶部3に格納されている制御プログラムの表示/編集の指示を出した際、認証ラダーフィルタリング処理部22は、認証処理部10aで生成した認証情報を取得し、取得した認証情報に基づいて認証ラダー挿入処理部14にて制御プログラムに挿入されている認証ラダーの挿入位置を確認する(認証情報からステップ数を算出して認証ラダーの挿入位置を把握する)。
認証ラダーフィルタリング処理部22は、制御プログラム記憶部3から制御プログラムを読出し、1度のみ実行するように設定した認証ラダー(図4(a)に例示した認証ラダー)と前記算出したステップ数に位置する認証ラダー(制御プログラム中の特定のステップ数に挿入した認証ラダー:図4(b)に例示した認証ラダー)に対して非表示設定を行う。
制御プログラム作成部2は、認証ラダーフィルタリング処理部22から受け取った制御プログラムを表示する際、非表示設定されている箇所を確認して、非表示設定されている箇所の認証ラダーを表示しない制御を行って表示部30に出力し、表示部30は認証ラダーを表示せずに制御プログラムのみを表示する。
When the user issues an instruction to display / edit the control program stored in the control program storage unit 3 using the input unit 1, the authentication ladder filtering processing unit 22 acquires the authentication information generated by the authentication processing unit 10a. Then, based on the acquired authentication information, the authentication ladder insertion processing unit 14 confirms the insertion position of the authentication ladder inserted in the control program (calculates the number of steps from the authentication information and grasps the insertion position of the authentication ladder). ).
The authentication ladder filtering processing unit 22 reads the control program from the control program storage unit 3 and is positioned at the authentication ladder (the authentication ladder illustrated in FIG. 4A) set to be executed only once and the calculated number of steps. The non-display setting is performed for the authentication ladder to be performed (the authentication ladder inserted at a specific number of steps in the control program: the authentication ladder illustrated in FIG. 4B).
When the control program creation unit 2 displays the control program received from the authentication ladder filtering processing unit 22, the control program creation unit 2 confirms the location that is not set to display, and performs control that does not display the authentication ladder at the location that is set to be hidden. The information is output to the display unit 30. The display unit 30 displays only the control program without displaying the authentication ladder.

また、認証ラダー挿入位置調整処理部23は、制御プログラム作成部2にて編集された後の制御プログラムに対して、ユーザによる命令の追記や削除によって生じた認証ラダー挿入位置(ステップ数)を認証処理部10aで生成した認証情報に基づいて元の位置に戻してから、制御プログラムを制御プログラム記憶部3に格納する。   Further, the authentication ladder insertion position adjustment processing unit 23 authenticates the authentication ladder insertion position (number of steps) generated by adding or deleting a command by the user with respect to the control program edited by the control program creating unit 2. After returning to the original position based on the authentication information generated by the processing unit 10a, the control program is stored in the control program storage unit 3.

このように、本実施の形態によれば、ユーザに認証ラダーを見せないことで、正規ユーザが誤って認証ラダーを削除したり変更したりするのを防ぎ、悪意を持ったユーザに制御プログラムの不正利用防止方法を解析されるのを困難にして制御プログラムの不正利用を防ぐことができる。   As described above, according to the present embodiment, by not showing the authentication ladder to the user, it is possible to prevent an authorized user from accidentally deleting or changing the authentication ladder, and to prevent a malicious user from using the control program. It is possible to prevent unauthorized use of the control program by making it difficult to analyze the unauthorized use prevention method.

以上、本実施の形態では、
エンジニアリング環境からPLCの実行用制御プログラム記憶部に格納されている制御プログラムの読み出し要求を受けてアクセス要求送信処理部に制御プログラムの読出し指示を出して読み出した制御プログラムを制御プログラム記憶部に格納する制御プログラム読出し要求部と、
認証ラダーが挿入された制御プログラムをユーザが表示/編集する場合に認証ラダーをユーザに見せないようにするためにフィルタリングをかける認証ラダーフィルタリング処理部と、
制御プログラム作成部にてユーザが制御プログラムを編集した場合に認証情報に合わせて挿入していた認証ラダーを元の位置に戻す処理を行う認証ラダー挿入位置調整処理部と、
実行用制御プログラム記憶部から制御プログラムを読み出す処理を行う制御プログラム読出し処理部を設けたFA機器制御プログラムの不正利用防止システムを説明した。
As described above, in the present embodiment,
In response to a request for reading a control program stored in the control program storage unit for execution of the PLC from the engineering environment, the control request is read out to the access request transmission processing unit, and the read control program is stored in the control program storage A control program read request section;
An authentication ladder filtering processing unit that performs filtering in order to prevent the authentication ladder from being shown to the user when the user displays / edits the control program in which the authentication ladder is inserted;
An authentication ladder insertion position adjustment processing unit for performing processing for returning the authentication ladder inserted according to the authentication information to the original position when the user edits the control program in the control program creating unit;
The system for preventing unauthorized use of the FA device control program provided with the control program read processing unit for performing the process of reading the control program from the execution control program storage unit has been described.

実施の形態4.
本実施の形態では、PLCから読み出した制御プログラムに対して、ユーザに専用デバイスの存在が明らかにならないようにするために認証ラダー挿入処理部14にて挿入した認証ラダーの専用デバイスを既存のデバイスに置き換える機能を説明する。
Embodiment 4 FIG.
In the present embodiment, an authentication ladder dedicated device inserted by the authentication ladder insertion processing unit 14 in order to prevent the user from revealing the existence of the dedicated device for the control program read from the PLC is an existing device. The function to replace with will be described.

図8は、本実施の形態に係る不正利用防止システムの機能構成を示す。
図8の不正利用防止システムでは、制御プログラムに挿入された認証ラダーの専用デバイスの番号をあらかじめ変換テーブルに設定した変換ルールに従って既存のデバイスの番号に置き換える。
FIG. 8 shows a functional configuration of the unauthorized use prevention system according to the present embodiment.
In the unauthorized use prevention system of FIG. 8, the dedicated device number of the authentication ladder inserted in the control program is replaced with the existing device number according to the conversion rule set in the conversion table in advance.

エンジニアリング環境側PC100の構成要素のそれぞれは、実施の形態1〜3で説明したものであるため、説明を省略する。   Since each component of the engineering environment side PC 100 has been described in the first to third embodiments, a description thereof will be omitted.

PLC200では、図7の構成に認証ラダー変換テーブル記憶部25及び認証ラダー変換処理部26が追加されている。
なお、図8でも、PLC200において本実施の形態に係る動作に直接関係のない要素の図示を省略している。
しかし、PLC200には、制御プログラム書込み処理部12、認証ラダー自動生成処理部13、認証ラダー挿入処理部14、制御プログラム実行制御部16、専用デバイス設定部17等の実施の形態1及び実施の形態2で説明した要素が含まれているものとする。
In the PLC 200, an authentication ladder conversion table storage unit 25 and an authentication ladder conversion processing unit 26 are added to the configuration of FIG.
In FIG. 8, elements that are not directly related to the operation according to the present embodiment in the PLC 200 are not shown.
However, the PLC 200 includes the control program writing processing unit 12, the authentication ladder automatic generation processing unit 13, the authentication ladder insertion processing unit 14, the control program execution control unit 16, the dedicated device setting unit 17, and the like in the first embodiment and the first embodiment. It is assumed that the elements described in 2 are included.

認証ラダー変換テーブル記憶部25は、エンジニアリング環境側PC100から制御プログラムの読み出し要求があった場合に制御プログラム中に挿入されている認証ラダーの専用デバイス番号を既存のデバイスの番号に変換する際に利用する変換テーブルを格納している。   The authentication ladder conversion table storage unit 25 is used when converting the dedicated device number of the authentication ladder inserted into the control program into the number of an existing device when the engineering environment side PC 100 receives a control program read request. The conversion table to be stored is stored.

認証ラダー変換処理部26は、認証ラダー変換テーブル記憶部25に格納されている変換テーブルを用いて専用デバイス番号を既存のデバイス番号に置き換える処理を行う。
前述のように、専用デバイスのデバイス番号は、対象デバイスのデバイス番号と番号体系が異なる(実施の形態1の例では、専用デバイス番号は「A」で始まり、対象デバイス番号は「X」、「Y」、「E」で始まる)。
このため、認証ラダー変換処理部26は、実行用制御プログラム記憶部15に格納されている制御プログラム(合成プログラム)の出力指示がエンジニアリング環境側PC100からあった場合に、認証ラダーの専用デバイス番号を対象デバイス番号と同じ番号体系に変更する(専用デバイス番号を例えば「X」で始まるようにする)。
認証ラダー変換処理部26は、デバイス番号変更部の例である。
また、本実施の形態では、アクセス要求受信処理部11(プログラム出力部)は、認証ラダー変換処理部26により変更された後の専用デバイス番号が含まれる制御プログラム(合成プログラム)をエンジニアリング環境側PC100に出力する。
The authentication ladder conversion processing unit 26 uses the conversion table stored in the authentication ladder conversion table storage unit 25 to perform processing for replacing the dedicated device number with an existing device number.
As described above, the device number of the dedicated device is different from the device number of the target device (in the example of Embodiment 1, the dedicated device number starts with “A”, the target device number is “X”, “ Y "and" E ").
Therefore, the authentication ladder conversion processing unit 26 assigns a dedicated device number of the authentication ladder when an instruction to output a control program (synthesizing program) stored in the execution control program storage unit 15 is issued from the engineering environment side PC 100. Change to the same numbering system as the target device number (specify the dedicated device number to begin with “X”, for example).
The authentication ladder conversion processing unit 26 is an example of a device number changing unit.
In the present embodiment, the access request reception processing unit 11 (program output unit) transmits the control program (synthetic program) including the dedicated device number after being changed by the authentication ladder conversion processing unit 26 to the engineering environment side PC 100. Output to.

次に、セキュリティ設定が有効となっている場合に制御プログラムの読み出しを実施した際に認証ラダーの専用デバイス番号を既存のデバイス番号に置き換える処理について説明する。   Next, a process for replacing the dedicated device number of the authentication ladder with the existing device number when the control program is read when the security setting is valid will be described.

制御プログラム読出し処理部24がエンジニアリング環境側PC100から制御プログラムの読み出し要求を受けると、制御プログラム読出し処理部24は、セキュリティ設定部6bのセキュリティ設定を確認し、セキュリティ設定が有効である場合に実行用制御プログラム記憶部15から読み出した制御プログラムに挿入されている認証ラダーの専用デバイスを既存のデバイスへの置き換えを認証ラダー変換処理部26に依頼する。   When the control program read processing unit 24 receives a control program read request from the engineering environment side PC 100, the control program read processing unit 24 checks the security setting of the security setting unit 6b, and executes it when the security setting is valid. The authentication ladder conversion processing unit 26 is requested to replace the dedicated device of the authentication ladder inserted in the control program read from the control program storage unit 15 with an existing device.

専用デバイスの既存デバイスへの変換要求を受けた認証ラダー変換処理部26は、認証ラダー変換テーブル記憶部25に設定されている変換テーブルに基づいて認証ラダーにて使用している専用デバイスを既存のデバイス(XデバイスやYデバイス)への置き換えを実施する。
例えば、専用デバイスA234は、既存デバイスであるX234に変換する。
既存デバイスに変換する場合に必ずXデバイスに変換する必要は無く、既存デバイスであれば良い。
また、デバイス番号についても専用デバイスと同じにする必要も無く置き換えた既存デバイスにて使用可能なデバイス番号であれば良い。
The authentication ladder conversion processing unit 26 that has received a request to convert the dedicated device to the existing device uses the existing dedicated device used in the authentication ladder based on the conversion table set in the authentication ladder conversion table storage unit 25. Replacement with a device (X device or Y device) is performed.
For example, the dedicated device A 234 converts to the existing device X 234.
When converting to an existing device, it is not always necessary to convert to an X device, and any existing device may be used.
Also, the device number need not be the same as that of the dedicated device, and may be a device number that can be used in the replaced existing device.

なお、専用デバイスを既存デバイスに置き換えた制御プログラムを読み取ったエンジニアリング環境側では、実施の形態3にて記載した通り、認証ラダーに対してフィルタリングを掛けて認証ラダーをユーザには見せないため、変換テーブルは必要ない。   As described in Embodiment 3, the engineering environment side that reads the control program that replaces the dedicated device with the existing device filters the authentication ladder and does not show the authentication ladder to the user. No table is needed.

このように、本実施の形態によれば、エンジニアリング環境側に読み出した制御プログラムに挿入した認証ラダーの専用デバイスを既存のデバイスに置き換えることで、例えば悪意を持ったユーザが読み出した制御プログラムをバイナリエディタやコードを解析するためのツールにて開いた際に、従来の制御プログラムでは使用していないデバイスが使われていることを容易にわからなくすることができ、認証処理の仕組みを解析されにくくすることができる。
つまり、実施の形態3によれば、認証ラダーを非表示にするため、専用デバイス番号は表示されないが、上記のようなツールが用いられた場合には、非表示に設定されていても専用デバイス番号の存在が明らかになる場合がある。本実施の形態では、このようなツールが用いられた場合でも、専用デバイス番号が通常のデバイス番号と同じ番号体系になっているので、専用デバイス番号が識別されることを回避することができる。
As described above, according to the present embodiment, by replacing the authentication ladder dedicated device inserted in the control program read out on the engineering environment side with the existing device, for example, the control program read out by a malicious user can be changed to binary. When opened with an editor or a tool for analyzing code, it can be easily obscured that a device that is not used in the conventional control program is used, and the authentication processing mechanism is difficult to analyze. can do.
That is, according to the third embodiment, since the authentication ladder is hidden, the dedicated device number is not displayed. However, when the above tool is used, the dedicated device is not displayed even if it is set to hidden. The existence of a number may become apparent. In the present embodiment, even when such a tool is used, the dedicated device number has the same numbering system as the normal device number, and therefore it is possible to avoid identifying the dedicated device number.

以上、本実施の形態では、
エンジニアリング環境からの制御プログラムの読み出しが要求された際に制御プログラム読出し処理部からの指示を受けて認証ラダーの専用デバイスを既存のデバイスに置き換える認証ラダー変換処理部と、
認証ラダー変換処理部にて認証ラダーの専用デバイスを既存のデバイスに置き換える際に利用する変換テーブルを格納する認証ラダー変換テーブル記憶部を設けたFA機器制御プログラムの不正利用防止システムを説明した。
As described above, in the present embodiment,
An authentication ladder conversion processing unit that replaces the dedicated device of the authentication ladder with an existing device in response to an instruction from the control program read processing unit when reading of the control program from the engineering environment is requested,
The FA device control program unauthorized use prevention system provided with the authentication ladder conversion table storage unit for storing the conversion table used when the authentication ladder conversion processing unit replaces the dedicated device of the authentication ladder with the existing device has been described.

実施の形態5.
本実施の形態では、PLCから制御プログラムの読み出しが行われる度にPLCに設けたカウンタの値を用いて認証情報を再生成し、認証ラダーも再生成して制御プログラム中に挿入済みの認証ラダーとの入れ替えを実施してからエンジニアリング環境側に送信する機能を説明する。
Embodiment 5 FIG.
In this embodiment, every time the control program is read from the PLC, the authentication information is regenerated using the counter value provided in the PLC, the authentication ladder is also regenerated, and the authentication ladder already inserted in the control program The function to transmit to the engineering environment side after exchanging with is explained.

図9は、本実施の形態に係る不正利用防止システムの機能構成を示す。
図9の不正利用防止システムでは、PLC200から制御プログラムの読み出しが行われる度にPLC200に設けたカウンタの値を用いて再生成した認証情報に基づき認証ラダーの再生成が行われ、制御プログラムに挿入されている認証ラダーとの入れ替えが行われる。
FIG. 9 shows a functional configuration of the unauthorized use prevention system according to the present embodiment.
In the unauthorized use prevention system of FIG. 9, every time a control program is read from the PLC 200, the authentication ladder is regenerated based on the authentication information regenerated using the counter value provided in the PLC 200, and is inserted into the control program. The authentication ladder is replaced.

図9では、エンジニアリング環境側PC100において、操作履歴記憶部27が追加されている。
操作履歴記憶部27は、エンジニアリング環境側PC100上でユーザが実行した機能名や実行したときのタイムスタンプおよびエラー情報などの操作内容を格納する。
操作履歴記憶部27は入力回数計数部の例である。
なお、操作履歴記憶部27以外のエンジニアリング環境側PC100の構成要素は、実施の形態1〜3で説明したものであるため、説明を省略する。
なお、図面上のスペースの問題により表示部30は図示が省略されているが、図9のエンジニアリング環境側PC100には表示部30が存在するものとする。
In FIG. 9, an operation history storage unit 27 is added to the engineering environment side PC 100.
The operation history storage unit 27 stores operation contents such as a function name executed by the user on the engineering environment side PC 100, a time stamp when executed, and error information.
The operation history storage unit 27 is an example of an input number counting unit.
The components of the engineering environment side PC 100 other than the operation history storage unit 27 are the same as those described in the first to third embodiments, and thus the description thereof is omitted.
Although the display unit 30 is not shown due to space problems in the drawing, it is assumed that the display unit 30 exists in the engineering environment side PC 100 of FIG.

PLC200では、認証ラダー削除処理部28及びカウンタ処理部29が追加されている。   In the PLC 200, an authentication ladder deletion processing unit 28 and a counter processing unit 29 are added.

認証ラダー削除処理部28は、制御プログラム中に挿入されている認証ラダーを削除する。
より具体的には、アクセス要求受信処理部11(プログラム出力部)は、外部装置たるエンジニアリング環境側PC100より認証ラダーが挿入されている制御プログラム(合成プログラム)の出力指示があった場合に、制御プログラム(合成プログラム)をエンジニアリング環境側PC100に出力するが、エンジニアリング環境側PC100への出力の度に、制御プログラム(合成プログラム)から認証ラダーを削除する。
認証ラダー削除処理部28は、削除処理部の例である。
The authentication ladder deletion processing unit 28 deletes the authentication ladder inserted in the control program.
More specifically, the access request reception processing unit 11 (program output unit) performs control when there is an output instruction of a control program (synthetic program) in which an authentication ladder is inserted from the engineering environment side PC 100 which is an external device. The program (synthesis program) is output to the engineering environment side PC 100, but the authentication ladder is deleted from the control program (synthesis program) each time the program is output to the engineering environment side PC 100.
The authentication ladder deletion processing unit 28 is an example of a deletion processing unit.

カウンタ処理部29は、エンジニアリング環境からの制御プログラムの読み出し要求を受け付ける度にPLC200内に設けたカウンタの値をカウントアップしカウントアップした値を記憶する。
つまり、アクセス要求受信処理部11により制御プログラム(合成プログラム)がエンジニアリング環境側PC100に出力される度に、出力回数を計数する。
カウンタ処理部29は、出力回数計数部である。
The counter processing unit 29 counts up the value of the counter provided in the PLC 200 each time it receives a control program read request from the engineering environment, and stores the counted up value.
That is, each time the control request (synthesis program) is output to the engineering environment side PC 100 by the access request reception processing unit 11, the number of outputs is counted.
The counter processing unit 29 is an output number counting unit.

そして、本実施の形態では、認証ラダー自動生成処理部13(認証プログラム生成部)は、アクセス要求受信処理部11により制御プログラム(合成プログラム)がエンジニアリング環境側PC100に出力される度に、シリアルID記憶部9bのシリアルIDとカウンタ処理部29の計数値と認証ラダー生成用乱数記憶部8bの乱数とに基づいて、新たに専用デバイスのデバイス番号を選択し、新たな専用デバイス番号が含まれる新たな認証ラダーを生成し、生成した新たな認証ラダーごとに認証ラダー削除処理部28による削除処理後の制御プログラム内の新たな挿入位置を決定する。
そして、認証ラダー挿入処理部14(プログラム合成部)は、認証ラダー自動生成処理部13により決定された新たな挿入位置にて新たな認証ラダーのそれぞれを制御プログラムに挿入して新たな合成プログラムとする。
In this embodiment, the authentication ladder automatic generation processing unit 13 (authentication program generation unit) receives the serial ID every time a control program (synthesis program) is output to the engineering environment side PC 100 by the access request reception processing unit 11. Based on the serial ID of the storage unit 9b, the count value of the counter processing unit 29, and the random number of the authentication ladder generation random number storage unit 8b, a new device number of the dedicated device is selected, and a new dedicated device number is included. A new authentication ladder is generated, and a new insertion position in the control program after the deletion processing by the authentication ladder deletion processing unit 28 is determined for each generated new authentication ladder.
Then, the authentication ladder insertion processing unit 14 (program synthesis unit) inserts each new authentication ladder into the control program at the new insertion position determined by the authentication ladder automatic generation processing unit 13, and creates a new synthesis program. To do.

なお、図9では、PLC200において本実施の形態に係る動作に直接関係のない要素の図示を省略している。
しかし、PLC200には、制御プログラム書込み処理部12、制御プログラム実行制御部16、専用デバイス設定部17等の実施の形態1〜3で説明した要素が含まれているものとする。
In FIG. 9, elements that are not directly related to the operation according to the present embodiment in the PLC 200 are omitted.
However, it is assumed that the PLC 200 includes the elements described in the first to third embodiments such as the control program write processing unit 12, the control program execution control unit 16, and the dedicated device setting unit 17.

次に、本実施の形態に係る動作を説明する。
まず、PLC200側の動作を説明する。
Next, the operation according to the present embodiment will be described.
First, the operation on the PLC 200 side will be described.

実施の形態1では、制御プログラムのPLCへの初回書込みの際にエンジニアリング環境側PC100で生成した乱数とPLC200のシリアルIDの2つ情報を入力としてハッシュ関数にて認証情報を生成していた。
本実施の形態では、前記2つの情報以外にカウンタ処理部29のカウンタの値も用いて認証情報を生成し、生成した認証情報から認証ラダーの生成を行う。
カウンタ処理部29のカウンタは、エンジニアリング環境側PC100から制御プログラムの読出し要求を受ける度にカウントアップする。
このカウンタの値は制御プログラムの初回書込み時に初期値0が設定され、初回書込み時に認証情報を生成する際のカウンタの値は0を用いる。
この後に、エンジニアリング環境側PC100からの制御プログラムの読出し要求を受けると、認証ラダー自動生成処理部13がカウンタ処理部29にカウントアップを指示し、当該指示によりカウンタ処理部29はカウンタの値を1つカウントアップする。
In the first embodiment, the authentication information is generated by the hash function with the input of the random number generated by the engineering environment side PC 100 and the serial ID of the PLC 200 when the control program is written to the PLC for the first time.
In the present embodiment, authentication information is generated using the counter value of the counter processing unit 29 in addition to the two pieces of information, and an authentication ladder is generated from the generated authentication information.
The counter of the counter processing unit 29 counts up every time a control program read request is received from the engineering environment side PC 100.
The counter value is set to an initial value 0 when the control program is written for the first time, and 0 is used as the counter value when generating authentication information at the time of the first writing.
Thereafter, upon receiving a control program read request from the PC 100 on the engineering environment side, the authentication ladder automatic generation processing unit 13 instructs the counter processing unit 29 to count up, and the counter processing unit 29 sets the counter value to 1 in response to the instruction. Count up.

エンジニアリング環境側PC100からの制御プログラムの読み出し要求を受けた制御プログラム読出し処理部24は認証ラダー自動生成処理部13に対して認証ラダーの再生成を指示する。
認証ラダー自動生成処理部13は、認証ラダーの再生成要求を受けて認証処理部10bに認証情報の生成を指示する。
認証処理部10bでは認証ラダー生成用乱数記憶部8bに格納されている乱数とシリアルID記憶部9bに格納されているシリアルIDおよびカウンタ処理部29に格納されているカウンタ値に対してハッシュ演算を行って認証情報を生成し、認証ラダー自動生成処理部13に返す。
認証ラダー自動生成処理部13は受け取った認証情報と制御プログラムを認証ラダー削除処理部28に渡す。
認証ラダー削除処理部28は受け取った認証情報に基づいて制御プログラム内に現在挿入されている認証ラダーの挿入位置を特定して認証ラダーを削除し、認証ラダーを削除した制御プログラムを認証ラダー自動生成処理部13に返す。
認証ラダー自動生成処理部13は、カウンタ処理部29に対してカウンタアップの指示を出し、カウンタ処理部29はカウンタの値をカウントアップして保持する。
認証ラダー自動生成処理部13は再度認証処理部10bに対して認証情報の生成を要求し、認証処理部10bはカウントアップしたカウンタの値を用いて認証情報の再生成を行い、再生成した認証情報を認証ラダー自動生成処理部13に返す。
認証ラダー自動生成処理部13は再生成した認証情報から認証ラダーを自動生成し(各認証ラダーの挿入位置を特定し)、生成した認証ラダーと、認証ラダー削除処理部28にて認証ラダーを削除した制御プログラムを認証ラダー挿入処理部14に渡す。
そして、認証ラダー自動生成処理部13は、再生成した認証ラダーの制御プログラムへの再挿入を指示し、認証ラダー挿入処理部14にて認証ラダーを再挿入する。
認証ラダーが再挿入された制御プログラムを制御プログラム読出し処理部24は、アクセス要求受信処理部11を経由してエンジニアリング環境へ送信する。
The control program read processing unit 24 that has received the control program read request from the engineering environment side PC 100 instructs the authentication ladder automatic generation processing unit 13 to regenerate the authentication ladder.
The authentication ladder automatic generation processing unit 13 receives an authentication ladder regeneration request and instructs the authentication processing unit 10b to generate authentication information.
The authentication processing unit 10b performs a hash operation on the random number stored in the authentication ladder generation random number storage unit 8b, the serial ID stored in the serial ID storage unit 9b, and the counter value stored in the counter processing unit 29. Authentication information is generated and returned to the authentication ladder automatic generation processing unit 13.
The authentication ladder automatic generation processing unit 13 passes the received authentication information and control program to the authentication ladder deletion processing unit 28.
The authentication ladder deletion processing unit 28 identifies the insertion position of the authentication ladder currently inserted in the control program based on the received authentication information, deletes the authentication ladder, and automatically generates a control program from which the authentication ladder is deleted. Return to the processing unit 13.
The authentication ladder automatic generation processing unit 13 issues a counter up instruction to the counter processing unit 29, and the counter processing unit 29 counts up and holds the counter value.
The authentication ladder automatic generation processing unit 13 requests the authentication processing unit 10b to generate authentication information again, and the authentication processing unit 10b regenerates the authentication information by using the counted counter value, and the regenerated authentication. Information is returned to the authentication ladder automatic generation processing unit 13.
The authentication ladder automatic generation processing unit 13 automatically generates an authentication ladder from the regenerated authentication information (specifies the insertion position of each authentication ladder), and deletes the authentication ladder by the generated authentication ladder and the authentication ladder deletion processing unit 28. The control program is passed to the authentication ladder insertion processing unit 14.
Then, the authentication ladder automatic generation processing unit 13 instructs re-insertion of the regenerated authentication ladder into the control program, and the authentication ladder insertion processing unit 14 reinserts the authentication ladder.
The control program read processing unit 24 transmits the control program in which the authentication ladder is reinserted to the engineering environment via the access request reception processing unit 11.

次に、エンジニアリング環境側PC100側での動作について説明する。   Next, the operation on the engineering environment side PC 100 side will be described.

制御プログラムを受け取った制御プログラム読出し要求部21は、制御プログラム記憶部3に格納する。
ユーザが入力部1を用いて制御プログラム記憶部3に格納されている制御プログラムの表示/編集の指示を出した際、認証ラダーフィルタリング処理部22は認証処理部10aに認証情報の生成を依頼する。
認証情報の生成要求を受けて認証処理部10aは、操作履歴記憶部27に格納されている操作履歴からPLC200からの制御プログラムの読み出し処理を実行した回数(読出しに成功した場合の回数のみ)を算出する。
次に、認証処理部10aは、算出した値(この値はPLCのカウンタ処理部29にて保持されているカウンタの値と同一)と認証ラダー生成用乱数記憶部8aに格納されている乱数およびシリアルID記憶部9aに格納されているシリアルIDから認証情報を算出し、認証ラダーフィルタリング処理部22に返す。
認証ラダーフィルタリング処理部22では、取得した認証情報に基づいて認証ラダー挿入処理部14にて制御プログラムに挿入されている認証ラダーの挿入位置を確認する(認証情報からステップ数を算出して認証ラダーの挿入位置を把握する)。
認証ラダーフィルタリング処理部22は制御プログラム記憶部3から制御プログラムを読出し、1度のみ実行するように設定した認証ラダー(図4(a)に例示した認証ラダー)と前記算出したステップ数に位置する認証ラダー(制御プログラム中の特定のステップ数に挿入した認証ラダー:図4(b)に例示した認証ラダー)に対して非表示設定を行う。
制御プログラム作成部2は、認証ラダーフィルタリング処理部22から受け取った制御プログラムを表示する際、非表示設定されている箇所を確認して、非表示設定されている箇所の認証ラダーを表示しない制御を行って表示部30に出力し、表示部30は認証ラダーを表示せずに制御プログラムのみを表示する。
また、認証ラダー挿入位置調整処理部23(位置調整部)は、制御プログラム作成部2にて編集された後の制御プログラムに対して、ユーザによる命令の追記や削除によって生じた認証ラダー挿入位置(ステップ数)を認証処理部10aで生成した認証情報に基づいて元の位置に戻してから、制御プログラムを制御プログラム記憶部3に格納する。
The control program read request unit 21 that has received the control program stores it in the control program storage unit 3.
When the user issues an instruction to display / edit the control program stored in the control program storage unit 3 using the input unit 1, the authentication ladder filtering processing unit 22 requests the authentication processing unit 10a to generate authentication information. .
Upon receiving the authentication information generation request, the authentication processing unit 10a indicates the number of times that the control program read processing from the PLC 200 is executed from the operation history stored in the operation history storage unit 27 (only when the read is successful). calculate.
Next, the authentication processing unit 10a calculates the calculated value (this value is the same as the counter value held in the PLC counter processing unit 29), the random number stored in the authentication ladder generation random number storage unit 8a, and Authentication information is calculated from the serial ID stored in the serial ID storage unit 9 a and returned to the authentication ladder filtering processing unit 22.
In the authentication ladder filtering processing unit 22, the authentication ladder insertion processing unit 14 confirms the insertion position of the authentication ladder inserted in the control program based on the acquired authentication information (calculates the number of steps from the authentication information and calculates the authentication ladder). To know where to insert).
The authentication ladder filtering processing unit 22 reads the control program from the control program storage unit 3 and is located in the authentication ladder (authentication ladder illustrated in FIG. 4A) set to be executed only once and the calculated number of steps. The non-display setting is performed for the authentication ladder (the authentication ladder inserted at a specific number of steps in the control program: the authentication ladder illustrated in FIG. 4B).
When the control program creation unit 2 displays the control program received from the authentication ladder filtering processing unit 22, the control program creation unit 2 confirms the location that is not set to display, and performs control that does not display the authentication ladder at the location that is set to be hidden. The information is output to the display unit 30. The display unit 30 displays only the control program without displaying the authentication ladder.
Further, the authentication ladder insertion position adjustment processing unit 23 (position adjustment unit) adds an authentication ladder insertion position (which is generated by adding or deleting a command by the user to the control program edited by the control program creating unit 2. The number of steps is returned to the original position based on the authentication information generated by the authentication processing unit 10a, and then the control program is stored in the control program storage unit 3.

このように、本実施の形態では、実行用制御プログラム記憶部15に格納されている制御プログラムの読み出し要求を受ける度にカウンタをカウントアップし、そのカウンタの値を用いて認証情報とその認証情報に基づいて認証ラダーを再生成して、制御プログラム中に挿入済みの認証ラダーと入れ替える。
これらの処理により、エンジニアリング環境側PC100側に読み取った制御プログラムは毎回異なるため、悪意を持ったユーザによる認証処理の解析を困難にすることができる。
更に、悪意を持ったユーザが制御プログラムを仮に別のPLCにコピーできたとしてもPLCごとに固有なカウンタの値を用いて認証情報を生成しているのでより制御プログラムの不正利用を防ぐことができる。
なお、通常、制御プログラムをPLCに書込んで実際の動作を確認しており、その結果に応じて制御プログラムなどをエンジニアリング環境との間で書込み/読出しを繰り返しながらプログラムやパラメータ設定を調整する作業を実施しているため、他のPLCとカウンタの値が同一になる可能性は低いと考える。
As described above, in the present embodiment, the counter is incremented every time a read request for the control program stored in the execution control program storage unit 15 is received, and the authentication information and the authentication information are used by using the counter value. Based on the above, the authentication ladder is regenerated and replaced with the authentication ladder already inserted in the control program.
By these processes, the control program read to the engineering environment side PC 100 side is different each time, so that it is possible to make it difficult for the malicious user to analyze the authentication process.
Furthermore, even if a malicious user can copy the control program to another PLC, the authentication information is generated using the counter value unique to each PLC, thereby preventing unauthorized use of the control program. it can.
Normally, the control program is written in the PLC and the actual operation is confirmed. According to the result, the program and parameter settings are adjusted while repeatedly writing / reading the control program to / from the engineering environment. Therefore, it is considered unlikely that the value of the counter is the same as that of the other PLC.

以上、本実施の形態では、
ユーザがエンジニアリング環境上で実行した機能の操作履歴を格納する操作履歴記憶部と、
制御プログラムに挿入された認証ラダーを再挿入するために一旦制御プログラムから削除する認証ラダー削除処理部と、
エンジニアリング環境からの制御プログラムの読み出し要求を受ける度にカウンタの値をカウントアップしカウントアップした値を格納するカウンタ処理部を設けたFA機器制御プログラムの不正利用防止システムを説明した。
As described above, in the present embodiment,
An operation history storage unit for storing an operation history of functions executed by the user in the engineering environment;
An authentication ladder deletion processing unit for once deleting from the control program in order to reinsert the authentication ladder inserted in the control program;
An FA device control program unauthorized use prevention system provided with a counter processing unit that counts up a counter value each time a control program read request is received from the engineering environment and stores the counted up value has been described.

1 入力部、2 制御プログラム作成部、3 制御プログラム記憶部、4 アクセス要求送信処理部、5 制御プログラム書込み要求部、6 セキュリティ設定部、7 乱数生成処理部、8 認証ラダー生成用乱数記憶部、9 シリアルID記憶部、10 認証処理部、11 アクセス要求受信処理部、12 制御プログラム書込み処理部、13 認証ラダー自動生成処理部、14 認証ラダー挿入処理部、15 実行用制御プログラム記憶部、16 制御プログラム実行制御部、17 専用デバイス設定部、18 実行制約時間記憶部、19 認証ラダー性能確認部、20 認証ラダー挿入判断部、21 制御プログラム読出し要求部、22 認証ラダーフィルタリング処理部、23 認証ラダー挿入位置調整処理部、24 制御プログラム読出し処理部、25 認証ラダー変換テーブル記憶部、26 認証ラダー変換処理部、27 操作履歴記憶部、28 認証ラダー削除処理部、29 カウンタ処理部、30 表示部、100 エンジニアリング環境側PC、200 PLC。   1 input unit, 2 control program creation unit, 3 control program storage unit, 4 access request transmission processing unit, 5 control program write request unit, 6 security setting unit, 7 random number generation processing unit, 8 authentication ladder generation random number storage unit, 9 serial ID storage unit, 10 authentication processing unit, 11 access request reception processing unit, 12 control program write processing unit, 13 authentication ladder automatic generation processing unit, 14 authentication ladder insertion processing unit, 15 execution control program storage unit, 16 control Program execution control unit, 17 Dedicated device setting unit, 18 Execution constraint time storage unit, 19 Authentication ladder performance confirmation unit, 20 Authentication ladder insertion determination unit, 21 Control program read request unit, 22 Authentication ladder filtering processing unit, 23 Authentication ladder insertion Position adjustment processing unit, 24 control program reading processing unit, 5 authentication ladder conversion table storage unit, 26 authenticated ladder conversion processing unit, 27 operation history storage unit, 28 authenticated ladder deletion processing section 29 counter processing unit, 30 display unit, 100 engineering environment side PC, 200 PLC.

Claims (14)

制御装置であって、
前記制御装置にユニークに設定されている固有識別情報を記憶する固有識別情報記憶部と、
前記制御装置の制御処理の対象となる対象デバイスのデバイス番号が含まれ、前記制御装置以外の装置による使用が許可されていないラダープログラムを主プログラムとして入力するプログラム入力部と、
前記固有識別情報に基づいて、前記制御装置以外の装置による主プログラムの使用を防止するラダープログラムを認証プログラムとして生成する認証プログラム生成部と、
主プログラムと認証プログラムとを合成して合成プログラムとするプログラム合成部と、
前記合成プログラムを記憶するプログラム記憶部とを有し、
前記認証プログラム生成部は、
対象デバイスのデバイス番号を疑似するデバイス番号であって、認証のために用いられる複数の認証用デバイスのデバイス番号を認証用デバイス番号として管理し、
前記固有識別情報に基づいて、1つ以上の認証用デバイス番号を選択し、
選択した選択認証用デバイス番号が含まれるラダープログラムであって、前記合成プログラムとして前記主プログラムとともに実行される際に前記認証プログラム生成部の選択動作から独立して前記固有識別情報に基づいて前記選択認証用デバイス番号が正確に選択され前記選択認証用デバイス番号に対応する選択認証用デバイスの各々に対して所定の設定処理が行われれば正常に動作して前記主プログラムが正常に動作し、前記合成プログラムとして前記主プログラムとともに実行される際に前記選択認証用デバイスの各々に対して前記設定処理が行われない場合には正常に動作せず前記主プログラムの動作が停止するラダープログラムを認証プログラムとして生成することを特徴とする制御装置。
A control device,
A unique identification information storage unit for storing unique identification information uniquely set in the control device;
A program input unit that includes a device number of a target device to be controlled by the control device, and that inputs a ladder program that is not permitted to be used by a device other than the control device as a main program;
Based on the unique identification information, an authentication program generating unit that generates a ladder program that prevents use of the main program by a device other than the control device as an authentication program;
A program synthesis unit that synthesizes the main program and the authentication program into a synthesis program;
A program storage unit for storing the synthesis program,
The authentication program generator is
It is a device number that simulates the device number of the target device, and manages device numbers of a plurality of authentication devices used for authentication as authentication device numbers,
Based on the unique identification information, one or more authentication device numbers are selected,
A ladder program including the selected selection authentication device number, wherein the selection is performed based on the unique identification information independently from a selection operation of the authentication program generation unit when the synthesis program is executed together with the main program. If the authentication device number is correctly selected and a predetermined setting process is performed on each of the selected authentication devices corresponding to the selected authentication device number, the main program operates normally and the main program operates normally. If the setting process is not performed for each of the selective authentication devices as a synthesis program together with the main program, a ladder program that does not operate normally and stops the operation of the main program is authenticated. A control device characterized by generating as follows.
前記制御装置は、更に、
前記複数の認証用デバイスを各々の認証用デバイス番号と対応付けて管理し、前記プログラム記憶部に記憶されている合成プログラムの実行の際に、前記認証プログラム生成部の選択動作から独立して前記固有識別情報に基づいて1つ以上の認証用デバイス番号を選択し、選択した選択認証用デバイス番号に対応する選択認証用デバイスの各々に対して所定の設定処理を行う設定処理部と、
前記設定処理部により前記選択認証用デバイスの各々に対して設定処理が行われた後に、前記プログラム記憶部に記憶されている合成プログラムの実行を行うプログラム実行部とを有することを特徴とする請求項1に記載の制御装置。
The control device further includes:
The plurality of authentication devices are managed in association with respective authentication device numbers, and the execution of the synthesis program stored in the program storage unit is independent of the selection operation of the authentication program generation unit. A setting processing unit that selects one or more authentication device numbers based on the unique identification information and performs a predetermined setting process on each of the selected authentication devices corresponding to the selected selection authentication device number;
A program execution unit configured to execute a synthesis program stored in the program storage unit after the setting processing unit performs setting processing on each of the selective authentication devices. Item 2. The control device according to Item 1.
前記制御装置は、更に、
乱数を記憶する乱数記憶部と、
前記認証プログラム生成部による認証プログラムの生成に先立ち、前記乱数記憶部に記憶されている乱数と前記固有識別情報記憶部に記憶されている固有識別情報とに対して一方向演算を行い、前記設定処理部による設定処理に先立ち、前記乱数記憶部に記憶されている乱数と前記固有識別情報記憶部に記憶されている固有識別情報とに対して一方向演算を行う一方向演算部とを有し、
前記認証プログラム生成部は、
前記一方向演算部による一方向演算値に基づいて、1つ以上の認証用デバイス番号を選択し、選択した選択認証用デバイス番号が含まれる認証プログラムを生成し、
前記設定処理部は、
前記一方向演算部による一方向演算値に基づいて、1つ以上の認証用デバイス番号を選択し、選択した選択認証用デバイス番号に対応する選択認証用デバイスの各々に対して所定の設定処理を行うことを特徴とする請求項2に記載の制御装置。
The control device further includes:
A random number storage unit for storing random numbers;
Prior to generation of the authentication program by the authentication program generation unit, a one-way operation is performed on the random number stored in the random number storage unit and the unique identification information stored in the unique identification information storage unit, and the setting is performed. Prior to setting processing by the processing unit, a one-way operation unit that performs one-way operation on the random number stored in the random number storage unit and the unique identification information stored in the unique identification information storage unit ,
The authentication program generator is
Based on the one-way operation value by the one-way operation unit, select one or more authentication device numbers, generate an authentication program including the selected selection authentication device number,
The setting processing unit
Based on the one-way calculation value by the one-way calculation unit, one or more authentication device numbers are selected, and a predetermined setting process is performed for each of the selection authentication devices corresponding to the selected selection authentication device number. The control apparatus according to claim 2, wherein the control apparatus performs the control.
前記認証プログラム生成部は、
選択認証用デバイスをOFF状態からON状態にする設定処理が行われれば正常に動作して前記主プログラムが正常に動作し、選択認証用デバイスをOFF状態からON状態にする設定処理が行われない場合には正常に動作せず前記主プログラムの動作が停止するラダープログラムを認証プログラムとして生成し、
前記設定処理部は、
選択認証用デバイスをOFF状態からON状態にする設定処理を行うことを特徴とする請求項2又は3に記載の制御装置。
The authentication program generator is
If the setting process for changing the selection authentication device from the OFF state to the ON state is performed, the main program operates normally and the setting process for changing the selection authentication device from the OFF state to the ON state is not performed. In this case, a ladder program that does not operate normally and stops the operation of the main program is generated as an authentication program,
The setting processing unit
The control apparatus according to claim 2 or 3, wherein a setting process for changing the selective authentication device from an OFF state to an ON state is performed.
前記認証プログラム生成部は、
2つ以上の認証用デバイス番号を選択し、
選択した選択認証用デバイス番号のすべてが含まれ前記主プログラムの先頭に配置されることになる先頭認証プログラムと、それぞれに選択認証用デバイス番号のいずれかが含まれ前記主プログラム内の複数の挿入位置に挿入されることになる2つ以上の挿入認証プログラムとの少なくともいずれかを生成し、
前記プログラム合成部は、
前記先頭認証プログラムを前記主プログラムの先頭に配置し、前記2つ以上の挿入認証プログラムを前記主プログラム内の複数の挿入位置に挿入することを特徴とする請求項1〜4のいずれかに記載の制御装置。
The authentication program generator is
Select two or more authentication device numbers,
A plurality of insertions in the main program each including one of the selected authentication device numbers, each of which includes all of the selected selective authentication device numbers and is placed at the top of the main program Generate at least one of two or more insertion verification programs to be inserted at the location;
The program synthesis unit
5. The head authentication program is arranged at the head of the main program, and the two or more insertion authentication programs are inserted into a plurality of insertion positions in the main program. Control device.
前記制御装置は、更に、
主プログラムと認証プログラムが合成された合成プログラムの実行所要時間の許容範囲を許容時間として記憶する許容時間記憶部と、
前記プログラム入力部により入力された主プログラムの実行所要時間を予測する所要時間予測部と、
前記所要時間予測部により予測された予測所要時間と前記許容時間とに基づき、前記認証プログラムに含める認証用デバイス番号の個数を決定する個数決定部とを有し、
前記認証プログラム生成部は、
前記個数決定部により決定された個数分の認証用デバイス番号を選択することを特徴とする請求項1〜5のいずれかに記載の制御装置。
The control device further includes:
An allowable time storage unit that stores the allowable range of the required execution time of the synthesis program in which the main program and the authentication program are combined as an allowable time;
A required time predicting unit that predicts an execution required time of the main program input by the program input unit;
A number determining unit that determines the number of device numbers for authentication to be included in the authentication program based on the predicted required time predicted by the required time predicting unit and the allowable time;
The authentication program generator is
6. The control device according to claim 1, wherein the number of authentication device numbers corresponding to the number determined by the number determination unit is selected.
前記制御装置は、更に、
前記プログラム入力部により入力された主プログラムのプログラムサイズが所定サイズ以上であるか否かを判断し、前記主プログラムのプログラムサイズが前記所定サイズ未満であれば、前記認証プログラム生成部に対して認証プログラムの生成の保留させ、前記主プログラムのプログラムサイズが前記所定サイズ以上であれば、前記認証プログラム生成部に対して認証プログラムの生成を指示するプログラムサイズ判断部を有することを特徴とする請求項1〜6のいずれかに記載の制御装置。
The control device further includes:
It is determined whether or not the program size of the main program input by the program input unit is equal to or larger than a predetermined size. If the program size of the main program is less than the predetermined size, the authentication program generation unit is authenticated. The program generation is suspended, and if the program size of the main program is equal to or larger than the predetermined size, a program size determination unit that instructs the authentication program generation unit to generate an authentication program is provided. The control apparatus in any one of 1-6.
前記認証プログラム生成部は、
2つ以上の認証用デバイス番号を選択し、
それぞれに選択認証用デバイス番号のいずれかが含まれる2つ以上の挿入認証プログラムを生成し、所定の挿入位置決定アルゴリズムに従って挿入認証プログラムごとに前記主プログラム内の挿入位置を決定し、
前記プログラム合成部は、
前記認証プログラム生成部により決定された挿入位置にて挿入認証プログラムのそれぞれを前記主プログラムに挿入し、
前プログラムサイズ判断部は、
前記認証プログラム生成部による挿入認証プログラムの生成に先立ち、前記主プログラムのプログラムサイズに基づき、前記挿入位置決定アルゴリズムに従って決定される挿入認証プログラムの挿入位置が前記主プログラムの特定部分に集中するか否かを判断し、
挿入認証プログラムの挿入位置が前記主プログラムの特定部分に集中する場合に、前記挿入位置決定アルゴリズム以外のアルゴリズムであって、挿入認証プログラムの挿入位置が前記主プログラム内でより分散するアルゴリズムに従って挿入認証プログラムの挿入位置を決定するよう前記認証プログラム生成部に指示することを特徴とする請求項7に記載の制御装置。
The authentication program generator is
Select two or more authentication device numbers,
Generating two or more insertion authentication programs each including one of the selected authentication device numbers, determining an insertion position in the main program for each insertion authentication program according to a predetermined insertion position determination algorithm;
The program synthesis unit
Insert each of the insertion authentication programs into the main program at the insertion position determined by the authentication program generation unit,
The previous program size determination section
Prior to generation of the insertion authentication program by the authentication program generation unit, whether or not the insertion positions of the insertion authentication program determined according to the insertion position determination algorithm are concentrated on a specific part of the main program based on the program size of the main program Determine whether
Insertion authentication according to an algorithm other than the insertion position determination algorithm when the insertion position of the insertion authentication program is concentrated on a specific part of the main program, wherein the insertion position of the insertion authentication program is more dispersed in the main program The control apparatus according to claim 7, wherein the control program generation unit is instructed to determine a program insertion position.
前記認証プログラム生成部は、
前記対象デバイスと番号体系が異なる認証用デバイス番号が含まれる認証用プログラムを生成し、
前記制御装置は、更に、
前記プログラム記憶部に記憶されている合成プログラムの出力指示が外部装置からあった場合に、前記合成プログラム中の認証プログラムに含まれている選択認証用デバイス番号を、前記対象デバイスのデバイス番号と同じ番号体系のデバイス番号に変更するデバイス番号変更部と、
認証プログラムに前記デバイス番号変更部による変更後のデバイス番号が含まれる合成プログラムを前記外部装置に出力するプログラム出力部とを有することを特徴とする請求項1〜8のいずれかに記載の制御装置。
The authentication program generator is
Generating an authentication program including an authentication device number having a different numbering system from the target device;
The control device further includes:
When the output instruction of the synthesis program stored in the program storage unit is from an external device, the selection authentication device number included in the authentication program in the synthesis program is the same as the device number of the target device A device number changing unit for changing to a device number of the number system,
The control apparatus according to claim 1, further comprising: a program output unit configured to output a synthesis program including a device number changed by the device number changing unit in the authentication program to the external device. .
前記認証プログラム生成部は、
2つ以上の認証用デバイス番号を選択し、
それぞれに選択認証用デバイス番号のいずれかが含まれる2つ以上の挿入認証プログラムを生成し、挿入認証プログラムごとに前記主プログラム内の挿入位置を決定し、
前記プログラム合成部は、
前記認証プログラム生成部により決定された挿入位置にて挿入認証プログラムのそれぞれを主プログラムに挿入して合成プログラムとし、
前記制御装置は、更に、
前記合成プログラムの出力指示が外部装置からあった場合に、前記合成プログラムを前記外部装置に出力するプログラム出力部と、
前記プログラム出力部により前記合成プログラムが前記外部装置に出力される度に、前記合成プログラムから前記2つ以上の挿入認証プログラムを削除する削除処理部と、
前記プログラム出力部により前記合成プログラムが前記外部装置に出力される度に、出力回数を計数する出力回数計数部とを有し、
前記認証プログラム生成部は、
前記プログラム出力部により前記合成プログラムが前記外部装置に出力される度に、前記固有識別情報と前記出力回数計数部の計数値とに基づいて、新たに2つ以上の認証用デバイス番号を選択し、それぞれに新たな選択認証用デバイス番号のいずれかが含まれる2つ以上の新たな挿入認証プログラムを生成し、生成した新たな挿入認証プログラムごとに前記削除処理部による削除処理後の主プログラム内の新たな挿入位置を決定し、
前記プログラム合成部は、
前記認証プログラム生成部により決定された新たな挿入位置にて新たな挿入認証プログラムのそれぞれを前記主プログラムに挿入して新たな合成プログラムとすることを特徴とする請求項1〜9のいずれかに記載の制御装置。
The authentication program generator is
Select two or more authentication device numbers,
Generating two or more insertion authentication programs each including one of the selected authentication device numbers, determining an insertion position in the main program for each insertion authentication program;
The program synthesis unit
Each of the insertion authentication programs at the insertion position determined by the authentication program generation unit is inserted into the main program as a synthesis program,
The control device further includes:
A program output unit for outputting the synthesis program to the external device when the synthesis program is output from an external device;
A deletion processing unit that deletes the two or more insertion authentication programs from the synthesis program each time the synthesis program is output to the external device by the program output unit;
An output number counting unit that counts the number of outputs each time the synthesis program is output to the external device by the program output unit;
The authentication program generator is
Each time the synthesis program is output to the external device by the program output unit, two or more authentication device numbers are newly selected based on the unique identification information and the count value of the output count unit. Two or more new insertion authentication programs each including one of the new selection authentication device numbers are generated, and the main program after the deletion processing by the deletion processing unit is generated for each generated new insertion authentication program Determine the new insertion position of
The program synthesis unit
The new insertion authentication program is inserted into the main program at a new insertion position determined by the authentication program generation unit to form a new synthesis program. The control device described.
制御装置を管理する管理装置であって、
前記制御装置以外の装置による使用が許可されていない、前記制御装置における制御に用いられる主プログラムと、前記制御装置以外の装置による主プログラムの使用を防止するために前記制御装置において生成された認証プログラムとが合成されている合成プログラムを前記制御装置から入力するプログラム入力部と、
前記合成プログラムの中から前記認証プログラムを抽出し、前記認証プログラムに対して非表示設定を行う非表示設定部と、
前記非表示設定部による非表示設定に基づき、前記認証プログラムは表示せずに、前記主プログラムのみを表示する表示部とを有することを特徴とする管理装置。
A management device for managing the control device,
A main program used for control in the control device that is not permitted to be used by a device other than the control device, and an authentication generated in the control device to prevent use of the main program by a device other than the control device A program input unit that inputs a synthesis program in which the program is synthesized from the control device;
A non-display setting unit that extracts the authentication program from the synthesis program and performs non-display settings for the authentication program;
And a display unit that displays only the main program without displaying the authentication program based on the non-display setting by the non-display setting unit.
前記管理装置は、更に、
前記制御装置にユニークに設定されている固有識別情報を記憶する固有識別情報記憶部と、
乱数を記憶する乱数記憶部とを有し、
前記プログラム入力部は、
複数の認証プログラムのそれぞれが前記主プログラム内の所定位置に配置されている合成プログラムであって、前記制御装置において所定の決定アルゴリズムに従い前記固有識別情報と前記乱数とを用いて認証プログラムごとに決定された位置にそれぞれの認証プログラムが配置されている合成プログラムを入力し、
前記非表示設定部は、
前記制御装置と同じ決定アルゴリズムに従い、前記固有識別情報記憶部の前記固有識別情報と前記乱数記憶部の前記乱数とを用いて、それぞれの認証プログラムの位置を判別して、それぞれの認証プログラムに対して非表示設定を行うことを特徴とする請求項11に記載の管理装置。
The management device further includes:
A unique identification information storage unit for storing unique identification information uniquely set in the control device;
A random number storage unit for storing random numbers,
The program input unit includes:
Each of the plurality of authentication programs is a synthesis program arranged at a predetermined position in the main program, and is determined for each authentication program using the unique identification information and the random number according to a predetermined determination algorithm in the control device. Enter the synthesis program in which each authentication program is placed at the specified position,
The non-display setting unit
According to the same determination algorithm as the control device, using the unique identification information of the unique identification information storage unit and the random number of the random number storage unit, determine the position of each authentication program, and for each authentication program The management apparatus according to claim 11, wherein non-display setting is performed.
前記管理装置は、更に、
前記制御装置にユニークに設定されている固有識別情報を記憶する固有識別情報記憶部と、
乱数を記憶する乱数記憶部と、
前記制御装置から前記合成プログラムが入力される度に、入力回数を計数する入力回数計数部とを有し、
前記プログラム入力部は、
複数の認証プログラムのそれぞれが前記主プログラム内の所定位置に配置されている合成プログラムであって、前記制御装置において所定の決定アルゴリズムに従い前記固有識別情報と前記乱数と前記制御装置から前記管理装置への合成プログラムの出力回数とを用いて認証プログラムごとに決定された位置にそれぞれの認証プログラムが配置されている合成プログラムを入力し、
前記非表示設定部は、
前記制御装置と同じ決定アルゴリズムに従い、前記固有識別情報記憶部の前記固有識別情報と前記乱数記憶部の前記乱数と前記入力回数計数部による計数値を用いて、それぞれの認証プログラムの位置を判別して、それぞれの認証プログラムに対して非表示設定を行うことを特徴とする請求項11に記載の管理装置。
The management device further includes:
A unique identification information storage unit for storing unique identification information uniquely set in the control device;
A random number storage unit for storing random numbers;
An input number counting unit that counts the number of times of input each time the synthesis program is input from the control device;
The program input unit includes:
Each of the plurality of authentication programs is a synthesis program arranged at a predetermined position in the main program, and the control device is configured to transmit the unique identification information, the random number, and the control device to the management device according to a predetermined determination algorithm. The synthesis program in which each authentication program is arranged at the position determined for each authentication program using the number of outputs of the synthesis program of
The non-display setting unit
According to the same determination algorithm as the control device, the position of each authentication program is determined using the unique identification information of the unique identification information storage unit, the random number of the random number storage unit, and the count value by the input number counting unit. The management apparatus according to claim 11, wherein non-display setting is performed for each authentication program.
前記管理装置は、更に、
前記管理装置において前記合成プログラムが更新された結果、いずれかの認証プログラムの配置が変動した場合に、当該認証プログラムの位置を変動前の位置に戻す位置調整部を有することを特徴とする請求項12又は13に記載の管理装置。
The management device further includes:
The position adjustment unit which returns the position of the authentication program to the position before the change when the arrangement of any authentication program changes as a result of the synthesis program being updated in the management device. The management device according to 12 or 13.
JP2010028793A 2010-02-12 2010-02-12 Control device and management device Expired - Fee Related JP5404463B2 (en)

Priority Applications (4)

Application Number Priority Date Filing Date Title
JP2010028793A JP5404463B2 (en) 2010-02-12 2010-02-12 Control device and management device
TW099118839A TWI435192B (en) 2010-02-12 2010-06-10 Control apparatus and management apparatus
CN201010237224.6A CN102156840B (en) 2010-02-12 2010-07-22 Controller and managing device thereof
KR1020100079652A KR101252918B1 (en) 2010-02-12 2010-08-18 Control device and management device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2010028793A JP5404463B2 (en) 2010-02-12 2010-02-12 Control device and management device

Publications (2)

Publication Number Publication Date
JP2011165041A JP2011165041A (en) 2011-08-25
JP5404463B2 true JP5404463B2 (en) 2014-01-29

Family

ID=44438332

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2010028793A Expired - Fee Related JP5404463B2 (en) 2010-02-12 2010-02-12 Control device and management device

Country Status (4)

Country Link
JP (1) JP5404463B2 (en)
KR (1) KR101252918B1 (en)
CN (1) CN102156840B (en)
TW (1) TWI435192B (en)

Families Citing this family (19)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP5756412B2 (en) * 2012-01-12 2015-07-29 株式会社日立製作所 Monitoring method and monitoring system
JP5900143B2 (en) * 2012-05-15 2016-04-06 富士電機株式会社 Control system, control device, and program execution control method
JP5377799B1 (en) 2012-07-26 2013-12-25 三菱電機株式会社 Programmable logic controller
CN104813246B (en) * 2012-11-22 2017-06-30 三菱电机株式会社 Program Generating servicing unit and method
DE112012007242T5 (en) 2012-12-20 2016-01-14 Mitsubishi Electric Corp. Control system, program transmission device, authentication server, program protection method, program transmission method and program for program transmission device
WO2014125639A1 (en) * 2013-02-18 2014-08-21 三菱電機株式会社 Control program management apparatus, controller apparatus, and control system
JP6045986B2 (en) * 2013-06-27 2016-12-14 富士電機株式会社 Software development support apparatus, software development support method, and software development support program
JP2015200971A (en) * 2014-04-04 2015-11-12 富士電機株式会社 Control system equipped with falsification detection function
JP6009130B2 (en) 2014-06-11 2016-10-19 三菱電機株式会社 Program editing apparatus, program management apparatus, program editing program, and program management program
KR101539253B1 (en) * 2014-06-17 2015-07-28 주식회사 엔에스이 A PLC device provided with a function for managing program quality
EP3380899B1 (en) * 2016-01-11 2020-11-04 Siemens Aktiengesellschaft Program randomization for cyber-attack resilient control in programmable logic controllers
JP6325630B2 (en) * 2016-10-28 2018-05-16 ファナック株式会社 Ladder library management device
CN110114772B (en) * 2017-06-23 2020-08-28 三菱电机株式会社 System, method and engineering tool for preventing illegal use of ladder program
JP2019159752A (en) * 2018-03-13 2019-09-19 オムロン株式会社 Controller, license management method, and license management program
JP6836549B2 (en) * 2018-05-31 2021-03-03 ファナック株式会社 Ladder display device
CN109756483B (en) * 2018-12-12 2021-05-25 杭州华威信安科技有限公司 Safety protection method aiming at MELASEC protocol
JP7227015B2 (en) * 2019-01-24 2023-02-21 ファナック株式会社 LADDER PROGRAM EDITING SYSTEM, SERVER, TERMINAL DEVICE, LADDER PROGRAM EDITING METHOD AND PROGRAM
JP6766917B1 (en) * 2019-04-25 2020-10-14 オムロン株式会社 Control system and control method
WO2021161534A1 (en) 2020-02-14 2021-08-19 三菱電機株式会社 Program providing device, program providing method, and program providing system

Family Cites Families (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP3729421B2 (en) * 1994-03-18 2005-12-21 富士通株式会社 Unauthorized use prevention method and unauthorized use prevention system
JP3289521B2 (en) * 1994-10-31 2002-06-10 健稔 岡本 Software Copyright Protection Methods
JPH11194937A (en) * 1997-12-26 1999-07-21 Orix Rentec Kk Rent control system for electronic computer program
JP4203232B2 (en) 2001-05-11 2008-12-24 株式会社エヌ・ティ・ティ・ドコモ Communication terminal and communication control program
JP2003330564A (en) * 2002-05-17 2003-11-21 Canon Inc Function-in-device usage limiting method
JP4497450B2 (en) * 2003-12-10 2010-07-07 独立行政法人科学技術振興機構 Program authentication system
CN1328632C (en) * 2004-09-23 2007-07-25 艾默生网络能源有限公司 Method and system for changing ladder diagram program into instruction listing program
JP4607080B2 (en) * 2005-09-27 2011-01-05 オムロン株式会社 Programmable controller system
JP2008293468A (en) * 2007-04-26 2008-12-04 Oki Electric Ind Co Ltd Method for manufacturing motherboard
JP2009070144A (en) * 2007-09-13 2009-04-02 Omron Corp Programming method in plc
CN101364098B (en) * 2008-09-12 2010-07-28 南京航空航天大学 Method and system for conversing trapezoidal pattern to be instruction catalogue program, and interpretation execution method and system

Also Published As

Publication number Publication date
TWI435192B (en) 2014-04-21
KR20110093561A (en) 2011-08-18
KR101252918B1 (en) 2013-04-09
TW201128334A (en) 2011-08-16
CN102156840B (en) 2014-09-17
JP2011165041A (en) 2011-08-25
CN102156840A (en) 2011-08-17

Similar Documents

Publication Publication Date Title
JP5404463B2 (en) Control device and management device
KR101598738B1 (en) Control program management system and method for changing control program
US7698664B2 (en) Secure exchange of information in electronic design automation
JP4170466B2 (en) Command authentication method
JP5171907B2 (en) Information processing apparatus and information processing program
CN102841992B (en) The method of the encryption key being used for shielded digital data object is generated for computer based current component
WO2007125911A1 (en) Data processing device, method, program, integrated circuit, and program generating device
JP2009230741A (en) Method and apparatus for verifying archived data integrity in integrated storage system
US20050177823A1 (en) License management
EP2736010B1 (en) License management device, license management system, license management method, and program
US10108786B2 (en) Process and device for encoding of source files for secure delivery of source code
CN107832589A (en) Software copyright protecting method and its system
Menhorn External secure storage using the PUF
US20220043434A1 (en) Method for Managing a Production Process
JP4713579B2 (en) Application program
WO2011096162A1 (en) Security analysis support system, method and program
JP2005293109A (en) Software execution management device, software execution management method, and control program
US20160239662A1 (en) Control system and authentication device
CN101208655A (en) Hardware functionality scan for device authentication
EP3714386B1 (en) Access control for digital assets
JP2010134749A (en) Access control system and access control method
JP4655613B2 (en) Program execution apparatus and program execution method
JP5997604B2 (en) Information processing apparatus having software illegal use prevention function, software illegal use prevention method and program
JP4659742B2 (en) Content reproduction system and index information output method
JP2007206743A (en) Access control system and access control method

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20120914

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20130920

A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20131001

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20131029

LAPS Cancellation because of no payment of annual fees