DE102018113772B4 - Encryption method - Google Patents

Encryption method Download PDF

Info

Publication number
DE102018113772B4
DE102018113772B4 DE102018113772.9A DE102018113772A DE102018113772B4 DE 102018113772 B4 DE102018113772 B4 DE 102018113772B4 DE 102018113772 A DE102018113772 A DE 102018113772A DE 102018113772 B4 DE102018113772 B4 DE 102018113772B4
Authority
DE
Germany
Prior art keywords
key
cipher
section
byte
plain text
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
DE102018113772.9A
Other languages
German (de)
Other versions
DE102018113772A1 (en
Inventor
Patentinhaber gleich
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.)
Individual
Original Assignee
Individual
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 Individual filed Critical Individual
Priority to DE102018113772.9A priority Critical patent/DE102018113772B4/en
Publication of DE102018113772A1 publication Critical patent/DE102018113772A1/en
Application granted granted Critical
Publication of DE102018113772B4 publication Critical patent/DE102018113772B4/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/12Transmitting and receiving encryption devices synchronised or initially set up in a particular manner
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/08Key distribution or management, e.g. generation, sharing or updating, of cryptographic keys or passwords
    • H04L9/0894Escrow, recovery or storing of secret information, e.g. secret key escrow or cryptographic key storage
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/14Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols using a plurality of keys or algorithms

Abstract

Symmetrisches Verfahren zur Verschlüsselung digitaler Klartextdaten zu einem Chiffrat basierend auf einem digitalen Schlüssel, wobei der Schlüssel eine Vielzahl von Bytes eines jeden möglichen Datums enthält, umfassend- Erzeugen eines Sectionschlüssels durch zyklisches Verschieben des Schlüssels um einen zufälligen Verschiebewert und- Speichern einer Kennung des Sectionschlüssels in dem Chiffrat, und- Ermitteln einer zufälligen Position eines Bytes in dem Sectionschlüssel, wobei das Datum des Bytes des Sectionschlüssels identisch zu dem Datum eines zu verschlüsselnden Bytes des Klartexts ist, und- Speichern der ermittelten Position in dem Chiffrat.Symmetrical method for encrypting digital plain text data into a cipher based on a digital key, the key containing a large number of bytes of each possible date, comprising- generating a section key by cyclically shifting the key by a random shift value and- storing an identifier of the section key in the cipher, and- determining a random position of a byte in the section key, the date of the byte of the section key being identical to the date of a byte of the plaintext to be encrypted, and- storing the determined position in the cipher.

Description

Die Erfindung betrifft ein Verfahren und eine entsprechende Vorrichtung zur Verschlüsselung digitaler Daten mit einem digitalen Schlüssel gemäß Anspruch 1.Weiterhin sind ein Verfahren zur Entschlüsselung der mit dem beschriebenen Verfahren verschlüsselten Daten (Chiffrat) beschrieben sowie eine zur Durchführung des Verfahrens vorgesehene und eingerichtete Vorrichtung und ein Computerprogram m produkt.The invention relates to a method and a corresponding device for encrypting digital data with a digital key. Furthermore, a method for decrypting the data (cipher) encrypted with the method described is described, as well as a device and a device provided and set up for performing the method Computer program m product.

Symmetrische Verschlüsselungsverfahren sind an sich bekannt. Bei Verschlüsselungsverfahren dieser Art werden die Klartextdaten anhand eines geheimen Schlüssels auf der Senderseite verschlüsselt auf der Empfängerseite entschlüsselt. Typischerweise werden symmetrische Verschlüsselungsverfahren zur Verschlüsselung digital vorliegender Informationen verwendet, die also in Form von Bits und Bytes vorliegen und die von einem digitalen Signalprozessor (DSP) verarbeitet werden können. Der zu verwendende Ver- bzw. entsprechende Entschlüsselungsalgorithmus kann dabei als ausführbares Computerprogramm vorliegen, welches von einem Computer (PC) ausgeführt werden kann. Der Schlüssel sowie die zu ver- oder entschlüsselnde Datei liegen in einem Speicher des PC und können von diesem gelesen werden. Für eine Reihe bekannter Verfahren existieren speziell für das Verfahren entwickelte Prozessoren, welche für die Ver- oder Entschlüsselung optimiert sind und das jeweilige Verfahren entsprechend schnell durchführen können, sogenannte application specific ICs (ASICs).Symmetrical encryption methods are known per se. With encryption methods of this type, the plain text data is encrypted and decrypted on the recipient side using a secret key on the sender side. Symmetrical encryption methods are typically used to encrypt digitally available information, which is in the form of bits and bytes and which can be processed by a digital signal processor (DSP). The encryption or corresponding decryption algorithm to be used can be present as an executable computer program which can be executed by a computer (PC). The key and the file to be encrypted or decrypted are stored in a memory on the PC and can be read by the latter. For a number of known methods, there are processors specially developed for the method, which are optimized for encryption or decryption and can carry out the respective method correspondingly quickly, so-called application specific ICs (ASICs).

Es ist eine Vielzahl symmetrischer Verschlüsselungsverfahren bekannt, beispielsweise der sogenannte Advanced Encryption Standard (AES) oder Rijndael, der Data Encryptions Standard DES bzw. die daraus hergeleitete Weiterentwicklung Triple-DES, der International Data Encryption Algorithm IDEA sowie die von Bruce Schneier entwickelten Verfahren Blowfish oder Twofish oder die CAST Verfahren von Carlisle M. Adams.A large number of symmetrical encryption methods are known, for example the so-called Advanced Encryption Standard (AES) or Rijndael, the Data Encryptions Standard DES or the further development Triple-DES derived from it, the International Data Encryption Algorithm IDEA and the Blowfish or Bruce Schneier processes Twofish or the CAST method of Carlisle M. Adams.

Eine Datei, welche die Information in unverschlüsselter Form enthält, wird dabei als Klartextdatei oder kurz als Klartext bezeichnet. Eine Datei, welche die Information in verschlüsselter Form enthält, wird als Chiffrat bezeichnet.A file that contains the information in unencrypted form is called a plain text file, or plain text for short. A file that contains the information in encrypted form is called a cipher.

Ein Vorteil dieser Verfahren ist ein einfaches Schlüsselmanagement, weil nur ein Schlüssel für die Ver- und Entschlüsselung benötigt wird. Weiterhin weisen die Verfahren typischerweise eine hohe Verarbeitungsgeschwindigkeit auf, weil diese meist auf effizienten Operationen wie Bit-Shifts oder XORs aufbauen.One advantage of this method is simple key management, because only one key is required for encryption and decryption. Furthermore, the methods typically have a high processing speed because they are mostly based on efficient operations such as bit shifts or XORs.

Jedoch weisen diese Verfahren den Nachteil auf, dass sie rechnerisch geknackt werden können. Mit ständig steigender Rechenleistung verfügbarer Computer nimmt dabei die dafür benötigte Zeit ab. However, these methods have the disadvantage that they can be broken computationally. As the computing power of available computers increases, the time required for this decreases.

Die US 2002/0126840 A1 beschreibt ein Verfahren und eine entsprechende Vorrichtung zur Anpassung eines symmetrischen Verschlüsselungsalgorithmus zu einem halbsymmetrischen Algorithmus. Basierend auf einem Hauptschlüssel können dabei individuelle Schlüssel erzeugt werden, auf deren Basis individuelle Entschlüsselungsprozesse erzeugt werden.The US 2002/0126840 A1 describes a method and a corresponding device for adapting a symmetrical encryption algorithm to a semi-symmetrical algorithm. Based on a master key, individual keys can be generated on the basis of which individual decryption processes are generated.

Bekannte asymmetrische Verschlüsselungsverfahren, auch bekannt als Public-Key-Verschlüsselungsverfahren, gelten dabei als sicherer. Das als RSA bekannte Verfahren von Rivest, Shamir und Adleman, oder das Merkle-Hellman oder das McEliece oder das Elgamal Verfahren sind derartige Verfahren. Diese weisen zwar den Vorteil auf, dass der sogenannte öffentliche Schlüssel (public key) nicht über einen sicheren Kanal an einen Sender übertragen werden muss, weil mit diesem lediglich die Verschlüsselung, nicht aber die Entschlüsselung durchgeführt werden kann. Jedoch weisen diese asymmetrischen Verfahren insbesondere den Nachteil auf, dass sie erheblich mehr Rechenleistung sowohl für die Ver- als auch für die Entschlüsselung benötigen. Darüber hinaus können auch diese Verfahren mit Blick auf die verfügbaren immer leistungsfähigeren Prozessoren nicht mehr als uneingeschränkt sicher gelten.Well-known asymmetrical encryption methods, also known as public key encryption methods, are considered to be more secure. The Rivest, Shamir and Adleman method known as RSA, or the Merkle-Hellman or the McEliece or the Elgamal method are such methods. These have the advantage that the so-called public key does not have to be transmitted to a transmitter via a secure channel, because it can only be used for encryption, but not decryption. However, these asymmetrical methods have the particular disadvantage that they require considerably more computing power both for encryption and for decryption. In addition, in view of the increasingly powerful processors available, these methods can no longer be regarded as unreservedly secure.

Damit besteht ein Bedarf ein Verfahren vorzuschlagen, welches die oben genannten Nachteile wenigstens teilweise löst.There is therefore a need to propose a method which at least partially solves the above-mentioned disadvantages.

Im Folgenden werden das Verfahren sowie ein zur Ver- und Entschlüsselung geeignetes und eingerichtetes System anhand von Figuren beschrieben. Dabei zeigen die Figuren

  • 1 schematischer Aufbau eines Schlüssels
  • 2 schematische Darstellung des Formats eines Chiffrats
  • 3 Ablaufdiagramm des Verschlüsselungsverfahrens
  • 4 Ablaufdiagramm der Umpositionierung
The following describes the method and a system that is suitable and set up for encryption and decryption with the aid of figures. The figures show
  • 1 schematic structure of a key
  • 2 schematic representation of the format of a cipher
  • 3 Encryption process flowchart
  • 4th Repositioning flowchart

Die im folgenden erläuterten Datenstrukturen zeigen jeweils eine mögliche Ausgestaltung der Datenformate. Für den Fachmann ist es dabei selbstverständlich, dass ein jeweiliges Datenformat durch ein äquivalentes Format ersetzt werden kann, wenn dieses die entsprechende Funktionalität bereitstellt.The data structures explained below each show a possible configuration of the data formats. For the person skilled in the art, it goes without saying that a respective data format can be replaced by an equivalent format if this provides the corresponding functionality.

Schlüsselkey

1 zeigt in schematischer Form einen Schlüssel 100, welcher für die Verschlüsselung eines Klartexts in ein Chiffrat und die Entschlüsselung eines Chiffrats in eine Klartextdatei verwendet werden kann. Ein Schlüssel umfasst für jeden mit einem Byte darstellbaren Wert, also dezimal 0 bis 255 oder in hexadezimaler Schreibweise 0x00 bis OxFF, eine Vielzahl von Bytes 110. Der Schlüssel weist damit eine Vielzahl von Bytes mit dem Wert 0x00 (alle Bits mit 0 besetzt), eine Vielzahl von Bytes mit dem Wert 0X01 (alle Bits bis auf das LSB (least significant Byte) mit Null besetzt), und eine Vielzahl von Bytes mit dem Wert 0x01 (alle Bits mit 0 besetzt, mit Ausnahme des LSB (Least Significant Bit)) und so weiter für alle Bytewerte und ebenso eine Vielzahl von Bytes mit dem Wert OxFF auf (alle Bits mit 1 besetzt). 1 shows in schematic form a key 100 , which can be used for the encryption of a plaintext into a cipher and the decryption of a cipher into a plaintext file. A key comprises for each value that can be represented with one byte, i.e. decimal 0 to 255 or in hexadecimal notation 0x00 to OxFF, a large number of bytes 110 . The key thus has a large number of bytes with the value 0x00 (all bits occupied by 0), a large number of bytes with the value 0X01 (all bits except for the LSB (least significant byte) occupied by zero), and a large number of bytes with the value 0x01 (all bits with 0, with the exception of the LSB (Least Significant Bit)) and so on for all byte values and also a large number of bytes with the value OxFF (all bits with 1).

