DE102005046696A1 - Secured program code producing method for license verification, involves storing modified program code including exchanged references, coded program blocks and program block with decoded function as protected computer program - Google Patents

Secured program code producing method for license verification, involves storing modified program code including exchanged references, coded program blocks and program block with decoded function as protected computer program Download PDF

Info

Publication number
DE102005046696A1
DE102005046696A1 DE200510046696 DE102005046696A DE102005046696A1 DE 102005046696 A1 DE102005046696 A1 DE 102005046696A1 DE 200510046696 DE200510046696 DE 200510046696 DE 102005046696 A DE102005046696 A DE 102005046696A DE 102005046696 A1 DE102005046696 A1 DE 102005046696A1
Authority
DE
Germany
Prior art keywords
program code
code block
program
encrypted
block
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.)
Granted
Application number
DE200510046696
Other languages
German (de)
Other versions
DE102005046696B4 (en
Inventor
Udo Fuhrmann
Stefan Heiss
Jürgen Brenner
Diana Filimon
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.)
Fujitsu Technology Solutions Intellectual Property GmbH
Original Assignee
Fujitsu Technology Solutions GmbH
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 Fujitsu Technology Solutions GmbH filed Critical Fujitsu Technology Solutions GmbH
Priority to DE200510046696 priority Critical patent/DE102005046696B4/en
Publication of DE102005046696A1 publication Critical patent/DE102005046696A1/en
Application granted granted Critical
Publication of DE102005046696B4 publication Critical patent/DE102005046696B4/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

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/10Protecting distributed programs or content, e.g. vending or licensing of copyrighted material ; Digital rights management [DRM]
    • G06F21/12Protecting executable software
    • G06F21/121Restricting unauthorised execution of programs
    • G06F21/125Restricting unauthorised execution of programs by manipulating the program code, e.g. source code, compiled code, interpreted code, machine code

Abstract

The method involves coding predetermined program code blocks into coded program code blocks (13,14). The predetermined program code blocks are exchanged with associated coded program code blocks. The modified program code including exchanged references, coded program blocks and program block with decoded function is stored as a protected computer program (9). The pre-determined program code block implements license verification. Independent claims are also included for the following: (1) a method for executing a program code of protected computer program (2) a computer program product with a program code for implementing the method for producing secured program code.

Description

Die Erfindung betrifft ein Verfahren zum Schutz einer Lizenzüberprüfung eines Computerprogramms.The The invention relates to a method for protecting a license check of a Computer program.

Computerprogramme mit Lizenzüberprüfungsmechanismen sind vielfach bekannt. Für eine Lizenzüberprüfung wird ein Computerprogramm oft mit einem individuellen Lizenzschlüssel versehen, der beispielsweise bei der Installation des Programms unter Verwendung einer vom Hersteller zur Verfügung gestellten Lizenznummer und nutzer- oder computerspezifischen Daten erstellt wird.computer programs with license verification mechanisms are widely known. For becomes a license review a computer program often provided with an individual license key, the for example, when installing the program using one available from the manufacturer provided license number and user or computer specific data is created.

In installierten Computerprogrammen befindet sich in der Regel Programmcode, der einen so erstellten Lizenzschlüssel auf Vorhandensein und Richtigkeit hin überprüft und die Ausführung des Programmes andernfalls unterbindet. Dabei unterscheiden sich die verwendeten Lizenzmechanismen in ihrer Komplexität, beispielsweise ob lediglich ein einzelner in einer lokal gespeicherten Datei abgelegter Lizenzschlüssel überprüft wird oder ob komplexe Nutzungsprofile einer Netzwerkinstallation für mehrere Benutzer zentral erfasst und überprüft werden.In installed computer programs are usually program code, of the created license key for availability and correctness checked out and the execution otherwise prevents the program. There are differences the used license mechanisms in their complexity, for example whether only a single license key stored in a locally stored file is checked or whether complex usage profiles of one network installation for multiple Users are recorded and checked centrally.

Praktisch alle beschriebenen Lizenzmechanismen haben jedoch eine gemeinsame Schwachstelle. Wenn es nämlich möglich ist, den Aufruf des Programmcodes zu unterbinden, der die eigentliche Überprüfung vornimmt, oder so abzuändern, dass die Überprüfung stets erfolgreich ist, ist es möglich das Pro gramm auch ohne gültige Lizenz zu nutzen. Die dadurch ermöglichte Nutzung solcher sogenannter Raubkopien lässt jährlich ein erheblicher wirtschaftlicher Schaden für die Hersteller und Verkäufer von Computerprogrammen entstehen.Practically however, all of the described licensing mechanisms have one common Weak spot. If it is possible is to stop the invocation of the program code, which performs the actual check, or change that, that review always successful, it is possible that Program also without valid License to use. The thus enabled use of such so-called Pirated copies yearly a significant economic damage for the manufacturers and sellers of Computer programs arise.

Ein solches Umgehen des Lizenzschutzes ist beispielsweise dadurch möglich, dass das Aufrufen einer Lizenzüberprüfungsfunktion effektiv aus dem Programm entfernt wird. Dabei wird der Aufruf, in der Regel ein Verzweigungs- oder Sprungbefehl, einfach durch einen anderen, wirkungslosen Befehl ersetzt, zum Beispiel eine sogenannte NOP (no operation) Anweisung.One such circumvention of the license protection is possible, for example, in that calling a license verification function effectively removed from the program. In doing so, the call, in usually a branch or jump command, simply by one other, ineffective command replaced, for example, a so-called NOP (no operation) statement.

Alternativ kann auch die Überprüfungsfunktion selber so abgeändert werden, dass sie stets ein positives Ergebnis zurückliefert. Beispielsweise kann der Rückgabewert einer Lizenzschlüsselverifizierungsfunktion fest auf den booleschen Wert "wahr" gesetzt werden, im Falle das dies eine erfolgreiche Überprüfung bedeutet.alternative can also use the verification function itself changed will always return a positive result. For example, the return value a license key verification function fixed to the boolean value "true", in case this means a successful check.

Solche Manipulationen sind mit verhältnismäßig geringem Aufwand durchführbar, zum Beispiel durch Verwendung eines Disassemblers mit dem ausführbarer Programmcode analysiert und verändert werden kann.Such Manipulations are relatively low Effort is feasible, for example, by using a disassembler with the executable Program code analyzed and changed can be.

Zwar sind von modernen Betriebssystemen und von Virenscanner her Verfahren bekannt, die eine Abänderung von ausführbarem Programmcode beispielsweise durch die Verwendung von Zertifikaten zur Signierung des ausführbaren Programmcodes erkennen und damit den Start verhindern können. Jedoch müssen solche Funktionen in der Regel durch den Benutzer selbst aktiviert werden. Nur bei wenigen Systemen, beispielsweise speziellen Smartphone Betriebssystemen, werden solche Verfahren zwangs weise durchgeführt, z.B. wenn dies von einem Betreiber eines Mobilfunknetzes erzwungen wird.Though are of modern operating systems and virus scanner forth procedures known, which is a modification of executable Program code, for example, through the use of certificates for signing the executable Recognize program codes and thus prevent the start. however have to Such features are usually activated by the user himself become. Only for a few systems, for example a special smartphone Operating systems, such procedures are enforced, e.g. if this is enforced by an operator of a mobile network.

Ein vorsätzliches Umgehen des Lizenzschutzes lässt sich mit solchen Verfahren in der Regel also nicht verhindern. Des Weiteren weisen nicht alle Betriebssysteme einen solchen Schutz auf, insbesondere ältere oder funktionseingeschränkte Betriebssysteme wie sie beispielsweise auf mobilen elektronischen Geräten wie PDAs oder Mobiltelefonen eingesetzt werden.One intentional Bypassing the license protection allows usually not prevent themselves with such procedures. Of Furthermore, not all operating systems have such protection on, especially older ones or functionally limited Operating systems such as those on mobile electronic devices how PDAs or mobile phones are used.

Aufgabe der Erfindung ist es daher, einen verbesserten Lizenzschutz für Computerprogramme zu beschreiben. Dabei soll der Schutzmechanismus nicht von einem zur Ausführung des Computerprogramms benutzten Betriebssystems abhängen.task It is therefore an object of the invention to provide improved license protection for computer programs describe. In this case, the protection mechanism should not from one to execution depend on the computer program used operating system.

