NearMDS transformation method and device, equipment and storage medium

By generating random bit strings and performing multi-level linear transformation, the big resource occupation problem caused by high-dimensional density of nearMDS transformation matrix is ​​solved, and efficient and secure nearMDS transformation is achieved, and data integrity and reliability are improved.

CN119652505AActive Publication Date: 2025-03-18WUHAN SHIP COMM RES INST (NO 722 RES INST OF CHINA STATE SHIPBUILDING CORP)
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202411738849.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-29
Publication Date
2025-03-18
Estimated Expiration
2044-11-29

AI Technical Summary

Technical Problem

In the prior art, nearMDS transformation matrix based on finite domain construction is usually high-dimensional and dense, resulting in large resource occupancy and making it difficult to achieve efficient implementation of software and hardware.

Method used

The first character string, the first inverse string, the second inverse string and the second inverse string are generated by randomly generated preset bits, and these strings are expanded through multi-step and multi-level linear transformations, and finally generate nearMDS transformation output through exclusive OR operation.

Benefits of technology

It increases the randomness and complexity of data, improves the security and efficiency of transformations, reduces the storage space requirements, and improves the integrity and reliability of data through data redundancy.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119652505A_ABST
    Figure CN119652505A_ABST
Patent Text Reader

Abstract

The invention discloses a nearMDS transformation method, device and equipment and a storage medium, and relates to the technical field of password encryption, and the method comprises the steps: connecting a randomly generated first random number or second random number of a preset bit to obtain a first character string, a first negation character string, a second character string and a second negation character string; inputting the first character string and the first negation character string into first linear transformation for expansion to obtain a first expansion set; inputting the second character string and the second negation character string into second linear transformation for expansion to generate a second expansion set; and performing exclusive-or operation on elements in the first extension set and the second extension set to obtain nearMDS transformation output. The linear transformation has high calculation efficiency, and complex linear operation is avoided through simple connection, negation, cyclic shift and AND and XOR operation, so that the transformation speed and efficiency are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of cryptographic encryption technology, and more specifically, to a nearMDS transformation method, apparatus, device and storage medium. Background Art

[0002] With the continuous development of Internet of Things technology, the use of resource-constrained devices such as RFID (Radio Frequency Identification) and wireless sensors has penetrated into all aspects of people's lives, and the security issues of the Internet of Things are becoming increasingly severe. Lightweight cryptography is used for the security protection of resource-constrained devices on the Internet of Things with its advantages of simple design, efficient calculation and low resource consumption.

[0003] There are many construction methods for MDS transformation in the prior art, mainly including: based on linear code, special matrix (circular matrix, Hadamard matrix, Cauchy matrix, Toeplitz matrix, etc.), linear feedback shift register, circular shift XOR operation, etc. The number of differential branches and linear branches of nearMDS transformation reaches the sub-maximum, which is called sub-optimal diffusion transformation. Although nearMDS transformation diffusion has higher software and hardware implementation efficiency, it can provide a balance point for the security and implementation efficiency of cryptographic algorithms.

[0004] However, compared with the MDS transformation, there are relatively few existing nearMDS transformation methods, and the existing nearMDS transformation methods are generally based on the nearMDS transformation constructed in a finite field. Since the matrix of the nearMDS transformation is usually high-dimensional and dense, there are problems such as large resource occupation and inconvenience in software and hardware implementation when implementing the transformation, which cannot meet the application requirements of cryptographic algorithms. Summary of the invention

[0005] In view of the defects of the prior art and the need for improvement, the present invention provides a nearMDS transformation method, apparatus, device and storage medium, which are used to solve the problem that the nearMDS transformation matrix constructed based on a finite field in the prior art is usually high-dimensional and dense, resulting in large resource consumption and being unfavorable for software and hardware implementation when implementing the transformation.

[0006] To achieve the above object, according to a first aspect of the present invention, a nearMDS transformation method is provided, comprising:

[0007] Concatenate the first random number or the second random number of preset bits randomly generated to obtain a first character string, a first inverted character string, a second character string, and a second inverted character string;

[0008] Inputting the first character string and the first inverted character string into a first linear transformation for expansion to obtain a first expansion set;