In einer Ausführungsform können die Werte 0x00 bis 0xFF (hexadezimale Schreibweise), also dezimal 0-255, der Bytes dabei innerhalb des Schlüssels gleichverteilt sein. Die Anordnung der verschiedenwertigen Bytes innerhalb des Schlüssels ist dabei zufällig gewählt. Die zufällige Anordnung der Bytes 2a, 2b, 2c, 2d verschiedener Werte ist in der 1 für den Schlüssel 100 durch beispielhafte Werte 0F, E1 ... 0B .... 01 dargestellt, welche die Werte 0x0F, 0xE1, 0x0B und 0x01 darstellen.In one embodiment, the values 0x00 to 0xFF (hexadecimal notation), that is to say decimal 0-255, of the bytes can be evenly distributed within the key. The arrangement of the bytes with different values within the key is chosen at random. The random arrangement of bytes 2a, 2b, 2c, 2d of different values is shown in the 1 for the key 100 represented by exemplary values 0F, E1 ... 0B .... 01, which represent the values 0x0F, 0xE1, 0x0B and 0x01.

In einer Ausführungsform kann der Schlüssel einen jeden möglichen Bytewert, also jeden der 256 mit 8 Bits darstellbaren Werte von 0x00 bis 0xFF, genau 256-mal umfassen, sodass der Schlüssel eine Größe von 256 x 256 = 65.536 Bytes aufweist.In one embodiment, the key can have any possible byte value, that is, any of the 256 with 8 bits representable values from 0x00 to 0xFF, include exactly 256 times, so that the key has a size of 256 x 256 = 65,536 bytes.

In einer alternativen Ausführungsform können die verschiedenen Werte der Bytes nicht gleichverteilt, sondern entsprechend der statistischen Häufigkeit der Werte in einem zu verschlüsselnden Klartext verteilt sein. Für den Fall, dass die Klartextdatei ein Text ist, in welchem beispielsweise druckbare Zeichen, also die ASCII Zeichen 0x20 (Leerzeichen) bis 0x7E (Tilde Zeichen) vorkommen, kann die Häufigkeit der Bytes mit diesen Werten entsprechend angepasst sein.In an alternative embodiment, the different values of the bytes can not be evenly distributed, but rather can be distributed according to the statistical frequency of the values in a plain text to be encrypted. In the event that the plain text file is a text in which, for example, printable characters, i.e. the ASCII characters 0x20 (space) to 0x7E (tilde), occur, the frequency of the bytes with these values can be adjusted accordingly.

In einer weiteren alternativen Ausführungsform kann der Schlüssel eine Vielzahl von Abschnitten aufweisen, wobei ein jeder Abschnitt gestaltet ist, wie oben für den Schlüssel beschrieben. Die Anzahl der Schlüsselabschnitte ist dabei nicht begrenzt. In diesem Fall sind das Verfahren sowie die Vorrichtung entsprechend dazu eingerichtet, dass die mehreren Schlüsselabschnitte verwaltet werden und in dem Chiffrat gekennzeichnet ist, welcher Schlüsselabschnitt verwendet wird. Die dazu notwendigen Mittel, also eine Kennzeichnung im Chiffrat eines für die Verschlüsselung verwendeten Schlüsselabschnitts, sind dem Fachmann geläufig, sodass an dieser Stelle nicht weiter darauf eingegangen wird.In a further alternative embodiment, the key can have a plurality of sections, each section being designed as described above for the key. The number of key sections is not limited. In this case, the method and the device are set up accordingly so that the multiple key sections are managed and which key section is used is identified in the cipher. The means necessary for this, that is to say an identification in the cipher of a key section used for the encryption, are familiar to the person skilled in the art, so that they will not be discussed further at this point.

Zusätzlich zu den Bytes in den Schlüsselabschnitten, welche für die Ableitung von Sectionschlüsseln vorgesehen sind, kann der Schlüssel Informationen über den Schlüssel aufweisen, sogenannte Metadaten. Diese Metadaten über den Schlüssel können vorzugsweise in einem zusätzlichen Abschnitt vorzugsweise am Anfang der Datei, dem sogenannten Header 120, abgelegt sein. Auf diese Weise kann ein Programm, bevor die eigentliche Ver- oder Entschlüsselung durchgeführt wird, Informationen über den Schlüssel und insbesondere über die Segmentierung in einzelne Abschnitte erlangen.In addition to the bytes in the key sections, which are provided for deriving section keys, the key can contain information about the key, so-called metadata. This metadata about the key can preferably be stored in an additional section, preferably at the beginning of the file, the so-called header 120 , be filed. In this way, before the actual encryption or decryption is carried out, a program can obtain information about the key and, in particular, about the segmentation into individual sections.

Der Schlüsselheader 120, umfasst eine Kennung des Schlüssels. Diese kann in einer Ausführungsform eine Größe von 4 Bytes aufweisen, sodass damit 232 = 4294967296 verschiedene Schlüssel identifizierbar und damit bei einer Ver- oder Entschlüsselungsstelle über diese Kennung identifizierbar sind. Die Kennung eines Schlüssels wird dabei per Zufall gewählt, ist also eine beliebige Zeichenkette geeigneter Länge. Die Kennung ist damit nicht abhängig oder in irgendeiner Weise verbunden oder verknüpft mit dem Inhalt des Schlüssels, sodass aus der Kennung des Schlüssels nicht auf dessen Inhalt geschlossen werden kann.The key header 120 , includes an identifier of the key. In one embodiment, this can have a size of 4 bytes, so that 2 32 = 4294967296 different keys can be identified and thus identified at an encryption or decryption point using this identifier. The identifier of a key is chosen at random, so it is any character string of suitable length. The identifier is therefore not dependent on or in any way connected or linked to the content of the key, so that the content of the key cannot be inferred from the identifier of the key.

Die nachfolgende Beschreibung geht von einem Schlüssel aus, welcher nur einen Schlüsselabschnitt aufweist und einen jeden möglichen Bytewert genau 256 mal aufweist, damit also eine Länge von 65536 Bytes zuzüglich der Länge des Headers aufweist.The following description is based on a key which has only one key section and exactly every possible byte value 256 times, so that it has a length of 65536 bytes plus the length of the header.

DAS CHIFFRATTHE CHIFFRAT

Das Chiffrat, in der Literatur auch Ciphertext, Kryptogramm oder Kryptotext genannt, bezeichnet die Datei, welche durch Anwendung des Verschlüsselungsalgorithmus auf die Klartextdatei und unter Verwendung eines Schlüssels erzeugt wurde und die verschlüsselte Information des Klartexts umfasst. Die Klartextdatei kann basierend auf dem Chiffrat und unter Verwendung des Schlüssels, welcher für die Verschlüsselung verwendet wurde, durch Anwendung des Entschlüsselungsalgorithmus erzeugt werden. Ein Chiffrat kann dabei eine abgeschlossene Datei sein oder ein quasi endlos-Strom sein, beispielsweise ein verschlüsselter Datenstrom, der kontinuierlich von einem Sender zu einem Empfänger übertragen wird.The cipher, also called ciphertext, cryptogram or cryptotext in the literature, refers to the file which was generated by applying the encryption algorithm to the plain text file and using a key and which includes the encrypted information of the plain text. The plain text file can be generated based on the cipher and using the key which was used for the encryption by applying the decryption algorithm. A cipher can be a closed file or a quasi-endless stream, for example an encrypted data stream that is continuously transmitted from a transmitter to a receiver.

2 zeigt schematisch den Aufbau eines Chiffrats 200. Die schematische Abbildung zeigt dabei eine von mehreren möglichen Anordnungen von Abschnitten von Daten. Die Reihenfolge der Abschnitte ist dabei beliebig, wobei diese sowohl der verschlüsselnden als auch der entschlüsselnden Stelle bekannt sein müssen, sodass die entschlüsselnde Stelle das Chiffrat entschlüsseln und damit die Klartextdatei wiederherstellen kann. 2 shows schematically the structure of a cipher 200 . The schematic illustration shows one of several possible arrangements of sections of data. The sequence of the sections is arbitrary, although both the encrypting and the decrypting authority must be aware of them so that the decrypting authority can decrypt the cipher and thus restore the plain text file.

Das Chiffrat 200 umfasst Metadaten und die verschlüsselten Daten. Dabei können die Metadaten selbst wenigstens teilweise verschlüsselt und wenigstens teilweise zu Beginn des Chiffrats in einem sogenannten Header 210 angeordnet sein, sodass die entschlüsselnde Stelle zunächst die Metadaten liest und davon ausgehend die Entschlüsselung durchführen kann.The cipher 200 includes metadata and the encrypted data. The metadata itself can be at least partially encrypted and at least partially at the beginning of the cipher in a so-called header 210 be arranged so that the decrypting body first reads the metadata and based thereon can carry out the decryption.

Wie später noch beschrieben kann das Chiffrat einen Header 210 aufweisen, welcher Metadaten aufweist, die für das gesamte Chiffrat gelten. Weiterhin kann das Chiffrat Metadaten aufweisen, welche nur auf einen Abschnitt des Chiffrats bezogen sind. Sofern ein Chiffrat mehrere Abschnitte umfasst, welche jeweils einem Abschnitt der Klartextdatei in verschlüsselter Form entsprechen, kann das Chiffrat zu einem jeden Abschnitt Metadaten umfassen, wobei diese abschnittsbezogenen Metadaten in einem Abschnittsheader gespeichert sind und nur für einen einzigen, typischerweise den nachfolgenden Abschnitt 220, 221 usw. gelten.Die Metadaten können optional eine Kennung des Schlüssels umfassen, mit welchem die Klartextdatei verschlüsselt wurde. Diese Information ermöglicht der entschlüsselnden Stelle die Identifizierung des zu verwendenden Schlüssels. Diese Information kann in einem geeigneten Feld 211 festgelegter Größe, beispielsweise 4 Byte, im Header 210 des Chiffrats 200 oder an anderer vereinbarter Position im Chiffrat gespeichert werden. Die entschlüsselnde Stelle erhält damit die Information, mit welchem Schlüssel das Chiffrat zu entschlüsseln ist. Für den Fall, dass das Chiffrat keine Kennung des Schlüssels enthält, muss die entschlüsselnde Stelle den für die Entschlüsselung zu verwendenden Schlüssel vorgeben. Weitere Kennungen von Schlüsseln, welche der Verschlüsselung zugrunde liegen, können in weiteren Feldern des Headers abgelegt sein.Optional können die Metadaten weitere Informationen aufweisen, welche sich auf das Verschlüsselungsverfahren beziehen. So können die Metadaten in einem Feld 212 eine Information über die Programmversion enthalten, welche für die Verschlüsselung verwendet wurde. Die entschlüsselnde Stelle kann aus dieser Information beispielsweise das Format des Chiffrats ermitteln, welches für eine Programmversion spezifisch ist. Weiterhin können in diesem Feld weitere, dem Fachmann geläufige Metainformationen zu Dateien, gespeichert sein.Wie später noch beschrieben ist, können die verschlüsselten Daten in mehrere Abschnitte derart aufgeteilt sein., dass diese mit jeweiligen Sectionschlüsseln (engl. section = Abschnitt) verschlüsselt sind. Dabei können die mehreren Abschnitte unterschiedlich lang sein. Die Kennung des für einen Chiffratabschnitt verwendeten Sectionschlüssels wird dabei vorzugsweise in dem Chiffrat 200 an geeigneter Stelle 213 gespeichert. In einer Variante spiegelt die Kennung des Sectionschlüssels den Verschiebewert wider, welcher der Ableitung des Sectionschlüssels zugrunde gelegt wurde. So kann ein erster Sectionschlüssel für die Verschlüsselung verschiedener Felder in dem Header des Chiffrats verwendet werden, und weitere Sectionschlüssel können für die Verschlüsselung weiterer Abschnitte des Chiffrats, in welchem verschlüsselte Klartextdaten abgelegt sind, verwendet werden. Das hier angegebene Format des Chiffrats ist lediglich eine mögliche Variante, wobei weitere, alternative Varianten eines Dateiformats dem Fachmann geläufig sind.As described later, the cipher can have a header 210 which has metadata that apply to the entire cipher. Furthermore, the cipher can have metadata which are only related to a section of the cipher. If a cipher comprises several sections, each corresponding to a section of the plain text file in encrypted form, the cipher can comprise metadata for each section, this section-related metadata being stored in a section header and only for a single section, typically the following section 220 , 221 The metadata can optionally include an identifier of the key with which the plain text file was encrypted. This information enables the decrypting agency to identify the key to be used. This information can be in an appropriate field 211 fixed size, e.g. 4 bytes, in the header 210 of the cipher 200 or at another agreed position in the cipher. The decrypting body thus receives the information as to which key is to be used to decrypt the cipher. In the event that the cipher does not contain an identifier for the key, the decrypting authority must specify the key to be used for decryption. Further identifications of keys on which the encryption is based can be stored in further fields of the header. Optionally, the metadata can contain further information relating to the encryption method. So the metadata in a field 212 contain information about the program version which was used for the encryption. The decrypting body can use this information to determine, for example, the format of the cipher, which is specific to a program version. Furthermore, further meta information on files that is familiar to the person skilled in the art can be stored in this field. As will be described later, the encrypted data can be divided into several sections in such a way that they are encrypted with the respective section keys. The several sections can be of different lengths. The identifier of the section key used for a cipher section is preferably in the cipher 200 in a suitable place 213 saved. In one variant, the identifier of the section key reflects the shift value on which the derivation of the section key was based. A first section key can be used to encrypt various fields in the header of the cipher, and further section keys can be used to encrypt further sections of the cipher in which encrypted plain text data is stored. The format of the cipher specified here is only one possible variant, further, alternative variants of a file format being familiar to the person skilled in the art.