Die Aufgabe wird erfindungsgemäß durch ein Verfahren zum Erzeugen von geschütztem Programmcode und ein Verfahren zum Ausführen von Programmcode eines geschützten Computerprogramms sowie ein Computerprogrammprodukt gelöst, wie sie in den Ansprüchen 1, 10 und 15 definiert sind.The The object is achieved by a Method for generating protected Program code and a method for executing program code protected Solved computer program as well as a computer program product, such as they in the claims 1, 10 and 15 are defined.

Erfindungsgemäß wird wenigstens ein Programmcodeblock verschlüsselt in dem ausführbaren Programmcode abgelegt. Während der Ausführung des Programms wird der verschlüsselte Programmcode dann nicht mehr direkt ausgeführt, sondern zunächst über eine Entschlüsselungsfunktion entschlüsselt und danach ausgeführt.According to the invention at least encoded a program code block in the executable program code stored. While the execution of the Program becomes the encrypted Program code then no longer executed directly, but first over a decryption function decrypts and then executed.

Gemäß einer Ausgestaltung der Erfindung handelt es sich bei dem verschlüsselten Programmcodeblock um eine Lizenzüberprüfungsfunktion. Durch die Verschlüsselung dieser Funktion wird ein einfaches Abändern der Lizenzüberprüfung verhindert, sodass nicht mehr auf einfache Weise die Rückgabe eines stets gültigen Überprüfungsergebnisses bewirkt werden kann.According to one Embodiment of the invention is in the encrypted Program code block for a license verification function. By the encryption This feature prevents a simple change to the license check so that no longer causes the return of an always valid verification result in a simple manner can be.

Um die Schutzwirkung des erfindungsgemäßen Verfahrens zu erhöhen, können sowohl einzelne Programmcodeblöcke als auch der Programmcode als Ganzes durch die Verwendung von Prüfsummen oder Signaturen geschützt werden. Diese Prüfsummen oder Signaturen können dann vor der Ausführung des Programmcodeblocks oder des Programms auf Richtigkeit hin überprüft werden. Wird der gesamte Programmcode durch eine Signatur oder Prüfsumme geschützt, kann zum Beispiel ein zum Laden verwendetes separates Programm oder das geschützte Programm selber die Verifizierung der Signatur bzw. der Prüfsumme durchführen. Entsprechender Programmcode kann beispielsweise in einem beim Programmstart aufgerufenen Programmcodeblock enthalten sein.Around To increase the protective effect of the method according to the invention, both individual program code blocks as well as the program code as a whole by the use of checksums or Signatures protected become. These checksums or signatures can then before the execution the program code block or program for correctness. If the entire program code is protected by a signature or checksum for example, a separate program used for loading or the protected program yourself verify the signature or checksum. Correspondent Program code may be, for example, in a program called at startup Program code block.

Durch die Verwendung eines asymmetrischen Verschlüsselungsverfahren wird in einer vorteilhaften Ausgestaltung der Erfindung verhindert, dass eine unberechtigte Person veränderten Programmcode selber verschlüsselt und in den ausführbaren Code einschleust. Somit kann verhindert werden, dass ein Programmcodeblock eines Computerprogramms verändert wird.By The use of an asymmetric encryption method is in one advantageous embodiment of the invention prevents a unauthorized person changed Program code itself encrypted and in the executable Inject code. Thus it can be prevented that a program code block of a computer program changed becomes.

In einer weiteren vorteilhaften Ausgestaltung werden wenigstens zwei Programmcodeblöcke verschlüsselt, wobei ein erster verschlüsselter Programmcodeblock einen Verweis auf einen zweiten verschlüsselten Programmcodeblock aufweist. Dadurch liegt der Verweis auf den zweiten Programmcodeblock selbst nur in verschlüsselter Form vor, so dass er in einem disassemblierten Programm nicht ohne erheblichen Aufwand entdeckt werden kann.In In another advantageous embodiment, at least two Program code blocks encrypted being a first encrypted Program code block a reference to a second encrypted Program code block. This is the reference to the second Program code block itself only in encrypted form, so he in a disassembled program not without considerable effort can be discovered.

Weitere Einzelheiten und Ausgestaltungen der Erfindung sind in den Unteransprüchen angegeben.Further Details and embodiments of the invention are specified in the subclaims.

Die Erfindung wird nachfolgend an einem Ausführungsbeispiel anhand der Zeichnungen näher erläutert. In den Zeichnungen zeigen:The Invention will be described below with reference to an embodiment with reference to the drawings explained in more detail. In show the drawings:

1 eine beispielhafte Struktur eines Computerprogramms nach dem Stand der Technik, 1 an exemplary structure of a computer program according to the prior art,

2 eine beispielhafte Struktur eines erfindungsgemäß geschützten Computerprogramms, 2 an exemplary structure of a computer program protected according to the invention,

3 eine beispielhafte Struktur eines verschlüsselten Programmcodeblocks, 3 an exemplary structure of an encrypted program code block,

4 ein Ablaufdiagramm für ein erfindungsgemäße Verfahren zum Erzeugen von geschütztem Programmcode, 4 a flow chart for a method according to the invention for generating protected program code,

5 ein Ablaufdiagramm eines erfindungsgemäßen Verfahrens zum Ausführen von Programmcode eines geschützten Computerprogramms. 5 a flow diagram of a method according to the invention for executing program code of a protected computer program.

1 zeigt eine beispielhafte Struktur eines Computerprogramms 1 gemäß dem Stand der Technik. Das Computerprogramm 1 umfasst vier Programmcodeblöcke 2, 3, 4 und 5 und vier Verweise 6a, 6b, 7 und 8 auf die Programmcodeblöcke 5, 3 bzw. 4. 1 shows an exemplary structure of a computer program 1 according to the prior art. The computer program 1 includes four program code blocks 2 . 3 . 4 and 5 and four references 6a . 6b . 7 and 8th on the program code blocks 5 . 3 respectively. 4 ,

Der erste Programmcodeblock 2 enthält eine als "main" bezeichnete Funktion, mit der die Ausführung des Programms 1 startet. Der Programmcodeblock 3 führt eine erste Programmfunktion A und der Programmcodeblock 4 eine zweite Programmfunktion B aus. Der mit C bezeichnete Programmcodeblock 5 führt eine Überprüfung eines Lizenzschlüssels für das Computerprogramm 1 aus. Aus dem Programmcodeblock 2 finden Verweise 6a und 7 auf die Programmcodeblöcke 5 bzw. 3 statt. Die Programmfunktion A des Programmcodeblocks 3 verweist durch den Verweis 8 auf den Programmcodeblock 4. Die Programmfunktion B des Programmcodeblocks 4 verweist durch den Verweis 6b ebenfalls auf den Programmcodeblock 5.The first program code block 2 contains a function called "main", with which the execution of the program 1 starts. The program code block 3 performs a first program function A and the program code block 4 a second program function B off. The program code block labeled C 5 performs a verification of a license key for the computer program 1 out. From the program code block 2 find references 6a and 7 on the program code blocks 5 respectively. 3 instead of. The program function A of the program code block 3 refers by the reference 8th to the program code block 4 , The program function B of the program code block 4 refers by the reference 6b also on the program code block 5 ,

2 zeigt eine beispielhafte Struktur eines erfindungsgemäß geschützten Computerprogramms 9 mit fünf Programmcodeblöcken 10, 11, 12, 13 und 14 sowie vier Verweisen 15a, 15b, 16 und 17. Die Programmcodeblöcke 10, 11 und 12 sind unverschlüsselt. Dahingegen befinden sich die Programmcodeblöcke 13 und 14 in einem verschlüsselten Zustand. 2 shows an exemplary structure of a protected computer program according to the invention 9 with five program code blocks 10 . 11 . 12 . 13 and 14 as well as four references 15a . 15b . 16 and 17 , The program code blocks 10 . 11 and 12 are unencrypted. By contrast, the program code blocks are located 13 and 14 in an encrypted state.