[0009] Inputting the second character string and the second inverted character string into a second linear transformation for expansion to generate a second expansion set;

[0010] Perform XOR operations on the elements in the first extended set and the second extended set respectively to obtain the nearMDS transformation output.

[0011] In a possible implementation, the first random number or the second random number of the preset bits randomly generated is concatenated to obtain a first string, a first inverted string, a second string, and a second inverted string, further comprising:

[0012] Concatenate a first number of first random numbers to generate a first string, and invert the first string bit by bit to generate a first inverted string;

[0013] A second number of first random numbers and a second number of second random numbers are concatenated to generate a second character string, and the second character string is bitwise inverted to generate a second inverted character string.

[0014] In one possible implementation, the input of the first linear transformation is X∈{0,1} 4·m , the output of the first linear transformation is Y i (X,u)∈{0,1} 4·m , where m is a positive integer, u is the first character string, and i=1, 2, …, 12.

[0015] In a possible implementation, the first character string and the first inverted character string are input into a first linear transformation for expansion to obtain a first extended set, further comprising:

[0016] Input the first string and the first inverted string, expand the first linear transformation input X to obtain the first initial set set1 = {X, X <<<m ,X <<<2·m ,X <<<3·m};

[0017] Randomly select two elements from the first initial set set1 and perform AND operation with the first string u and the first negated string ū respectively, and keep the remaining two elements unchanged to generate the first extended set set2;

[0018] Among them, "X <<<m ”, “X <<<2·m ”, “X <<<3·m ” respectively denotes X cyclically shifted left by m bits, 2·m bits, and 3·m bits.

[0019] In one possible implementation, the input of the second linear transformation is X∈{0,1} 4·m , the output of the second linear transformation is Z i(X,v)∈{0,1} 4·m , where m is a positive integer, v is the second character string, and i=1, 2, …, 4.

[0020] In a possible implementation, the second character string and the second inverted character string are input into a second linear transformation for expansion to generate a second extended set, further comprising:

[0021] Input the second string and the second inverted string, expand the second linear transformation input X to obtain the second initial set set3 = {X, X <<<m ,X <<<2·m ,X <<<3·m};

[0022] From the second initial set set3, the second string v and the second inverted string are respectively obtained according to the preset combination. Perform an AND operation to generate the second extended set set4;

[0023] Among them, "X 1<<m ”, “X <<<2·m ”, “X <<<3·m ” respectively denotes X cyclically shifted left by m bits, 2·m bits, and 3·m bits.

[0024] In a possible implementation, performing an XOR operation on the elements in the first extended set and the elements in the second extended set respectively to obtain a nearMDS transformation output, further comprising:

[0025] According to the input and output logic of the first linear transformation, the elements of the first extended set are subjected to an XOR operation to obtain a first nearMDS transformation output;

[0026] According to the input and output logic of the second linear transformation, the elements of the second extended set are XORed to obtain a second nearMDS transformation output.

[0027] According to a second aspect of the present invention, there is also provided a nearMDS conversion device, comprising:

[0028] A concatenation module, configured to concatenate a first random number or a second random number of preset bits randomly generated to obtain a first string, a first inverted string, a second string, and a second inverted string;

[0029] A first expansion module is configured to input the first string and the first inverted string into a first linear transformation for expansion to obtain a first expansion set;

[0030] A second expansion module is configured to input the second string and the second inverted string into a second linear transformation for expansion to generate a second expansion set;

[0031] The transformation module is configured to perform an XOR operation on the elements in the first extended set and the elements in the second extended set respectively to obtain a nearMDS transformation output.

[0032] According to the third aspect of the present invention, a nearMDS transformation device is also provided, which includes at least one processing unit and at least one storage unit, wherein the storage unit stores a computer program, and when the computer program is executed by the processing unit, the processing unit performs any step of the above-mentioned nearMDS transformation method.

[0033] According to a fourth aspect of the present invention, there is also provided a storage medium storing a computer program executable by an access authentication device, wherein when the computer program runs on the access authentication device, the access authentication device executes any one of the steps of the nearMDS transformation method described above.