Optional kann auch die Länge der verschlüsselten Klartextdatei (in Bytes) in das Chiffrat geschrieben werden, dabei vorzugsweise in ein Feld 214 des Headers 210. In einer bevorzugten Ausführungsform kann der Wert der Länge in byteweiser verschlüsselter Form in das Chiffrat geschrieben werden, wobei die byteweise Verschlüsselung basierend auf dem Schlüssel oder dem Sectionschlüssel durchgeführt wird. Ebenso optional kann der Name der Klartextdatei in das Chiffrat, vorzugsweise in den Header des Chiffrats geschrieben werden, siehe Feld 215, sodass nach erfolgreicher Dekodierung des Chiffrats die entstandene Klartextdatei den Namen der originalen Klartextdatei erhalten kann. Dabei kann das Feld eine festgelegte Länge aufweisen oder so strukturiert sein, dass zunächst eine Längenangabe von beispielsweise 2 Bytes spezifiziert ist, an welche sich das Feld der angegebenen Länge anschließt, in welchem der Name der Klartextdatei in verschlüsselter Form abgelegt ist. Auf diese Weise erhält die entschlüsselnde Stelle ebenfalls in verschlüsselter Form die Information über den Namen der Klartextdatei. Der Name der Klartextdatei kann dabei mit einem Sectionschlüssel verschlüsselt sein.In einer vorteilhaften Ausführungsform können sogenannte Junkbytes (engl junk = Müll) in das Chiffrat aufgenommen werden. Dabei sind Junkbytes solche Bytes, die nicht zu dem Klartext gehören, sondern dem Chiffrat willkürlich hinzugefügt wurden und ohne inhaltliche Bedeutung sind. Die entschlüsselnde Stelle kann derartige Junkbytes ignorieren, weil diese keinerlei Information transportieren und nicht zum Klartext gehören. Junkbytes können dem Chiffrat hinzugefügt werden, um einem Angreifer das ungewünschte Entschlüsseln dadurch zu erschweren, dass die tatsächliche Nutzinformation des Chiffrats durch Hinzufügen der Junkbytes verschleiert wird, sog. obfuscation. Die Anzahl der einem Abschnitt des Chiffrats hinzugefügten Junkbytes werden in das Chiffrat und zu dem jeweiligen Abschnitt in das Chiffrat geschrieben, sodass die entschlüsselnde Stelle eine Information darüber erhält, welche Bytes eines Chiffratabschnitts bei der Entschlüsselung zu ignorieren sind. Dabei wird die Anzahl der dem Chiffratabschnitt hinzugefügten Junkbytes in verschlüsselter Form in das Chiffrat geschrieben, siehe Feld 216, wobei für die Verschlüsselung der Sectionschlüssel verwendet werden kann, welcher für die Verschlüsselung des Chiffratabschnitts verwendet wurde. Die hinzugefügten Junkbytes können in einem Feld 216 des Chiffrats abgelegt werden, welches sich bevorzugt an das Feld 217 anschließt, welches die Anzahl der hinzugefügten Junkbytes angibt. Da die Junkbytes selbst keine Information transportieren, können die Werte der Junkbytes zufällig gewählt werden. Im Anschluss an die Headerdaten 5 umfasst ein Chiffrat mindestens einen oder mehrere Abschnitte 220, 221..., in welchem verschlüsselter Inhalt der Klartextdatei abgelegt ist. Dabei kann ein jeder solcher Abschnitt, der verschlüsselten Klartext enthält, mit einem jeweiligen Sectionschlüssel verschlüsselt sein. Dementsprechend kann ein erster Abschnitt des Klartexts mit einem ersten Sectionschlüssel verschlüsselt sein, und weitere Abschnitte können mit jeweiligen weiteren Sectionschlüsseln verschlüsselt sein, wobei ein jeweiliger Sectionschlüssel aus einem ursprünglichen Schlüssel abgeleitet ist. Weiterhin können weitere Abschnitte mit jeweiligen Sectionschlüsseln verschlüsselt sein, welche aus weiteren ursprünglichen Schlüsseln abgeleitet sind. Für die Verschlüsselung einer Klartextdatei, die in mehreren Abschnitten verschlüsselt wird, können dementsprechend mehrere Schlüssel mit jeweils mehreren abgeleiteten Sectionschlüsseln verwendet werden.Optionally, the length of the encrypted plain text file (in bytes) can also be written into the cipher, preferably in a field 214 of the header 210 . In a preferred embodiment, the value of the length can be written into the cipher in byte-wise encrypted form, the byte-wise encryption being carried out based on the key or the section key. The name of the plain text file can also optionally be written in the cipher, preferably in the header of the cipher, see field 215 so that after successful decoding of the cipher, the resulting plain text file will be the Can get the name of the original plain text file. The field can have a fixed length or be structured in such a way that initially a length specification of, for example, 2 bytes is specified, followed by the field of the specified length in which the name of the plain text file is stored in encrypted form. In this way, the decrypting point also receives the information about the name of the plain text file in encrypted form. The name of the plain text file can be encrypted with a section key. In an advantageous embodiment, so-called junk bytes can be included in the cipher. Junk bytes are those bytes that do not belong to the plain text, but have been arbitrarily added to the cipher and have no meaning in terms of content. The decrypting agency can ignore such junk bytes because they do not transport any information and do not belong to the plain text. Junk bytes can be added to the cipher to make unwanted decryption more difficult for an attacker by obfuscating the actual useful information of the cipher by adding the junk bytes. The number of junk bytes added to a section of the cipher are written into the cipher and for the respective section into the cipher, so that the decrypting agency receives information about which bytes of a cipher section are to be ignored during decryption. The number of junk bytes added to the cipher is written in encrypted form in the cipher, see field 216 , whereby the section key can be used for the encryption, which was used for the encryption of the cipher section. The added junk bytes can be in a field 216 of the cipher, which is preferred to the field 217 which indicates the number of junk bytes added. Since the junk bytes themselves do not transport any information, the values of the junk bytes can be chosen at random. Following the header data 5, a cipher comprises at least one or more sections 220 , 221 ..., in which encrypted content of the plain text file is stored. Each such section that contains encrypted plain text can be encrypted with a respective section key. Accordingly, a first section of the plain text can be encrypted with a first section key, and further sections can be encrypted with respective further section keys, a respective section key being derived from an original key. Furthermore, further sections can be encrypted with respective section keys, which are derived from further original keys. For the encryption of a plain text file that is encrypted in several sections, you can use several keys, each with several derived section keys.

Die Informationen zu einem solchen Sectionschlüssel sind vorzugsweise in einem jeweiligen Datenfeld 211 und zugeordnet zu einem Abschnitt des Chiffrats in dem Chiffrat abgelegt, welches vor dem zugehörigen Chiffratabschnitt 220, 221 angeordnet ist. Die entschlüsselnde Stelle kann dementsprechend basierend auf der Kennung, d.h. basierend auf dem Verschiebewert, einen entsprechenden Sectionschlüssel aus dem Schlüssel ableiten und der Entschlüsselung des Chiffratabschnitts zugrunde legen.The information on such a section key is preferably in a respective data field 211 and stored assigned to a section of the cipher in the cipher which is before the associated cipher section 220 , 221 is arranged. The decrypting body can accordingly derive a corresponding section key from the key based on the identifier, ie based on the shift value, and use it as the basis for decrypting the cipher section.

Weiterhin umfasst das Chiffrat eine Information über die Länge des Chiffratabschnitts 220, 221, welcher mit einem jeweiligen Sectionschlüssel verschlüsselt wurde. Die Länge 218 eines nächsten verschlüsselten Abschnitts sowie die Kennung des entsprechend verwendeten Sectionschlüssels 213 können im Anschluss an das Ende des vorhergehenden verschlüsselten Abschnitts platziert sein. Das Chiffrat kann somit einen ersten Chiffratabschnitt 220 aufweisen, welcher sich an den Header 210 anschließt. Diesem ersten Chiffratabschnitt 220 können weitere Chiffratabschnitte gleicher Struktur folgen, sodass ein Chiffrat 4 mindestens den Header und nahezu beliebig viele Chiffratabschnitte aufweisen kann. Die entschlüsselnde Stelle erhält aus dem Header sowie den zu einem Chiffratabschnitt jeweils gespeicherten Metainformationen, also der Abschnittslänge sowie den Informationen zu dem zu verwendenden Sectionschlüssel, die für die Entschlüsselung notwendigen Informationen.The cipher also includes information about the length of the cipher section 220 , 221 , which was encrypted with a respective section key. The length 218 of the next encrypted section as well as the identifier of the corresponding section key used 213 can be placed at the end of the previous encrypted section. The cipher can thus be a first cipher section 220 have, which is attached to the header 210 connects. This first section of the cipher 220 further cipher sections of the same structure can follow, so that a cipher 4 can have at least the header and almost any number of cipher sections. The decrypting body receives the information necessary for decryption from the header and the meta information stored in each case for a cipher section, i.e. the section length and the information on the section key to be used.