Der Programmcodeblock 10 entspricht der Funktion "main" des Programmcodeblocks 2. Gegenüber dem ursprünglichen Programmcodeblock 2 wurde lediglich der Verweis 15a geändert. Der Programmcodeblock 12 entspricht dem Programmcodeblock 3 des ungeschützten Computerprogramms 1 und wurde lediglich durch Anpassung des Verweises 17 geändert. Die Programmcodeblöcke 13 und 14 der Funktionen B und C liegen nun in verschlüsselter Form in dem Computerprogramm 9 vor, sodass ein direktes Aufrufen der Funktionen B und C aus den Programmcodeblöcken 10, 12 und 13 nicht mehr möglich ist. Insbesondere der Verweis 15b aus der nunmehr verschlüsselten Programmfunktion B auf den Programmcodeblock 14 ist nun selbst Teil des verschlüsselten Programmcodeblocks 13. Der Programmcodeblock 11 entspricht einer zusätzlichen Entschlüsselungsfunktion D, die zur Entschlüsselung der Programmcodeblöcke 13 und 14 dient.The program code block 10 corresponds to the function "main" of the program code block 2 , Opposite the original program code block 2 just became the reference 15a changed. The program code block 12 corresponds to the program code block 3 the unprotected computer program 1 and was merely by adjusting the reference 17 changed. The program code blocks 13 and 14 Functions B and C are now in encrypted form in the computer program 9 before, allowing a direct call of functions B and C from the program code blocks 10 . 12 and 13 is no longer possible. In particular, the reference 15b from the now encrypted program function B to the program code block 14 is now itself part of the encrypted program code block 13 , The program code block 11 corresponds to an additional decryption function D, which is used to decrypt the program code blocks 13 and 14 serves.

Die Verweise 15a, 15b und 17 aus den Programmcodeblöcken 10, 12 beziehungsweise 13 sind nun auf die Entschlüsselungsfunk tion D in dem Programmcodeblock 11 gerichtet. Dabei wird als Aufrufparameter die Startadresse der Programmcodeblöcke 14 beziehungsweise 13 übergeben, was in der 2 durch die gestrichelten Pfeile angedeutet ist.The references 15a . 15b and 17 from the program code blocks 10 . 12 respectively 13 are now on the decryption tion D in the program code block 11 directed. The start address of the program code blocks is used as the call parameter 14 respectively 13 pass what's in of the 2 indicated by the dashed arrows.

Beim Erreichen des Verweises 15a des Programmcodeblocks 10 werden in dem geschützten Computerprogramm 9 folgende Schritte abgearbeitet: Zunächst wird die Entschlüsselungsfunktion D des Programmcodeblocks 11 aufgerufen und ihr als Parameter die Startadresse des Programmcodeblocks 14 übergeben. Die Entschlüsselungsfunktion D lädt sodann den verschlüsselten Programmcodeblock 14 beginnend an der übermittelten Startadresse und entschlüsselt den im Programmcodeblock 14 enthaltenen Programmcode mithilfe eines asymmetrischen Entschlüsselungsverfahren. Beispielsweise kann der dazu benötigte öffentliche Schlüssel in dem Programmcodeblock 11 enthalten sein oder auf dem Computer, auf dem das geschützte Programm 9 abläuft, gespeichert sein.Upon reaching the reference 15a of the program code block 10 be in the protected computer program 9 following steps are executed: First, the decryption function D of the program code block 11 and the parameter start address of the program code block 14 to hand over. The decryption function D then loads the encrypted program code block 14 starting at the transmitted start address and decrypts that in the program code block 14 contained program code using an asymmetric decryption method. For example, the required public key in the program code block 11 be included or on the computer on which the protected program 9 expires, be saved.

Nach Entschlüsselung des Programmcodeblocks 14 wird dieser beispielsweise im Arbeitsspeicher des ausführenden Computers mit dem entschlüsselten Programmcodeblock 5 der Funktion C überschrieben und die Ausführung des Programms 9 an der Startadresse des entschlüsselten Programmcodeblocks 5 fortgesetzt. Nach Abarbeitung des Programmcodeblocks 5 wird die Ausführung des Programmcodeblocks 10 nach dem Verweis 15a fortgesetzt.After decryption of the program code block 14 this is for example in the working memory of the executing computer with the decrypted program code block 5 the function C overwrites and the execution of the program 9 at the start address of the decrypted program code block 5 continued. After processing the program code block 5 becomes the execution of the program code block 10 after the reference 15a continued.

Der zweite verschlüsselte Programmcodeblock 13 sowie die Verweise 17 bzw. 15b werden in äquivalenter Weise abgearbeitet. Um den für die Entschlüsselung benötigten Rechenaufwand zu begrenzen, können einmal entschlüsselte Programmcodeblöcke 4 und 5 der verschlüsselten Programmcodeblöcke 13 und 14 für die Dauer der Ausführung des geschützten Programms 9 in dem Arbeitsspeicher behalten werden. Alternativ ist es auch möglich, die entschlüsselten Programmcodeblöcke 4 und 5 jeweils wieder durch die verschlüsselten Programmcodeblöcke 13 und 14 nach Ausführung der entschlüsselten Programmcodeblöcke 4 und 5 zu ersetzen, sodass der entschlüsselte Programmcode 4 beziehungsweise 5 nur für die Dauer der Ausführung in dem Hauptspeicher gespeichert ist.The second encrypted program code block 13 as well as the references 17 respectively. 15b are processed in an equivalent way. In order to limit the amount of computation required for the decryption, once decrypted program code blocks 4 and 5 the encrypted program code blocks 13 and 14 for the duration of the execution of the protected program 9 be kept in the working memory. Alternatively, it is also possible to decrypt the program code blocks 4 and 5 again through the encrypted program code blocks 13 and 14 after execution of the decrypted program code blocks 4 and 5 replace, so the decrypted program code 4 respectively 5 is stored in main memory only for the duration of the execution.

In beiden Fällen liegt der Programmcodeblock 14, der im Ausführungsbeispiel die Funktion C zum Überprüfen eines Lizenzschlüssels enthält, nur in verschlüsselter Form auf einem Datenträger eines Computers vor. Somit ist ein Verändern des Programmcodeblocks 5 praktisch nicht durchführbar. Denn zu einer erfolgreichen Veränderung des zunächst einmal zu entschlüsselndem Programmcodeblocks 14 müsste dieser nach erfolgter Veränderung wieder verschlüsselt werden. Zur Verschlüsselung eines Programmcodeblocks wird in dem dargestellten Ausführungsbeispiel jedoch ein privater Schlüssel eines asymmetrischen Schlüsselpaares benötigt, der in dem geschützten Programmcode 9 nicht enthalten ist.In both cases, the program code block is located 14 in the embodiment, the function C for verifying a license key, only in encrypted form on a disk of a computer before. Thus, changing the program code block 5 practically impossible. For a successful change of the first time to decrypt the program code block 14 this would have to be encrypted again after the change. In order to encrypt a program code block, however, a private key of an asymmetric key pair is required in the illustrated embodiment, which is contained in the protected program code 9 not included.

Aber auch das Ersetzen der Verweise 15a und 15b durch eine wirkungslose Operation ist in dem geschützten Programm 9 nur sehr schwer möglich. Denn der Verweis 15a verweist ebenso wie der Verweis 17 auf den Programmcodeblock 11 und nicht auf den verschlüsselten Programmcodeblock 14. Somit ist eine Unterscheidung der Verweise 15a und 17 in einem disassemblierten, geschützten Programm 9 nur schwer möglich. Werden jedoch beide Verweise 15a und 17 aus dem Programmcode des Programms 9 entfernt, wird damit auch der Programmcodeblock 13 deaktiviert. Vorausgesetzt der Programmcodeblock 13 enthält eine für die Nutzung des Programms 9 wichtige Funktion, wird damit das Programm 9 unbrauchbar gemacht. Dasselbe gilt ebenfalls für eine Manipulation der in dem Programmcodeblock 11 enthaltenen Entschlüsselungsfunktion D, da ohne diese Funktion oder mit einer Funktionsbeeinträchtigung dieser Funktion auch der Programmcodeblock 13 nicht mehr erfolgreich ausgeführt werden kann.But also the replacement of the references 15a and 15b by an ineffective operation is in the protected program 9 very difficult. Because the reference 15a refers as well as the reference 17 to the program code block 11 and not the encrypted program code block 14 , Thus, a distinction of references 15a and 17 in a disassembled, protected program 9 only possible with difficulty. However, both are references 15a and 17 from the program code of the program 9 This removes the program code block 13 disabled. Provided the program code block 13 contains one for the use of the program 9 important function, thus becomes the program 9 rendered useless. The same also applies to a manipulation of those in the program code block 11 contained decryption function D, since without this function or with a functional impairment of this function and the program code block 13 can no longer be executed successfully.