[0034] In general, the above technical solutions conceived by the present invention can achieve the following beneficial effects compared with the prior art:

[0035] The present invention provides a nearMDS transformation method, which increases the randomness and complexity of data by connecting a first random number and a second random number of preset bits randomly generated, and generating a first string, a first inverted string, a second string, and a second inverted string respectively. Two different linear transformation strings are expanded by a multi-step and multi-level transformation method of a first linear transformation and a second linear transformation, making it difficult for attackers to predict and crack, thereby enhancing the overall security. Linear transformation has high computational efficiency. The method avoids complex linear operations through simple connection, inversion, circular shift, and and XOR operations, thereby improving the efficiency of transformation. At the same time, since the method does not require additional storage resources to save intermediate results, storage space is also saved. By generating a first extended set and a second extended set, and performing XOR operations on the elements in the sets, the method increases the redundancy of data during the transformation process, helps to detect and correct errors during data transmission or storage, and improves the integrity and reliability of data. BRIEF DESCRIPTION OF THE DRAWINGS

[0036] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0037] Figure 1 A schematic diagram of a flow chart of an embodiment of a nearMDS transformation method provided by the present invention;

[0038] Figure 2 A schematic diagram of the structure of an embodiment of a nearMDS conversion device provided by the present invention;

[0039] Figure 3 A schematic diagram of the structure of a nearMDS conversion device provided in an embodiment of the present invention. DETAILED DESCRIPTION

[0040] In order to make the purpose, technical solutions and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention. In addition, the technical features involved in the various embodiments of the present invention described below can be combined with each other as long as they do not conflict with each other.

[0041] The terms "first", "second", "third", etc. in the specification and claims of this application and the above-mentioned drawings are used to distinguish different objects, rather than to describe a specific order. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device that includes a series of steps or units is not limited to the listed steps or units, but optionally includes steps or units that are not listed, or optionally includes other steps or units inherent to these processes, methods, products or devices.

[0042] The present invention provides a nearMDS transformation method, apparatus, device and storage medium, which are described below respectively.

[0043] See also Figure 1 , Figure 1 A flowchart of an embodiment of a nearMDS transformation method provided by the present invention is provided. In a specific embodiment of the present invention, a nearMDS transformation method is disclosed, including:

[0044] S101, concatenating a first random number or a second random number of preset bits randomly generated to obtain a first character string, a first inverted character string, a second character string, and a second inverted character string;

[0045] S102, inputting the first character string and the first inverted character string into a first linear transformation for expansion to obtain a first expansion set;

[0046] S103, inputting the second character string and the second inverted character string into a second linear transformation for expansion to generate a second expansion set;

[0047] S104 , performing an XOR operation on the elements in the first extended set and the elements in the second extended set respectively to obtain a nearMDS transformation output.

[0048] In the above embodiment, two sets of independent random numbers, namely, the first random number and the second random number, are randomly generated according to the preset bit length m. The first random number and the second random number can be used to constitute the original input of the transformation, and their randomness helps to enhance the security of the transformed data. The first random numbers are concatenated (i.e., spliced ​​in sequence) to form a first string, and all bits thereof are inverted to obtain a first inverted string; similarly, the first random number and the second random number are concatenated to form a second string, and all bits thereof are inverted to generate a second inverted string. Through the concatenation and inversion operations, the complexity and diversity of the input data are increased.

[0049] The first string and the first inverted string are input to the first linear transformation module for expansion. It can be understood that linear transformation is a mathematical operation that maintains the linear relationship of data, which can usually be implemented by matrix multiplication or vector addition. The output of the first linear transformation will constitute a first extended set, which contains multiple transformed elements, which are linearly expanded and transformed based on the original data.

[0050] Similarly, the second string and the second inverted string are input into the second linear transformation module for expansion. It should be noted that the second linear transformation can be the same as the first linear transformation or different, depending on the specific application scenario and security requirements. The output of the second linear transformation will constitute a second extended set, which also includes multiple transformed elements.

