The invention relates to a method for writing and reading data into or out of an indexed dataset, which comprises a data structure and an associated index structure, a processing unit receiving data to be written in plain text and writing to the data structure by means of write access and updating index data in the index structure and the processing unit detecting data to be read out or the memory location thereof by means of access to the index data and reading out the data to be read out from the data structure by means of read access and making the same available in plain text.
The invention furthermore relates to a device for writing and reading data into and out of an indexed dataset, which comprises a data structure and an associated index structure, comprising a processing unit, in which the data to be written can be received in plain text and which has write access to the data structure, in order to write the data to the data structure, and which interacts with the index structure, in order to update index data in the index structure, and which has access to the index data, in order to detect data to be read out or the memory location thereof, and which has read access to the data structure, in order to read out the data to be read out from the data structure and to make the same available in plain text.
At present, indexed datasets, particularly indexed databases, constitute the most widespread mass storage of data. From a technical hardware viewpoint, an indexed database is a mass storage device, which has a connected index memory to accelerate access. A database index is an index structure in a database, which is separated from the data structure and accelerates searching and sorting for certain fields. An index consists of a collection of pointers (references), which define an order relation to one of a plurality of columns in a table. If an indexed column is called upon as a search criterion during a query, a processing unit, that is generally a database management system, searches the desired data records on the basis of these pointers. Without an index, the column would have to be searched sequentially, which would take up much time, even with fast hardware. There is a multiplicity of different index structures. However, B+ trees are generally used.
It is desirable to encrypt databases, in order to protect access to the content of the database from unauthorised access. In this case, rapid access to the encrypted data should be retained, however, i.e. having to decrypt the entire database before only one or a plurality of certain data records are accessed by means of a search query should be avoided. It would therefore be desirable that only the data records to be read out or the data records to be written are encrypted in each case.
Secure protection of the database is only ensured if not only the data stored in the data structure, but also the index data stored in the index structure are present in an encrypted manner.
If data are encrypted, it is a functional requirement that the same can be placed in a clear relationship to the code used for encryption. The following problems arise when indexing encrypted data: When encrypting the data, it must be possible for the processing unit to recognise the content of the data. Whether the size of the data on the storage medium is changed during encryption must furthermore be taken into account. When decrypting the data, it is to be ensured that the key used for encryption is available again.
The invention therefore aims to create a method and a device, using which, the integrity of the data structure and the index structure of a dataset can be protected, without access to the data by authorised users using the index being impaired. The unrestricted functionality of an indexed data base should be retained.
To achieve this object, it is provided according to a first aspect of the invention, that the data in the data structure and the index data in the index structure are stored in an encrypted manner and that write/read access of the processing unit to the index structure and to the data structure takes place via at least one en- and decryption unit, using which the data are en- or decrypted by means of stream cipher. The fact that the data to be written and to be read are en- or decrypted by means of stream cipher ensures that the image of the encrypted data and the unencrypted data on the storage medium has exactly the same dimensions (bit length), so that the same are located in a bit-precise manner, even in encrypted form and can be transmitted to the requesting user without knowing the content. As each individual piece of information has exactly the same dimensions (bit length) as the unencrypted version, it is even possible to access the position of the encrypted data exactly from an index created in unencrypted form, so that the content of the encrypted data does not have to be recognised by the processing unit of the database and no consideration has to be given to the factor of encryption during storage location searching.
Stream cipher is a cryptographic algorithm, in which plain-text characters are individually linked with the characters of a key stream. In the case of stream cipher of digital data—only the characters 0 and 1 are used—the linking of the plain-text stream with the key stream takes place with the aid of the XOR function. The key stream is a pseudo-random character sequence. Most stream ciphers use a symmetrical key. The key determines the initial state of the system.
Preferably, in the context of the invention, the procedure is such that the generation of the key stream for the stream cipher takes place using at least one feedback shift register, which is filled with a defined sequence of bits for the initialisation thereof. Linear feedback shift registers can be implemented effectively both directly in hardware, such as for example FPGAs, and in software. Feedback shift registers are fast and produce pseudo-random sequences with good statistical properties. A feedback shift register is realised in digital technology as a shift register with n storage elements. The individual storage elements are typically D flip flops, which can each store one bit. By contrast with a conventional shift register, there are branches between certain D flip flops, which constitute the feedback. An XOR function is generally used in each case for the feedback. Instead of the XOR link, an XNOR link can however also be used.
For initialisation, the shift register with XOR feedback can be filled with random values, which determine the key stream generated by the shift register in the sequence. Like any other shift register, the feedback shift register also has a clock input: For each clock pulse, a change is made to the successor state; i.e. if a bit should be output, all of the bits in the shift register are shifted by one storage location; the new bit at the end of the shift register is calculated as a function of the other bits. This process counts as one clock. To completely run through all combinations, 2n−1 clock pulses are required. A code sequence of this type therefore has a length of 2n−1 bits (n=number of code-generating storage elements of the shift register connected in series). A plurality of linear feedback shift registers are generally used as key stream generator, which for the most part are of different length and have different feedback polynomials. Thus, one combines linear feedback shift registers to form non-linear generators.
The larger the length of the code sequence of the key stream or the code is, the harder it is to decrypt the same. For example, an infinite code would not have to be hidden, as it is never known entirely. Functionally, any code, which does not repeat before the end of the information to be encrypted, is to be regarded as infinite. A functionally infinite code has the disadvantage that it cannot be transmitted; it must be generated.
Disadvantageous in the case of code generators in the form of conventional feedback shift registers is the fact that it is easily possible to infer the structure of the generator from the code sequence, so that the same can be re-generated using an identically built generator. An increase in security is achieved according to a preferred procedure in the context of the invention in that for each write access of the processing unit to the data structure or the index structure, a different key stream is used. This means that the feedback shift register(s) is or are re-initialised for encrypting each data packet. Preferably, the procedure is such here, that in each case at least one first sequence of bits and a second sequence of bits is used for initialising the feedback shift register(s). This takes place in particular if only one single feedback shift register is used for generating the key stream in such a manner that the first and the second sequences of bits are linked with the aid of an XOR function and the sequence of bits resulting from the linking is fed to the feedback shift register for initialisation. Alternatively, specifically for the case that at least two mutually connected feedback shift registers are used for generating the key stream, the procedure is such that at least one first feedback shift register is filled with the first sequence of bits for its initialisation and at least one second feedback shift register is filled with the second sequence of bits for its initialisation.
In the context of the invention, it must be ensured that the encryption of a section of the dataset, such as e.g. a dataset of the database and the encryption of the same section or data record are synchronised with one another, that is to say that the encryption and the decryption takes place using the same key stream. This means that the code generator must be returned to the point of the start of the encryption. The synchronisation preferably takes place using the indices of the data records. In particular, the procedure is such that an index number assigned to the data record to be encrypted or decrypted is chosen as first sequence of bits or that the first sequence of bits is generated from the same. The primary index is preferably used for this. The second sequence of bits is preferably a unique identifier of the database or is generated from the same.
A higher security results if, as corresponds to a further preferred procedure, a third sequence of bits is furthermore used for initialising the feedback shift register(s). The third sequence of bits is in this case advantageously a unique identifier of the respective user or generated from the same. The third sequence of bits is preferably fed to a third feedback shift register for initialisation.
A further advantage of the method according to the invention is the fact that the generation of the key stream for the stream cipher can begin as soon as at least one of the feedback shift registers is filled with the first bit from the respective sequence of bits. In particular, the feedback shift registers are filled with the respective sequence of bits at the same time.
The structure of the key stream generator is preferably such that at least one XOR gate is used for the feedback of the shift register(s), as is known per se. The complexity of the generator can be increased in this manner in that the feedback shift registers are connected to one another in such a manner that the at least one XOR gate of the one shift register is switched on or off depending on the state of the other shift register.
An extremely preferred development results if a code generator, as is described in WO 03/075507 A1, comes to be used, whereby reference is made to the Claims 15 and 16 and also 33 and 38 of the present application. In the case of such a code generator, the encryption cannot even be broken if both the structure of the code generator and the algorithm running in the same are known. The structure of the generator is namely of such a type that it is in a position to generate such a high number of different codes with such a long length, that the discovery of the currently used code and the currently produced position in the code sequence is only possible with an extremely low possibility. The code cannot be re-generated if the generator can create so many different codes that it is not possible to draw a conclusion from a section of the individual code about the continuation thereof.
The access of a user computer to the dataset or the database generally takes place from a remote location via a data communication connection, particularly via a computer network. The access of a user computer to the data structure and the index structure in this case takes place via the processing unit. As the data are present in the processing unit in plain text, it is advantageous to create measures to prevent user computers from gaining access to these plain-text data. In this connection, the invention preferably provides that the data transmitted between the processing unit and a user computer are transmitted in an encrypted manner. In particular, the procedure is such that the encrypted transmission of the data between the processing unit and the user computer takes place using one en- and decryption unit assigned to the user computer and one assigned to the dataset, using which the data are en- or decrypted by means of stream cipher.
A particularly secure design is ensured in that any transmission of data from and to the processing unit takes place via at least one en- and decryption unit, using which the data are en- or decrypted by means of stream cipher. The processing unit therefore has no unencrypted input or output into/out of the surrounding network, so that it is ensured that the data memory of the processing unit, in which the data are present in plain text, cannot be seen.
According to a further aspect of the present invention, a device of the type mentioned at the beginning, for writing and reading data into or out of an indexed dataset is suggested. The device according to the invention is characterised in that the processing unit is connected to the data structure and to the index structure via at least one en- and decryption unit, using which the data can be en- or decrypted by means of a stream cipher, so that the write/read access of the processing unit to the index structure and to the data structure takes place via the at least one en- and decryption unit.
The processing unit is preferably constructed as a CPU assigned to the data structure and the index structure.
Preferred developments of the device according to the invention result from the subclaims.
The invention is explained in more detail hereinafter on the basis of schematically illustrated exemplary embodiments. In the figures,
A database 1 is illustrated in
In the processing unit 4, the data to be written to the data structure 2 or the index structure 3 and the data to be read out of the data structure 2 or the index structure 3 are present in plain text, so that the operations required for the indexing and for the location of data records can be carried out. By contrast, in the data structure 2 and in the index structure 3, the data are present in encrypted form exclusively. So that the processing unit 4 can access the encrypted data, access takes place via the en- and decryption unit 6 or 7. In
The en- and decryption units 6 and 7 en- and decrypt the respective data by means of stream cipher and accordingly comprise a key stream generator, which is explained in more detail on the basis of the various embodiments in
A user computer 8 can access the database 1 via a communication connection 9. The data are transmitted via the communication connection 9 in encrypted form, the en- and decryption taking place by means of the en- and decryption units 10 and 11. The encryption and the decryption preferably takes place by means of stream cipher.
The en- and decryption units 6, 7, 10 and 11 can comprise one code generator in each case according to WO 03/075507 A1, the code generators of the en- and decryption units 6 and 7 must be synchronised for the encryption and the later decryption of data. Furthermore, the code generators of the en- and decryption units 10 and 11 must be synchronised with one another.
If a user is searching for certain information under the data stored by the same in the database 1, it inputs corresponding search words in the user computer 8. The same encrypts this input and transmits it to the database 1. In the database 1, this search term is decrypted by means of the en- and decryption unit 11 and supplied to the processing unit 4 in plain text. The processing unit 4 searches for the search term in the index structure 3, the index structure 3 of the processing unit 4 being available on a plain-text basis owing to real-time access via the en- and decryption unit 7. The index structure 3 makes the exact location of the searched data in the encrypted data structure 2. Furthermore, the encrypted data are sought in the data structure 2 and forwarded to the user computer 8 of the user in unmodified encrypted form. The user computer 8 decrypts the data with the aid of the en- and decryption unit 10, so that the same is displayed there as the requested plain-text data. Alternatively, the reading out of the encrypted data from the data structure 2 can take place by means of the en- and decryption unit 6, these data being present in the processing unit 4 in plain text and having to be encrypted again using the en- and decryption unit 11 for the purpose of transmission to the user computer 8.
The synchronisation of the en- and decryption units 6 and 7 is explained in more detail on the basis of
The key stream generator 12 generates a key stream 19a. An incoming stream 19b of plain-text data is encrypted in such a manner that the bits of the bit stream 19b of the plain text are linked with the bits of a key stream 19a individually with the aid of an XOR gate 20. If the plain-text data represent a data record of the database 1, the index of this data record is determined in accordance with the inherent structuring of the database and supplied as a sequence of bits 14 to the key stream generator 12 as an initialisation sequence.
If the stream 19b is a stream of encrypted data, the same is decrypted in such a manner that the bits of the bit stream 19b of the encrypted data are linked with the bits of the key stream individually with the aid of an XOR gate 20. If the encrypted data represent an encrypted data record of the database 1, the index of this data record is determined in accordance with the inherent structuring of the database and supplied as a sequence of bits 14 to the key stream generator 12 as an initialisation sequence.
In the modified design according to
Thus, a code generator 12 with three levels is created, the code generation being influenced at each level by initialisation of the respective shift register 21, 22 and 23 with the sequence of bits 14, 15 and 16. The initialisation can in this case preferably take place in such a manner that the first sequence of bits 14 is supplied to the shift register 21 of the first level, the second sequence of bits 15 is supplied to the shift register 22 of the second level and the third sequence of bits 16 is supplied to the shift register 23 of the third level, the sequences of bits 14, 15, 16 preferably being defined as described in
In the embodiment according to
Lc=2n−1
If this unit is operated with a certain clock, the following applies for the duration of the code:
With fewer than 50 storage elements for a code generation clock frequency of 384,000 bits/s, the code runs for longer than one year without the sequence repeating, so that a signal to be encrypted can simultaneously be transmitted encrypted via a fixed line and decrypted over just as long a time period, so that transmissions are possible live over just as long a time period.
If, for a corresponding length of the shift register 24, one then inserts an XOR gate XORp1,p2,p3,p4 at various positions of this shift register 24 between a storage element FF1,2,3,4 and the next storage element located in the series and then feeds the same with the signal from a third storage element FF8,15,20,23, one thus changes the code generated thereby in each case (
In the case of a plurality of code-changing XOR gates XORp1,p2,p3,p4, cf.
If one connects an output of an AND gate ANDp1 or ANDp1,p2,p3,p4, the one input of which depends on an output of the storage element FF3 or FF8,15,20,23, to one of the two inputs of the respective XORp1 or XORp1,p2,p3,p4, then one can turn this XOR gate XOR gate XORp1 or XORp1,p2,p3,p4 on or off in terms of the code-changing action of the same by means of the second input of the AND gate ANDp1,p2,p3,p4 and if one connects a further storage element FFp1,p2,p3,p4 thereto, one can make the switching on and off of the code influencing action of the XOR gate XORp1 or XORp1,p2,p3,p4 programmable. The code-programming storage elements FFp1,p2,p3,p4 can in this case be connected together to form a shift register 25. Subsequently, the code-programming storage elements FFp1,p2,p3,p4 of the shift register 25 itself can in turn be recursively wired with the aid of an XOR gate XORpp1.
The number of programmable different codes is calculated as follows:
Nc=2pn−1
If one is then in possession of an identical code generator and would like to infer the further course of the code sequence on the basis of a certain number of bits, the possibility of one detecting the correct continuation of the code sequence depends both on the number of storage elements FF1,2, . . . n used in the code generation and also the number of programmable code-changing XOR gates XORp1,p2, . . . pn. This results in a possibility of discovering the programming on which the code is based and thus predicting the further course of the code from:
233 is the 52nd prime number. If one does not use 1 and 233 expresses the total number of storage elements connected in series, then there are 50 different storage elements on this stretch, which are in each case located remotely from an output storage element, which corresponds to a primary number (np=50). As each recursive XOR gate 1-50 is in each case switched on in series between a next storage element 1-50 starting from the first, the total length of the storage elements is extended to (n=233+50=283).
Thus:
In other words, the code sequence must be observed for 1.7498005798*10100 clock cycles so that one discovers a certain sequence with the possibility 1. If the clock frequency is 384000 Hz, this results in an observation time of 1.4449430312*1087 years.
By wiring the code-programming storage elements (FFp1,p2,p3,p4,p5,p6) of the shift register 25 to one another recursively, so that they run through all possible state combinations within the time interval
So that the programming cannot be discovered even approximately from the program duration, the programming can take place in a two-stage manner. To this end, a further programming level can be added, in that the code-programming XOR gate XORpp1 itself if in turn connected to a storage-element series RRR with the interposition of an AND gate ANDpp1 and thus made programmable, an XOR gate XORppp1 being used in turn for recursive wiring of the shift register 26 (
Starting from the above calculation example, it is thereby ensured that the (2283−1)*(250−1) different states are broken down into 250−1 different sections, of which one is selected in the first programming phase. This selection process takes place in at most 2ppn−1 steps (ppn=number of prime numbers, which are contained in the number of prime numbers (50) used during the programming, that is to say 16). This means that at most 216 cycles must take place before all of the sections are found. At a programming clock frequency of 1 MHz, this process is completed in 0.065 seconds. A time period, which is covered well for each programming, as it lies below human reaction time, which is why it is ensured that no conclusions about the programming of the keys can be drawn from the actual elapsed programming time.
| Number | Date | Country | Kind |
|---|---|---|---|
| A 106/2012 | Jan 2012 | AT | national |
| Filing Document | Filing Date | Country | Kind |
|---|---|---|---|
| PCT/AT2013/000010 | 1/22/2013 | WO | 00 |