Noch schwieriger wäre ein Entfernen beziehungsweise ein Ersetzen des verschlüsselten Verweises 15b auf die Lizenzüberprüfungsfunktion C. Denn dieser Verweis liegt überhaupt erst nach dem Entschlüsseln des Programmcodeblocks 13 in entschlüsselter Form vor. Somit kann der Verweis 15b durch bloßes Disassemblieren des geschützten Programms 9 nicht erkannt werden.Even more difficult would be removing or replacing the encrypted link 15b to the license check function C. Because this reference is in fact only after decrypting the program code block 13 in decrypted form. Thus, the reference 15b by merely disassembling the protected program 9 not be recognized.

3 zeigt eine mögliche Struktur des verschlüsselten Programmcodeblocks 13. An dessen Anfang steht zunächst eine Längenangabe 19, die die Länge von nachfolgendem verschlüsselten Programmcode 20 enthält. Dem verschlüsselten Programmcode 20 folgen dann noch eine Prüfsumme 21 und ein Auffüllbereich 22, der den verbleibenden Speicherplatz bis zum Beginn des nächsten Programmcodeblocks 14 einnimmt. 3 shows a possible structure of the encrypted program code block 13 , At the beginning is initially a length specification 19 the length of subsequent encrypted program code 20 contains. The encrypted program code 20 then follow a checksum 21 and a padding area 22 , the remaining space until the beginning of the next program code block 14 occupies.

Da unverschlüsselter Programmcode in der Regel redundante Informationen enthält, ist der verschlüsselte Programmcode 20 oftmals kürzer als der ursprüngliche unverschlüsselte Programmcodeblock 4. Gegebenenfalls kann dies durch die Verwendung allgemein bekannter Kompressionsalgorithmen erreicht werden. Alternativ kann der unverschlüsselte Programmcodeblock 4 auch schon durch ein Übersetzungsprogramm künstlich verlängert werden, beispielsweise durch das Einfügen wirkungslosen Befehle. Dadurch ist es möglich, den unverschlüsselten Programmcodeblock 14 durch einen verschlüsselten Programmcodeblock 13 zu ersetzen ohne dabei den nachfolgenden Programmcodeblocks 14 zu beschädigen.Since unencrypted program code usually contains redundant information, this is the encrypted program code 20 often shorter than the original unencrypted program code block 4 , Optionally, this can be accomplished by the use of well-known compression algorithms. Alternatively, the unencrypted program code block 4 even be artificially extended by a translation program, for example, by inserting ineffective commands. This makes it possible to use the unencrypted program code block 14 by an encrypted program code block 13 without replacing the subsequent program code block 14 to damage.

Zur Entschlüsselung muss die Entschlüsselungsfunktion D jedoch die Länge des verschlüsselten Programmcodes 20 kennen. Deshalb enthält die in 3 dargestellte Struktur am Beginn des verschlüsselten Programmcodeblocks 13 die Längenangabe 19, die beispielsweise die Länge des verschlüsselten Programmcodes 20 in Bytes enthält. Nach der Längenangabe 19 folgt unmittelbar der verschlüsselte Programmcode 20 des Programmcodeblocks 13.For decryption, however, the decryption function D must be the length of the encrypted program code 20 know. Therefore, the in 3 illustrated structure at the beginning of the encrypted program code block 13 the length specification 19 for example, the length of the encrypted program code 20 in bytes. After the length specification 19 immediately follows the encrypted program code 20 of the program code block 13 ,

Zur Erhöhung der Sicherheit des erfindungsgemäßen Verfahrens wurde des Weiteren eine Prüfsumme 21 für den verschlüsselten Programmcode 20 erstellt und in den verschlüsselten Programmcodeblock 13 aufgenommen. Bei der Prüfsumme kann es sich beispielsweise um eine so genannte CRC-Checksumme handeln oder um eine Signatur für den verschlüsselten Programmcode 20, der zum Beispiel mit demselben asymmetrischen Schlüsselpaar erzeugt wurde und überprüft werden kann, der auch zur Ver- bzw. Entschlüsselung des Programmcodeblocks 4 bzw. des Programmcodes 20 eingesetzt wird.To increase the security of the method according to the invention was further a checksum 21 for the encrypted program code 20 created and in the encrypted program code block 13 added. The checksum can be, for example, a so-called CRC checksum or a signature for the encrypted program code 20 which has been generated and can be checked, for example, with the same asymmetric key pair, which is also used to encrypt or decrypt the program code block 4 or the program code 20 is used.

Der Auffüllbereich 22, also der verbleibende Platz bis zum Beginn des nachfolgenden Programmcodeblocks 14, kann beispielsweise durch Nullen oder andere vorbestimmte Werte aufgefüllt werden, so dass hier nicht sicherheitsrelevante Informationen, beispielsweise Teile des zuvor unverschlüsselten Programmcodeblocks 4, bestehen bleiben.The filling area 22 , ie the remaining space until the beginning of the subsequent program code block 14 , for example, can be filled by zeros or other predetermined values, so that here not safety-related information, for example, parts of the previously unencrypted program code block 4 , remain.

Beim Laden und Entschlüsseln des verschlüsselten Programmcodeblocks 13 lädt die Entschlüsselungsfunktion D zunächst die Längenangabe 19 des verschlüsselten Programmcodes 20. Nach folgend wird der verschlüsselte Programmcode 20 durch die Entschlüsselungsfunktion D eingelesen und mithilfe eines öffentlich verfügbaren Schlüssels entschlüsselt. Optional kann zuvor die Unversehrtheit des verschlüsselten Programmcodes 20 mithilfe der Prüfsumme 21 verifiziert werden. Alternativ kann sich die Prüfsumme 21 natürlich auch auf den unverschlüsselten Programmcode des Programmcodeblocks 4 beziehen. In diesen Fall wird die Unversehrtheit des Programmcodeblocks 4 nach dessen Entschlüsselung überprüft.When loading and decrypting the encrypted program code block 13 the decryption function D first loads the length specification 19 the encrypted program code 20 , Following is the encrypted program code 20 read by decryption function D and decrypted using a publicly available key. Optionally, previously, the integrity of the encrypted program code 20 using the checksum 21 be verified. Alternatively, the checksum may be 21 of course also on the unencrypted program code of the program code block 4 Respectively. In this case, the integrity of the program code block becomes 4 checked after its decryption.

4 zeigt Ablaufdiagramm für ein erfindungsgemäße Verfahren zum Erzeugen von geschütztem Programmcode. 4 shows a flow chart for a method according to the invention for generating protected program code.

In einem ersten Schritt 41 werden die Startaddressen der Programmcodeblöcke 2, 3, 4 und 5 ermittelt. Beispeilsweise kann dies beim Übersetzen von Quelltextblöcken in die Programmcodeblöcke 2, 3, 4 und 5 des Computerprogramms 1 vorgenommen werden. Beispiele solcher Quelltextblöcke sind Funktionsdefinitionen oder Prozeduren, oder auch Module wie beispielsweise Objekte eines Programmquelltextes. Dabei sind in dem Programmquelltext Verweise 6a, 6b, 7 und 8 auf diese Quelltextblöcke, üblicherweise in der Form von Funktionsaufrufen enthalten. Alternativ können die benötigten Informationen, also insbesondere die Startadressen der einzelnen Programmcodeblöcke 2 bis 5, beispielsweise auch beim Linken der Programmcodeblöcke 2, 3, 4 und 5 ermittelt oder aus separat gespeicherten Informationen, wie etwa einem so genannten Map-File, ermittelt werden.In a first step 41 become the start adresses of the program code blocks 2 . 3 . 4 and 5 determined. For example, this can be done when translating source text blocks into the program code blocks 2 . 3 . 4 and 5 of the computer program 1 be made. Examples of such source text blocks are function definitions or procedures, or even modules such as objects of a program source text. There are references in the program source text 6a . 6b . 7 and 8th to these source text blocks, usually in the form of function calls. Alternatively, the required information, so in particular the start addresses of the individual program code blocks 2 to 5 , for example, when linking the program code blocks 2 . 3 . 4 and 5 determined or from separately stored information, such as a so-called map file, are determined.