[0051] The elements in the first extended set and the second extended set are subjected to an XOR operation. The XOR operation is a binary operation. For two input elements, if they are the same, 0 is output, and if they are different, 1 is output. By combining the elements of the two extended sets, the complexity and security of the transformed data are further increased. The output of the XOR operation will be used as the final output of the nearMDS transformation, which can be used for subsequent encryption, decryption, data integrity verification and other operations.

[0052] Compared with the prior art, the nearMDS transformation method provided in this embodiment increases the randomness and complexity of the data by connecting the first random number and the second random number of the preset bits randomly generated, and generating the first string, the first inverted string, the second string and the second inverted string respectively. The two different linear transformation strings are expanded by the multi-step and multi-level transformation method of the first linear transformation and the second linear transformation, making it difficult for attackers to predict and crack, thereby enhancing the overall security. Linear transformation has high computational efficiency. The method avoids complex linear operations through simple connection, inversion, circular shift, and and XOR operations, thereby improving the efficiency of the transformation. At the same time, since the method does not require additional storage resources to save intermediate results, it also saves storage space. By generating the first extended set and the second extended set, and performing XOR operations on the elements in the set, the method increases the redundancy of the data during the transformation process, helps to detect and correct errors during data transmission or storage, and improves the integrity and reliability of the data.

[0053] In some embodiments of the present invention, the first random number or the second random number of the preset bits randomly generated is concatenated to obtain the first string, the first inverted string, the second string, and the second inverted string, further comprising:

[0054] Concatenate a first number of first random numbers to generate a first string, and invert the first string bit by bit to generate a first inverted string;

[0055] A second number of first random numbers and a second number of second random numbers are concatenated to generate a second character string, and the second character string is bitwise inverted to generate a second inverted character string.

[0056] In the above embodiment, two types of random numbers need to be generated. The first random number and the second random number can be binary bit sequences generated based on a pseudo-random number generation algorithm (such as a linear congruential generator) or a true random number generator (such as a physical noise source).

[0057] It should be noted that the first random number and the second random number may differ in distribution, range or generation method, depending on application requirements. For example, the first random number may be used to provide basic randomness, while the second random number may have specific statistical properties or be used to increase complexity.

[0058] In view of the problems that nearMDS transformation on finite fields occupies large resources and is not conducive to software and hardware implementation, the present invention proposes a nearMDS transformation method with a differential branch number and a linear branch number of 4 based on simple cyclic shift, XOR and AND operations, and sets the first number to 4, which represents the number of first random numbers constituting the first string. Then, according to the preset bits, a first random number with preset bits is randomly generated, and the first random numbers of the first number are connected to form a complete binary string, namely the first string. The first string is bitwise inverted. If a bit in the first string is 1, the bit at the corresponding position in the first inverted string will be set to 0; vice versa, thereby generating a complementary version of the first string, namely the first inverted string.

[0059] Similarly, the second number in the present invention is set to 2, and 2 numbers are selected from the first random number and the second random number to generate the second string, which can also realize the nearMDS transformation method with 4 differential branches and linear branches. Two numbers are randomly selected from the generated first random number and the second random number, and they are concatenated to form a binary string containing two preset bit random numbers, that is, the second string. Similar to the generation of the first inverted string, the second string is bitwise inverted to generate a complementary version of the second string, that is, the second inverted string.

[0060] In some embodiments of the present invention, the input of the first linear transformation is X∈{0,1} 4·m , the output of the first linear transformation is Y i (X,u)∈{0,1} 4·m , where m is a positive integer, u is the first character string, and i=1, 2, …, 12.

[0061] In some embodiments of the present invention, the first character string and the first inverted character string are input into a first linear transformation for expansion to obtain a first extended set, further comprising:

[0062] Input the first string and the first inverted string, expand the input X of the first linear transformation to obtain the first initial set set1 = {X, X <<<m ,X <<<2·m ,X <<<3·m};

[0063] Randomly select two elements from the first initial set set1 and add them to the first string u and the first inverted string respectively. Perform an AND operation, and keep the remaining two elements unchanged, generating the first extended set set2;

[0064] Among them, "X <<<m ”, “X <<<2·m ”, “X <<<3·m” respectively denotes X cyclically shifted left by m bits, 2·m bits, and 3·m bits.