Auf diese Weise kann ein Chiffrat von nahezu beliebiger Größe erzeugt werden, welches in mehrere Abschnitte unterteilt ist, und wobei vor jedem Abschnitt des Chiffrats die für die jeweilige Entschlüsselung notwendigen Informationen in dem Chiffrat abgelegt sind. Auf diese Weise kann eine verschlüsselnde Stelle einen ersten Abschnitt eines Klartextes verschlüsseln und anschließend mehrere weitere Abschnitte mit einem jeweiligen Sectionschlüssel, ohne dass dazu Daten im Header des Chiffrats abzulegen sind. Die Übertragung eines Chiffrats an eine entschlüsselnde Stelle kann damit beginnen, sobald der erste Abschnitt verschlüsselt ist und es können nahezu beliebig viele Chiffratabschnitte, die mit einem jeweiligen Sectionschlüssel verschlüsselt sind, folgen.In this way, a cipher of almost any size can be generated, which is divided into several sections, and the information necessary for the respective decryption is stored in the cipher in front of each section of the cipher. In this way, an encrypting body can encrypt a first section of a plain text and then several other sections with a respective section key, without data having to be stored in the header of the cipher. The transmission of a cipher to a decrypting point can begin as soon as the first section is encrypted and almost any number of cipher sections, which are encrypted with a respective section key, can follow.

VerschlüsselungEncryption

Im Folgenden wird das Verfahren zur Verschlüsselung einer Klartextdatei schematisch beschrieben. Die Klartextdatei kann dabei ein beliebiges Format und beliebigen Inhalt haben. Das Verfahren zur Verschlüsselung ist dabei vorzugsweise in einem ausführbaren Programmcode implementiert sein, der auf einem digitalen Signalprozessor ausgeführt werden kann. Der Programmcode kann damit Teil eines Computerprogrammprodukts sein. In einer Ausführungsform kann dies ein an sich bekannter Computer (PC) sein, welcher einen zur Ausführung des Programmcodes geeigneten Prozessor sowie Speicher zur Speicherung des Klartexts, des Schlüssels und des Sectionschlüssels sowie des Chiffrats aufweist, und welcher zur Ausführung des Programmcodes geeignet ist.The procedure for encrypting a plain text file is described schematically below. The plain text file can have any format and any content. The procedure for Encryption is preferably implemented in an executable program code that can be executed on a digital signal processor. The program code can thus be part of a computer program product. In one embodiment, this can be a known computer (PC) which has a processor suitable for executing the program code and a memory for storing the plain text, the key and the section key and the cipher, and which is suitable for executing the program code.

Das Verschlüsselungsverfahren 300 kann in einer beliebigen geeigneten Computersprache implementiert sein. In alternativen Ausführungsformen kann der Programmcode auf einem zur Ausführung des Programmcodes speziell eingerichteten und besonders geeigneten sogenannten anwendungsspezifischen integrierten Schaltkreis, d.h. einem sogenannten Application Specific IC (ASIC) ausgeführt werden.The encryption method 300 can be implemented in any suitable computer language. In alternative embodiments, the program code can be executed on a so-called application-specific integrated circuit which is specially set up and particularly suitable for executing the program code, ie a so-called application-specific IC (ASIC).

In einem ersten Schritt 301 des Verschlüsselungsverfahrens werden dem Programm der zu verwendende Schlüssel sowie die Klartextdatei zur Verfügung gestellt. Dabei ist dem Fachmann bekannt, dass dies beispielsweise durch Angeben des jeweiligen Pfades zu der Klartextdatei und der Datei des Schlüssels bewirkt werden kann. Wir werden derartige und für den Fachmann selbstverständliche Zwischenschritte im Folgenden auslassen. In den ersten Schritten des Verschlüsselungsverfahrens beginnen mit dem Schreiben einiger Felder des Headers des Chiffrats die Kennungen der Schlüssel, welcher dem weiteren Verschlüsselungsverfahren zugrunde gelegt werden, wird dabei unverschlüsselt in das entsprechende Feld des Headers geschrieben, ebenso die Version.In a first step 301 During the encryption process, the key to be used and the plain text file are made available to the program. The person skilled in the art is aware that this can be brought about, for example, by specifying the respective path to the plain text file and the file of the key. We will omit such intermediate steps, which are self-evident for the person skilled in the art, in the following. In the first steps of the encryption process, the identification of the key on which the further encryption process is based begin with the writing of some fields of the header of the cipher, and is written unencrypted in the corresponding field of the header, as is the version.

In einem anschließenden Schritt liest das Programm den Schlüssel und erzeugt aus diesem Schlüssel einen sogenannten Sectionschlüssel. Dazu ermittelt das Verfahren eine ganzzahlige Zufallszahl, im Folgenden Verschiebewert genannt, um dessen Wert die Bytes des Schlüssels zyklisch verschoben werden. Der Wert des Verschiebewerts liegt dabei im Intervall null bis Schlüsselgröße, wobei Schlüsselgröße die Anzahl der Bytes des Schlüssels ist. Für einen hier beispielsweise angenommenen Verschiebewert von 93 und einer hier beispielhaft angenommenen Schlüsselgröße von 65.535 Bytes werden die Bytes auf den Speicherpositionen 0 bis 65.535 - 93 = 65.442 um 93 Bytes auf die Speicherplätze 93 bis 65.535 verschoben. Die Bytes der Speicherpositionen 65.443 bis 65.535 werden auf die Speicherpositionen null bis 92 und unter Beibehaltung der Reihenfolge geschrieben. Ein erzeugter Sectionschlüssel weist damit dieselbe Länge wie der Schlüssel auf.In a subsequent step, the program reads the key and generates a so-called section key from this key. For this purpose, the method determines an integer random number, hereinafter referred to as the shift value, by whose value the bytes of the key are shifted cyclically. The value of the shift value is in the interval zero to key size, where key size is the number of bytes in the key. For a shift value of 93 assumed here, for example, and a key size of 65,535 bytes assumed here as an example, the bytes in memory positions 0 to 65,535 - 93 = 65,442 are shifted by 93 bytes to memory locations 93 to 65,535. The bytes in memory positions 65,443 to 65,535 are written to memory positions zero to 92 and the order is retained. A generated section key has the same length as the key.

In einer alternativen Ausgestaltung des Verfahrens kann der Sectionschlüssel durch bitweises zufälliges Verschieben erzeugt werden, d. h. dass die Bits des Schlüssels nicht um ganze Bytes, sondern nur um Bits verschoben werden, wobei der zufällig erzeugte Verschiebewert die Anzahl der Bits angibt, um welche die Bits des Schlüssels zyklisch verschoben werden. Auch hierbei bleibt die Reihenfolge der Bits innerhalb der Verschiebeintervalle unverändert. In jedem Falle wird der zufällig ermittelte Verschiebewert in dem Chiffrat und an geeigneter Stelle zu dem Abschnitt gespeichert, welcher mit dem Sectionschlüssel, der mit dem Verschiebewert erzeugt wurde, verschlüsselt ist. Ein auf diese Weise erzeugter Sectionschlüssel ist damit zufällig, wenngleich basierend auf dem ursprünglichen Schlüssel.In einer weiteren vorteilhaften Ausgestaltung können mehrere Schlüssel verwendet werden, von denen jeweils durch oben beschriebenes byte- oder bitweises Verschieben Sectionschlüssel abgeleitet werden können. In diesem Fall werden die mehreren zur Ableitung von Sectionsschlüsseln verwendeten Kennungen von Schlüsseln in dem Chiffrat gespeichert und es wird zu einem jeden Abschnitt des Chiffrats gespeichert, welcher Schlüssel dem verwendeten Sectionschlüssel zugrunde liegt, sodass die entschlüsselnde Stelle den jeweiligen Sectionschlüssel aus dem richtigen Schlüssel durch Verschieben ableiten kann. Insbesondere kann die Ableitung eines weiteren Sectionschlüssels auf einem weiteren Schlüssel basieren, wenn basierend auf einem ersten Schlüssel sämtliche möglichen Permutationen nach oben beschriebenem Vorgehen bereits durchgeführt und die erzeugten Sectionschlüssel verwendet wurden.In einer besonders bevorzugten Ausführungsform wird der Verschiebewert basierend auf dem Schlüssel Byte für Byte verschlüsselt, und es wird der byteweise verschlüsselte Verschiebewert als Kennung des Sectionschlüssels in das Chiffrat geschrieben.In an alternative embodiment of the method, the section key can be generated by bit-by-bit random shifting; H. that the bits of the key are not shifted by whole bytes, but only by bits, with the randomly generated shift value indicating the number of bits by which the bits of the key are cyclically shifted. Here too, the order of the bits within the shift intervals remains unchanged. In any case, the randomly determined shift value is stored in the cipher and in a suitable place for the section which is encrypted with the section key that was generated with the shift value. A section key generated in this way is therefore random, albeit based on the original key. In a further advantageous embodiment, several keys can be used, from which section keys can be derived by shifting byte or bit byte as described above. In this case, the multiple identifiers of keys used to derive section keys are stored in the cipher and for each section of the cipher it is stored which key the section key used is based on, so that the decrypting body can move the respective section key from the correct key can derive. In particular, the derivation of a further section key can be based on a further key if, based on a first key, all possible permutations according to the procedure described above have already been carried out and the generated section keys have been used. In a particularly preferred embodiment, the shift value is based on the key byte for byte encrypted, and the byte-wise encrypted shift value is written into the cipher as the identifier of the section key.

Die byteweise Verschlüsselung des Verschiebewerts basierend auf dem Schlüssel wird dadurch bewirkt, dass die Position eines zufällig ausgewählten Bytes des Schlüssels, welches denselben Inhalt hat wie das zu verschlüsselnde Byte des Verschiebewert, in den Header des Chiffrats 4 geschrieben wird. Bei einer angenommenen Größe des Schlüssels von 65.535 Bytes und einer angenommenen byteweisen Verschiebung des Schlüssels zur Erzeugung des Zechenschlüssels, wäre der Verschiebewert im Klartext mit 2 Bytes darstellbar. 1 Byte des Verschiebewerts kann nun dadurch verschlüsselt werden, dass die Position eines zufällig gewählten Bytes in den Header geschrieben wird, wobei die Position wiederum mit 2 Bytes darstellbar ist. Die byteweise Verschlüsselung des Verschiebewerts benötigt dementsprechend 4 Bytes. Auf diese Weise wird bereits der Verschiebewert in verschlüsselter Form im Header gespeichert, d. h. eine Kennung des Sectionschlüssels, nämlich der verschlüsselte Verschiebewert, wird in dem Chiffrat gespeichert.The byte-wise encryption of the shift value based on the key is achieved by writing the position of a randomly selected byte of the key, which has the same content as the byte of the shift value to be encrypted, in the header of the cipher 4. With an assumed size of the key of 65,535 bytes and an assumed byte-wise shifting of the key to generate the mining key, the shift value could be represented in plain text with 2 bytes. 1 byte of the shift value can now be encrypted by writing the position of a randomly selected byte in the header, whereby the position can again be represented with 2 bytes. The byte-by-byte encryption of the shift value accordingly requires 4 bytes. In this way the shift value is already stored in encrypted form in the header, ie an identifier of the section key, namely the encrypted shift value, is stored in the cipher.

Nachdem der erste Sectionschlüssel erzeugt ist, werden die oben beschriebenen Felder des Headers mit dem ersten Sectionschlüssel verschlüsselt und in den Header des Chiffrats geschrieben. Dabei wird die Verschlüsselung der Felder mit den gleichen unten angegebenen Schritten wie die Verschlüsselung der Klartextdateien durchgeführt, jedoch mit einem Sectionschlüssel, der lediglich für die Verschlüsselung der Felder des Headers verwendet wird.After the first section key has been generated, the header fields described above are encrypted with the first section key and written in the header of the cipher. The fields are encrypted using the same steps as the plain text files are encrypted, but with a section key that is only used to encrypt the header fields.