In einem Schritt 42 wird ein zusätzliche Programmcodeblock 11 mit einer Entschlüsselungsfunktion in den geänderten Programmcode 9 eingefügt. Beispielsweise kann dieser an das Ende des geänderten Programmcodes 9 angehängt werden, wie dies inIn one step 42 becomes an additional program code block 11 with a decryption function in the changed program code 9 inserted. For example, this may be at the end of the modified program code 9 be attached as in

2 dargestellt ist. Dabei enthält die Entschlüsselungsfunktion alle Anweisungen, die benötigt werden, um einen verschlüsselten Programmcodeblock 13 oder 14 wieder zu entschlüsseln. Beispielsweise kann eine Entschlüsselungsfunktion über einen in den Programmcodeblock 11 integrierten, öffentlichen Schlüssel verfügen. Alternativ kann die Entschlüsselungsfunktion auch Programmcode vorsehen, der einen entsprechenden öffentlichen Schlüssel von einem dem Computersystem zugänglichen Server herunter lädt. 2 is shown. In this case, the decryption function contains all the instructions that are needed to form an encrypted program code block 13 or 14 to decrypt again. For example, a decryption function can be put into the program code block via one 11 integrated public key. Alternatively, the decryption function may also provide program code that downloads a corresponding public key from a server accessible to the computer system.

In einem Schritt 43 werden die Verweise 6a, 6b und 8 auf vorbestimmte, zu verschlüsselnde Programmcodeblöcke 4 und 5 durch Verweise 15a, 15b und 17 auf den Programmcodeblock 11 ersetzt. Dabei wird der darin enthaltenen Entschlüsselungsfunktion zusätzlich noch die im Schritt 41 ermittelte Startadresse der vorbestimmten Programmcodeblöcke 4 bzw. 5 übergeben. Auf diese Weise kann der Entschlüsselungsfunktion mitgeteilt werden, was entschlüsselt werden soll.In one step 43 become the references 6a . 6b and 8th to predetermined, to be encrypted program code blocks 4 and 5 by references 15a . 15b and 17 to the program code block 11 replaced. At the same time, the decryption function contained therein is also the one in the step 41 determined starting address of the predetermined program code blocks 4 respectively. 5 to hand over. In this way, the decryption function can be told what to decrypt.

In einem weiteren Schritt 44 werden die vorbestimmte Programmcodeblöcke 4 und 5 verschlüsselt. Beispielsweise können durch geeignete Kommentare oder Anweisungen in dem Programmquelltext selber oder separate Anweisungen an ein zur Übersetzung oder zum Linken eingesetztes Computerprogramm die Programmcodeblöcke 4 und 5 zur Verschlüsselung ausgewählt werden. Dabei wird zu jedem zu verschlüsselten Programmcodeblock 4 und 5 die Länge ermittelt und festgehalten.In a further step 44 become the predetermined program code blocks 4 and 5 encrypted. For example, by appropriate comments or instructions in the program source text itself or separate instructions to a computer program used for translation or linking, the program code blocks 4 and 5 be selected for encryption. In this case, each encrypted program code block becomes 4 and 5 the length is determined and recorded.

In einem Schritt 45 werden die vorbestimmten unverschlüsselten Programmcodeblöcke 4 und 5 durch verschlüsselte Programmcodeblöcke 13 und 14 ersetzt. Zur Verschlüsselung kann beispielsweise der so genannte Blowfish-Algorithmus oder auch ein anderer dem Fachmann bekannter asymmetrischer Verschlüsselungsalgorithmus eingesetzt werden.In one step 45 become the predetermined unencrypted program code blocks 4 and 5 by encrypted program code blocks 13 and 14 replaced. For encryption, for example, the so-called Blowfish algorithm or another asymmetric encryption algorithm known to those skilled in the art can be used.

Alternativ kann auch ein symmetrisches Verschlüsselungsverfahren eingesetzt werden. Diese sind zwar unsicherer, haben jedoch den Vorteil, dass sie schneller sind als asymmetrische Verschlüsselungsverfahren. Somit bietet sich insbesondere bei Geräten mit geringer Rechenleistung die Verwendung symmetrischer Verschlüsselungsverfahren an. Selbstverständlich können auch kombinierte Lösungen eingesetzt werden, bei denen ein für ein symmetrisches Verschlüsselungsverfahren genutzter, verhältnismäßig kurzer Schlüssel mit Hilfe eines asymmetrischen Verschlüsselungsverfahren geschützt ist.alternative can also be used a symmetric encryption method become. Although these are less secure, they have the advantage of being faster than asymmetric encryption methods. Thus offers especially in devices With low computational power the use of symmetric encryption methods at. Of course can also combined solutions be used, where one for a symmetric encryption method used, relatively short key protected by means of an asymmetric encryption method.

Die Struktur des verschlüsselten Programmcodeblocks 13 entspricht dabei der in 3 gezeigten. Zunächst wird die Länge des verschlüsselten Programmcodeblocks 13 als Längenangabe 19 an die in Schritt 41 ermittelte Startadresse geschrieben. Darauf folgend wird der verschlüsselte Programmcode 20 geschrieben, möglicherweise gefolgt von einer Prüfziffer 21. Wenn der verschlüsselte Programmcode 20 kürzer ist als die im Schritt 42 ermittelte Länge des unverschlüsselten Programmcodeblocks 4 beziehungsweise 5, wird der Bereich 22 wahlweise noch mit Nullen aufgefüllt, der den verbleibenden Platz des unverschlüsselten Programmcodeblocks 4 gegenüber dem verschlüsselten Programmcode 20 zuzüglich der Felder 19 und 21 ausmacht. Dadurch wird auch vermieden, dass der nachfolgende Programmcodeblock 14 in seiner Position verschoben wird, sodass keine weiteren Anpassungen von Verweisen in dem geänderten Programm 9 notwendig sind. Der Programmcodeblock 5 wird auf gleiche Weise durch den verschlüsselten Programmcodeblock 14 ersetzt.The structure of the encrypted program code block 13 corresponds to the in 3 shown. First, the length of the encrypted program code block 13 as a length specification 19 to the one in step 41 written start address written. Subsequently, the encrypted program code 20 written, possibly followed by a check digit 21 , If the encrypted program code 20 shorter than the one in the step 42 determined length of the unencrypted program code block 4 respectively 5 , the area becomes 22 optionally filled with zeros, the remaining space of the unencrypted program code block 4 against the encrypted program code 20 plus the fields 19 and 21 accounts. This also avoids that the subsequent program code block 14 is moved in its position, leaving no further adjustments to references in the modified program 9 necessary. The program code block 5 is done in the same way by the encrypted program code block 14 replaced.

In einem Schritt 46 kann der so geänderte, geschützte Programmcode 9 noch signiert werden. Beispielsweise kann dasselbe asymmetrische Schlüsselpaar zur Signierung des Programmcodes 9 verwendet werden, das auch zur Verschlüsselung der Programmcodeblöcke 4 und 5 eingesetzt wurde. Damit kann ein Benutzer oder ein Betriebssystem überprüfen, ob der Programmcode 9 nach seiner Erstellung noch verändert wurde. Alternativ kann auch eine Prüfsumme berechnet werden. Beide Schritte sind für das dargestellte Verfahren zum Schützen von Programmcode jedoch optional.In one step 46 may be the modified, protected program code 9 still to be signed. For example, the same asymmetric key pair can be used to sign the program code 9 which is also used to encrypt the program code blocks 4 and 5 was used. This allows a user or an operating system to check if the program code 9 was still changed after its creation. Alternatively, a checksum can also be calculated. However, both steps are optional for the illustrated method of protecting program code.

In einem Schritt 47 wird der erstellte Programmcode 9 gespeichert. Optional kann auch eine zusätzliche Signatur, die im Schritt 46 berechnet wurde, gespeichert werden. Der Programmcode 9 kann nun, möglicherweise in Verbindung mit einer Signatur und dem öffentlichen Teil des asymmetrischen Schlüsselpaares, an einen Benutzer ausgeliefert werden.In one step 47 becomes the created program code 9 saved. Optionally, an additional signature can be added in step 46 was calculated to be stored. The program code 9 can now be delivered to a user, possibly in conjunction with a signature and the public part of the asymmetric key pair.

5 zeigt ein Ablaufdiagramm für ein Verfahren zum Ausführen von erfindungsgemäß geschützten Programmcode. 5 shows a flowchart for a method for carrying out inventively protected program code.

In einem Schritt 51 wird Programmcode mit wenigstens einem verschlüsselten Programmcodeblock 13 beziehungsweise 14 geladen. Das geschützte Computerprogramm 9 enthält des Weiteren eine Entschlüsselungsfunktion in dem Programmcodeblock 11.In one step 51 becomes program code with at least one encrypted program code block 13 respectively 14 loaded. The protected computer program 9 further includes a decryption function in the program code block 11 ,

In einem Schritt 52 wird zunächst ein vorbestimmter Programmcodeblock 10, der an einer vorbestimmten Adresse des Programms 9 steht, ausgeführt. Dies kann beispielsweise die Startadresse des Programms 9 oder die eines durch vorbestimmte Informationen, wie etwa dem Namen einer Funktion, bestimmten Programmcodeblocks sein.In one step 52 First, a predetermined program code block 10 which is at a predetermined address of the program 9 stands, executed. This can be, for example, the start address of the program 9 or that of a program code block determined by predetermined information, such as the name of a function.

Die Ausführung des Programmcodeblocks 10 wird solange fortgesetzt, bis in einem Schritt 53 ein Verweis 15a auf den Programmcodeblock 11 mit der Entschlüsselungsfunktion erkannt wird.The execution of the program code block 10 will continue until one step 53 a reference 15a to the program code block 11 is recognized with the decryption function.

Wurde ein Verweis 15a auf die Entschlüsselungsfunktion erkannt, wird diese in einem Schritt 54 aufgerufen. Dabei wird der Entschlüsselungsfunktion durch den Verweis 15a die Startadresse des verschlüsselten Programmcodeblocks 14 übergeben. Die Entschlüsselungsfunktion liest nun in einem ersten Schritt die Länge des verschlüsselten Programmcodes 20 aus der Längenangabe 19 ein. Nachfolgend kann der verschlüsselte Programmcode 20 selbst in vorher zugeteilten Speicher geladen werden.Became a reference 15a Detected on the decryption function, this is in one step 54 called. The decryption function is replaced by the reference 15a the start address of the encrypted program code block 14 to hand over. The decryption function now reads the length of the encrypted program code in a first step 20 from the length specification 19 one. Below is the encrypted program code 20 itself in previously allocated memory to be loaded.

In einem Schritt 55 wird der verschlüsselte Programmcode 20 mithilfe der Prüfsumme 21 oder einer Signatur auf seine Korrektheit hin überprüft. Wird in diesem Schritt eine Veränderung an dem verschlüsselten Programmcodeblock 20 festgestellt, kann die Ausführung des geschützten Programms 9 aus Sicherheitsgründen abgebrochen werden.In one step 55 becomes the encrypted program code 20 using the checksum 21 or a signature checked for its correctness. In this step, a change to the encrypted program code block 20 detected, the execution of the protected program 9 for safety reasons.

In einem Schritt 56 wird der verschlüsselte Programmcode 20 entschlüsselt. Dazu muss die Entschlüsselungsfunktion D in der Regel dynamisch Speicher für die Speicherung des entschlüsselten Programmcodeblocks 5 anfordern. Alternativ kann auch der verschlüsselte Programmcodeblock 14 durch den entschlüsselten Programmcodeblock 5 ersetzt werden, da diese dieselbe Länge besitzen.In one step 56 becomes the encrypted program code 20 decrypted. For this purpose, the decryption function D usually has dynamic memory for storing the decrypted program code block 5 Request. Alternatively, the encrypted program code block 14 through the decrypted program code block 5 be replaced because they have the same length.

Der Verweis 15a auf den Programmcodeblock 11 wird nun auf den entschlüsselten Programmcodeblock 5 weitergeleitet. Dabei werden alle Parameter, die zunächst der Entschlüsselungsfunktion übergeben wurden, an den entschlüsselten Programmcodeblock 5 weitergeleitet. Dies geschieht im Schritt 57.The reference 15a to the program code block 11 will now go to the decrypted program code block 5 forwarded. In this case, all parameters that were initially transferred to the decryption function are sent to the decrypted program code block 5 forwarded. This happens in the step 57 ,

Nach Beenden der Ausführung des unverschlüsselten Programmcodeblocks 5 wird die Ausführung des aufrufenden Programmcodeblocks 10 fortgesetzt. In der 5 ist dies durch einen Rücksprung zu dem Schritt 52 gekennzeichnet. Dabei wird im Schritt 53 auch weiterhin auf Verweise 15a, 15b und 17 auf die Entschlüsselungsfunktion im Programmcodeblock 11 überwacht.After finishing the execution of the unv keyed in program code blocks 5 becomes the execution of the calling program code block 10 continued. In the 5 this is by going back to the step 52 characterized. It is in the step 53 continue to have references 15a . 15b and 17 to the decryption function in the program code block 11 supervised.

Ob ein einmal entschlüsselter Programmcodeblock 13 beziehungsweise 14 als entschlüsselter Programmcodeblock 4 beziehungsweise 5 im Arbeitsspeicher des ausführenden Computers verbleibt oder nicht, hängt beispielsweise von dem zur Verfügung stehenden Arbeitsspeicher und vorbestimmten Sicherheitskriterien ab.Whether a once decrypted program code block 13 respectively 14 as a decrypted program code block 4 respectively 5 remains in the working memory of the executing computer or not, for example, depends on the available memory and predetermined security criteria.

Beispielsweise kann am Ende der Ausführung eines entschlüsselten Programmcodeblocks 4 oder 5 dieser wieder aus dem Speicher entfernt werden. Diese Funktion kann beispielsweise die Entschlüsselungsfunktion übernehmen, bevor sie die Kontrolle an den aufrufenden Programmcodeblock zurückgibt.For example, at the end of execution of a decrypted program code block 4 or 5 this will be removed from the memory again. For example, this function can take over the decryption function before returning control to the calling program code block.

Alternativ kann die Entschlüsselungsfunktion D auch eine Tabelle verwenden, in der Einträge auf bereits entschlüsselte Programmcodeblöcke 4 beziehungsweise 5 enthalten sind. Bei einem wiederholten Aufrufen eines verschlüsselten Programmcodeblocks 13 beziehungsweise 14 kann direkt auf den entschlüsselten Programmcodeblock 4 oder 5 verwiesen werden, ohne dass eine neuerliche Entschlüsselung oder Verifizierung des verschlüsselten Programmcodeblocks 13 oder 14 nötig wird.Alternatively, the decryption function D may also use a table in which entries on already decrypted program code blocks 4 respectively 5 are included. Upon a repeated call to an encrypted program code block 13 respectively 14 can directly access the decrypted program code block 4 or 5 without further decryption or verification of the encrypted program code block 13 or 14 becomes necessary.

11
Computerprogrammcomputer program
22
Programmcodeblock (Programmhauptfunktion main)Program code block (Main program function main)
33
Programmcodeblock (Programmfunktion A)Program code block (Program function A)
44
Programmcodeblock (Programmfunktion B)Program code block (Program function B)
55
Programmcodeblock (Lizenzüberprüfungsfunktion C)Program code block (License check function C)
6–86-8
Verweisereferences
99
geschütztes Computerprogrammprotected computer program
1010
Programmcodeblock (Programmhauptfunktion main)Program code block (Main program function main)
1111
Programmcodeblock (Entschlüsselungsfunktion D)Program code block (Decryption function D)
1212
Programmcodeblock (Programmfunktion A)Program code block (Program function A)
1313
verschlüsselter Programmcodeblock (Programmfunktion B)encrypted Program code block (program function B)
1414
verschlüsselter Programmcodeblock (Lizenzüberprüfungsfunktion C)encrypted Program code block (license verification function C)
15–1715-17
Verweisereferences
1919
Längenangabelength specification
2020
verschlüsselter Programmcodeencrypted program code
2121
Prüfsummechecksum
2222
Auffüllbereichpadding
41–4741-47
Schritte des Verfahrens zum Erstellen von geschützem Programmcodesteps the process of creating protected program code
51–5751-57
Schritte des Verfahrens zum Ausführen von geschütztem Programmcodesteps the method for performing protected program code