[0065] In the above embodiment, 4·m bits of u and The input X of the first linear transformation is expanded to generate a set set1 = {X, X <<<m ,X <<<2·m ,X <<<3·m}, randomly select two elements from set1 and compare them with u and Perform an AND operation, keep the other two elements unchanged, and generate a new set set2, which is the first extended set.

[0066] In some embodiments of the present invention, the input of the second linear transformation is X∈{0,1} 4·m , the output of the second linear transformation is Z i (X,v)∈{0,1} 4·m , where m is a positive integer, v is the second character string, and i=1, 2, …, 4.

[0067] In some embodiments of the present invention, the second string and the second inverted string are input into a second linear transformation for expansion to generate a second extended set, further comprising:

[0068] Input the second string and the second inverted string, expand the second linear transformation input X to obtain the second initial set set3 = {X, X <<<m ,X <<<2·m ,X <<<3·m};

[0069] From the second initial set set3, the second string v and the second inverted string are respectively obtained according to the preset combination. Perform an AND operation to generate the second extended set set4;

[0070] Among them, "X <<<m ”, “X <<<2·m ”, “X <<<3·m ” respectively denotes X cyclically shifted left by m bits, 2·m bits, and 3·m bits.

[0071] In the above embodiment, 4·m bits of v and The second linear transformation input X is expanded to generate a set set3 = {X, X <<<m ,X <<<2·m ,X <<<3·m}. Select two elements (X, X) from set3 <<<m ) or (X <<<m , X <<<3·m ) or (X <<<2·m , X) or (X <<<3·m , X<<<m ) and v, Perform an AND operation, keep the other two elements unchanged, and generate a new set set4.

[0072] In some embodiments of the present invention, performing an XOR operation on the elements in the first extended set and the second extended set respectively to obtain a nearMDS transformation output further includes:

[0073] According to the input and output logic of the first linear transformation, the first extended set is XORed to obtain a first nearMDS transformation output;

[0074] According to the input and output logic of the second linear transformation, the second extended set is XORed to obtain a second nearMDS transformation output.

[0075] In the above embodiment, the preset bit is m, the first random number a∈{0,1} m , the first string u=(a∥a∥a∥a)∈{0,1} 4·m , first negate string For input X∈{0,1} 4·m , the output is Y i (X,u)∈{0,1} 4·m The first linear transformation of can obtain 12 transformation results:

[0076]

[0077]

[0078] The above linear transformation Y i (X,u)∈{0,1} 4·m They are nearMDS transformations with a differential branch number and a linear branch number equal to 4, and Y2(X,u) and Y8(X,u) are also involutive transformations. The above linear transformations satisfy: Among them, "·" represents multiplication operation, "<<<" represents circular left shift operation, and "&" represents AND operation. It represents XOR operation, and “∥” represents bit concatenation.

[0079] The preset bit is m, the first random number a∈{0,1} m , the second random number c∈{0,1} m , the second string v = (a∥c∥a∥c), the second inverted string For input X∈{0,1} 4·m , the output is Z i (X,v)∈{0,1} 4·m The second linear transformation of can obtain 4 transformation results:

[0080]

[0081] Then, the above linear transformation Z i (X,v) are nearMDS transformations with a difference branch number and a linear branch number equal to 4, and Z1(X,v) and Z3(X,v) are also involution transformations. The above linear transformations satisfy:

[0082] It should be noted that the number of branches, the number of differential branches, and the number of linear branches: Assume that the linear transformation θ:(F2 m ) n →(F2 m ) n , x→θ(x)=x·A, then the number of branches of θ transformation B(θ) and the number of differential branches B d (θ), linear branch number B l (θ) is:

[0083]

[0084] in, A is The n-order square matrix, w(x) represents non-zero x i (1≤i≤n), w(β) represents the number of non-zero β i The number of (1≤i≤n), "T" represents the transposition operation, and "‖" represents the bit series connection. Represents an n-dimensional vector space, where the vector length is m 0 / 1 bits.