Nachdem die Felder des Headers 5 in das Chiffrat geschrieben wurden, beginnt die Verschlüsselung des Klartexts. Dazu kann für die anschließende Verschlüsselung des Klartexts ein weiterer Sectionschlüssel erzeugt werden, siehe 303, wie oben beschrieben. Die Kennung des Sectionschlüssel wird in das Chiffrat und zu dem Chiffratabschnitt geschrieben. Wie oben erwähnt kann das Chiffrat mehrere Abschnitte enthalten, die mit einem jeweiligen Sectionschlüssel verschlüsselt sind, und in denen die verschlüsselte Klartextdatei abgelegt ist. Die Verschlüsselung des Klartexts wird jeweils Byte für Byte durchgeführt. Dazu wird der Wert des nächsten, oder gegebenenfalls des ersten, Bytes des Klartexts gelesen, Schritt 305, und es wird eine Position eines Bytes in dem Sectionschlüssel ermittelt, wobei der Wert des Bytes des Sectionschlüssels gleich demjenigen des gelesenen Klartextbytes sein muss. Dabei wird eine Position eines Bytes des Sectionschlüssels ermittelt, Schritt 307, welche für die Verschlüsselung des Abschnitts noch nicht verwendet wurde, sodass eine jede Position eines Bytes des Sectionschlüssels nur einmal verwendet wird. Die Position des ermittelten Bytes des Sectionschlüssels wird dann in das Chiffrat geschrieben, Schritt 308. Dabei weist die in das Chiffrat zu schreibende Position des ermittelten Bytes bei einer Länge des Sectionschlüssels von 65.536 Bytes eine Länge von 2 Bytes auf. Bei der hier beispielhaft gewählten Länge eines Sectionschlüssels von 65.536 Bytes wird für ein jeweiliges Byte des Klartexts eine Position mit einer Länge von 2 Bytes, hier also ein Bytepaar, in das Chiffrat geschrieben. Auf diese Weise können die Bytes des Klartexts der Reihe nachgelesen und basierend auf dem Sectionschlüssel verschlüsselt und in das Chiffrat geschrieben werden.After the fields of header 5 have been written into the cipher, the encryption of the plain text begins. For this purpose, a further section key can be generated for the subsequent encryption of the plain text, see 303, as described above. The identifier of the section key is written in the cipher and to the cipher section. As mentioned above, the cipher can contain several sections that are encrypted with a respective section key and in which the encrypted plain text file is stored. The plaintext is encrypted byte by byte. To do this, the value of the next, or possibly the first, byte of the plain text is read, step 305 , and a position of a byte in the section key is determined, whereby the value of the byte of the section key must be the same as that of the plain text byte read. A position of a byte of the section key is determined, step 307 which has not yet been used for the encryption of the section, so that each position of a byte of the section key is only used once. The position of the determined byte of the section key is then written into the cipher, step 308 . The position of the determined byte to be written into the cipher has a length of 2 bytes with a length of the section key of 65,536 bytes. With the length of a section key of 65,536 bytes selected here as an example, a position with a length of 2 bytes, in this case a byte pair, is written into the cipher for each byte of the plain text. In this way, the bytes of the plaintext can be read in sequence and, based on the section key, encrypted and written into the cipher.

Dabei ist für den Fachmann klar, dass bei der hier gewählten Größe des Sectionschlüssels von 256 x 256 = 65.536 Bytes, also 65kB, die Positionen von Bytes in dem Sectionschlüssel mit zwei Bytes dargestellt werden können. Es können jedoch Schlüssel und Sectionschlüssel verwendet werden, die kleiner oder größer als die hier beispielhaft und ohne Beschränkung der Allgemeinheit gewählten 65kB sein können und die dementsprechend weniger oder mehr Bits bzw. Bytes für die Adressierung erfordern. Dabei ist dem Fachmann klar, dass Bytegrenzen nicht notwendigerweise einzuhalten sind. Sofern also im Nachfolgenden von zwei Bytes oder Bytepaaren die Rede ist, welche für ein verschlüsseltes Byte stehen, ist dem Fachmann klar, dass diese Speicherplatzgröße für andere Schlüsselgrößen gegebenenfalls anzupassen ist.It is clear to a person skilled in the art that with the size of the section key selected here of 256 x 256 = 65,536 bytes, i.e. 65kB, the positions of bytes in the section key can be represented with two bytes. However, keys and section keys can be used which can be smaller or larger than the 65kB selected here by way of example and without restriction of generality and which accordingly require fewer or more bits or bytes for addressing. It is clear to the person skilled in the art that byte limits do not necessarily have to be adhered to. So if two bytes or byte pairs are mentioned below, which stand for an encrypted byte, it is clear to the person skilled in the art that this storage space size may have to be adapted for other key sizes.

Um sicherzustellen, dass die Position eines Bytes des Sectionschlüssels nur einmal verwendet wird, kann das Verfahren eine Liste führen, anhand der sichergestellt wird, dass eine Byteposition innerhalb eines Verschlüsselungsabschnitts nur einmal verwendet wird. Dazu kann das verschlüsselte System eine entsprechend geeignete interne Datenstruktur aufbauen, beispielsweise ein zweidimensionales Array, in dem markiert wird, welche Positionen von Bytes des gerade verwendeten Sectionschlüssels bereits verwendet und damit in das Chiffrat geschrieben wurden und damit nicht nochmal verwendet werden sollen. Falls für einen Bytewert des Klartexts keine entsprechende Position eines Bytewerts gefunden werden kann, weil alle Bytepositionen dieses Werts bereits verwendet wurden, siehe 307 in 3, wird ein neuer Sectionschlüssel nach oben beschriebenen Schritten erzeugt und für die Verschlüsselung der nächsten Bytes des Klartexts verwendet, siehe 303. Weiterhin wird, bevor eine nächste Byteposition in das Chiffrat geschrieben wird, die Länge des bisher verschlüsselten Abschnitts der Klartextdatei, also die Länge des zuletzt geschriebenen Abschnitts des Chiffrats, in das Chiffrat geschrieben, Schritt 309 und Feld 218. Die entschlüsselnde Stelle erhält damit die Information, welche Bytes mit einem Sectionschlüssel verschlüsselt wurden und dementsprechend mit dem Sectionschlüssel zu entschlüsseln sind. Vorzugsweise wird der Wert der Länge eines Abschnitts des Chiffrats vor den entsprechenden Abschnitt in das Chiffrat geschrieben. Mit dem neu erzeugten Sectionschlüssel wird das Verschlüsselungsverfahren dann fortgesetzt.In einer vorteilhaften Ausführungsform kann eine beliebige Anzahl von Junkbytes in einen Chiffratabschnitt vor oder nach den verschlüsselten Klartext Daten geschrieben werden. Dazu ist zu dem entsprechenden Chiffratabschnitt anzugeben, wie viele Junkbytes angegeben sind. In einer Ausführungsform kann in einem Feld 5f die Anzahl der nachfolgend eingebrachten Junkbytes angegeben sein, wobei die Anzahl mit einem Sectionschlüssel verschlüsselt sein kann, und die entsprechenden Junkbytes können in einem nachfolgenden Feld 217 angegeben sein. Die entschlüsselnde Stelle erhält damit beim Lesen des Chiffrats die Information ob und gegebenenfalls welche der nachfolgenden Bytes eines Abschnitts des Chiffrats zu ignorieren sind.Das Verschlüsselungsverfahren wird für eine Klartextdatei beendet, wenn das Ende der Klartextdatei (EOF = End Of File), siehe 306, erreicht wurde. In diesem Fall wird die Länge des mit dem Sectionschlüssel verschlüsselten Abschnitts in das Chiffrat geschrieben, siehe 310 und Feld 218, wobei diese Länge wiederum zu dem Abschnitt geschrieben wird.In order to ensure that the position of a byte of the section key is only used once, the method can keep a list that is used to ensure that a byte position within an encryption section is only used once. For this purpose, the encrypted system can set up a suitable internal data structure, for example a two-dimensional array, in which it is marked which positions of bytes of the section key currently in use have already been used and thus written into the cipher and should therefore not be used again. If no corresponding position of a byte value can be found for a byte value of the plaintext because all byte positions of this value have already been used, see 307 in 3 , a new section key is generated according to the steps described above and used for the encryption of the next bytes of the plain text, see 303 . Furthermore, before a next byte position is written into the cipher, the length of the previously encrypted section of the plain text file, i.e. the length of the section of the cipher last written, is written into the cipher, step 309 and field 218 . The decrypting body thus receives the information which bytes were encrypted with a section key and which are to be decrypted accordingly with the section key. The value of the length of a section of the cipher is preferably written into the cipher before the corresponding section. The encryption process is then continued with the newly generated section key. In an advantageous embodiment, any number of junk bytes can be written into a cipher section before or after the encrypted plain text data. To do this, specify how many junk bytes are specified for the corresponding cipher section. In one embodiment, the number of subsequently introduced junk bytes can be specified in a field 5f, wherein the number can be encrypted with a section key, and the corresponding junk bytes can be entered in a subsequent field 217 be specified. When reading the cipher, the decrypting body receives the information whether and, if so, which of the following bytes of a section of the cipher are to be ignored. The encryption process is ended for a plain text file when the end of the plain text file (EOF = End Of File), see 306 , was achieved. In this case the length will be of the section encrypted with the section key is written into the cipher, see 310 and field 218 , this length in turn being written to the section.

In einer vorteilhaften Ausgestaltung des Verschlüsselungsverfahrens kann der Inhalt verschlüsselter Klartextbytes in umgekehrter Reihenfolge in das Chiffrat geschrieben werden, sodass dieser Abschnitt bei der Entschlüsselung in der Reihenfolge der Bytes einmal umgedreht werden muss, d. h. dieser Abschnitt ist rückwärts zu lesen. Dazu kann das Chiffrat ein entsprechendes Feld aufweisen, dessen Inhalt darüber Auskunft gibt, ob ein bestimmter Abschnitt des Chiffrats in umgekehrter Reihenfolge geschrieben wurde. Dies kann beispielsweise mit einem 2 Byte langen Schlüssel zu einem Abschnitt des Chiffrats in das Chiffrat geschrieben werden.In an advantageous embodiment of the encryption method, the content of encrypted plain text bytes can be written into the cipher in reverse order, so that this section has to be reversed once during the decryption in the order of the bytes, ie. H. this section is to be read backwards. For this purpose, the cipher can have a corresponding field, the content of which provides information on whether a certain section of the cipher was written in reverse order. This can be written into the cipher for a section of the cipher using a 2-byte long key, for example.

UmpositionierungRepositioning

In einer vorteilhaften Ausführungsform kann die Verschlüsselung eines Abschnitts zusätzlich eine Änderung der Position der Bytepaare innerhalb eines Chiffratabschnitts umfassen. Dies bewirkt, dass die Bytepaare, welche jeweils eine Position/Adresse eines Bytewerts in dem Abschnittsschlüssel angeben, nicht mehr in der Reihenfolge angeordnet sind, welcher der Reihenfolge der Klartextbytes entspricht. 4 zeigt eine entsprechende Abfolge von Verfahrensschritten für eine solche Umpositionierung in einem Chiffratabschnitt.In an advantageous embodiment, the encryption of a section can additionally include a change in the position of the byte pairs within a cipher section. This has the effect that the byte pairs, which each specify a position / address of a byte value in the section key, are no longer arranged in the order which corresponds to the order of the plaintext bytes. 4th shows a corresponding sequence of method steps for such a repositioning in a cipher section.

Zunächst wird aus dem Abschnittsschlüssel ein Positionsschlüssel abgeleitet, Schritt 410. Dieser enthält für die maximale Anzahl der Bytepaare eines Chiffratabschnitts, d.h. der Positionen der Bytepaare, eine (pseudo-)zufällige Verteilung der Werte von 0 bis zur maximalen Anzahl der Bytepaare. Basierend auf dem Positionsschlüssel können die Bytepaare innerhalb eines Chiffratabschnitts umpositioniert werden, d.h. die Reihenfolge der Bytepaare, wird nach einer Zuordnungsvorschrift und basierend auf dem Positionsschlüssel verändert.First, a position key is derived from the section key, step 410 . This contains a (pseudo-) random distribution of the values from 0 to the maximum number of byte pairs for the maximum number of byte pairs of a cipher section, ie the positions of the byte pairs. Based on the position key, the byte pairs can be repositioned within a cipher section, ie the sequence of the byte pairs is changed according to an assignment rule and based on the position key.

Durch die Umpositionierung der Bytepaare eines Chiffratabschnitts basierend auf dem Positionsschlüssel werden die Bytepaare an diejenigen Positionen verschoben, welche den Werten des Positionsschlüssels entsprechen. Ein erstes Bytepaar wird dementsprechend an diejenige Position verschoben, welche einem Wert in dem Umpositionierungsschlüssel entspricht. Das in Leserichtung im Chiffratabschnitt platzierte zweite Bytepaar wird dann auf diejenige Position verschoben, welche dem Wert des in Leserichtung nächsten Wertes des Umpositionierungsschlüssels entspricht und so weiter. Auf diese Weise werden die im Chiffratabschnitt nebeneinander platzierten Bytepaare auf diejenigen Positionen verschoben, welche durch die Werte im Positionsschlüssel festgelegt sind. Dabei werden Werte des Positionsschlüssels, also Positionswerte, welche außerhalb der Länge des Chiffratabschnitts liegen, ignoriert und es wird der in Leserichtung nächste Wert verwendet, welcher eine Position bezeichnet, die innerhalb des Chiffratabschnitts liegt.By repositioning the byte pairs of a cipher section based on the position key, the byte pairs are shifted to those positions which correspond to the values of the position key. A first byte pair is accordingly shifted to that position which corresponds to a value in the repositioning key. The second pair of bytes placed in the reading direction in the cipher section is then shifted to the position which corresponds to the value of the next value of the repositioning key in reading direction and so on. In this way, the byte pairs placed next to one another in the cipher section are shifted to those positions which are determined by the values in the position key. Values of the position key, i.e. position values that lie outside the length of the cipher section, are ignored and the next value in the reading direction is used, which designates a position that lies within the cipher section.

Die Umpositionierung der Bytepaare eines Chiffratabschnitts beginnt mit dem ersten Bytepaar. Dieses Bytepaar kann in einer Ausführungsform auf diejenige Position innerhalb des Chiffratabschnitts verschoben werden, welche durch den ersten Wert des Positionsschlüssels bezeichnet ist. In einer weiteren, besonders bevorzugten Ausführungsform, wird das erste Bytepaar des Chiffratabschnitts auf diejenige Position verschoben, welche durch den Wert an der Stelle des Verschiebewerts des Positionsschlüssels definiert ist, d.h. dass für die erste Umpositionierung nicht der Wert des ersten Feldes des Positionsschlüssels, sondern derjenige des Feldes, welches durch den Verschiebewert bezeichnet ist, verwendet wird. Sofern dieser Wert, wie bereits oben erwähnt, eine Position bezeichnet, die außerhalb des Chiffratabschnitts liegt wird der in Leserichtung nächste Wert für die Umpositionierung gelesen, siehe 402, und wiederum geprüft. Wird das Ende des Positionsschlüssels beim Lesen des nächsten Positionswerts erreicht, so wird als nächstes der erste Wert des Positionsschlüssels verwendet.The repositioning of the byte pairs of a cipher section begins with the first byte pair. In one embodiment, this byte pair can be shifted to that position within the cipher section which is designated by the first value of the position key. In a further, particularly preferred embodiment, the first byte pair of the cipher section is shifted to that position which is defined by the value at the point of the shift value of the position key, that is, for the first repositioning, not the value of the first field of the position key, but that of the field indicated by the shift value is used. If this value, as already mentioned above, designates a position that lies outside the cipher section, the next value in the reading direction for the repositioning is read, see 402 , and checked again. If the end of the position key is reached when reading the next position value, the first value of the position key is used next.

In einer Variante des Umpositionierens der Bytepaare eines Chiffratabschnitts kann die Umpositionierung mit dem letzten Bytepaar des Chiffratabschnitts beginnen und die Umpositionierung wird in umgekehrter Reihenfolge durchgeführt. Dazu kann in den Metadaten eines Chiffratabschnitts, beispielsweise in einem Feld 219, welches vor einem Chiffratabschnitt platziert ist, codiert sein, in welcher Richtung die Umpositionierung stattgefunden hat.In a variant of the repositioning of the byte pairs of a cipher section, the repositioning can begin with the last byte pair of the cipher section and the repositioning is carried out in the reverse order. This can be done in the metadata of a cipher section, for example in a field 219 , which is placed in front of a cipher section, the direction in which the repositioning took place must be coded.

Nach dem Erzeugen des Positionsschlüssels, siehe 401, wird dann ein Wert des Positionsschlüssels gelesen, siehe 402. Dabei wird in einer Schleife solange der nächste Wert des Positionsschlüssels gelesen, bis ein Wert gefunden ist, welcher eine Position in dem Chiffratabschnitt bezeichnet, siehe 403 und 402. Dann wird das Bytepaar, welches umzupositionieren ist, gelesen und auf die durch den gelesenen Wert bezeichnete Position in dem Chiffrat verschoben, also dort gespeichert, siehe 404, wobei für den Fachmann klar ist, dass das in dem Chiffratabschnitt dort bisher platzierte Bytepaar nicht überschrieben werden darf. Ein solches Überschreiben kann beispielsweise durch Verwendung eines temporären Speichers verhindert werden, in welchen die umpositionierten Bytepaare zunächst geschrieben werden.After generating the item code, see 401 , a value of the item code is then read, see 402 . The next value of the position key is read in a loop until a value is found which designates a position in the cipher section, see 403 and 402 . Then the byte pair that is to be repositioned is read and shifted to the position in the cipher indicated by the read value, i.e. stored there, see 404 , it being clear to the person skilled in the art that the byte pair previously placed there in the cipher section must not be overwritten. Such overwriting can be prevented, for example, by using a temporary memory into which the repositioned byte pairs are initially written.

Die Umpositionierung endet, 406, wenn das Ende des Chiffratabschnitts erreicht ist, siehe 405, d.h. wenn alle Bytepaare eines Chiffratabschnitts auf eine andere Position innerhalb des Chiffratabschnitts verschoben wurden. Anderenfalls, wenn also noch weitere Bytes des Chiffratabschnitts umzupositionieren sind, wird ein nächster Positionswert des Positionsschlüssels gelesen und geprüft, solange bis ein Positionswert innerhalb des Chiffratabschnitts gefunden ist, siehe 402 und 403.The repositioning ends 406 when the end of the cipher section is reached, see 405 , ie when all byte pairs of a cipher section have been moved to a different position within the cipher section. Otherwise, if there are still further bytes of the cipher section to be repositioned, a next position value of the position key is read and checked until a position value is found within the cipher section, see 402 and 403 .

In dem hier gewählten Ausführungsbeispiel weist der Schlüssel eine Länge von 65536 Bytes auf, ebenso der Sectionschlüssel. Dementsprechend weist ein Chiffratabschnitt jedenfalls weniger als 65536 Bytepaare auf. Tatsächlich weist ein Chiffratabschnitt jedenfalls weniger Bytepaare auf, nämlich 256 x 255 = 65280 Bytepaare, da ein neuer Sectionschlüssel spätestens dann erzeugt und verwendet wird, wenn alle Positionen eines Bytewerts in einem Chiffratabschnitt verwendet wurde.In the exemplary embodiment selected here, the key has a length of 65536 bytes, as does the section key. Accordingly, a cipher section has fewer than 65536 byte pairs. In fact, a cipher section has fewer byte pairs, namely 256 x 255 = 65280 byte pairs, since a new section key is generated and used at the latest when all positions of a byte value in a cipher section have been used.

In einer Ausführungsform kann ein Positionsschlüssel aus dem Sectionschlüssel abgeleitet werden. Der Positionsschlüssel wird dabei gemäß nachfolgender Vorschrift aus dem Sectionschlüssel abgeleitet. Der Wert eines Bytes des Positionsschlüssels wird errechnet als Summe des Bytewerts des Bytes des Abschnittsschlüssels und der Anzahl der bisherigen Vorkommen des Bytewerts multipliziert mit 256. Der Abschnittsschlüssel wird dementsprechend Byte für Byte gelesen, und die Bytes, d.h. die Werte des Positionsschlüssels werden Byte für Byte geschrieben. Dabei wird für jeden möglichen Bytewert, also für jeden Wert im Intervall 0 bis 255 gezählt, wie oft ein jeweiliger Wert in der zufälligen Anordnung des Abschnittsschlüssels bereits gelesen wurde. Nachfolgendes Beispiel verdeutlicht eine solche Ableitung des Positionsschlüssels aus einem Sectionschlüssel, wobei der Sectionschlüssel in der oberen Zeile und der Positionsschlüssel in der unteren Zeile dargestellt sind.

Figure DE102018113772B4_0001
Figure DE102018113772B4_0002
Wenn ein Wert des Schlüssels erstmalig in dem Sectionschlüssel vorkommt, wird dieser in den Positionsschlüssel übernommen. Dementsprechend werden die ersten Werte 117, 0, 255 und 14 des Sectionschlüssels unverändert in den Positionsschlüssel übernommen. Für den (in Leserichtung) zum zweiten Mal vorkommenden Wert 255 wird ein Wert 256 x 1 + 255 = 511 in den Positionsschlüssel geschrieben, für den zum zweiten Mal vorkommenden Wert 0 wird nach gleichem Algorithmus der Wert 256 x 1 + 0 = 256 in den Positionsschlüssel geschrieben, für den zum dritten Mal vorkommenden Wert 255 wird der Wert 256 x 2 + 255 = 767 abgeleitet und in den Positonsschlüssel geschrieben, für das dritte Vorkommen des Wertes 0 wird ein Wert von 256 x 2 + 0 = 512, für den zum vierten Mal vorkommenden Wert 0 entsprechend ein Wert 768 und für das zweite Vorkommen des Wertes 14 wird ein Wert von 270 abgeleitet und entsprechend in den Positionsschüssel geschrieben. Für den hier beispielhaft angenommenen Sectionschlüssel mit einer Gleichverteilung aller 256 Bytewerte bei einer Länge von 256 x 256 = 65536 Bytes bei zufälliger Anordnung der Werte wird dementsprechend ein Positionsschlüssel erzeugt, welcher in (pseudo) zufälliger Anordnung alle Werte von 0 bis 65535 aufweist. Auf diese Weise kann also aus dem Sectionschlüssel ein Positionsschlüssel abgeleitet werden, welcher für das Intervall entsprechend der Länge des Sectionschlüssels sämtliche Werte aufweist, jedoch jeden Wert genau einmal. Die Anordnung der Werte in dem Positionsschlüssel ist dabei (pseudo-)zufällig, da die Reihenfolge der Werte des Sectionschlüssels zufällig gewählt ist. Der für die Entschlüsselung ebenfalls notwendige Positionsschlüssel kann mit selbiger Vorschrift aus dem Sectionschlüssel abgeleitet werden und steht damit bei der Entschlüsselung zur Verfügung.In one embodiment, a position key can be derived from the section key. The position key is derived from the section key in accordance with the following regulation. The value of a byte of the position key is calculated as the sum of the byte value of the byte of the section key and the number of previous occurrences of the byte value multiplied by 256 . The section key is accordingly read byte for byte, and the bytes, ie the values of the position key, are written byte by byte. For every possible byte value, i.e. for every value in the interval 0 to 255 counts how often a respective value in the random arrangement of the section key has already been read. The following example illustrates such a derivation of the item key from a section key, the section key being shown in the top line and the item key in the bottom line.
Figure DE102018113772B4_0001
Figure DE102018113772B4_0002
When a value of the key appears in the section key for the first time, it is transferred to the item key. Accordingly, the first values are 117, 0, 255 and 14 of the section key transferred unchanged to the position key. For the value that occurs the second time (in reading direction) 255 becomes a value 256 x 1 + 255 = 511 written in the position key, for the value 0 occurring the second time, the value 256 x 1 + 0 = 256 written in the position key for the value that occurs the third time 255 becomes the value 256 x 2 + 255 = 767 and written to the position key, for the third occurrence of the value 0 a value of 256 x 2 + 0 = 512, for the fourth occurrence of the value 0 a value 768 and for the second occurrence of the value 14 a value of 270 is derived and written accordingly in the position key. For the section key assumed here as an example with an equal distribution of all 256 Byte values with a length of 256 x 256 = 65536 bytes if the values are arranged randomly, a position key is generated that has all values from 0 to 65535 in a (pseudo) random order. In this way, a position key can be derived from the section key, which has all values for the interval according to the length of the section key, but each value exactly once. The arrangement of the values in the position key is (pseudo-) random, since the order of the values in the section key is chosen randomly. The position key, which is also required for decryption, can be derived from the section key with the same rule and is therefore available for decryption.

