CN113206736A - Encryption method based on AES encryption algorithm - Google Patents
Encryption method based on AES encryption algorithm Download PDFInfo
- Publication number
- CN113206736A CN113206736A CN202110427361.4A CN202110427361A CN113206736A CN 113206736 A CN113206736 A CN 113206736A CN 202110427361 A CN202110427361 A CN 202110427361A CN 113206736 A CN113206736 A CN 113206736A
- Authority
- CN
- China
- Prior art keywords
- ciphertext
- algorithm
- encryption algorithm
- encryption
- executing
- 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.)
- Pending
Links
- 238000000034 method Methods 0.000 title claims abstract description 32
- 238000006467 substitution reaction Methods 0.000 claims abstract description 15
- 238000005336 cracking Methods 0.000 claims abstract description 11
- 239000011159 matrix material Substances 0.000 claims description 32
- 238000010586 diagram Methods 0.000 description 4
- 238000013507 mapping Methods 0.000 description 1
- 239000002243 precursor Substances 0.000 description 1
- 150000003839 salts Chemical class 0.000 description 1
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L9/00—Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
- H04L9/06—Cryptographic 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/0618—Block ciphers, i.e. encrypting groups of characters of a plain text message using fixed encryption transformation
- H04L9/0631—Substitution permutation network [SPN], i.e. cipher composed of a number of stages or rounds each involving linear and nonlinear transformations, e.g. AES algorithms
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L9/00—Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
- H04L9/06—Cryptographic 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/065—Encryption by serially and continuously modifying data stream elements, e.g. stream cipher systems, RC4, SEAL or A5/3
- H04L9/0656—Pseudorandom key sequence combined element-for-element with data sequence, e.g. one-time-pad [OTP] or Vernam's cipher
Abstract
An encryption method based on an AES encryption algorithm. The existing encryption algorithm is divided into a symmetric encryption algorithm and an asymmetric encryption algorithm, the same secret key is used for encryption and decryption, the ciphertext obtained by encrypting the same plaintext by using AES is usually fixed, a plaintext-ciphertext table is complete enough, and an illegal cracker can crack the plaintext, so that the leakage of plaintext data information is caused. The method of the invention comprises the following steps: firstly, inputting a plaintext into an AES encryption algorithm in a parameter mode, and executing key expansion operation to obtain a round key; performing a loop iteration operation of round encryption: byte substitution, row shifting, column mixing and round key addition are carried out to obtain a ciphertext C; executing a pseudo-random number generation function, and generating a random data character string G by taking the time of a system as a seed; the final ciphertext consists of ciphertext C and random data string G; the randomness of the ciphertext is realized, the difficulty of cracking is increased, and the safety performance of the encryption algorithm is improved. The invention is used for an encryption method based on an AES encryption algorithm.
Description
Technical Field
The invention relates to the technical field of data encryption of data nodes of the Internet of things, in particular to an encryption method based on an AES encryption algorithm.
Background
Data encryption is a reliable method for guaranteeing the data security of data nodes of the Internet of things, and data is converted into ciphertext through an encryption algorithm and an encryption key, so that the data security is protected;
the existing encryption algorithms are divided into a symmetric encryption algorithm and an asymmetric encryption algorithm, and the symmetric encryption algorithm is characterized in that the same secret key is used for encryption and decryption operations, such as an AES encryption algorithm and a DES encryption algorithm; the asymmetric encryption algorithm is characterized in that different keys are used for encryption and decryption operation, and the keys comprise an ABE encryption algorithm, an ECC encryption algorithm, a homomorphic encryption algorithm and the like; the precursor of the AES encryption algorithm is the Rijndael algorithm, which is selected by the NIST in the United states to replace the original DES advanced algorithm and is used for protecting the safety of important government information;
the ciphertext obtained by encrypting the same plaintext by using the AES is usually fixed, so that a table corresponding to the plaintext and the ciphertext can be obtained, and as long as the plaintext and the ciphertext table are complete enough, an illegal cracker can deduce the plaintext to be cracked by cracking the plaintext and the ciphertext table, so that leakage of plaintext data information is caused.
Patent document 1 (publication No. CN 106385313A) discloses a random ciphertext system based on block encryption algorithm and an implementation method thereof, which automatically determines the bit length of an encrypted plaintext and the block length of the block encryption algorithm used by the encrypted plaintext, and intelligently fills the plaintext to generate a random ciphertext to generate different ciphertext information after each encryption, thereby greatly increasing the cost of hackers for acquiring sensitive data, increasing the robustness of the ciphertext, and only improving the security of related systems.
Disclosure of Invention
The invention aims to provide an encryption method based on an AES encryption algorithm, which ensures that ciphertext obtained after encryption has randomness by adding a random data character string G, namely the ciphertext obtained after encrypting the same plaintext is different. The difficulty of cracking the encryption algorithm is improved.
The above purpose is realized by the following technical scheme:
an encryption method based on an AES encryption algorithm comprises the following steps: firstly, inputting a plaintext into an AES encryption algorithm in a parameter mode, and executing key expansion operation to obtain a round key; performing a loop iteration operation of round encryption: byte substitution, row shifting, column mixing and round key addition are carried out to obtain a ciphertext C; executing a pseudo-random number generation function, and generating a random data character string G by taking the time of a system as a seed; the final ciphertext consists of ciphertext C and random data string G; the randomness of the ciphertext is realized, the difficulty of cracking is increased, and the safety performance of the encryption algorithm is improved.
The encryption method based on the AES encryption algorithm comprises the following specific steps:
step 1: transmitting a plaintext into an AES encryption algorithm in a parameter form to obtain system time;
step 2: executing a key expansion algorithm to obtain a round key;
and step 3: executing a byte substitution algorithm;
and 4, step 4: executing a line shifting algorithm;
and 5: executing a column mixing algorithm;
step 6: executing a round key adding algorithm;
and 7: judging whether the number of loop iterations is reached, if so, turning to 8 to obtain a ciphertext C, otherwise, turning to 3;
and 8: executing a pseudo-random number generation function to obtain a random data character string G;
and step 9: and outputting the final ciphertext C + G.
According to the encryption method based on the AES encryption algorithm, plaintext data are encrypted through the AES encryption algorithm to obtain a ciphertext C, a pseudo-random number generator generates a random data character string G, and the ciphertext is composed of the ciphertext C and the random data character string G. The resulting ciphertext is random.
The encryption method based on the AES encryption algorithm comprises four rounds of encryption operations of the AES encryption algorithm: the byte substitution is to replace each byte of the data matrix with another byte according to a non-linear replacement table, the row shifting is to circularly shift each bit of the data matrix by a certain length, the column mixing is to map each byte in the data matrix to obtain a new byte, and the round key addition is to perform exclusive-or operation on the data matrix and the key matrix.
According to the encryption method based on the AES encryption algorithm, the random data character string G is generated by the pseudo-random number generator, the confusion degree of the random data character string to a ciphertext can be increased according to the encryption level, and the difficulty in cracking the algorithm is increased.
Has the advantages that:
1. the invention mainly relates to an encryption method based on an AES encryption algorithm, which ensures that ciphertext results obtained by encrypting the same plaintext for multiple times are changed randomly by adding random character strings, increases the difficulty of cracking and improves the safety performance of the encryption algorithm.
2. The random data string G is generated by using the time seed with less bits, so that a large amount of resource storage space is not occupied, and the method is suitable for safely encrypting the data of the data node in the Internet of things.
3. The method comprises the steps of adding a random salt strategy, filling a ciphertext with a random data character string generated by a pseudorandom number generator, enabling the final ciphertext to be changed randomly, dividing the final ciphertext obtained by the method into two parts, wherein the first part is the ciphertext C, the second part is the random data character string G, and splicing the two parts of data to form the final ciphertext.
Description of the drawings:
FIG. 1 is a schematic flow diagram of the present invention.
Fig. 2 is a flow diagram of key expansion of the present invention.
Fig. 3 is a schematic view of the S-box of the present invention.
Fig. 4 is a schematic diagram of a variation of the byte substitution of the present invention.
Fig. 5 is a flow chart of the line shifting of the present invention.
FIG. 6 is a flow diagram of column mixing of the present invention.
Fig. 7 is a flow chart of round key addition of the present invention.
The specific implementation mode is as follows:
example 1:
an encryption method based on an AES encryption algorithm comprises the following steps: firstly, inputting a plaintext into an AES encryption algorithm in a parameter mode, and executing key expansion operation to obtain a round key; performing a loop iteration operation of round encryption: byte substitution, row shifting, column mixing and round key addition are carried out to obtain a ciphertext C; executing a pseudo-random number generation function, and generating a random data character string G by taking the time of a system as a seed; the final ciphertext consists of ciphertext C and random data string G; the randomness of the ciphertext is realized, the difficulty of cracking is increased, and the safety performance of the encryption algorithm is improved.
Example 2:
the encryption method based on the AES encryption algorithm according to embodiment 1, the encryption method includes the specific steps of:
step 1: transmitting a plaintext into an AES encryption algorithm in a parameter form to obtain system time;
step 2: executing a key expansion algorithm to obtain a round key;
and step 3: executing a byte substitution algorithm;
and 4, step 4: executing a line shifting algorithm;
and 5: executing a column mixing algorithm;
step 6: executing a round key adding algorithm;
and 7: judging whether the number of loop iterations is reached, if so, turning to 8 to obtain a ciphertext C, otherwise, turning to 3;
and 8: executing a pseudo-random number generation function to obtain a random data character string G;
and step 9: and outputting the final ciphertext C + G.
Example 3:
according to the encryption method based on the AES encryption algorithm, plaintext data is encrypted by the AES encryption algorithm to obtain a ciphertext C, a random data character string G is generated by a pseudo-random number generator, and the ciphertext is composed of the ciphertext C and the random data character string G. The resulting ciphertext is random.
Example 4:
an encryption method based on the AES encryption algorithm according to embodiment 2 or 3, the four rounds of encryption operations of the AES encryption algorithm: the byte substitution is to replace each byte of the data matrix with another byte according to a non-linear replacement table, the row shifting is to circularly shift each bit of the data matrix by a certain length, the column mixing is to map each byte in the data matrix to obtain a new byte, and the round key addition is to perform exclusive-or operation on the data matrix and the key matrix.
Example 5:
according to the encryption method based on the AES encryption algorithm, as the random data character string G is generated by the pseudo-random number generator, the confusion degree of the random data character string to the ciphertext can be increased according to the encryption level, and the difficulty in cracking the algorithm is increased;
the byte substitution algorithm is to substitute each byte of the data matrix into another byte according to a nonlinear substitution table;
the row shifting algorithm is to circularly shift each bit of the data matrix by a certain length; the column mixing algorithm maps the bytes in the data matrix to a new state matrix;
the round key addition algorithm is to carry out XOR operation on the data matrix and the key matrix to obtain a new state matrix;
the pseudo-random number generation function takes system time as a seed to generate a random data character string G;
in the key expansion algorithm, the initial key is subjected to key expansion to obtain a round key, and as shown in fig. 2, 4 32-bit words are expanded into 44 32-bit words;
the above-mentioned byte substitution algorithm is the only nonlinear substitution operation in the AES encryption algorithm, each byte of the matrix is substituted with another byte by looking up a table using an S-box (as shown in fig. 3), which is a two-dimensional data table;
the state of the data matrix changes after S box replacement: as shown in fig. 4, the plaintext 0x23 corresponds to column 2 of the S-box, and the state of row 3 is 0x 56;
the row shifting algorithm cyclically shifts each bit in each row of the data matrix by a certain length; the invention takes the example of circular left shift, i.e. the k-th row moves k-1 unit circularly left, as shown in fig. 5, the plaintext S1 in the first column of the second row moves 1 unit circularly left at the position of the data matrix primitive S13;
in the column mixing algorithm, each byte in each column obtains a new byte through a mapping relation, as shown in fig. 6, the state matrix is multiplied by a data matrix to obtain a new state matrix, so that the confusion degree is increased;
the round key addition algorithm performs exclusive or operation on the state matrix and the key matrix to obtain a new state matrix, as shown in fig. 7;
the pseudo-random number generation function uses the system time as a seed to generate a random sequence as a random data character string G; splicing the ciphertext C and the random data character string G to form a final ciphertext C + G;
the encryption method of the invention realizes the randomness of the ciphertext, improves the difficulty of cracking and increases the safety performance of the encryption algorithm.
Claims (5)
1. An encryption method based on AES encryption algorithm is characterized in that: the method comprises the following steps: firstly, inputting a plaintext into an AES encryption algorithm in a parameter mode, and executing key expansion operation to obtain a round key; performing a loop iteration operation of round encryption: byte substitution, row shifting, column mixing and round key addition are carried out to obtain a ciphertext C; executing a pseudo-random number generation function, and generating a random data character string G by taking the time of a system as a seed; the final ciphertext consists of ciphertext C and random data string G; the randomness of the ciphertext is realized, the difficulty of cracking is increased, and the safety performance of the encryption algorithm is improved.
2. The AES encryption algorithm-based encryption method of claim 1, wherein: the encryption method comprises the following specific steps:
step 1: transmitting a plaintext into an AES encryption algorithm in a parameter form to obtain system time;
step 2: executing a key expansion algorithm to obtain a round key;
and step 3: executing a byte substitution algorithm;
and 4, step 4: executing a line shifting algorithm;
and 5: executing a column mixing algorithm;
step 6: executing a round key adding algorithm;
and 7: judging whether the number of loop iterations is reached, if so, turning to 8 to obtain a ciphertext C, otherwise, turning to 3;
and 8: executing a pseudo-random number generation function to obtain a random data character string G;
and step 9: and outputting the final ciphertext C + G.
3. The AES encryption algorithm-based encryption method according to claim 2, wherein:
and encrypting plaintext data by using an AES encryption algorithm to obtain a ciphertext C, generating a random data character string G by using a pseudo-random number generator, and finally forming the ciphertext by using the ciphertext C and the random data character string G, wherein the obtained ciphertext has randomness.
4. An encryption method based on AES encryption algorithm as claimed in claim 2 or 3, wherein:
four rounds of encryption operations of the AES encryption algorithm: the byte substitution is to replace each byte of the data matrix with another byte according to a non-linear replacement table, the row shifting is to circularly shift each bit of the data matrix by a certain length, the column mixing is to map each byte in the data matrix to obtain a new byte, and the round key addition is to perform exclusive-or operation on the data matrix and the key matrix.
5. An encryption method based on AES encryption algorithm as claimed in claim 2, 3 or 4, wherein:
the random data character string G is generated by the pseudo-random number generator, the confusion degree of the random data character string to the ciphertext can be increased according to the encryption level, and the difficulty of algorithm cracking is increased.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110427361.4A CN113206736A (en) | 2021-04-21 | 2021-04-21 | Encryption method based on AES encryption algorithm |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110427361.4A CN113206736A (en) | 2021-04-21 | 2021-04-21 | Encryption method based on AES encryption algorithm |
Publications (1)
Publication Number | Publication Date |
---|---|
CN113206736A true CN113206736A (en) | 2021-08-03 |
Family
ID=77027559
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202110427361.4A Pending CN113206736A (en) | 2021-04-21 | 2021-04-21 | Encryption method based on AES encryption algorithm |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN113206736A (en) |
Cited By (10)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113452508A (en) * | 2021-08-27 | 2021-09-28 | 北京华云安信息技术有限公司 | Data encryption method, device, equipment and computer readable storage medium |
CN113591117A (en) * | 2021-08-04 | 2021-11-02 | 中国人民大学 | Social platform daily conversation encryption method and system, storage medium and computing device |
CN113765663A (en) * | 2021-09-26 | 2021-12-07 | 清华大学 | Method and device for strengthening security of quantum key distribution network |
CN113779614A (en) * | 2021-11-09 | 2021-12-10 | 深圳市永达电子信息股份有限公司 | Encryption method based on improved AES algorithm and computer-readable storage medium |
CN114124529A (en) * | 2021-11-23 | 2022-03-01 | 国网山东省电力公司电力科学研究院 | Method and device for encrypting/decrypting grid-connected test data and data processing method and device |
CN115695509A (en) * | 2022-09-29 | 2023-02-03 | 北京宜通华瑞科技有限公司 | Intelligent sewing system based on Internet of things communication protocol |
CN116667993A (en) * | 2023-04-28 | 2023-08-29 | 江苏芯信电子科技有限公司 | Block chain identity confirmation system based on big data and using device thereof |
CN117118713A (en) * | 2023-08-30 | 2023-11-24 | 广州趣米网络科技有限公司 | Encryption algorithm based on double encryption |
CN117394987A (en) * | 2023-11-08 | 2024-01-12 | 广东知业科技有限公司 | Method and system for secure communication between edge computing and cloud service |
CN117725605A (en) * | 2024-02-07 | 2024-03-19 | 四川建设网有限责任公司 | Method and system for remotely and automatically compiling electronic archive file information confidentiality |
-
2021
- 2021-04-21 CN CN202110427361.4A patent/CN113206736A/en active Pending
Cited By (13)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113591117A (en) * | 2021-08-04 | 2021-11-02 | 中国人民大学 | Social platform daily conversation encryption method and system, storage medium and computing device |
CN113452508A (en) * | 2021-08-27 | 2021-09-28 | 北京华云安信息技术有限公司 | Data encryption method, device, equipment and computer readable storage medium |
CN113765663A (en) * | 2021-09-26 | 2021-12-07 | 清华大学 | Method and device for strengthening security of quantum key distribution network |
CN113779614A (en) * | 2021-11-09 | 2021-12-10 | 深圳市永达电子信息股份有限公司 | Encryption method based on improved AES algorithm and computer-readable storage medium |
CN113779614B (en) * | 2021-11-09 | 2022-03-15 | 深圳市永达电子信息股份有限公司 | Encryption method based on improved AES algorithm and computer-readable storage medium |
CN114124529B (en) * | 2021-11-23 | 2024-03-29 | 国网山东省电力公司电力科学研究院 | Method and device for encrypting/decrypting grid-connected test data, and data processing method and device |
CN114124529A (en) * | 2021-11-23 | 2022-03-01 | 国网山东省电力公司电力科学研究院 | Method and device for encrypting/decrypting grid-connected test data and data processing method and device |
CN115695509A (en) * | 2022-09-29 | 2023-02-03 | 北京宜通华瑞科技有限公司 | Intelligent sewing system based on Internet of things communication protocol |
CN116667993A (en) * | 2023-04-28 | 2023-08-29 | 江苏芯信电子科技有限公司 | Block chain identity confirmation system based on big data and using device thereof |
CN117118713A (en) * | 2023-08-30 | 2023-11-24 | 广州趣米网络科技有限公司 | Encryption algorithm based on double encryption |
CN117394987A (en) * | 2023-11-08 | 2024-01-12 | 广东知业科技有限公司 | Method and system for secure communication between edge computing and cloud service |
CN117725605A (en) * | 2024-02-07 | 2024-03-19 | 四川建设网有限责任公司 | Method and system for remotely and automatically compiling electronic archive file information confidentiality |
CN117725605B (en) * | 2024-02-07 | 2024-04-23 | 四川建设网有限责任公司 | Method and system for remotely and automatically compiling electronic archive file information confidentiality |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN113206736A (en) | Encryption method based on AES encryption algorithm | |
CN106656475B (en) | Novel symmetric key encryption method for high-speed encryption | |
JP5911654B2 (en) | Random number generator and stream cipher | |
Siahaan | An overview of the RC4 algorithm | |
AU2003273688B2 (en) | Method of generating a stream cipher using multiple keys | |
WO2014136386A1 (en) | Tag generation device, tag generation method, and tag generation program | |
JPWO2017203992A1 (en) | Encryption apparatus, encryption method, decryption apparatus, and decryption method | |
US9391770B2 (en) | Method of cryption | |
CN113271201B (en) | Dynamic AES physical layer data encryption method | |
Battey et al. | Efficient quasigroup block cipher for sensor networks | |
JP2007019789A (en) | Random number sharing system and method therefor | |
US11075889B2 (en) | Method and system for encrypting/decrypting data with ultra-low latency for secure data storage and/or communication | |
US20040247116A1 (en) | Method of generating a stream cipher using multiple keys | |
Young et al. | Backdoor attacks on black-box ciphers exploiting low-entropy plaintexts | |
KR101076747B1 (en) | Method and apparatus for random accessible encryption and decryption by using a hierarchical tree structure of stream cipher module | |
Amro et al. | Known-plaintext attack and improvement of PRNG-based text encryption | |
JP2015050708A (en) | Dynamic encryption key generation system | |
RU2291578C1 (en) | Method for stream encryption of data | |
JP5268011B2 (en) | Encryption system and decryption system | |
RU2423799C2 (en) | Method for data stream encryption | |
JP2011128655A (en) | Pseudo random number generation system | |
NOUR-EL AINE et al. | Secure IoT Seed-based Matrix Key Generator, A Novel Algorithm for Steganographic Security application. | |
CN114125801A (en) | Bluetooth device data encryption structure and encryption and decryption method | |
Yu et al. | Cryptanalysis and improvement on a block encryption algorithm based on dynamic sequences of multiple chaotic systems | |
He | Research on Password Algorithms based on Chaos and Algebraic Groups |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication |