+

CN119449271A - A white box encryption and decryption method, device, storage device and medium based on AES - Google Patents

A white box encryption and decryption method, device, storage device and medium based on AES Download PDF

Info

Publication number
CN119449271A
CN119449271A CN202411006450.1A CN202411006450A CN119449271A CN 119449271 A CN119449271 A CN 119449271A CN 202411006450 A CN202411006450 A CN 202411006450A CN 119449271 A CN119449271 A CN 119449271A
Authority
CN
China
Prior art keywords
encryption
round
decryption
key
round key
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202411006450.1A
Other languages
Chinese (zh)
Other versions
CN119449271B (en
Inventor
谢坚锐
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Zhiyou Wang'an Technology Co ltd
Original Assignee
Beijing Zhiyou Wang'an Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Zhiyou Wang'an Technology Co ltd filed Critical Beijing Zhiyou Wang'an Technology Co ltd
Priority to CN202411006450.1A priority Critical patent/CN119449271B/en
Publication of CN119449271A publication Critical patent/CN119449271A/en
Application granted granted Critical
Publication of CN119449271B publication Critical patent/CN119449271B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/06Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols the encryption apparatus using shift registers or memories for block-wise or stream coding, e.g. DES systems or RC4; Hash functions; Pseudorandom sequence generators
    • H04L9/0618Block ciphers, i.e. encrypting groups of characters of a plain text message using fixed encryption transformation
    • H04L9/0631Substitution permutation network [SPN], i.e. cipher composed of a number of stages or rounds each involving linear and nonlinear transformations, e.g. AES algorithms
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/04Network architectures or network communication protocols for network security for providing a confidential data exchange among entities communicating through data packet networks
    • H04L63/0428Network architectures or network communication protocols for network security for providing a confidential data exchange among entities communicating through data packet networks wherein the data content is protected, e.g. by encrypting or encapsulating the payload
    • H04L63/0435Network architectures or network communication protocols for network security for providing a confidential data exchange among entities communicating through data packet networks wherein the data content is protected, e.g. by encrypting or encapsulating the payload wherein the sending and receiving network entities apply symmetric encryption, i.e. same key used for encryption and decryption
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/08Key distribution or management, e.g. generation, sharing or updating, of cryptographic keys or passwords
    • H04L9/0861Generation of secret information including derivation or calculation of cryptographic keys or passwords
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/40Network security protocols

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computer Hardware Design (AREA)
  • Computing Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Storage Device Security (AREA)

Abstract

本申请实施例提出一种基于AES的白盒加解密方法、装置、存储设备及介质,首先基于高级加密标准的每一轮循环,根据加密轮密钥生成表TypeΙΙ和第一矩阵,再将高级加密标准的每一轮循环左乘第一矩阵之后查找表TypeΙΙ得到第二矩阵,完成高级加密标准的加密,然后对加密轮密钥进行密钥变换得到解密轮密钥,最后将解密轮密钥替换掉加密轮密钥,依次重复高级加密标准的加密流程得到第二矩阵,完成高级加密标准的解密,与现有技术相比满足下运行效率、运行内存、安全性三者之间的平衡,实现了与黑盒AES相比无明显差异的加解密速度、可忽略不计的额外内存占用、符合终端设备场景下的弱安全性需求。

The embodiment of the present application proposes a white-box encryption and decryption method, apparatus, storage device and medium based on AES. First, based on each round of the advanced encryption standard, a table Type ΙΙ and a first matrix are generated according to the encryption round key. Then, each round of the advanced encryption standard is multiplied on the left by the first matrix, and then the table Type ΙΙ is looked up to obtain a second matrix to complete the encryption of the advanced encryption standard. Then, the encryption round key is transformed to obtain a decryption round key. Finally, the decryption round key is replaced with the encryption round key. The encryption process of the advanced encryption standard is repeated in sequence to obtain the second matrix to complete the decryption of the advanced encryption standard. Compared with the prior art, a balance between operating efficiency, operating memory and security is met, and an encryption and decryption speed with no significant difference compared with the black-box AES is achieved, and the additional memory usage is negligible, which meets the weak security requirements in the terminal device scenario.

Description

AES-based white box encryption and decryption method and device, storage equipment and medium
Technical Field
The application relates to the technical field of information security and cryptography application, in particular to a white-box encryption and decryption method, device, storage equipment and medium based on AES.
Background
Keys are the core of the cryptography, and key management and storage are the most critical ring in the implementation of cryptographic algorithm engineering. In designing a cryptographic algorithm, a designer typically assumes that the cryptographic algorithm will be used in a black box environment, i.e., the cryptographic algorithm is inaccessible to intermediate data at run-time, with only input and output allowing access. This assumption is impractical in many engineering applications (e.g., mobile device terminals) where the key runs the risk of direct leakage from memory and cache. White-box implementations of conventional cryptographic algorithms have therefore evolved.
White-box environments refer to any intermediate data, input and output, that allow unlimited access when the cryptographic algorithm is running. As the name suggests, white-box implementation of a traditional cryptographic algorithm refers to an implementation method that modifies a traditional cryptographic algorithm designed based on black-box environment assumptions to still have good security in a white-box environment.
The advanced encryption standard (Advanced Encryption Standard, AES) is a symmetric encryption algorithm which is the most mainstream from the beginning, and is widely applied to aspects of social life production, including various terminal devices and software/hardware services. AES is still not moving ahead in terms of usage worldwide due to its ultra-high security and ultra-fast performance.
Therefore, the implementation method of the white-box AES has attracted attention from researchers, but researchers have focused on approaching the security of the white-box AES to the strong security of the black-box AES, and tend to ignore the feasibility in engineering applications. These white-box AES implementations may suffer from problems of data refresh delay due to inefficient operation (e.g., CEJO frames) and overload of the terminal device due to excessive operating memory (e.g., the Xiao-Lai/schottky scheme).
Disclosure of Invention
The application provides an AES-based white-box encryption and decryption method, an AES-based white-box encryption and decryption device, storage equipment and a storage medium, which can solve the problem that the existing public white-box AES implementation scheme is not feasible in industrial Internet application, and realize the balance among operation efficiency, operation memory and security in industrial Internet application scenes.
In order to achieve the above object, the technical scheme adopted by the embodiment of the application is as follows:
In a first aspect, an embodiment of the present application provides a white-box encryption and decryption method based on AES, where the method includes:
Step S1, generating a table Type I and a first matrix according to an encryption round key based on each round of circulation of an advanced encryption standard;
Step S2, the first matrix is multiplied by each round of circulation of the advanced encryption standard, then the look-up table Type I is searched to obtain a second matrix, and encryption of the advanced encryption standard is completed;
s3, carrying out key transformation on the encryption round key to obtain a decryption round key;
And S4, replacing the encryption round key with the decryption round key, and sequentially performing the step S1 and the step S2 to obtain a second matrix, thereby completing the decryption of the advanced encryption standard.
In one possible implementation manner, the step of generating the table Type i and the first matrix according to the encryption round key includes:
Adopting CEJO frames to generate a table TMC i according to the encryption round key;
selecting a random linear coding generation table Type I from CEJO frames;
Adding prepositive and postsitive linear codes of the ith wheel and the ith wheel in the table Type I, decoding, and then carrying out the circulation of the advanced encryption standard by combining the table TMC i and the table Type I;
generating a first matrix in the loop enables decoding from wheel to wheel.
In one possible embodiment, the method further comprises:
Binary exclusive-or operators in a programming language are used for exclusive-or.
In one possible implementation, the advanced encryption standard employs any of AES-128, AES-192, AES-256.
In one possible implementation, the step of performing a key transformation on the encryption round key to obtain the decryption round key includes:
Taking the encryption round key of the first round as the decryption round key of the last round;
The encryption round key of each round in the middle is converted into the decryption round key of each round in the middle of the reverse order by adopting an inverse operator InvMixColumns;
And taking the encryption round key of the last round as the decryption round key of the first round to obtain the decryption round key.
In a second aspect, an embodiment of the present application further provides an AES-based white-box encryption and decryption apparatus, where the apparatus includes:
the generation module is used for generating a table Type I and a first matrix according to the encryption round key based on each round of circulation of the advanced encryption standard;
the encryption module is used for multiplying the first matrix by each round of circulation of the advanced encryption standard, and then looking up the table Type I to obtain a second matrix to complete encryption of the advanced encryption standard;
the key conversion module is used for carrying out key conversion on the encryption round key to obtain a decryption round key;
And the decryption module is used for replacing the encryption round key with the decryption round key, and sequentially executing the steps of the generation module and the encryption module to obtain a second matrix, so as to finish decryption of the advanced encryption standard.
In a possible implementation manner, the generating module is further configured to:
Adopting CEJO frames to generate a table TMC i according to the encryption round key;
selecting a random linear coding generation table Type I from CEJO frames;
Adding prepositive and postsitive linear codes of the ith wheel and the ith wheel in the table Type I, decoding, and then carrying out the circulation of the advanced encryption standard by combining the table TMC i and the table Type I;
generating a first matrix in the loop enables decoding from wheel to wheel.
In one possible implementation, the key transformation module is further configured to:
Taking the encryption round key of the first round as the decryption round key of the last round;
The encryption round key of each round in the middle is converted into the decryption round key of each round in the middle of the reverse order by adopting an inverse operator InvMixColumns;
And taking the encryption round key of the last round as the decryption round key of the first round to obtain the decryption round key.
In a third aspect, an embodiment of the present application further provides a storage device, including a processor, a memory, and a bus, where the memory stores program instructions executable by the processor, and when the storage device is running, the processor communicates with the memory through the bus, and the processor executes the program instructions to execute the AES-based white-box encryption and decryption method according to any one of the first aspect.
In a fourth aspect, an embodiment of the present application further provides a computer readable storage medium, where a computer program is stored, where the computer program is executed by a processor to perform the AES-based white-box encryption and decryption method according to any one of the first aspects.
The inventive arrangements described above and their further alternatives may be freely combined to form a plurality of arrangements, all of which are employable and claimed by the present application, and the present application may be freely combined between (non-conflicting choice) choices and with other choices. Various combinations will be apparent to those skilled in the art from a review of the present disclosure, and are not intended to be exhaustive or all of the present disclosure.
The embodiment of the application provides a white-box encryption and decryption method, device, storage equipment and medium based on AES (advanced encryption standard), which are characterized in that firstly, each round of circulation based on the advanced encryption standard is generated into a table Type I and a first matrix according to the encryption round key, then each round of circulation of the advanced encryption standard is multiplied left by the first matrix, then the table Type I is searched to obtain a second matrix, encryption of the advanced encryption standard is completed, then the encryption round key is subjected to key transformation to obtain a decryption round key, finally, the decryption round key is replaced by the encryption round key, and the encryption process of the advanced encryption standard is sequentially repeated to obtain the second matrix, so that decryption of the advanced encryption standard is completed.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings that are needed in the embodiments will be briefly described below, it being understood that the following drawings only illustrate some embodiments of the present application and therefore should not be considered as limiting the scope, and other related drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
Fig. 1 shows an AES-based white-box encryption and decryption method according to an embodiment of the present application.
Detailed Description
For the purpose of making the objects, technical solutions and advantages of the embodiments of the present application more apparent, the technical solutions of the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present application, and it is apparent that the described embodiments are some embodiments of the present application, but not all embodiments of the present application. The components of the embodiments of the present application generally described and illustrated in the figures herein may be arranged and designed in a wide variety of different configurations.
Thus, the following detailed description of the embodiments of the application, as presented in the figures, is not intended to limit the scope of the application, as claimed, but is merely representative of selected embodiments of the application. All other embodiments, which can be made by those skilled in the art based on the embodiments of the application without making any inventive effort, are intended to be within the scope of the application.
It should be noted that like reference numerals and letters refer to like items in the following figures, and thus once an item is defined in one figure, no further definition or explanation thereof is necessary in the following figures.
It should be noted that the features of the embodiments of the present application may be combined with each other without conflict.
In the prior art, since researchers have focused on approaching the security of white-box AES to the strong security of black-box AES, feasibility in engineering applications is often ignored. These white-box AES implementations may suffer from problems of data refresh delay due to inefficient operation (e.g., CEJO frames) and overload of the terminal device due to excessive operating memory (e.g., the Xiao-Lai/schottky scheme).
Therefore, in order to solve the technical problems described above, the embodiments of the present application provide a white-box encryption and decryption method, apparatus, storage device, and medium based on AES, which satisfy the balance among operating efficiency, operating memory, and security in the application scenario of industrial internet, realize encryption and decryption speed without obvious difference, negligible additional memory occupation, and meet the weak security requirement in the terminal equipment scenario compared with black-box AES, and will be described in detail below.
Referring to fig. 1, fig. 1 shows an AES-based white-box encryption and decryption method according to an embodiment of the present application, where the method includes:
step S1, generating a table Type I and a first matrix according to an encryption round key based on each round of circulation of an advanced encryption standard.
The step before generating the table Type i and the first matrix further includes:
The number of encryption and decryption rounds of the advanced encryption standard is set to Nr, respectively, each round of the advanced encryption standard being Roundi (i=1,.,. The number of rounds, nr), where Nr represents the total number of rounds in the AES encryption or decryption process, and Roundi represents each specific round operation, whether the ith round in the encryption or decryption process, the main difference between them being the specific operation content and order performed in each round.
In addition, four operators included in each round of the advanced encryption standard are AddRoundKey, subBytes, shiftRows, mixColumns, and an inverse operator of the operators included in each round of the advanced encryption standard is InvSubBytes, invShiftRows, invMixColumns. If the output of any operator F with input x is F (x) and the output of any operator G with input x is G (x), the complex operator with input x is recordedThe output of (2) isNotation TypeIa, typeIb, typeII, typeIII, typeIV of 5 tables in CEJO frames is followed.
Wherein the advanced encryption standard employs any one of AES-128, AES-192, and AES-256.
In one possible implementation manner, the step of generating the table Type i and the first matrix according to the encryption round key includes:
Adopting CEJO frames to generate a table TMC i according to the encryption round key;
selecting a random linear coding generation table Type I from CEJO frames;
Adding prepositive and postsitive linear codes of the ith wheel and the ith wheel in the table Type I, decoding, and then carrying out the circulation of the advanced encryption standard by combining the table TMC i and the table Type I;
generating a first matrix in the loop enables decoding from wheel to wheel.
The encryption step is that each round of the advanced encryption standard is Roundi, i is more than or equal to 1 and less than or equal to Nr, a table TypeII and a first matrix M i are generated according to an encryption round key K i-1 of the ith round, a CEJO framework is adopted to generate a table TMC i according to an encryption round key K i-1, the random nonlinear coding selected by the CEJO framework is modified to be the random linear coding selected to generate a table TypeII, and the front linear coding, the rear linear coding and the decoding of the ith round are added in the table Type I IIAnd) And then combining the table TMC i and the table Type I to carry out the circulation of the advanced encryption standard, wherein the circulation process is as follows:
The loop shows a series of steps in the AES encryption process, which is divided into rounds, each round having a specific step to process the incoming data. This means that after the last round the data has been fully encrypted, forming ciphertext.
This expression demonstrates the process of multiple rounds of linear encoding, where each round applies a different matrix multiplication, increasing the complexity and security of the cryptosystem.
Table TypeIII in CEJO framework is replaced by a first matrix in an embodiment of the application that generates the first matrix in a loop to effect the round-to-round decoding:
Round1:Mi:=ShiftRows;
this means that the first matrix of the first round is a row shift matrix (ShiftRows), the first matrix of the i-th round is the decoding of the post-linear encoding of the previous round Sequentially passing through a row shift matrix (ShiftRows) and a matrix obtained by the post linear coding (L i-1) of the round.
And S2, multiplying the first matrix by each round of circulation of the advanced encryption standard, and then searching the table Type I to obtain a second matrix, thereby completing encryption of the advanced encryption standard.
Roundi (i=1,) for each round of advanced encryption standard, nr, the encryption flow is completed by looking up TypeII after the first matrix M i is multiplied left.
In one possible embodiment, the method further comprises:
Binary exclusive-or operators in a programming language are used for exclusive-or.
At a particular stage (Roundi), a matrix is first left multiplied by the first matrix M i and then queried according to some type of table (TypeII). Unlike the other approach (CEJO framework), since random linear encoding is employed, binary exclusive-or operators provided by some programming languages, such as the ++symbols in C++, can be used directly when performing exclusive-or operations on data of 32-bits and 128-bits in length after completion of the look-up table TypeII operation.
Considering symmetry of AES encryption and decryption, decryption includes the steps of:
And S3, performing key transformation on the encryption round key to obtain the encryption round key.
In one possible implementation, the step of performing a key transformation on the encryption round key to obtain the decryption round key includes:
Taking the encryption round key of the first round as the decryption round key of the last round;
The encryption round key of each round in the middle is converted into the decryption round key of each round in the middle of the reverse order by adopting an inverse operator InvMixColumns;
And taking the encryption round key of the last round as the decryption round key of the first round to obtain the decryption round key.
Assuming that the encryption round key is K i, the decryption round key is K i', and the formula of the key transformation is:
the first row represents the decryption round key K' 0 for the first round as equal to the encryption round key for the Nr-th round The second row represents the keys from round 1 to round N r -1 by applying an inverse mix column transform to the keys of the previous round, and the last row represents the decryption round key of the last roundEqual to the encryption round key K 0 for the first round.
And S4, replacing the encryption round key with the decryption round key, and sequentially performing the step S1 and the step S2 to obtain a second matrix, thereby completing the decryption of the advanced encryption standard.
The AES-128 is adopted to compare with CEJO frames and the Xiao-Lai/Sho-Lai scheme.
Unlike the CEJO framework, the embodiment of the present application does not require the generation (336 kB) and lookup (2688 times) of TypeIV, and instead the overhead generated by the binary exclusive-or operation is negligible.
Unlike the CEJO framework, embodiments of the present application do not require the generation (128 kB) and lookup (32 times) of Type Ia and Type Ib, taking into account the impractical external input/output coding on actual product logic and the inconvenience of engineering implementation of separate input/output coding for each table.
Unlike the CEJO framework, similar to the Xiao-Lai/sho-coming scheme, the embodiment of the application uses 10 matrix multiplications to achieve the decoding from wheel to wheel (20 kB), without the need for Type III generation (144 kB) and lookup (144 times).
Unlike the CEJO framework, which selects 8 16-bit to 32-bit table TMCs (10 rounds total 20480 kB) similar to the Xiaao-Lai/Sho-Law scheme, the present embodiment uses 16 8-bit to 32-bit table TMCs (10 rounds total 160 kB).
Compared with the prior art, the embodiment of the application has the beneficial effects that:
First, theoretically, compared with CEJO frames (3008 table lookups, 752 kB) and the Xiao-Lai/schottky scheme (80 table lookups, 40 xors, 11 matrix multiplications, 20502 kB), the embodiment of the application (144 table lookups, 216 xors, 11 matrix multiplications, 164 kB) has the advantages of high efficiency and light weight, and is very similar to the performance of black box AES (160 table lookups, 152 xors, 4 kB).
Second, compared with CEJO frames (2 22) and the Xiao-Lai/sho-Lai scheme (2 32), the embodiment of the application has the safety between about 2 12 and 2 22, belongs to weak safety, and is enough to meet the requirements of mobile terminals under the consolidation of reinforcement technology and the like.
Thirdly, through a large number of tests, the encryption/decryption method and device for the single plaintext/ciphertext with the size of 500kB, 1mB and 2mB in the embodiment of the application have the time consumption of 79.1ms, 98.8ms and 117.8ms respectively in the ECB mode, and have the time consumption of 76.8ms, 99.3ms and 162.2ms respectively in the CBC mode, so that macroscopic delay of real-time data refreshing can not be caused.
In a second aspect, an embodiment of the present application further provides an AES-based white-box encryption and decryption apparatus, where the apparatus includes:
the generation module is used for generating a table Type I and a first matrix according to the encryption round key based on each round of circulation of the advanced encryption standard;
the encryption module is used for multiplying the first matrix by each round of circulation of the advanced encryption standard, and then looking up the table Type I to obtain a second matrix to complete encryption of the advanced encryption standard;
the key conversion module is used for carrying out key conversion on the encryption round key to obtain a decryption round key;
And the decryption module is used for replacing the encryption round key with the decryption round key, and sequentially executing the steps of the generation module and the encryption module to obtain a second matrix, so as to finish decryption of the advanced encryption standard.
In a possible implementation manner, the generating module is further configured to:
Adopting CEJO frames to generate a table TMC i according to the encryption round key;
selecting a random linear coding generation table Type I from CEJO frames;
Adding prepositive and postsitive linear codes of the ith wheel and the ith wheel in the table Type I, decoding, and then carrying out the circulation of the advanced encryption standard by combining the table TMC i and the table Type I;
generating a first matrix in the loop enables decoding from wheel to wheel.
In one possible implementation, the key transformation module is further configured to:
Taking the encryption round key of the first round as the decryption round key of the last round;
The encryption round key of each round in the middle is converted into the decryption round key of each round in the middle of the reverse order by adopting an inverse operator InvMixColumns;
And taking the encryption round key of the last round as the decryption round key of the first round to obtain the decryption round key.
The preferred embodiment provides a computer device, which can implement the steps in any embodiment of the AES-based white-box encryption and decryption method provided in the embodiment of the present application, so that the beneficial effects of the AES-based white-box encryption and decryption method provided in the embodiment of the present application can be implemented, which are detailed in the previous embodiments and are not described herein.
Those of ordinary skill in the art will appreciate that all or a portion of the steps of the various methods of the above embodiments may be performed by instructions, or by instructions controlling associated hardware, which may be stored in a computer-readable storage medium and loaded and executed by a processor. To this end, an embodiment of the present application provides a storage medium in which a plurality of instructions are stored, where the instructions can be loaded by a processor to perform the steps of any one of the embodiments of the AES-based white-box encryption and decryption method provided in the embodiment of the present application.
The storage medium may include a Read Only Memory (ROM), a random access Memory (RAM, randomAccess Memory), a magnetic disk, an optical disk, or the like.
The steps in any AES-based white-box encryption and decryption method embodiment provided by the embodiment of the present application can be executed due to the instructions stored in the storage medium, so that the beneficial effects that any AES-based white-box encryption and decryption method provided by the embodiment of the present application can be achieved, and detailed descriptions of the previous embodiments are omitted here.
The foregoing is merely illustrative of the present application, and the present application is not limited thereto, and any changes or substitutions easily contemplated by those skilled in the art within the scope of the present application should be included in the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.