Claims (15)

Verfahren zum Erzeugen von geschütztem Programmcode, aufweisend – Bereitstellen eines Computerprogramms (1) mit mehreren Programmcodeblöcken (2, 3, 4, 5), insbesondere Funktionen, und Verweisen (6a, 6b, 7, 8) auf die Programmcodeblöcke (2, 3, 4, 5), insbesondere Funktionsaufrufen, – Ermitteln einer Startadresse wenigstens eines vorbestimmten Programmcodeblocks (4, 5), – Bereitstellen eines Programmcodeblocks (11) mit einer Entschlüsselungsfunktion, durch die ein verschlüsselter Programmcodeblock (13, 14) entschlüsselbar ist, – Ersetzen der Verweise (6a, 6b, 8) auf den vorbestimmten Programmcodeblock (4, 5) durch Verweise (15a, 15b, 17) auf den Programmcodeblock (11) mit der Entschlüsselungsfunktion mit Übermittlung der Startadresse des vorbestimmten Programmcodeblocks (4, 5), – Verschlüsseln des vorbestimmten Programmcodeblocks (4, 5) in einen verschlüsselten Programmcodeblock (13, 14), – Ersetzen des vorbestimmten Programmcodeblocks (4, 5) mit dem zugehörigen verschlüsselten Programmcodeblock (13, 14), und – Speichern des geänderten Programmcodes, aufweisend die ersetzenden Verweise (15a, 15b, 16, 17), den verschlüsselten Programmcodeblock (13, 14) und den Programmcodeblock (11) mit der Entschlüsselungsfunktion als geschütztes Computerprogramm (9).Method for generating protected program code, comprising - providing a computer program ( 1 ) with several program code blocks ( 2 . 3 . 4 . 5 ), in particular functions, and references ( 6a . 6b . 7 . 8th ) to the program code blocks ( 2 . 3 . 4 . 5 ), in particular function calls, - determining a start address of at least one predetermined program code block ( 4 . 5 ), - providing a program code block ( 11 ) with a decryption function by which an encrypted program code block ( 13 . 14 ) can be decrypted, - replacing the references ( 6a . 6b . 8th ) to the predetermined program code block ( 4 . 5 ) by references ( 15a . 15b . 17 ) to the program code block ( 11 ) with the decryption function with transmission of the start address of the predetermined program code block ( 4 . 5 ), - encrypting the predetermined program code block ( 4 . 5 ) into an encrypted program code block ( 13 . 14 ), - replacing the predetermined program code block ( 4 . 5 ) with the associated encrypted program code block ( 13 . 14 ), and - storing the changed program code, comprising the replacing references ( 15a . 15b . 16 . 17 ), the encrypted program code block ( 13 . 14 ) and the program code block ( 11 ) with the decryption function as a protected computer program ( 9 ). Verfahren nach Anspruch 1, dadurch gekennzeichnet, dass der vorbestimmte Programmcodeblock (4, 5) eine Lizenzüberprüfung durchführt.Method according to claim 1, characterized in that the predetermined program code block ( 4 . 5 ) carries out a license check. Verfahren nach Anspruch 1 oder 2, dadurch gekennzeichnet, dass im Schritt des Ermittelns der Startadresse zusätzlich die Länge des vorbestimmten Programmcodeblocks (4, 5) ermittelt wird und im Schritt des Verschlüsselns die Länge des verschlüsselten Programmcodeblocks (13, 14) ermittelt wird.Method according to claim 1 or 2, characterized in that, in the step of determining the start address, additionally the length of the predetermined program code block ( 4 . 5 ) and, in the step of encrypting, the length of the encrypted program code block ( 13 . 14 ) is determined. Verfahren nach Anspruch 3, dadurch gekennzeichnet, dass im Schritt des Ersetzens kürzerer verschlüsselter Programmcode (20) bis zur Länge eines längeren unverschlüsselten Programmcodeblocks (4, 5) mit einem Auffüllbereich (22) mit vorbestimmten Werten aufgefüllt wird.A method according to claim 3, characterized in that in the step of replacing shorter encrypted program code ( 20 ) to the length of a longer unencrypted program code block ( 4 . 5 ) with a filling area ( 22 ) with vorbestimm is filled up. Verfahren nach Anspruch 3 oder 4, dadurch gekennzeichnet, dass dem verschlüsselten Programmcodeblock (13, 14) die Länge (19) des verschlüsselten Programmcodes (20) voran gestellt wird.Method according to claim 3 or 4, characterized in that the encrypted program code block ( 13 . 14 ) the length ( 19 ) of the encrypted program code ( 20 ) is advanced. Verfahren nach einem der Ansprüche 1 bis 5, dadurch gekennzeichnet, dass der verschlüsselte Programmcodeblock (13, 14) eine Prüfsumme (21) oder Signatur aufweist.Method according to one of Claims 1 to 5, characterized in that the encrypted program code block ( 13 . 14 ) a checksum ( 21 ) or signature. Verfahren nach einem der Ansprüche 1 bis 6, dadurch gekennzeichnet, dass für das geschützte Computerprogramm (9) eine Prüfsumme oder Signatur berechnet wird und die Prüfsumme oder Signatur mit dem Programmcode gespeichert wird.Method according to one of claims 1 to 6, characterized in that for the protected computer program ( 9 ) a checksum or signature is calculated and the checksum or signature is stored with the program code. Verfahren nach einem der Ansprüche 1 bis 7, dadurch gekennzeichnet, dass das Verschlüsselungsverfahren ein asymmetrisches Verschlüsselungsverfahren ist.Method according to one of claims 1 to 7, characterized that the encryption process an asymmetric encryption method is. Verfahren nach einem der Ansprüche 1 bis 8, dadurch gekennzeichnet, dass wenigstens zwei Programmcodeblöcke (4, 5) verschlüsselt werden, wobei ein erster verschlüsselter Programmcodeblock (13) einen Verweis (15b) auf einen zweiten verschlüsselten Programmcodeblock (14) aufweist.Method according to one of claims 1 to 8, characterized in that at least two program code blocks ( 4 . 5 ), a first encrypted program code block ( 13 ) a reference ( 15b ) to a second encrypted program code block ( 14 ) having. Verfahren zum Ausführen von Programmcode eines geschützten Computerprogramms (9), aufweisend – Laden eines Computerprogramms (9) mit wenigstens einem verschlüsselten Programmcodeblock (13, 14) und einem Programmcodeblock (11) mit einer Entschlüsselungsfunktion in einen Arbeitsspeicher, – Starten der Ausführung des Computerprogramms (9) mit einem vorbestimmten Programmcodeblock (10), – Aufrufen der Entschlüsselungsfunktion zur Entschlüsselung eines verschlüsselten Programmcodeblocks (13, 14), – Entschlüsseln des verschlüsselten Programmcodeblocks (13, 13) in einen entschlüsselten Programmcodeblocks (4, 5) durch die Entschlüsselungsfunktion, und – Ausführen des entschlüsselten Programmcodeblocks (4, 5).Method for executing program code of a protected computer program ( 9 ), comprising - loading a computer program ( 9 ) with at least one encrypted program code block ( 13 . 14 ) and a program code block ( 11 ) with a decryption function in a working memory, - starting the execution of the computer program ( 9 ) with a predetermined program code block ( 10 ), - calling the decryption function for decrypting an encrypted program code block ( 13 . 14 ), - decrypting the encrypted program code block ( 13 . 13 ) into a decrypted program code block ( 4 . 5 ) by the decryption function, and - executing the decrypted program code block ( 4 . 5 ). Verfahren nach Anspruch 10, dadurch gekennzeichnet, dass im Schritt des Ausführens des entschlüsselten Programmcodeblocks (4, 5) eine Lizenzüberprüfung für das Computerprogramm durchgeführt wird.A method according to claim 10, characterized in that in the step of executing the decrypted program code block ( 4 . 5 ) a license check is performed on the computer program. Verfahren nach Anspruch 10 oder 11, dadurch gekennzeichnet, dass der verschlüsselte Programmcodeblock (13, 14) verschlüsselten Programmcode (20) sowie eine Längenangabe (19) umfasst und im Schritt des Entschlüsselns zunächst die Längenangabe (19) des verschlüsselten Programmcodeblocks (13, 14) gelesen und zur Bestimmung des verschlüsselten Programmcodes (20) verwendet wird.Method according to claim 10 or 11, characterized in that the encrypted program code block ( 13 . 14 ) encrypted program code ( 20 ) as well as a length indication ( 19 ) and in the step of decrypting first the length specification ( 19 ) of the encrypted program code block ( 13 . 14 ) and to determine the encrypted program code ( 20 ) is used. Verfahren nach einem der Ansprüche 10 bis 12, dadurch gekennzeichnet, dass der verschlüsselte Programmcodeblock (13, 14) eine Prüfsumme (21) oder Signatur aufweist und im Schritt des Entschlüsselns die Richtigkeit der Prüfsumme (21) oder Signatur überprüft wird.Method according to one of Claims 10 to 12, characterized in that the encrypted program code block ( 13 . 14 ) a checksum ( 21 ) or signature and in the step of decrypting the correctness of the checksum ( 21 ) or signature is checked. Verfahren nach einem der Ansprüche 10 bis 13, dadurch gekennzeichnet, dass im Schritt des Ladens zusätzlich eine Prüfsumme oder Signatur für das geschützte Computerprogramm (9) geladen wird und die Richtigkeit der Prüfsumme oder Signatur überprüft wird.Method according to one of claims 10 to 13, characterized in that in the step of loading additionally a checksum or signature for the protected computer program ( 9 ) is loaded and the correctness of the checksum or signature is checked. Computerprogrammprodukt mit Programmcode zur Durchführung eines Verfahrens nach einem der Ansprüche 1 bis 14, wenn der Programmcode auf einem Prozessor abläuft.Computer program product with program code for performing a Method according to one of the claims 1 to 14 when the program code runs on a processor.
DE200510046696 2005-09-29 2005-09-29 A method for generating protected program code and method for executing program code of a protected computer program and computer program product Expired - Fee Related DE102005046696B4 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
DE200510046696 DE102005046696B4 (en) 2005-09-29 2005-09-29 A method for generating protected program code and method for executing program code of a protected computer program and computer program product

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
DE200510046696 DE102005046696B4 (en) 2005-09-29 2005-09-29 A method for generating protected program code and method for executing program code of a protected computer program and computer program product