[0085] Involution transformation: Let linear transformation x→θ(x)=x·A, which is The n-order square matrix, A -1 is the inverse matrix of A, and I is The n-th order identity matrix. If A All of them can satisfy θ(θ(x))=θ(x·A)=x·A·A=x·I, that is, A·A=I, A -1 =A, then the θ transformation is called an involution transformation.

[0086] MDS transformation, nearMDS matrix, almostMDS matrix: Assume linear transformation x→θ(x)=x·A, the number of differential branches of θ transformation is B d (θ), the number of linear branches is B l (θ). If B d (θ) = B l (θ) = n + 1, then θ is called MDS transformation; if B d (θ) = B l(θ) = n, then θ is called nearMDS transformation; if B d (θ) = n, B l (θ)≠n, then θ is called the alomostMDS transformation.

[0087] In order to better implement the nearMDS transformation method in the embodiment of the present invention, based on the nearMDS transformation method, correspondingly, please refer to Figure 2 , Figure 2 This is a structural diagram of an embodiment of a nearMDS conversion device provided by the present invention. The embodiment of the present invention provides a nearMDS conversion device 200, including:

[0088] A concatenation module 210, configured to concatenate the first random number or the second random number of preset bits randomly generated to obtain a first string, a first inverted string, a second string, and a second inverted string;

[0089] A first expansion module 220 is configured to input the first string and the first inverted string into a first linear transformation for expansion to obtain a first expansion set;

[0090] A second expansion module 230 is configured to input the second string and the second inverted string into a second linear transformation for expansion to generate a second expansion set;

[0091] The transformation module 240 is configured to perform an XOR operation on the elements in the first extended set and the elements in the second extended set respectively to obtain a nearMDS transformation output.

[0092] It should be noted here that: the device 200 provided in the above embodiment can implement the technical solutions described in the above method embodiments. The specific implementation principles of the above modules or units can refer to the corresponding contents in the above method embodiments, which will not be repeated here.

[0093] See also Figure 3 , Figure 3 The schematic diagram of the structure of the nearMDS conversion device provided by the embodiment of the present invention. Based on the above nearMDS conversion method, the present invention also provides a nearMDS conversion device, which can be a computing device such as a mobile terminal, a desktop computer, a notebook, a palmtop computer and a server. The nearMDS conversion device 300 includes a processor 310, a memory 320 and a display 330. Figure 3 Only some of the components of the nearMDS transformation device are shown, but it should be understood that it is not required to implement all of the components shown, and more or fewer components may be implemented instead.

[0094] In some embodiments, the memory 320 may be an internal storage unit of the nearMDS conversion device 300, such as a hard disk or memory of the nearMDS conversion device 300. In other embodiments, the memory 320 may also be an external storage device of the nearMDS conversion device 300, such as a plug-in hard disk, a smart memory card (SmartMedia Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), etc. equipped on the nearMDS conversion device 300. Further, the memory 320 may also include both the internal storage unit of the nearMDS conversion device 300 and an external storage device. The memory 320 is used to store application software and various data installed in the nearMDS conversion device 300, such as the program code for installing the nearMDS conversion device 300. The memory 320 may also be used to temporarily store data that has been output or is to be output. In one embodiment, a nearMDS transformation program 340 is stored in the memory 320 , and the nearMDS transformation program 340 can be executed by the processor 310 , thereby implementing the nearMDS transformation method of each embodiment of the present application.

[0095] In some embodiments, the processor 310 may be a central processing unit (CPU), a microprocessor or other data processing chip, used to run program codes stored in the memory 320 or process data, such as executing the nearMDS transformation method.

[0096] In some embodiments, the display 330 may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, an OLED (Organic Light-Emitting Diode) touch device, etc. The display 330 is used to display information on the nearMDS conversion device 300 and to display a visual user interface. The components 310-330 of the nearMDS conversion device 300 communicate with each other via a system bus.

[0097] In one embodiment, when the processor 310 executes the nearMDS transformation program 340 in the memory 320 , the steps in the above nearMDS transformation method are implemented.

[0098] This embodiment further provides a computer-readable storage medium, on which a nearMDS transformation program 340 is stored. When the nearMDS transformation program 340 is executed by a processor, the following steps are implemented:

[0099] Concatenate the first random number or the second random number of preset bits randomly generated to obtain a first character string, a first inverted character string, a second character string, and a second inverted character string;

[0100] Inputting the first character string and the first inverted character string into a first linear transformation for expansion to obtain a first expansion set;

[0101] Inputting the second character string and the second inverted character string into a second linear transformation for expansion to generate a second expansion set;

[0102] Perform XOR operations on the elements in the first extended set and the second extended set respectively to obtain the nearMDS transformation output.

[0103] In summary, the present invention provides a nearMDS transformation method, which increases the randomness and complexity of data by connecting the first random number and the second random number of the preset bits randomly generated, and generating the first string, the first inverted string, the second string and the second inverted string respectively. The two different linear transformation strings are expanded by the multi-step and multi-level transformation method of the first linear transformation and the second linear transformation, making it difficult for attackers to predict and crack, thereby enhancing the overall security. Linear transformation has high computational efficiency. The method avoids complex linear operations through simple connection, inversion, circular shift, and and XOR operations, thereby improving the efficiency of transformation. At the same time, since the method does not require additional storage resources to save intermediate results, storage space is also saved. By generating the first extended set and the second extended set, and performing XOR operations on the elements in the set, the method increases the redundancy of data during the transformation process, helps to detect and correct errors during data transmission or storage, and improves the integrity and reliability of data.

[0104] The present application also provides a computer-readable storage medium on which a computer program is stored, and when the program is executed by a processor, the steps of the above method are implemented. The computer-readable storage medium may include, but is not limited to, any type of disk, including a floppy disk, an optical disk, a DVD, a CD-ROM, a micro drive, and a magneto-optical disk, a ROM, a RAM, an EPROM, an EEPROM, a DRAM, a VRAM, a flash memory device, a magnetic card or an optical card, a nanosystem (including a molecular memory IC), or any type of medium or device suitable for storing instructions and / or data.

[0105] It should be noted that, for the aforementioned method embodiments, for the sake of simplicity, they are all expressed as a series of action combinations, but those skilled in the art should be aware that the present application is not limited by the described order of actions, because according to the present application, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the present application.

[0106] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0107] In the several embodiments provided in the present application, it should be understood that the disclosed devices can be implemented in other ways. For example, the device embodiments described above are only schematic, such as the division of the units, which is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some service interfaces, and the indirect coupling or communication connection of devices or units can be electrical or other forms.

[0108] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0109] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0110] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable memory. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a memory, including a number of instructions to enable a computer device (which can be a personal computer, server or network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned memory includes: U disk, read-only memory (ROM), random access memory (RAM), mobile hard disk, disk or optical disk and other media that can store program code.

[0111] A person of ordinary skill in the art can understand that all or part of the steps in the various methods of the above embodiments can be completed by hardware related to program instructions. The program can be stored in a computer-readable memory, and the memory can include: a flash drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, etc.

[0112] The above is only an exemplary embodiment of the present disclosure, and the scope of the present disclosure cannot be limited thereto. That is, any equivalent changes and modifications made according to the teachings of the present disclosure are still within the scope of the present disclosure. After considering the specification and practice, those skilled in the art will easily think of the implementation scheme of the present disclosure. This application is intended to cover any modification, use or adaptation of the present disclosure, which follows the general principles of the present disclosure and includes common knowledge or customary technical means in the technical field not recorded in the present disclosure. The description and examples are regarded as exemplary only, and the scope and spirit of the present disclosure are defined by the claims.

[0113] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0114] It will be easily understood by those skilled in the art that the above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention should be included in the protection scope of the present invention.

Claims

1. A nearMDS transformation method, characterized in that: include: Concatenate the first random number or the second random number of preset bits randomly generated to obtain a first character string, a first inverted character string, a second character string, and a second inverted character string; Inputting the first character string and the first inverted character string into a first linear transformation for expansion to obtain a first expansion set; Inputting the second character string and the second inverted character string into a second linear transformation for expansion to generate a second expansion set; Perform an XOR operation on the elements in the first extended set and the second extended set respectively to obtain a nearMDS transformation output.