Claims (10)

1.一种基于AES的白盒加解密方法,其特征在于,所述方法包括:1. A white box encryption and decryption method based on AES, characterized in that the method comprises: 步骤S1、基于高级加密标准的每一轮循环,根据加密轮密钥生成表TypeΙΙ和第一矩阵;Step S1, based on each round of the Advanced Encryption Standard, generate a table Type ΙΙ and a first matrix according to the encryption round key; 步骤S2、将高级加密标准的每一轮循环左乘第一矩阵之后查找表TypeΙΙ得到第二矩阵,完成高级加密标准的加密;Step S2, after each round of the advanced encryption standard is cyclically multiplied by the first matrix, the second matrix is obtained by looking up the table Type ΙΙ, thereby completing the encryption of the advanced encryption standard; 步骤S3、对加密轮密钥进行密钥变换得到解密轮密钥;Step S3, performing key transformation on the encryption round key to obtain the decryption round key; 步骤S4、将解密轮密钥替换掉加密轮密钥,依次进行步骤S1、步骤S2得到第二矩阵,完成高级加密标准的解密。Step S4, replace the encryption round key with the decryption round key, and perform steps S1 and S2 in sequence to obtain the second matrix, thereby completing the decryption of the Advanced Encryption Standard. 2.根据权利要求1所述的基于AES的白盒加解密方法,其特征在于,根据加密轮密钥生成表TypeΙΙ和第一矩阵的步骤,包括:2. The AES-based white box encryption and decryption method according to claim 1, characterized in that the step of generating a table Type II and a first matrix according to an encryption round key comprises: 采用CEJO框架,根据加密轮密钥生成表TMCiUsing the CEJO framework, the table TMC i is generated according to the encryption round key; 在CEJO框架中选择随机线性编码生成表TypeΙΙ;Select the random linear coding generation table Type ΙΙ in the CEJO framework; 在表TypeΙΙ中加入第i轮的前置、后置线性编码、解码之后结合表TMCi和表TypeΙΙ进行高级加密标准的循环;Add the i-th round of pre- and post-linear encoding and decoding to table Type ΙΙ, and then combine table TMC i and table Type ΙΙ to perform the Advanced Encryption Standard cycle; 在循环中生成第一矩阵实现轮与轮之间的解码。The first matrix is generated in a loop to achieve decoding between rounds. 3.根据权利要求2所述的基于AES的白盒加解密方法,其特征在于,所述方法还包括:3. The AES-based white box encryption and decryption method according to claim 2, characterized in that the method further comprises: 对异或使用编程语言中的二元异或操作符。For XOR, use the binary XOR operator in your programming language. 4.根据权利要求1所述的基于AES的白盒加解密方法,其特征在于,高级加密标准采用AES-128、AES-192、AES-256中的任意一个。4. The AES-based white box encryption and decryption method according to claim 1 is characterized in that the advanced encryption standard adopts any one of AES-128, AES-192, and AES-256. 5.根据权利要求1所述的基于AES的白盒加解密方法,其特征在于,对加密轮密钥进行密钥变换得到解密轮密钥的步骤,包括:5. The AES-based white box encryption and decryption method according to claim 1, characterized in that the step of performing key transformation on the encryption round key to obtain the decryption round key comprises: 将第一轮的加密轮密钥作为最后一轮的解密轮密钥;Use the first round encryption key as the last round decryption key; 采用逆算子InvMixColumns将中间每一轮的加密轮密钥变换为逆序的中间每一轮的解密轮密钥;Use the inverse operator InvMixColumns to transform the encryption round key of each intermediate round into the decryption round key of each intermediate round in reverse order; 将最后一轮的加密轮密钥作为第一轮的解密轮密钥,得到解密轮密钥。The encryption round key of the last round is used as the decryption round key of the first round to obtain the decryption round key. 6.一种基于AES的白盒加解密装置,其特征在于,所述装置包括:6. A white box encryption and decryption device based on AES, characterized in that the device comprises: 生成模块,用于基于高级加密标准的每一轮循环,根据加密轮密钥生成表TypeΙΙ和第一矩阵;A generating module, configured to generate a table Type ΙΙ and a first matrix according to an encryption round key in each cycle of the advanced encryption standard; 加密模块,用于将高级加密标准的每一轮循环左乘第一矩阵之后查找表TypeΙΙ得到第二矩阵,完成高级加密标准的加密;An encryption module, used for performing left multiplication of each round of the advanced encryption standard by the first matrix and then looking up the table Type ΙΙ to obtain a second matrix, thereby completing encryption of the advanced encryption standard; 密钥变换模块,用于对加密轮密钥进行密钥变换得到解密轮密钥;A key conversion module, used to convert the encryption round key to obtain the decryption round key; 解密模块,用于将解密轮密钥替换掉加密轮密钥,依次执行生成模块和加密模块的步骤得到第二矩阵,完成高级加密标准的解密。The decryption module is used to replace the encryption round key with the decryption round key, and sequentially execute the steps of the generation module and the encryption module to obtain the second matrix, thereby completing the decryption of the advanced encryption standard. 7.根据权利要求6所述的基于AES的白盒加解密装置,其特征在于,生成模块,还用于:7. The AES-based white box encryption and decryption device according to claim 6, characterized in that the generation module is further used for: 采用CEJO框架,根据加密轮密钥生成表TMCiUsing the CEJO framework, the table TMC i is generated according to the encryption round key; 在CEJO框架中选择随机线性编码生成表TypeΙΙ;Select the random linear coding generation table Type ΙΙ in the CEJO framework; 在表TypeΙΙ中加入第i轮的前置、后置线性编码、解码之后结合表TMCi和表TypeΙΙ进行高级加密标准的循环;Add the i-th round of pre- and post-linear encoding and decoding to table Type ΙΙ, and then combine table TMC i and table Type ΙΙ to perform the Advanced Encryption Standard cycle; 在循环中生成第一矩阵实现轮与轮之间的解码。The first matrix is generated in a loop to achieve decoding between rounds. 8.根据权利要求6所述的基于AES的白盒加解密装置,其特征在于,密钥变换模块,还用于:8. The AES-based white box encryption and decryption device according to claim 6, characterized in that the key transformation module is further used for: 将第一轮的加密轮密钥作为最后一轮的解密轮密钥;Use the first round encryption key as the last round decryption key; 采用逆算子InvMixColumns将中间每一轮的加密轮密钥变换为逆序的中间每一轮的解密轮密钥;Use the inverse operator InvMixColumns to transform the encryption round key of each intermediate round into the decryption round key of each intermediate round in reverse order; 将最后一轮的加密轮密钥作为第一轮的解密轮密钥,得到解密轮密钥。The encryption round key of the last round is used as the decryption round key of the first round to obtain the decryption round key. 9.一种存储设备,其特征在于,包括:处理器、存储器和总线,所述存储器存储有所述处理器可执行的程序指令,当所述存储设备运行时,所述处理器与所述存储器之间通过总线通信,所述处理器执行所述程序指令,以执行时执行如权利要求1-5任一所述的基于AES的白盒加解密方法。9. A storage device, characterized in that it includes: a processor, a memory and a bus, the memory stores program instructions executable by the processor, when the storage device is running, the processor and the memory communicate through the bus, and the processor executes the program instructions to perform the AES-based white box encryption and decryption method as described in any one of claims 1-5. 10.一种计算机可读存储介质,其特征在于,所述计算机可读存储介质上存储有计算机程序,所述计算机程序被处理器运行时执行如权利要求1-5任意一项所述的基于AES的白盒加解密方法。10. A computer-readable storage medium, characterized in that a computer program is stored on the computer-readable storage medium, and when the computer program is executed by a processor, the AES-based white-box encryption and decryption method according to any one of claims 1 to 5 is executed.
CN202411006450.1A 2024-07-25 2024-07-25 AES-based white box encryption and decryption method, device, storage device and medium Active CN119449271B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202411006450.1A CN119449271B (en) 2024-07-25 2024-07-25 AES-based white box encryption and decryption method, device, storage device and medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202411006450.1A CN119449271B (en) 2024-07-25 2024-07-25 AES-based white box encryption and decryption method, device, storage device and medium