Es sei angemerkt, dass jeder geeignete Positionsschlüssel verwendet werden kann, solange dieser auf der Ver- und ebenso auf der Entschlüsselungsseite identisch ist, sodass bei der Ver- und entsprechend der Entschlüsselung derselbe Positionsschlüssel verwendet wird.It should be noted that any suitable position key can be used, as long as it is identical on the encryption and also on the decryption side, so that the same position key is used for the encryption and, correspondingly, the decryption.

Der Positionsschlüssel weist in dieser Ausführungsform dieselbe Länge auf wie der Sectionschlüssel, sodass sichergestellt ist, dass für jedes Bytepaar ein Umpositionierungsschlüssel verfügbar ist. Falls ein Chiffratabschnitt gleich viele oder weniger Bytes aufweist wie der Umpositionierungsschlüssel Elemente hat, so kann die Umpositionierung des Chiffratabschnitts für einzelne Bytes durchgeführt werden. Dies bedeutet für den hier beschriebenen Fall, bei dem die Verschlüsselung eines Bytes des Klartexts sich in einem Bytepaar widerspiegelt, dass die beiden Bytes eines Bytepaares nach der Umpositionierung nicht mehr nebeneinander angeordnet sind. Entschlüsselung Die Entschlüsselung eines Chiffrats umfasst im Wesentlichen die oben beschriebenen Schritte in umgekehrter Reihenfolge. Dabei kann die entschlüsselnde Stelle die im Chiffrat angegebenen Junkbytes ignorieren. Dabei liest die entschlüsselnde Stelle aus dem Header des Chiffrats zunächst eine Schlüsselkennung sowie die weiteren unverschlüsselten Metainformationen, beispielsweise eine Versionsnummer. Anhand der Versionsnummer kann die entschlüsselnde Stelle das Format des Chiffrats erkennen. Anschließend kann die Kennung des Sectionschlüssels, welcher für die Verschlüsselung der weiteren Felder des Headers verwendet wurde und es kann basierend auf dem anhand der Schlüsselkennung identifizierten Schlüssel und der Kennung des Sectionschlüssels ein solcher aus dem Schlüssel abgeleitet werden. Mit diesem können anschließend die weiteren Felder des Headers gelesen, entschlüsselt und in eine Klartextdatei geschrieben werden.In this embodiment, the position key has the same length as the section key, so that it is ensured that a repositioning key is available for each byte pair. If a cipher section has as many or fewer bytes as the repositioning key has elements, the repositioning of the cipher section can be carried out for individual bytes. For the case described here, in which the encryption of a byte of the plain text is reflected in a byte pair, this means that the two bytes of a byte pair are no longer arranged next to one another after the repositioning. Decryption The decryption of a cipher essentially comprises the steps described above in reverse order. The decrypting agency can ignore the junk bytes specified in the cipher. The decrypting body first reads a key identifier and the other unencrypted meta information, for example a version number, from the header of the cipher. Based on the version number, the decrypting agency can identify the format of the cipher. The identifier of the section key that was used to encrypt the other fields of the header can then be derived from the key based on the key identified using the key identifier and the identifier of the section key. With this, the other fields of the header can then be read, decrypted and written to a plain text file.

Ebenso kann basierend auf dem Schlüssel und auf der Kennung eines Sectionschlüssels ein solcher für die anschließende Entschlüsselung eines Chiffratabschnitts abgeleitet werden. Die Entschlüsselung der verschlüsselten Klartextdaten findet dann dadurch statt, dass eine Position des Chiffratabschnitts gelesen wird und der Wert des Bytes an der Position in dem Sectionschlüssel gelesen und in die Klartextdatei geschrieben wird. Auf diese Weise kann für jede 2 Byte lange Position in einem Chiffratabschnitt ein Bytewert in die Klartextdatei geschrieben werden. Dabei werden die Positionen eines Chiffratabschnitts der Reihe nach gelesen, bis das Ende eines Chiffratabschnitts erreicht ist. Dabei hat die entschlüsselnde Stelle die Information über die Länge eines Chiffratabschnitts dem entsprechenden Feld 218 entnommen.Likewise, based on the key and on the identifier of a section key, a section key can be derived for the subsequent decryption of a cipher section. The decryption of the encrypted plain text data then takes place in that a position of the cipher section is read and the value of the byte at the position in the section key is read and written to the plain text file. In this way, a byte value can be written to the plain text file for every 2-byte position in a cipher section. The positions of a cipher section are read in sequence until the end of a cipher section is reached. The decrypting body has the information about the length of a cipher section in the corresponding field 218 taken.

Wenn das Ende des Chiffrats erreicht ist, so kann die entschlüsselnde Stelle die Klartextdatei mit dem ursprünglichen Namen umbenennen, welcher in dem Chiffrat in Feld 215 codiert ist. Weiterhin kann die entschlüsselnde Stelle prüfen, ob die Länge der erstellten Klartextdatei mit der in dem Chiffrat codierten Dateilänge, siehe Feld 214, übereinstimmt.When the end of the cipher has been reached, the decrypting agency can rename the plaintext file with the original name that appears in the cipher in field 215 is coded. The decrypting agency can also check whether the length of the plain text file created matches the file length encoded in the cipher, see field 214 , matches.

Für den Fall, dass zu einem Chiffratabschnitt spezifiziert ist, dass dieser Chiffratabschnitt in umgekehrter Reihenfolge geschrieben wurde, so ist bei der Entschlüsselung des Abschnitts die Reihenfolge entsprechend wiederum umzukehren.In the event that it is specified for a cipher section that this cipher section was written in the reverse order, the sequence must be reversed accordingly when the section is decrypted.

Ebenso ist bei der Entschlüsselung zu prüfen, ob für einen Chiffratabschnitt die Bytepaare basierend auf einem Positionierungsschlüssel positioniert wurden. In diesem Fall ist die ursprüngliche Reihenfolge der Bytepaare des Chiffratabschnitts basierend auf dem Positionierungsschlüssel wiederherzustellen, der wie oben beschrieben, aus dem Sectionschlüssel abgeleitet werden. Ebenso ist zu prüfen, ob die Umpositionierung in umgekehrter Reihenfolge, d. h. beginnend mit dem letzten Bytepaar eines Chiffratabschnitts, durchgeführt wurde. Gegebenenfalls ist die Umpositionierung ebenso in entsprechender umgekehrter Reihenfolge durchzuführen. Dabei kann die Umkehrung der Reihenfolge der beiden Paare innerhalb eines Chiffratabschnitts vor oder nach dem Entschlüsseln der Bytepaare durchgeführt werden. Ebenso kann die Umpositionierung anhand des Positionsschlüssels wahlweise vor oder nach dem Entschlüsseln durchgeführt werden.During the decryption it is also necessary to check whether the byte pairs for a cipher section have been positioned based on a positioning key. In this case, the original order of the byte pairs of the cipher section is to be restored based on the positioning key, which is derived from the section key as described above. It is also necessary to check whether the repositioning is carried out in the reverse order, i. H. starting with the last byte pair of a cipher section. If necessary, the repositioning must also be carried out in the corresponding reverse order. The order of the two pairs within a cipher section can be reversed before or after the byte pairs have been decrypted. Repositioning can also be carried out using the position key either before or after decryption.

Das Ver-bzw. Entschlüsselungsverfahren können auf einer entsprechend eingerichteten Vorrichtung ausgeführt werden. Die Vorrichtung kann dabei jeweils einen digitalen Signalprozessor sowie ein Datenspeicher aufweisen, wobei der Datenspeicher dazu eingerichtet ist, einen ausführbaren Programmcode zu speichern, der das Ver-bzw. Entschlüsselungsprogramm implementiert. Wird der Programmcode aus dem Datenspeicher in den digitalen Signalprozessor geladen, so führt der Prozessor das entsprechende Ver-bzw. Entschlüsselungsprogramm aus. Weiterhin ist der Datenspeicher dazu eingerichtet und vorgesehen, den Klartext und das Chiffrat zu speichern. Der digitale Signalprozessor kann hierzu auf den Datenspeicher zugreifen, d. h. Inhalte aus dem Datenspeicher lesen und Inhalte in den Datenspeicher schreiben, sodass das Programm einen Klartext verschlüsseln und entsprechend entschlüsseln kann. In einer Ausführungsform kann der digitale Signalprozessor sowie der Datenspeicher ein an sich bekannter PC sein. In diesem Fall kann das Programm als Computerprogrammprodukt verwirklicht sein, welches das Ver-bzw. Entschlüsselungsprogramm implementiert, welches auf einem Datenspeicher abgelegt ist, und von dem aus es in den Signalprozessor geladen werden kann. In einer alternativen Ausführungsform können der digitale Signalprozessor sowie der Datenspeicher in einem sogenannten Application Specific IC (ASIC) realisiert sein.The ver or. Decryption methods can be carried out on an appropriately set up device. The device can each have a digital signal processor as well as a data memory, the data memory being set up to store an executable program code that controls or Decryption program implemented. If the program code is loaded from the data memory into the digital signal processor, the processor carries out the corresponding processing or processing. Decryption program. Furthermore, the data memory is set up and provided to store the plain text and the cipher. The digital signal processor can access the data memory for this purpose, i. H. Read content from the data memory and write content to the data memory so that the program can encrypt a plain text and decrypt it accordingly. In one embodiment, the digital signal processor and the data memory can be a PC known per se. In this case, the program can be implemented as a computer program product, which the processing or. Decryption program implemented, which is stored on a data memory, and from which it can be loaded into the signal processor. In an alternative embodiment, the digital signal processor and the data memory can be implemented in a so-called application-specific IC (ASIC).

BezugszeichenlisteList of reference symbols

100100
Schlüsselkey
110110
Bytes verschiedener Werte des SchlüsselsBytes of different values of the key
120120
Header des Schlüssels Header of the key
200200
ChiffratCipher
210210
HeaderHeader
220, 221220, 221
ChiffratabschnittCipher section
211211
SchlüsselkennungKey identifier
212212
Version, MetainformationVersion, meta information
213213
Kennung eines Sectionschlüssels (Verschiebewert)Identification of a section key (shift value)
214214
Länge der KlartextdateiLength of the plain text file
215215
Name der KlartextdateiName of the plain text file
216216
Anzahl JunkbytesNumber of junk bytes
217217
JunkbytesJunk bytes
218218
Länge des Chiffratabschitts (mit Sectionschlüssel verschlüsselt)Length of the cipher section (encrypted with section key)
219219
Kennung Rückwärtsverschlüsselung, Umpositionierung Reverse encryption identifier, repositioning
300300
VerschlüsselungsverfahrenEncryption method
301301
Lesen der StartinformationReading the start information
302302
Headerdaten d. Chiffrats schreibenHeader data d. Write cipher
303303
Sectionschlüssel erzeugenGenerate section key
304304
Array erstellenCreate an array
305305
(nächstes) Klartextbyte lesenRead (next) plain text byte
306306
Ende der Klartextdatei (EOF)End of plain text file (EOF)
307307
Byteposition im Sectionschlüssel prüfenCheck byte position in the section key
308308
Byteposition schreibenWrite byte position
309309
Chiffratabschnittslänge schreibenWrite ciphertext section length
310310
Länge des Chiffratabschnitts schreiben Write the length of the cipher section
400400
UmpositionierungsverfahrenRepositioning procedure
401401
Erzeugen eines PositionsschlüsselsGenerating a position key
402402
Lesen des nächsten PositionswertsRead the next position value
403403
Positionswert prüfenCheck position value
404404
UmpositionierenRepositioning
405405
Ende ChiffratabschnittEnd of cipher section
406406
Endeend