2. The nearMDS transformation method according to claim 1, characterized in that: The method of concatenating the first random number or the second random number of the preset bits randomly generated to obtain the first string, the first inverted string, the second string, and the second inverted string also includes: Concatenate a first number of first random numbers to generate the first character string, and invert the first character string bit by bit to generate a first inverted character string; A second number of first random numbers and a second number of second random numbers are concatenated to generate the second character string, and the second character string is bitwise inverted to generate a second inverted character string.

3. The nearMDS transformation method according to claim 1, characterized in that: The input of the first linear transformation is X∈{0,1} 4·m , the output of the first linear transformation is Y i (X,u)∈{0,1} 4·m , where m is a positive integer, u is the first character string, and i=1, 2, …, 12.

4. The nearMDS transformation method according to claim 3, characterized in that: The step of inputting the first character string and the first inverted character string into a first linear transformation for expansion to obtain a first extended set further includes: Input the first string and the first inverted string, expand the first linear transformation input X to obtain a first initial set set1 = {X, X <<<m ,X <<<2·m ,X <<<3·m }; Randomly select two elements from the first initial set set1 and add them to the first string u and the first inverted string Perform an AND operation, and keep the remaining two elements unchanged, generating the first extended set set2; Among them, "X <<<m ”、"X <<<2·m ”、"X <<<3·m ” respectively denotes X cyclically shifted left by m bits, 2·m bits, and 3·m bits.

5. The nearMDS transformation method according to claim 3, characterized in that: The input of the second linear transformation is X∈{0,1} 4·m , the output of the second linear transformation is Z i (X, v)∈{0,1} 4·m , where m is a positive integer, v is the second character string, and i=1, 2, …, 4.

6. The nearMDS transformation method according to claim 5, characterized in that: Inputting the second character string and the second inverted character string into a second linear transformation for expansion to generate a second expansion set, further comprising: The second character string and the second inverted character string are input, and the second linear transformation input X is expanded to obtain a second initial set set3 = {X, X <<<m , X <<<2·m , X <<<3·m }; From the second initial set set3, the second string v and the second inverted string are respectively obtained according to the preset combination. Perform an AND operation to generate the second extended set set4; Among them, "X <<<m ”、"X <<<2·m ”、"X <<<3·m ” respectively denotes X cyclically shifted left by m bits, 2·m bits, and 3·m bits.

7. The nearMDS transformation method according to claim 5, characterized in that: Performing an XOR operation on the elements in the first extended set and the second extended set respectively to obtain a nearMDS transformation output, further comprising: According to the input and output logic of the first linear transformation, performing an XOR operation on the elements of the first extended set to obtain a first nearMDS transformation output; According to the input and output logic of the second linear transformation, the elements of the second extended set are subjected to an XOR operation to obtain a second nearMDS transformation output.

8. A nearMDS conversion device, characterized in that: include: A concatenation module, configured to concatenate a first random number or a second random number of preset bits randomly generated to obtain a first string, a first inverted string, a second string, and a second inverted string; A first expansion module is configured to input the first character string and the first inverted character string into a first linear transformation for expansion to obtain a first expansion set; A second expansion module is configured to input the second character string and the second inverted character string into a second linear transformation for expansion to generate a second expansion set; A transformation module is configured to perform an XOR operation on the elements in the first extended set and the second extended set respectively to obtain a nearMDS transformation output.

9. A nearMDS conversion device, characterized in that: It comprises at least one processing unit and at least one storage unit, wherein the storage unit stores a computer program, and when the computer program is executed by the processing unit, the processing unit executes the steps of the nearMDS transformation method according to any one of claims 1 to 7.

10. A storage medium, characterized in that: It stores a computer program executable by an access authentication device. When the computer program runs on the access authentication device, the access authentication device executes the steps of the nearMDS transformation method according to any one of claims 1 to 7.

Citation Information

Patent Citations

  • Lightweight password encryption method and system

    CN108462574A

  • Data encryption method and device, terminal equipment and computer readable storage medium

    CN115941304A

  • Linear transformation construction method and system based on Feistel

    CN115996112A

  • Encryption apparatus and method, and decryption apparatus and method based on block encryption

    US20020016773A1