Publications (2)

Publication Number Publication Date
CN119449271A true CN119449271A (en) 2025-02-14
CN119449271B CN119449271B (en) 2025-08-29

Family

ID=94530949

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202411006450.1A Active CN119449271B (en) 2024-07-25 2024-07-25 AES-based white box encryption and decryption method, device, storage device and medium

Country Status (1)

Country Link
CN (1) CN119449271B (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20190305930A1 (en) * 2016-07-12 2019-10-03 Giesecke+Devrient Mobile Security Gmbh White box aes implementation
CN112199696A (en) * 2020-10-09 2021-01-08 西安电子科技大学 Encryption and decryption method based on white-box block cipher
US20210152326A1 (en) * 2019-11-14 2021-05-20 Electronics And Telecommunications Research Institute White-box encryption method for prevention of fault injection attack and apparatus therefor
CN116722968A (en) * 2023-06-27 2023-09-08 西安微电子技术研究所 Lightweight AES-128 dynamic encryption method based on UWB

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20190305930A1 (en) * 2016-07-12 2019-10-03 Giesecke+Devrient Mobile Security Gmbh White box aes implementation
US20210152326A1 (en) * 2019-11-14 2021-05-20 Electronics And Telecommunications Research Institute White-box encryption method for prevention of fault injection attack and apparatus therefor
CN112199696A (en) * 2020-10-09 2021-01-08 西安电子科技大学 Encryption and decryption method based on white-box block cipher
CN116722968A (en) * 2023-06-27 2023-09-08 西安微电子技术研究所 Lightweight AES-128 dynamic encryption method based on UWB

Also Published As

Publication number Publication date
CN119449271B (en) 2025-08-29

Similar Documents

Publication Publication Date Title
CN106411518B (en) A kind of unfixed symmetrical whitepack encryption method of key and device
KR100917073B1 (en) Method and apparatus for increasing the speed of cryptographic processing
Chen et al. High performance data encryption with AES implementation on FPGA
US20090323927A1 (en) Mechanism for chained output feedback encryption
CN109450632B (en) Key recovery method based on white-box block cipher CLEFIA analysis
CN108809626A (en) A kind of whitepack SM4 cryptographic algorithms scheme and system
CN110880967B (en) Method for parallel encryption and decryption of multiple messages by adopting packet symmetric key algorithm
US20250013430A1 (en) Reconfigurable architecture for improvement and optimization of advanced encryption standard
Abd Zaid et al. Modification advanced encryption standard for design lightweight algorithms
Arrag et al. Design and Implementation A different Architectures of mixcolumn in FPGA
Buchanan et al. Review of the nist light-weight cryptography finalists
Dawood et al. The new block cipher design (Tigris Cipher)
Zhou et al. Towards practical white-box lightweight block cipher implementations for IoTs
CN109033892A (en) Round transformation multiplex circuit and AES based on composite matrix decrypt circuit
CN109039583B (en) Multiplexing rotation circuit, AES encryption circuit and encryption method
Patel et al. Hybrid security algorithms for data transmission using AES-DES
Paar et al. The Advanced Encryption Standard (AES)
CN119449271B (en) AES-based white box encryption and decryption method, device, storage device and medium
CN104618092A (en) Information encryption method and system
Shylashree et al. FPGA implementations of advanced encryption standard: A survey
CN109033847B (en) AES encryption operation unit, AES encryption circuit and encryption method thereof
Mohan et al. Revised aes and its modes of operation
CN107437990A (en) Encryption method, decryption method, encryption device and decryption device
Murtaza et al. Fortification of aes with dynamic mix-column transformation
JP2000075785A (en) High-speed encryption processing circuit and processing method

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载