Claims (17)

Symmetrisches Verfahren zur Verschlüsselung digitaler Klartextdaten zu einem Chiffrat basierend auf einem digitalen Schlüssel, wobei der Schlüssel eine Vielzahl von Bytes eines jeden möglichen Datums enthält, umfassend - Erzeugen eines Sectionschlüssels durch zyklisches Verschieben des Schlüssels um einen zufälligen Verschiebewert und - Speichern einer Kennung des Sectionschlüssels in dem Chiffrat, und - Ermitteln einer zufälligen Position eines Bytes in dem Sectionschlüssel, wobei das Datum des Bytes des Sectionschlüssels identisch zu dem Datum eines zu verschlüsselnden Bytes des Klartexts ist, und - Speichern der ermittelten Position in dem Chiffrat.Symmetrical method for encrypting digital plain text data to form a cipher based on a digital key, the key containing a large number of bytes of each possible date, comprising - generating a section key by cyclically shifting the key by a random shift value and - storing an identifier of the section key in the cipher, and - Determining a random position of a byte in the section key, the date of the byte of the section key being identical to the date of a byte of the plain text to be encrypted, and storing the determined position in the cipher. Verfahren nach einem der vorstehenden Ansprüche, wobei die für die zyklische Verschiebung des Schlüssels zur Erzeugung eines Sectionschlüssels durchgeführte Verschiebung eineindeutig ist.Method according to one of the preceding claims, wherein the shift carried out for the cyclical shift of the key to generate a section key is one-to-one. Verfahren nach einem der vorstehenden Ansprüche, wobei der Verschiebewert vor dem Speichern in dem Chiffrat mit dem Schlüssel verschlüsselt wird.Method according to one of the preceding claims, wherein the shift value is encrypted with the key before it is stored in the cipher. Verfahren nach einem der vorstehenden Ansprüche, wobei die Größe der Klartextdatei in dem Chiffrat gespeichert wird.Method according to one of the preceding claims, wherein the size of the plain text file is stored in the cipher. Verfahren nach einem der vorstehenden Ansprüche, wobei der Verschiebewert in einem vordefinierten Wertebereich zufällig ausgewählt wird.Method according to one of the preceding claims, wherein the shift value is selected randomly in a predefined value range. Verfahren nach einem der vorstehenden Ansprüche, weiterhin umfassend den Schritt des Speicherns des Namens der Klartextdatei in dem Chiffrat.A method according to any preceding claim, further comprising the step of storing the name of the plain text file in the cipher. Verfahren nach einem der vorstehenden Ansprüche, weiterhin umfassend den Schritt des Erzeugens eines weiteren Sectionschlüssels durch Verschieben des Schlüssels um einen weiteren zufälligen Verschiebewert, und Speichern des weiteren Verschiebewerts in dem Chiffrat.Method according to one of the preceding claims, further comprising the step of generating a further section key by shifting the key by a further random shift value, and storing the further shift value in the cipher. Verfahren nach einem der vorstehenden Ansprüche, weiterhin umfassend - Erzeugen eines Positionsschlüssels basierend auf dem Sectionschlüssel, und - Umpositionieren von Bytepaaren in dem Chiffrat basierend auf dem Positionsschlüssel.A method according to any preceding claim, further comprising - Generating a position key based on the section key, and - Repositioning of byte pairs in the cipher based on the position key. Verfahren nach Anspruch 8, wobei das Verschieben von Positionen in dem Chiffrat weiterhin auf der Kennung des Sectionschlüssels basiert.Procedure according to Claim 8 The shifting of positions in the cipher is still based on the identifier of the section key. Verfahren zur Entschlüsselung eines Chiffrats zu Klartextdaten basierend auf einem digitalen Schlüssel, wobei der Schlüssel eine Vielzahl von Bytes eines jeden möglichen Datums enthält, umfassend Lesen einer Kennung eines Sectionschlüssels, und Erzeugen des Sectionschlüssels basierend auf der Kennung des Sectionschlüssels und dem digitalen Schlüssel, und Ermitteln des Werts eines Bytes in dem Sectionschlüssel, dessen Position identisch zu dem Wert eines Bytepaares des Chiffrats ist, und Speichern des ermittelten Bytewerts in den Klartextdaten.A method for decrypting a cipher into plain text data based on a digital key, the key containing a plurality of bytes of each possible date, comprising Reading an identifier of a section key, and Generation of the section key based on the identifier of the section key and the digital key, and Determining the value of a byte in the section key, the position of which is identical to the value of a byte pair in the cipher, and Saving the determined byte value in the plain text data. Verfahren nach Anspruch 10, wobei die Kennung des Sectionschlüssels in dem Chiffrat mit dem Schlüssel verschlüsselt ist.Procedure according to Claim 10 , whereby the identifier of the section key in the cipher is encrypted with the key. Verfahren nach einem der Ansprüche zehn oder elf, weiterhin umfassend den Schritt des Lesens des verschlüsselten Namens der Klartextdatei, Entschlüsseln des Namens der Klartextdatei, und Umbenennen der Klartextdatei.A method according to any one of claims ten or eleven, further comprising the step of reading the encrypted name of the plain text file, decrypting the name of the plain text file, and renaming the plain text file. Verfahren nach einem der vorstehenden Ansprüche 10-12, weiterhin umfassend Erzeugen eines Positionsschlüssels basierend auf dem Sectionschlüssel, und Umpositionieren der Positionen basierend auf dem Positionsschlüssel.Method according to one of the preceding Claims 10 - 12th , further comprising generating a position key based on the section key, and repositioning the positions based on the position key. Verfahren nach Anspruch 13, wobei die Umpositionierung weiterhin auf der Kennung des Sectionschlüssels basiert.Procedure according to Claim 13 , whereby the repositioning is still based on the identifier of the section key. Vorrichtung zur Verschlüsselung digitaler Klartextdaten umfassend einen digitalen Signalprozessor sowie einen Datenspeicher, wobei der Datenspeicher einen ausführbaren Programmcode speichert, der ein Verfahren nach einem der vorstehenden Verfahrensansprüche 1 bis 9 implementiert, und wobei die Vorrichtung zur Durchführung eines Verfahrens nach einem der vorgenannten Verfahrensansprüche eingerichtet ist.A device for encrypting digital plain text data comprising a digital signal processor and a data memory, the data memory storing an executable program code which can be used in a method according to one of the above methods claims 1 to 9 implemented, and wherein the device is set up to carry out a method according to one of the aforementioned method claims. Vorrichtung zur Entschlüsselung eines Chiffrats umfassend einen digitalen Signalprozessor sowie einen Datenspeicher, wobei der Datenspeicher einen ausführbaren Programmcode speichert, der ein Verfahren nach einem der vorstehenden Ansprüche 10 bis 15 implementiert, und wobei die Vorrichtung zur Durchführung eines Verfahrens nach einem der vorgenannten Verfahrensansprüche 10 bis 15 eingerichtet ist.Device for decrypting a cipher, comprising a digital signal processor and a data memory, wherein the data memory stores an executable program code which a method according to any of the above Claims 10 to 15th implemented, and wherein the device for performing a method according to one of the aforementioned methods claims 10 to 15th is set up. Computerprogrammprodukt mit Anweisungen zur Ausführung durch einen digitalen Signalprozessor, wobei ein Verfahren nach einem der vorstehenden Verfahrensansprüche ausgeführt wird, wenn die Anweisungen auf deinem Computer ausgeführt werden.Computer program product with instructions for execution by a digital signal processor, wherein a method according to one of the preceding method claims is executed when the instructions are executed on your computer.
DE102018113772.9A 2018-06-08 2018-06-08 Encryption method Expired - Fee Related DE102018113772B4 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
DE102018113772.9A DE102018113772B4 (en) 2018-06-08 2018-06-08 Encryption method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
DE102018113772.9A DE102018113772B4 (en) 2018-06-08 2018-06-08 Encryption method

Publications (2)

Publication Number Publication Date
DE102018113772A1 DE102018113772A1 (en) 2019-12-12
DE102018113772B4 true DE102018113772B4 (en) 2021-07-08

Family

ID=68651329

Family Applications (1)

Application Number Title Priority Date Filing Date
DE102018113772.9A Expired - Fee Related DE102018113772B4 (en) 2018-06-08 2018-06-08 Encryption method

Country Status (1)

Country Link
DE (1) DE102018113772B4 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113593682B (en) * 2021-07-15 2023-12-01 丹源医学科技(杭州)有限公司 Equipment management system carrying product information

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20020126840A1 (en) 2001-03-12 2002-09-12 Robbins Virginia L. Method and apparatus for adapting symetric key algorithm to semi symetric algorithm

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20020126840A1 (en) 2001-03-12 2002-09-12 Robbins Virginia L. Method and apparatus for adapting symetric key algorithm to semi symetric algorithm

Also Published As

Publication number Publication date
DE102018113772A1 (en) 2019-12-12

Similar Documents

Publication Publication Date Title
DE69929251T2 (en) ENCRYPTION SYSTEM WITH A KEY OF CHANGING LENGTH
EP2605445B1 (en) Method and apparatus for securing block ciphers against template attacks
EP1777913B1 (en) Method to enciphering/deciphering data packets of a data steam
DE69917356T2 (en) Security technology on a computer network
DE112017006020T5 (en) Method and system for search-dummy dynamic symmetric searchable encryption
DE19744961A1 (en) Generate clear and unpredictable values
WO2010133355A1 (en) Encoding methods
EP1298834A1 (en) Method and apparatus for encrypting and decrypting data
DE102018113772B4 (en) Encryption method
DE60004409T2 (en) Circuit and method for generating random numbers
DE112016000791B4 (en) Media key block based broadcast encryption
DE202023104060U1 (en) A multi-level randomized SALT technique for confidentiality in IoT devices
DE102010045580A1 (en) Circuit arrangement for use in microprocessor for e.g. smart card, has identification circuit producing key for encrypting data value to be written or decrypting data value to be read, where key depends on arrangement inherent properties
DE2360788A1 (en) ELECTRONIC DATA PROCESSING SYSTEM
EP0135888B1 (en) Process for preventing the execution of a programme in a computer which is not allowed to execute said programme
EP1322062B1 (en) Method for computer assisted encryption and decryption of data
DE102017202940A1 (en) Method and apparatus for generating cryptographic keys
EP3156932A1 (en) Method and system for protecting confidential electronic data
EP0982896A2 (en) Method and apparatus for proving existence of a digital signature of a digital file
DE3244537A1 (en) Method for encrypting and decrypting data blocks
DE19914225A1 (en) Device and method for secure electronic data transmission
DE10229976B4 (en) Method for encrypting and decrypting digital data transmitted or stored according to the method of prioritized pixel transmission
EP2288073A1 (en) Apparatus for encrypting data
DE102022004632B3 (en) Method for encrypting plain text
DE4107266C2 (en) Process for fast encryption or decryption of large files using a chip card

Legal Events

Date Code Title Description
R012 Request for examination validly filed
R016 Response to examination communication
R018 Grant decision by examination section/examining division
R020 Patent grant now final
R119 Application deemed withdrawn, or ip right lapsed, due to non-payment of renewal fee