Fill data
The method generates messages with secure padding data by incorporating a random number and length representation, addressing inefficiencies and enhancing security in data processing and encryption.
Patent Information
- Authority / Receiving Office
- FR · FR
- Patent Type
- Applications
- Current Assignee / Owner
- STMICROELECTRONICS INT NV
- Filing Date
- 2024-10-16
- Publication Date
- 2026-04-17
AI Technical Summary
Existing methods for generating messages with padding data are inefficient and lack security, particularly in data processing and encryption, leading to potential information leaks and attacks.
A method for generating messages with padding data that includes a first part representing a random number and a second part representing the length of the padding data minus one, where the second part is equal to the rounded square root of the message length, enhancing security and efficiency.
This approach improves security by preventing certain attacks without relying on message authentication codes, while ensuring efficient padding data generation.
Smart Images

Figure 00000000_0000_ABST
Abstract
Description
Title of the invention: Filling data technical field
[0001] This description relates generally to electronic systems and devices, and their use of data. More specifically, this description relates to data management and processing, for example, data management during encryption. Previous technique
[0002] When electronic systems and devices need to use information, the format of that information is important for creating a message. It is common to standardize message formats by adding padding data to data representing information within a message.
[0003] It would be desirable to be able to improve, at least in part, certain aspects of data processing, and more particularly certain aspects of data filling processes. Summary of the invention
[0004] There is a need for a more efficient method of generating a fillable message comprising fillable data.
[0005] There is a need for a more secure method of generating a message including padding data.
[0006] There is a need for a more efficient method of generating filling data that includes information on the lengths of the filling data.
[0007] An embodiment overcomes all or part of the drawbacks of known methods of generating a message including filler data.
[0008] One embodiment provides a method for generating a message including filler data.
[0009] One embodiment provides an electronic device capable of implementing a method for generating a message comprising fill data.
[0010] One embodiment provides a computer program product capable of implementing a method for generating a message including fill data.
[0011] One embodiment provides a method for generating a message consisting of one or more blocks of a first number of bytes, said message comprising a first group of bytes containing data of said message and a second group of bytes corresponding to padding data of said message, in which said padding data comprises a first part of bits representing a random number and a second part of bits representing the length of said padding data minus one, in which a second number of bits of said second part of said padding data is equal to the rounded square root of said first number.
[0012] An embodiment provides an electronic device capable of generating a message comprising a first group of bytes comprising data of said message and a second group of bytes corresponding to padding data of said message, in which said padding data comprises a first part of bits representing a random number and a second part of bits representing the length of said padding data less one.
[0013] According to one embodiment, the second part of the bits is placed at the end of the padding data.
[0014] According to one embodiment, said first number is a power of two.
[0015] According to one embodiment, when said first number is equal to eight, said The second number in the second part of the said filling data is equal to three.
[0016] According to one embodiment, when said first number is equal to sixteen, said second number of bits of said second part of said filling data is equal to four.
[0017] According to one embodiment, when said first number is equal to thirty-two, said second number of bits of said second part of said filling data is equal to five.
[0018] According to one embodiment, the fill data is placed at the end of said message.
[0019] One embodiment provides a computer program product comprising instructions which, when the program is executed by a computer, cause the computer to perform the process described above.
[0020] One embodiment provides an encryption method comprising the method described above.
[0021] One embodiment provides an encryption device comprising the device described above. Brief description of the drawings
[0022] These features and advantages, as well as others, will be described in detail in the following description of particular embodiments, given by way of non-limiting example, in relation to the accompanying figures, among which:
[0023] [Fig.1] represents, in block form, an embodiment of an electronic device;
[0024] [Fig.2] represents, schematically and in block form, an example of a message;
[0025] Figure 3 represents, schematically and in block form, one way of conveying a message; and
[0026] [Fig.4] represents, schematically and in block form, an example of the embodiment of [Fig.3]. Description of the implementation methods
[0027] The same elements have been designated by the same reference numerals in the different figures. In particular, the structural and / or functional elements common to the different embodiments may have the same reference numerals and may have identical structural, dimensional and material properties.
[0028] For the sake of clarity, only the steps and elements useful for understanding the described embodiments have been represented and are detailed.
[0029] Unless otherwise specified, when referring to two elements connected together, this means directly connected without intermediate elements other than conductors, and when referring to two elements coupled together, this means that these two elements can be connected or linked through one or more other elements.
[0030] In the following description, when reference is made to absolute position qualifiers, such as the terms "front", "back", "top", "bottom", "left", "right", etc., or relative position qualifiers, such as the terms "above", "below", "superior", "inferior", etc., or to orientation qualifiers, such as the terms "horizontal", "vertical", etc., reference is made, unless otherwise specified, to the orientation of the figures.
[0031] Unless otherwise specified, the expressions "approximately", "roughly", and "in the order of" mean within 10%, preferably within 5%.
[0032] The embodiments described above relate to the management and processing of messages containing data when used in various situations. For example, when an electronic device needs to apply an algorithm, such as an encryption algorithm, certain aspects of the message format can be standardized, such as the message length. To meet these requirements, it is common practice to use padding data in a message to increase its length. The embodiments described above relate to a method for generating a message containing padding data. These embodiments also relate to an electronic device and a computer program product, both capable of performing such a method.
[0033] Furthermore, the embodiments described above are particularly suitable for use in all types of industrial markets where the use of filling data is necessary in data processing. More specifically, such a filling process and associated device may be intended for: - the automotive industry, for example in the field of car electrification or in the field of advanced driver assistance systems (ADAS); - the industrial sector, for example in the field of green energy, in the field of infrastructure electrification, the Internet of Things (IoT) and connected homes, for which energy consumption and data exchange are key elements; - the personal electronics industry, for example in the field of mobile telephony and the Internet of Things (IoT), and in the field of broadband interfaces; and - communication equipment, computers and peripherals, for example in the field of infrastructure and data centers, and in the field of low Earth orbit satellites.
[0034] Moreover, the embodiments described above are particularly suitable for use in any device using an encryption method, such as an encryption method using cipher block chaining (CBC).
[0035] Fig. 1 represents, very schematically and in block form, an electronic device 100 capable of implementing the process of generating a message including filling data.
[0036] Device 100 is an electronic device adapted for processing information and data in the form of messages. The structure of a message according to one embodiment is described with reference to Figures 2 to 4.
[0037] The device 100 includes a processor 101 (CPU) capable of processing data. In one example, the device 100 may include a plurality of processors, each adapted to processing different types of data. In a particular example, the device 100 may include at least one processor adapted to both data processing and filling data processing.
[0038] The device 100 further comprises one or a plurality of memories 102 (MEMs) in which data, for example critical data, are stored. By way of example, the device 100 comprises a plurality of memory types, such as ROM, RAM, volatile memory and / or non-volatile memory.
[0039] The device 100 further comprises one or more secure elements 103 (SE) adapted for processing sensitive and / or secret data. The secure element 103 may comprise its own processor(s), its own memory(ies), etc. Said One or more secure elements 103 may be integrated into or incorporated into device 100.
[0040] The device 100 further and optionally includes one or a plurality of input / output circuits 104 (IN / OUT) enabling the device 100 to transmit and / or receive data and / or energy with one or a plurality of external electronic devices.
[0041] The device 100 further includes one or a plurality of circuits 105 (FCT1) and 106 (FCT2) implementing one or a plurality of functionalities of the device 100. According to an example, the circuits 105 and 106 may include particular data processing circuits, such as encryption circuits, or circuits for performing measurements, such as sensors.
[0042] The device 100 further comprises one or a plurality of communication buses 107 enabling all the circuits of the device 100 to communicate. In [Fig. 1], a single bus 107 linking the processor 101, the memory(ies) 102, the secure element 103 and the circuits 104 to 106 is shown, but, in practice, the device 100 comprises a plurality of communication buses linking these different elements.
[0043] According to a particular example, the electronic device 100 is adapted to implement computer program products, and in particular a computer program product comprising instructions which, when the program is executed by a computer, cause the computer to perform data processing according to an embodiment.
[0044] According to one embodiment, the electronic device 100 may be a less complex electronic device capable of implementing the embodiments described above. According to one embodiment, the electronic device 100 may be a logic circuit, a controller, a finite state machine (FSM), or a field-programmable gate array (FPGA).
[0045] Fig. 2 represents, very schematically and in block form, an example of a 200-fillable message.
[0046] In this description, a message or data is defined as a group of data bits representing one or more pieces of information. When data is programmed in hexadecimal, it is common to refer to the size of a message in terms of the number of bytes, with one byte representing eight bits. Furthermore, it is common to divide a message into blocks of bytes of equal size. The size of a byte block is generally fixed by a communication protocol or an encryption algorithm.
[0047] In this description, a message or data with padding is a message or data comprising padding data, that is to say including several bits of data used solely to increase the length of the message or data.
[0048] Message 200 comprises data 201 (DD DD ... DD) representing information and padding data 202 (XX XX ... XX). The length of message 200 is given by the number N, where N is an integer, of bytes contained in one of the byte blocks constituting message 200, multiplied by the number of blocks constituting message 200. A number Nd, where Nd is an integer, of data bytes 201 is defined, and a number Np, where Np is an integer strictly greater than zero and less than or equal to N, of padding data bytes 202 is defined. The sum of the numbers Nd and Np is equal to a multiple of the number N.
[0049] For message 200, the presence of padding data is mandatory, so the length Np is greater than zero. If the length Nd of the data 201 is equal to the target size of message 200, the padding data 202 is always present in message 200 and its length Np is equal to the target size of message 200. In this case, message 200 has a length equal to twice the target size.
[0050] In the example shown in [Fig.2], the filler data 202 is placed at the end of message 200. However, it is obvious to a person skilled in the art that the filler data can be placed at the beginning of message 200, or within data 201.
[0051] According to one example, the padding data 201 may comprise Np bytes representing a random number, or representing formatted data such as "FF ... FF". According to another example, the padding data 201 may comprise one byte representing its length, i.e., the number Np. Depending on the data execution context, and according to one example, the composition of the padding data may be defined by a standard. In the context of encryption algorithms, according to ISO 10126, the last byte of the padding data represents the number Np, and the remaining bytes of the padding data represent the value FF.
[0052] A message of the type message 200 may also include a message authentication code (MAC) which is the result of a cryptographic operation intended to verify the integrity of a message. For example, the message authentication code may be part of the padding data.
[0053] Fig. 3 represents, very schematically and in block form, an embodiment of a 300-fill-in message.
[0054] Message 300 comprises data 301 (DD DD ... DD) representing information and padding data 302 (XX XX ... XX). As with message 200 in [Fig. 2], the length of message 300 is given by the number N, where N is an integer, of bytes contained in one of the byte blocks forming the The number of data bytes in message 300 is multiplied by the number of blocks forming message 300. A number Nd, where Nd is an integer, is defined as the number of data bytes 301, and a number Np, where Np is an integer strictly greater than zero and less than or equal to N plus one (N+1), is defined as the number of padding data bytes 302. In one embodiment, Np is greater than one and less than N plus one (N+1). The sum of Nd and Np is equal to a multiple of N.
[0055] For message 300, the presence of padding data is mandatory, so the length Np is greater than zero. If the length Nd of the data 301 is equal to the target size of message 300, the padding data 302 is always present in message 300 and its length Np is equal to the target size of message 300. In this case, message 300 has a length equal to twice the target size.
[0056] In one embodiment, the padding data 302 is separated into two groups of bits. A first group of bits represents a true random number, and a second group of bits represents information relating to the length Np of the padding data 302. In one embodiment, this information is not equal to the length Np. In another embodiment, this information is equal to the length Np minus one.
[0057] According to a preferred example, the second part of the bits in the padding data 302 comprises p bits, p being an integer equal to the rounded square root of the number N of bytes in the message 300. According to an example: - when the number N is equal to eight, the number of bits of said second part of said filling data is equal to three; - when the number N is equal to sixteen, the number of bits of said second part of said filling data is equal to four (this example is illustrated in [Fig.4]); - when the number N is equal to thirty-two, the number of bits in the second part of the said padding data is equal to five; and - when the number N is equal to five hundred and twelve, the number of bits of said second part of said filling data is equal to nine, that is to say more than one byte.
[0058] In one example, the second bit set is placed at the end of the padding data. In another variant, the second bit set is placed at the beginning of the padding data within the first bit set. Considering this variant, the location of the second bit set is defined by the device using message 301.
[0059] According to one embodiment, a method for generating message 300 includes generating the padding data 302 as defined previously, and then adding this padding data 302 to the data 301.
[0060] According to one embodiment, said message generation method 300 can be used in a data encryption method.
[0061] [Fig.4] represents, very schematically and in block form, an embodiment of a 400-fill message. The 400 message is a practical example of the 300-fill message described in relation to [Fig.3].
[0062] According to one example, the 400-byte padding message comprises one or more blocks of sixteen bytes, and in this case, the second part of the padding data bits comprises four bits, which corresponds to half a byte. According to a preferred example, this second part of the padding data bits is placed at the end of the padding data.
[0063] The use of messages comprising one or more blocks of sixteen bytes is very common, particularly in encryption, ciphering, and cryptography techniques. Programming information using four bits, or half a byte, allows this information to be hidden. When the information is equal to the number Np minus one, all possible sizes of padding data can be covered with only the four bits.
[0064] One advantage of this embodiment is that it improves security by preventing certain attacks. More specifically, one type of attack relies on triggering an invalid combination of padding data to access certain information about the data. Several countermeasures are commonly used to overcome this type of attack, and most of them use a message authentication code. The embodiment proposed here is capable of overcoming this type of attack without using a message authentication code, which can lead to information leaks.
[0065] Various embodiments and variations have been described. A person skilled in the art will understand that certain features of these various embodiments and variations could be combined, and other variations will become apparent to a person skilled in the art.
[0066] Finally, the practical implementation of the embodiments and variants described is within the reach of a person skilled in the art, based on the functional indications given above.
Claims
Demands
1. A method for generating a message (300; 400) formed by one or more blocks of a first number (N) of bytes, said message (300; 400) comprising a first group of bytes (301; 401) comprising data of said message (300; 400) and a second group of bytes (302; 402) corresponding to padding data of said message (300; 400), in which said padding data (302; 402) comprises a first part of bits representing a random number and a second part of bits representing the length (Np) of said padding data (302; 402) minus one, in which a second number (Np) of bits of said second part of said padding data (302; 402) is equal to the rounding of the square root of said first number (N).
2. Method according to claim 1, wherein the second part of the bits is placed at the end of the padding data (302; 402).
3. Method according to claim 1 or 2, wherein said first number (N) is a power of two.
4. A method according to claim 3, wherein, when said first number (N) is equal to eight, said second number (Np) of said second part of said filling data (302; 402) is equal to three.
5. A method according to claim 3, wherein, when said first number (N) is equal to sixteen, said second number (Np) of bits of said second part of said padding data (302; 402) is equal to four.
6. A method according to claim 3, wherein, when said first number (N) is equal to thirty-two, said second number (Np) of bits of said second part of said padding data (302; 402) is equal to five.
7. A method according to any one of claims 1, 3 to 6, wherein the fill data (302; 402) are placed at the end of said message.
8. Product computer program comprising instructions which, when the program is executed by a computer, cause the computer to perform the process according to any one of claims 1, 3 to 7.
9. Encryption method comprising the method according to any one of claims 1, 3 to 7.
10. Electronic device capable of generating a message (300; 400) comprising a first group of bytes (301; 401) comprising data of said message (300; 400) and a second group of bytes (302; 402) corresponding to padding data of said message (300; 400), wherein said padding data (302; 402) comprises a first part of bits representing a random number and a second part of bits representing the length of said padding data (302; 402) minus one.
11. Encryption device comprising the device according to claim 10.
Citation Information
Patent Citations
Device and method for implementing a cryptographic HASH function
WO2011097702A1
Secure encryption of partial blocks
WO2023052869A1