Method for Authenticating Messages in Resource Limited Systems
20220094552 · 2022-03-24
Inventors
Cpc classification
H04L9/3242
ELECTRICITY
International classification
H04L9/32
ELECTRICITY
Abstract
The present invention provides a method for message authentication, in particular in case of low of transmission or storage capacities. The present invention further provides corresponding devices for generating or sending authenticated messages and for receiving or retrieving authenticated messages as well as a system comprising such devices. In an embodiment, the method may comprise (a) preparing a data block having an uncompressed length; (b) compressing the data block so that the data block has a compressed length smaller than the uncompressed length; (c) determining an available length from at least the compressed length and a maximum length of a data frame; (d) calculating a message authentication code, MAC, from at least the data block, having a MAC length not greater than the available length; and (e) creating the data frame, comprising the data block and the MAC.
Claims
1-11. (canceled)
12. A method for message authentication, comprising: preparing a data block having an uncompressed length; compressing the data block to obtain a compressed data block that has a compressed length that is smaller than the uncompressed length; determining an available length based on the compressed length and a maximum length of a data frame; calculating a message authentication code (MAC) based on the data block, the MAC having a MAC length not greater than the available length; and creating the data frame comprising the data block and the MAC.
13. The method of claim 12, further comprising creating an additional data frame that comprises the data block and an additional MAC, wherein calculating the MAC comprises calculating the additional MAC based on the data block, the additional MAC having an additional MAC length not greater than the available length.
14. The method of claim 12, further comprising encrypting the data block.
15. The method of claim 12, further comprising transmitting or storing the data frame.
16. The method of claim 15, wherein the MAC is calculated based on the data block and a previously transmitted or stored data block.
17. The method of claim 15, further comprising receiving or retrieving the data frame and verifying the MAC.
18. The method of claim 17, further comprising attributing a trust level to the data frame.
19. The method of claim 18, further comprising verifying that the trust level is above a threshold of acceptance.
20. The method of claim 17, further comprising attributing a trust level to the data block.
21. The method of claim 20, further comprising verifying that the trust level is above a threshold of acceptance.
22. A computer-readable data carrier having stored thereon a computer program comprising instructions which, when the computer program is executed by a computer or a computer system, cause the computer or the computer system to carry out the method of claim 12.
23. A method for message authentication, comprising preparing a data block having a block length; determining an available length based the block length and a maximum length of a data frame; calculating a message authentication code (MAC) based on the data block, the MAC having a MAC length not greater than the available length; calculating an additional MAC based on the data block, the additional MAC having an additional MAC length not greater than the available length; creating the data frame that comprises the data block and the MAC; and creating an additional data frame that comprises the data block and the additional MAC.
24. The method of claim 23, further comprising encrypting the data block.
25. The method of claim 23, further comprising transmitting or storing the data frame and transmitting or storing the additional data frame.
26. The method of claim 25, wherein the MAC and the additional MAC are calculated based on the data block and a previously transmitted or stored data block.
27. The method of claim 25, further comprising: receiving or retrieving the data frame and the additional data frame; and verifying the MAC and the additional MAC.
28. The method of claim 27, further comprising attributing a trust level to the data frame and to the additional data frame.
29. The method of claim 28, further comprising verifying that the trust level is above a threshold of acceptance.
30. The method of claim 27, further comprising attributing a trust level to the data block and verifying that the trust level is above a threshold of acceptance.
31. A computer-readable data carrier having stored thereon a computer program comprising instructions which, when the computer program is executed by a computer or a computer system, cause the computer or the computer system to carry out the method of claim 23.
32. A device for generating authenticated messages, wherein the device is configured to: prepare a data block having an uncompressed length or a block length; determine an available length based on the block length and a maximum length of a data frame or based on a compressed length and a maximum length of a data frame; calculate a message authentication code (MAC) based on the data block a message authentication code, the MAC having a MAC length not greater than the available length; and create the data frame, which comprises the data block and the MAC, wherein the device is further configured to compress the data block such that the compressed data block has the compressed length smaller than the uncompressed length; or calculate an additional MAC having an additional MAC length not greater than the available length and create an additional data frame that comprises the data block and the additional MAC.
33. A system for authenticating messages comprising: the device according to claim 32; and a device for receiving authenticated messages, wherein the device for receiving authenticated messages is configured to: receive a data frame that comprises a data block and a received MAC; verify the received MAC; receive an additional data frame that comprises the data block and an additional received MAC; and verify the additional received MAC.
34. A device for receiving authenticated messages, wherein the device is configured to: receive a data frame that comprises a data block and a Message Authentication Code (MAC); verify the MAC; receive an additional data frame that comprises the data block and an additional MAC; and verify the additional MAC.
Description
BRIEF DESCRIPTION OF THE DRAWINGS
[0069] The subject-matter of the present invention will be explained in more detail in the following text with reference to exemplary embodiments which are illustrated in the attached drawings.
[0070]
[0071]
[0072]
[0073]
[0074]
[0075]
[0076]
[0077]
[0078]
[0079]
[0080]
[0081] The reference symbols used in the drawings, and their meanings, are listed in summary form in the list of reference symbols. In principle, identical parts are provided with the same reference symbols in the figures.
DETAILED DESCRIPTION OF EXEMPLARY EMBODIMENTS
[0082] The present invention will be described in more detail with reference to the drawings, in which exemplary embodiments are shown.
[0083] In other words, the first aspect of the present invention can be described as a method for authenticating a data block in a data frame, comprising [0084] preparing the data block so that it has a block length, [0085] placing the data block in the data frame, [0086] allocating, in the data frame or in the data frame and in at least one additional data frame, an available space, having an available length for placing a Message Authentication Code, MAC,
[0087] wherein
[0088] preparing the data block comprises compressing the data block; and/or
[0089] the available space is allocated in the data frame and in the at least one additional data frame and the method further comprises replicating the data block in the additional data frame. The method may further comprise calculating the MAC of the available length from at least the data block, placing the MAC in the data frame or in the data frame and in the additional data frame, encrypting the data block, in particular previous to calculating the MAC and/or subsequent to compressing the data block, and/or sending or storing the data frame and/or the additional data frame. In embodiments, the MAC may be calculated over at least the data block and at least one previously transmitted or stored data block. The method may further comprise receiving or retrieving the data frame and/or the additional data frame, and verifying the MAC or verifying at least parts of the MAC, in particular the part of the MAC placed in the data frame or the part of the MAC placed in the additional data frame. The method may further comprise decompressing the data block. In embodiments, the method may further comprise attributing a trust level to the data block, the data frame, and/or the additional frame wherein the trust level is based on the length of the verified MAC or of the verified parts of the MAC. In these alternative words, the MAC comprises the additional MAC; i.e., the additional MAC is the part of MAC that is placed in the additional data frame.
[0090] In the context of the present invention, a message may be a piece of information or data, e.g., comprised in a data block, which may be transmitted or stored by a sending or message generating side, in particular with the intention for consumption of the message by a recipient such as a message receiving or retrieving side. Further, a data frame according to the present invention may be a message frame. In the context of the present invention, a compressed length may be a compressed data block length and an uncompressed length may be an uncompressed data block length; a block length may be in particular a data block length.
[0091] The present invention proposes to use or create available capacity in a data frame or in an additional data frame to carry as much authentication information as possible. Accordingly, methods and devices according to aspects of the present invention are adaptive to an available spare capacity and the MAC length and the additional MAC length may vary. Such a spare capacity may be created or may be available, in particular by data compression of the information, the data, or the data block. Any data compression method is applicable, in particular methods for lossless compression, such as Huffman coding, run length coding, arithmetic coding, Lempel-Ziv coding, Lempel-Ziv-Welch, or Lempel-Ziv-Storer-Szymanski coding, or methods for lossy compression. Depending on the entropy of the data block and, in case of lossy compression, on the level of level of tolerable losses, the size of the compressed data and/or the compression ratio may vary. A further option to create or use spare capacity may be padding. Due to constraints of the message format and/or size granularities in number of bytes of words, a data frame may be filled up with dummy or padding bits. In the aspects of the present invention, padding or dummy bits may be used for at least parts of the MAC and/or the additional MAC. Often in communication and data storage, messages are transmitted or stored redundantly, e.g. in the case of GOOSE transmission in IEC61850. E.g., identical messages may be transmitted over disjoint paths to achieve seamless failover against network components as in the case of PRP or iPRP. In case of redundant message generation and/or transmission, the message retrieving or receiving side in prior art discards any redundantly retrieved or received message or data frame. In the present invention, a redundant message or data frame, i.e., an additional message or data frame comprising the same data block, may comprise an additional MAC, e.g., an additional part of the authentication information. In case the message retrieving or receiving side retrieves or receives more than one data frame comprising the data block, it has more authentication bits available and can increase a trust level of the data frame and/or the data block. Furthermore, also the calculation of a MAC of a data block or a frame may employ chaining of the data block to one or more previously transmitted or stored data blocks such that the message authentication of the previously transmitted or stored data blocks and of the data block increases the trust level for the data block as well as the previously transmitted or stored data block. Such a chaining may, e.g., be based on Cipher Block Chaining, CBC-MAC, or on Cipher Feedback MAC, CFB-MAC. In general, a trust level that may be attributed to an authenticated data frame, additional data frame, and/or data block can be used in the aspects of the present invention and may correspond to the number of bits available for authentication of the data frame or the data block.
[0092] The aspects of the present invention may further comprise means for error control of the data frame and/or the additional data frame. This can be achieved by the data frame and/or the additional data frame comprising a checksum or an integrity check value, which may be calculated at the message generating or sender side over other or all other elements of the data frame or the additional data frame, in particular such as the data block and/or the MAC/the additional MAC. At the message retrieving or receiving side, the checksum or the integrity check value may be checked and, in case, an error is found, the data frame or the additional data frame can be discarded.
[0093] Exemplary embodiments of the method according to a first aspect of this method is depicted in
[0094] In method element a, a data block, in particular an uncompressed data block 300 may be prepared, e.g., by a preparation module 110. This data block may comprise information relevant for storage or transmission and has a certain entropy and an uncompressed length L.sub.U or a block length L.sub.B; the uncompressed length L.sub.U or block length L.sub.B may be a pre-defined or fixed length corresponding to an amount of information to be included in the data frame.
[0095] Accordingly, method element b of compressing data block, in particular by a compression module 120, leads to the compressed data block 420 with compressed length L.sub.C, typically shorter than the uncompressed length L.sub.U. In case of too high entropy of the data block, the compression ratio may be one or close to one and the compression may not result in any reduction in length of the data block.
[0096] In case of message authentication of redundant messages, the method element b of compressing the data block 300, 420 is optional and the objectives of the present invention can be achieved by an embodiment of the method as schematically depicted in
[0097] In method element c, an available length L.sub.avail is determined from at least the compressed length L.sub.C or the block length L.sub.B and a maximum length L.sub.max, in particular by an authentication module 140. This can be achieved, e.g., by subtracting the compressed length L.sub.C or block length L.sub.B and, possibly, a length L.sub.H of a data frame header 410 and of other message parts according to a message format, from the maximum length L.sub.max of a data frame 400. Depending on the uncompressed length L.sub.U or block length L.sub.B, the entropy of the uncompressed data block 300, subsequently the compression ratio, and/or the compressed length L.sub.C, the available length L.sub.avail may vary; e.g., in case of lower entropy of the uncompressed data block 300, there may be more bits available for the MAC 430 and the available length L.sub.avail may be larger.
[0098] In method element d of calculating a MAC, the MAC is calculated, in particular by the authentication module 140, from at least the data block 300, 420. This method element may further comprise calculating an additional MAC 630 from at least the data block, having an additional MAC length L.sub.MAC2 not greater than the available length L.sub.avail. In particular, a secret key as authentication key may be used; the same keys or different keys may be used for calculating the MAC and the additional MAC. To increase security, the authentication key may be regularly changed, i.e., re-keyed. This may be achieved by the message generating or sender side 100 providing appropriate key roll-over information to the message receiving or retrieving side 200. The calculation of the MAC and/or the additional MAC can be done by a cryptographic hash function. The input for this calculation can comprise the data block 300, 420 and, optionally, at least parts of the data frame header 410 or of the additional message header or other parts of the data frame or the additional data frame. The calculation can be done by a function such that it directly yields a MAC 430 of the MAC length L.sub.MAC and/or an additional MAC 630 of the additional MAC length L.sub.MAC2; alternatively, an initial MAC is calculated that has a length larger than the MAC length L.sub.MAC, then the MAC may be accordingly truncated. In case of redundant message generation or transmission, the truncated part of the initial MAC may be an additional MAC for an additional data frame. In more detail, in case n−1 additional data frames are to be generated, wherein n is an integer larger than 1, an initial MAC having a length of n times the MAC length L.sub.MAC may be calculated and, subsequently, the MAC and n−1 additional MACs may be generated by truncation. In this example, the additional MAC length L.sub.MAC2 and the MAC length L.sub.MAC coincide; in other embodiments additional MAC length and MAC length could also vary, e.g., by one or more bits, for example, in case the MAC and one additional MAC are generated from an initial MAC of uneven length. In any case, the MAC and/or the additional MAC may not only be calculated from the data block 300, 420 and, optionally, the data frame header 410 or other parts of the data frame 400 alone, but may be also be additionally based on or calculated from at least one previously transmitted or stored data block. Then the methods mentioned above regarding chaining may be employed. The at least one previously transmitted or stored data block may itself also be compressed and/or may be transmitted or stored according to embodiments of the method of the first aspect of the present invention.
[0099] In method element e of creating the data frame 400, the data frame may be created by a message generation module 150, e.g., in a pre-defined order or message format. By way of example, such a message format is schematically depicted in
[0100] The method may comprise further method elements, e.g. schematically depicted in
[0101] A further method element b2 may be encrypting the data block 300, 420, in particular by an encryption module 130. Preferably, encryption may be done after optional compressing b of the data block 420 since encryption typically increases the entropy of the data block which results in a compression ratio of 1 or close to 1. For increased security, an encryption key different from the authentication key may be used. As in the case of the authentication key, the encryption key may be regularly re-keyed, wherein the message generating or sender side 100 may provide appropriate key roll-over information to the message receiving or retrieving side 200. The encryption may be executed before calculating the MAC and/or the additional MAC such that the MAC 430 and/or the additional MAC 630 are calculated over the encrypted data block 420; and the data frame 400 and/or the additional data frame can be authenticated before decryption; alternatively the data block 420 and further parts of the data frame 400 and/or the additional data frame 600 can be encrypted after calculation of the MAC 430 and/or the additional MAC 630; in such a case, decryption is required before message authentication. The data frame 400 may further be transmitted or stored. This method element f may be executed by a transmission or storage module 160 in the device 100. For storage, any storage means such as an internal memory in the device 100, a cloud storage, an external data or event recorder, or removable storage medium may be used. For transmission, a transmission channel 700, such as radio transmission, a short range wireless network, WIFI, Bluetooth, cellular transmission, NFC, a low power long range wide area network, a wired or fiber-optic communication link, and/or powerline communication, may be employed. Storage means or transmission channel 700 may be communicatively coupled to the transmission or storage module 160. A further method element f2 may be transmitting or storing the additional data frame 600, in particular by the transmitting or storing module 160. To this end, the same transmission channel 700 or the same storage means as for transmitting or storing the data frame 400 may be used. Alternatively, also a different transmission channel, such as a different channel of a wireless network, or different storage means may be used to achieve higher reliability. The transmitting or storing module 160 may also be communicatively coupled to this different transmission channel or storage means.
[0102] Method elements carried out subsequently to transmitting or storing the data frame 400 may in particular be executed at a message receiving or retrieving side, in particular by a device 200 according to the fourth aspect of the present invention as, by way of example, schematically illustrated in
[0103] A further method element i may be decompressing, in particular by a decompression module 240, the compressed data block 420. This may be done previous or subsequent to verifying the MAC. In the latter case, the compressed data block 420 may only be decompressed in case of positive verification of the MAC 430 or, alternatively, the compressed data block 420 may be decompressed in any case. In case of no positive verification of the MAC 430, the compressed data block 420 or the data frame 400 may be rejected as schematically depicted, by way of example, in the flow diagram of
[0104] By way of example,
[0105] The method may further comprise the method element j of outputting the data block 300, 420, in particular, by an output module 250. The data block 420 may be output to a user or an application 260, in particular, only in case of positive verification of the MAC 430 and/or the additional MAC or in case the trust level is above a threshold of acceptance. The trust level may be output together with the data block 300, 420 such that the user or application can decide based on the trust level if and to which extent the information of the data block 300, 420 shall be processed further. E.g., below a certain trust level, the application/user may still use the data block for information purposes, but may not initiate certain actions based on the information of the data block; below another certain trust level, the data block may be completely discarded.
[0106] The third aspect of the present invention relates to a device for sending or generating authenticated messages 100, which is, by way of example, schematically depicted in
[0107]
[0108] While the invention has been described in detail in the drawings and foregoing description, such description is to be considered illustrative or exemplary and not restrictive. Variations to the disclosed embodiments can be understood and effected by those skilled in the art and practising the claimed invention, from a study of the drawings, the disclosure, and the appended claims. In the claims, the word “comprising” does not exclude other elements or steps, and the indefinite article “a” or “an” does not exclude a plurality. The mere fact that certain elements or steps are recited in distinct claims does not indicate that a combination of these elements or steps cannot be used to advantage, specifically, in addition to the actual claim dependency, any further meaningful claim combination shall be considered disclosed.
LIST OF REFERENCE SYMBOLS
[0109] 100 message source, sender side, message generating side, device for sending or generating authenticated messages [0110] 110 preparation module [0111] 120 compression module [0112] 130 encryption module [0113] 140 authentication module [0114] 150 message generation module [0115] 160 transmitting or storing module [0116] 200 message retrieving side, receiver side, device for receiving or retrieving authenticated messages [0117] 210 message retrieving module, receiving module [0118] 220 verification module [0119] 230 decryption module [0120] 240 decompression module [0121] 250 output module [0122] 260 user, application [0123] 300 data block, uncompressed data block [0124] 420 data block, compressed data block [0125] 400 data frame [0126] 410 data frame header, data item indicative of the compressed length, the block length, and/or the MAC length [0127] 430 MAC [0128] 600 additional data frame [0129] 610 header of additional message, data item indicative of the block length, the compressed length and/or the additional MAC length [0130] 630 additional MAC [0131] 700 transmission channel [0132] L.sub.B block length [0133] L.sub.U uncompressed length [0134] L.sub.C compressed length, length of the compressed data block [0135] L.sub.max maximum length [0136] L.sub.avail available length [0137] L.sub.MAC MAC length, length of the MAC [0138] L.sub.MAC2 additional MAC length, length of the additional MAC [0139] L.sub.H data frame header length