Publications (2)

Publication Number Publication Date
DE102005046696A1 true DE102005046696A1 (en) 2007-04-12
DE102005046696B4 DE102005046696B4 (en) 2009-11-05

Family

ID=37886815

Family Applications (1)

Application Number Title Priority Date Filing Date
DE200510046696 Expired - Fee Related DE102005046696B4 (en) 2005-09-29 2005-09-29 A method for generating protected program code and method for executing program code of a protected computer program and computer program product

Country Status (1)

Country Link
DE (1) DE102005046696B4 (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20080301771A1 (en) * 2007-06-04 2008-12-04 Takanao Kawai Electronic device, application authentication method, application execution system, and computer readable medium containing executable program instruction
DE102009019089A1 (en) * 2009-04-20 2010-11-04 Pilz Gmbh & Co. Kg Method and device for creating a user program for a safety control
CN104537320A (en) * 2014-12-05 2015-04-22 深圳市雷赛软件技术有限公司 Automatic encrypting method and system for chip
EP3798873A1 (en) * 2019-09-24 2021-03-31 Siemens Aktiengesellschaft Method for protecting a computer-implemented application from manipulation

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5530752A (en) * 1994-02-22 1996-06-25 Convex Computer Corporation Systems and methods for protecting software from unlicensed copying and use

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7320075B2 (en) * 2001-11-20 2008-01-15 Safenet, Inc. Software protection method utilizing hidden application code in a protection dynamic link library object
CA2415334C (en) * 2002-12-31 2012-04-24 Protexis Inc. System for persistently encrypting critical software data to control operation of an executable software program

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5530752A (en) * 1994-02-22 1996-06-25 Convex Computer Corporation Systems and methods for protecting software from unlicensed copying and use

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20080301771A1 (en) * 2007-06-04 2008-12-04 Takanao Kawai Electronic device, application authentication method, application execution system, and computer readable medium containing executable program instruction
DE102009019089A1 (en) * 2009-04-20 2010-11-04 Pilz Gmbh & Co. Kg Method and device for creating a user program for a safety control
US8910131B2 (en) 2009-04-20 2014-12-09 Pilz Gmbh & Co. Kg Method and apparatus for generating an application program for a safety-related control unit
CN104537320A (en) * 2014-12-05 2015-04-22 深圳市雷赛软件技术有限公司 Automatic encrypting method and system for chip
EP3798873A1 (en) * 2019-09-24 2021-03-31 Siemens Aktiengesellschaft Method for protecting a computer-implemented application from manipulation

Also Published As

Publication number Publication date
DE102005046696B4 (en) 2009-11-05

Similar Documents

Publication Publication Date Title
EP2515499B1 (en) Method for generating a cryptographic key for a secure digital data object on the basis of the current components of a computer
DE60127310T2 (en) DEVICE FOR PROTECTING DIGITAL DATA
DE102009041176B4 (en) A compiler system and method for compiling a source code into an encrypted machine language code
DE10392528T5 (en) Microcode patch authentication
DE102009013384A1 (en) System and method for providing a secure application fragmentation environment
DE102013105042A1 (en) Safe flash programming of a secondary processor
DE102016205289A1 (en) Method, processor and device for checking the integrity of user data
DE102012205689A1 (en) Instruction encryption / decryption arrangement and method with iterative encryption / decryption updating
EP1798653B1 (en) Method, computer program product and device for protecting a program comprising a function block
EP1271310B1 (en) Method to extend application that is to be installed with an installation program with a function and a computer program product
EP2913772A1 (en) Method and computer system for protecting a computer program against influence
EP1999521B1 (en) Field device
DE102005046696B4 (en) A method for generating protected program code and method for executing program code of a protected computer program and computer program product
EP2434424B1 (en) Method for increasing the security of security-relevant online services
EP3552344B1 (en) Bidirectionally linked blockchain structure
EP1439446A1 (en) Method for extending a program through a copy protection function
EP2394232B1 (en) Device and method for preventing unauthorized use and/or manipulation of software
EP1636700A1 (en) Method for booting up a software in the boot sector of a programmable read-only memory
EP3497606B1 (en) Individual encryption of control commands
EP3745287B1 (en) Protection of a software application
EP3251281B1 (en) Intrinsic authentication of program code
DE102014113441A1 (en) Protection against software components by means of encryption
EP1318451B1 (en) Method to execute a program on a computer
EP2569726B1 (en) Method for checking whether program instructions have been executed by a portable terminal
EP3441898B1 (en) Method and device for protecting software against unauthorised use

Legal Events

Date Code Title Description
OP8 Request for examination as to paragraph 44 patent law
8364 No opposition during term of opposition
R084 Declaration of willingness to licence
R081 Change of applicant/patentee

Owner name: FUJITSU TECHNOLOGY SOLUTIONS INTELLECTUAL PROP, DE

Free format text: FORMER OWNER: FUJITSU SIEMENS COMPUTERS GMBH, 80807 MUENCHEN, DE

Effective date: 20111229

R082 Change of representative

Representative=s name: EPPING HERMANN FISCHER, PATENTANWALTSGESELLSCH, DE

Effective date: 20111229

Representative=s name: EPPING HERMANN FISCHER PATENTANWALTSGESELLSCHA, DE

Effective date: 20111229

R119 Application deemed withdrawn, or ip right lapsed, due to non-payment of renewal fee
R079 Amendment of ipc main class

Free format text: PREVIOUS MAIN CLASS: G06F0021220000

Ipc: G06F0021100000