Encryption authentication method based on hash function and Feistel structure
By employing an encryption and authentication method based on hash functions and Feistel structures, this method addresses the problem that block cipher algorithms cannot provide integrity verification of ciphertext messages. It enables flexible settings for block length and key length, ensuring the security and integrity of data transmission and making it suitable for wireless communication environments such as satellite internet.
Patent Information
- Application Number
- CN202511957209.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-23
- Publication Date
- 2026-03-20
AI Technical Summary
Existing block cipher algorithms have fixed block lengths and limited key lengths, and traditional modes cannot provide ciphertext integrity verification functions, thus failing to effectively guarantee the security and integrity of data transmission in satellite internet.
An encryption and authentication method based on hash functions and Feistel structure is adopted. Ciphertext data is generated by hash function and a check code is output. During decryption, the hash values are verified to ensure integrity.
It enables the adjustment of block length and key length according to application scenarios, improving the adaptability and security of cryptographic algorithms, ensuring the integrity and correctness of data transmission, and is suitable for wireless communication environments such as satellite Internet.
Smart Images

Figure CN121711085A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of information security technology, and in particular to an encryption authentication method based on hash functions and Feistel structures. Background Technology
[0002] With the increasing sophistication of 5G technology, the development of 6G technology has also been put on the agenda. 6G networks will be a fully connected world integrating terrestrial wireless and satellite communications. By incorporating satellite networks into 6G communication networks, seamless global coverage can be achieved. Satellite internet is an open network system with characteristics such as dynamic topology changes, large coverage areas, and long transmission distances. These characteristics, along with the openness of space link communication, make satellite internet vulnerable to various security attacks, both external and internal. Messages sent may be tampered with or forged, and the integrity and authenticity of transmitted data cannot be effectively guaranteed.
[0003] With the expansion of network scale and the increasing severity of network attacks, network applications are placing higher demands on the security of data transmission. To improve data transmission security, more and more network applications are encrypting data and using message integrity verification to ensure data integrity and correctness. However, traditional block cipher algorithms have fixed block lengths and limited key length support. Furthermore, among existing block cipher modes, CBC, CFB, and OFB cannot provide ciphertext message integrity verification and suffer from large error propagation. On the other hand, the ZUC algorithm, a stream cipher with low error propagation, uses different key padding for its 128-bit and 256-bit keys. Therefore, a new mode is urgently needed to address these issues. Summary of the Invention
[0004] The purpose of this invention is to solve at least one technical problem in the background art and to provide an encryption authentication method based on hash functions and Feistel structures.
[0005] To achieve the above objectives, this invention provides an encryption authentication method based on hash functions and Feistel structures, comprising: Encryption authentication: Obtain the plaintext block length L and the key length, select the hash function as the round function of the Feitel structure, and let the hash value length be M; Set plaintext as , key data The initial vector IV is used as input to the hash function, which is then run to obtain the initial hash value. ; From hash value Extracting plaintext data Equal-length hash value , , and XOR generates ciphertext data. ; Run the hash function to get the hash value. From hash value Extracting plaintext data Equal-length hash value , , and , XOR generates ciphertext data. ; Run the hash function to get the hash value. From hash value Extracting plaintext data Equal-length hash value , and , XOR generates ciphertext data. ; This process continues until the hash function is executed and the hash value is obtained. From hash value Extracting plaintext data Equal-length hash value , and , XOR generates ciphertext data. Simultaneously output the hash value. As a verification code; Decryption verification: Obtain the plaintext block length L and the key length, select the hash function as the round function of the Feitel structure, and let the hash value length be M; The ciphertext is , key data The initial vector IV is used as input to the hash function, which is then run to obtain the initial hash value. ; From hash value Intercepting and ciphertext data Equal-length hash value , , and XOR generates plaintext data. ; Run the hash function to get the hash value. From hash value Intercepting and ciphertext data Equal-length hash value , , and , XOR generates plaintext data. ; Run the hash function to get the hash value. From hash value Intercepting and ciphertext data Equal-length hash value , and , XOR generates plaintext data. ; This process continues until the hash function is executed and the hash value is obtained. From hash value Intercepting and ciphertext data Equal-length hash value , and , XOR generates plaintext data. Simultaneously output the hash value. Verify received and Check if they are equal. If they are equal, the integrity check passes; otherwise, the integrity check fails.
[0006] According to one aspect of the invention, if The hash function is a hash function; if The hash function consists of t hash functions.
[0007] According to one aspect of the invention, the specified plaintext is , key data The initial vector IV is used as input to the hash function, which is then run to obtain the initial hash value. ,include: if When the hash function is a hash function, the key data is... The initial vector IV is used as input to the hash function, which is then run to obtain the initial hash value. ; if When there are t hash functions, the t hash functions are used in parallel. The key data K and the initialization vector IV are divided into t equal parts, and then input into the t hash functions sequentially to obtain the result. .
[0008] According to one aspect of the invention, the hash value Extracting plaintext data Equal-length hash value , , and XOR generates ciphertext data. ,include: if , , They are different; if , , They are the same; if , Truncate the hash value and plaintext to the same length Perform an XOR operation to generate ciphertext data. .
[0009] According to one aspect of the invention, the operation of the hash function to obtain the hash value From hash value Extracting plaintext data Equal-length hash value , and , XOR generates ciphertext data. ,include: if Run the hash function to get the hash value. ; if Perform parallel hash operations to obtain a hash value sequence. , , ..., , Truncate the hash value and plaintext to the same length Perform an XOR operation to generate ciphertext data. .
[0010] According to one aspect of the invention, the ciphertext is , key data The initial vector IV is used as input to the hash function, which is then run to obtain the initial hash value. ,include: if When the hash function is a hash function, the key data is... The initial vector IV is used as input to the hash function, which is then run to obtain the initial hash value. ; if When the hash function is t hash functions, the key data is... Divide the initial vector IV into t equal parts, and input them sequentially into t hash functions to obtain... .
[0011] According to one aspect of the invention, the hash value Intercepting and ciphertext data Equal-length hash value , , and XOR generates plaintext data. ,include: if , , They are different; if , , They are the same; if , Truncate the hash value and plaintext to the same length Perform an XOR operation to generate plaintext data. .
[0012] According to one aspect of the invention, the operation of the hash function to obtain the hash value From hash value Intercepting and ciphertext data Equal-length hash value , and , XOR generates plaintext data. ,include: if Run the hash function to get the hash value. ; if Perform parallel hash operations to obtain a hash value sequence. , , ..., , Truncate the hash value and plaintext to the same length Perform an XOR operation to generate plaintext data. .
[0013] To achieve the above objectives, the present invention also provides an encryption authentication system based on hash functions and Feistel structures, comprising: Encryption authentication module: Obtain the plaintext block length L and the key length, select the hash function as the round function of the Feitel structure, and let the hash value length be M; Set plaintext as , key data The initial vector IV is used as input to the hash function, which is then run to obtain the initial hash value. ; From hash value Extracting plaintext data Equal-length hash value , , and XOR generates ciphertext data. ; Run the hash function to get the hash value. From hash value Extracting plaintext data Equal-length hash value , , and , XOR generates ciphertext data. ; Run the hash function to get the hash value. From hash value Extracting plaintext data Equal-length hash value , and , XOR generates ciphertext data. ; This process continues until the hash function is executed and the hash value is obtained. From hash value Extracting plaintext data Equal-length hash value , and , XOR generates ciphertext data. Simultaneously output the hash value. As a verification code; Decryption and verification module: Obtain the plaintext block length L and the key length, select the hash function as the round function of the Feitel structure, and let the hash value length be M; The ciphertext is , key data The initial vector IV is used as input to the hash function, which is then run to obtain the initial hash value. ; From hash value Intercepting and ciphertext data Equal-length hash value , , and XOR generates plaintext data. ; Run the hash function to get the hash value. From hash value Intercepting and ciphertext data Equal-length hash value , , and , XOR generates plaintext data. ; Run the hash function to get the hash value. From hash value Intercepting and ciphertext data Equal-length hash value , and , XOR generates plaintext data. ; This process continues until the hash function is executed and the hash value is obtained. From hash value Intercepting and ciphertext data Equal-length hash value , and , XOR generates plaintext data. Simultaneously output the hash value. Verify received and Check if they are equal. If they are equal, the integrity check passes; otherwise, the integrity check fails.
[0014] To achieve the above objectives, the present invention also provides an electronic device, including a processor, a memory, and a computer program stored in the memory and executable on the processor. When the computer program is executed by the processor, it implements the encryption authentication method based on hash functions and Feistel structures as described above.
[0015] To achieve the above objectives, the present invention also provides a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the encryption and authentication method based on hash functions and Feistel structures as described above.
[0016] According to the above-described scheme of the present invention, the cryptographic design method based on hash functions and Feitel structures allows users to set the plaintext block length according to the communication rate of the application scenario, thus adapting the speed. For example, setting the plaintext block length to 64 bits, 128 bits, 160 bits, 256 bits, or 512 bits significantly improves the adaptability and flexibility of the cryptographic algorithm. By setting the plaintext block length, the algorithm speed can be adjusted according to the needs of the application scenario, expanding the applicability of the cryptographic algorithm.
[0017] Users can set the key length according to the password security strength requirements of the application scenario. For example, setting the key length to 128 bits, 160 bits, 192 bits, 256 bits, etc. can improve the flexibility of the password algorithm's security strength and meet the needs of different security levels without having to change the algorithm itself, thereby saving development costs.
[0018] This invention enables the implementation of key-related hash message authentication code (HMAC) functionality, effectively solving the authentication problem. Through hash operations and Feitel structure design, it ensures the integrity and correctness of data transmission, effectively addressing the lack of message integrity verification functionality in existing block cipher algorithms.
[0019] The encryption and decryption algorithms of the cryptographic design method of the present invention are consistent. In the scenario of serial processing of plaintext, there is no need to design a decryption algorithm. During decryption, the ciphertext can be input into the encryption algorithm.
[0020] The encryption authentication method of the present invention can directly call SM3 during implementation, which saves the time cost of algorithm implementation and is very suitable for domestic platforms.
[0021] The method of this invention is similar to stream cipher, so it has low error propagation and can be widely applied to wireless communication environments such as satellite internet and the Internet of Things. Attached Figure Description
[0022] Figure 1 This diagram illustrates the encryption authentication algorithm flowchart in an encryption authentication method based on hash functions and Feistel structures according to an embodiment of the present invention. Figure 2 The diagram illustrates the decryption authentication algorithm flowchart in an encryption authentication method based on hash functions and Feistel structures according to an embodiment of the present invention. Detailed Implementation
[0023] The invention will now be discussed with reference to exemplary embodiments. It should be understood that the described embodiments are merely intended to enable those skilled in the art to better understand and thus implement the invention, and are not intended to imply any limitation on the scope of the invention.
[0024] As used herein, the term "comprising" and its variations are to be interpreted as open-ended terms meaning "including but not limited to". The term "based on" is to be interpreted as "at least partially based on". The terms "one embodiment" and "an embodiment" are to be interpreted as "at least one embodiment".
[0025] Figure 1 This diagram illustrates the encryption authentication algorithm flowchart in an encryption authentication method based on hash functions and Feistel structures according to an embodiment of the present invention. Figure 2 This diagram schematically illustrates the decryption authentication algorithm flowchart in an encryption authentication method based on hash functions and Feistel structures according to an embodiment of the present invention. Figure 1 and Figure 2 As shown, in this embodiment, the encryption authentication method based on hash functions and Feistel structures includes: Encryption authentication: Obtain the plaintext block length L and the key length, select the hash function as the round function of the Feitel structure, and let the hash value length be M; Set plaintext as , key data The initial vector IV is used as input to the hash function, which is then run to obtain the initial hash value. ; From hash value Extracting plaintext data Equal-length hash value , , and XOR generates ciphertext data. ; Run the hash function to get the hash value. From hash value Extracting plaintext data Equal-length hash value , , and , XOR generates ciphertext data. ; Run the hash function to get the hash value. From hash value Extracting plaintext data Equal-length hash value , and , XOR generates ciphertext data. ; This process continues until the hash function is executed and the hash value is obtained. From hash value Extracting plaintext data Equal-length hash value , and , XOR generates ciphertext data. Simultaneously output the hash value. As a verification code; Decryption verification: Obtain the plaintext block length L and the key length, select the hash function as the round function of the Feitel structure, and let the hash value length be M; The ciphertext is , key data The initial vector IV is used as input to the hash function, which is then run to obtain the initial hash value. ; From hash value Intercepting and ciphertext data Equal-length hash value , , and XOR generates plaintext data. ; Run the hash function to get the hash value. From hash value Intercepting and ciphertext data Equal-length hash value , , and , XOR generates plaintext data. ; Run the hash function to get the hash value. From hash value Intercepting and ciphertext data Equal-length hash value , and , XOR generates plaintext data. ; This process continues until the hash function is executed and the hash value is obtained. From hash value Intercepting and ciphertext data Equal-length hash value , and , XOR generates plaintext data. Simultaneously output the hash value. Verify received and Check if they are equal. If they are equal, the integrity check passes; otherwise, the integrity check fails.
[0026] Furthermore, according to one embodiment of the present invention, if The hash function is a hash function; if The hash function consists of t hash functions.
[0027] Furthermore, according to one embodiment of the present invention, the plaintext is set as , key data The initial vector IV is used as input to the hash function, which is then run to obtain the initial hash value. ,include: if When the hash function is a hash function, the key data is... The initial vector IV is used as input to the hash function, which is then run to obtain the initial hash value. ; if When there are t hash functions, the t hash functions are used in parallel. The key data K and the initialization vector IV are divided into t equal parts, and then input into the t hash functions sequentially to obtain the result. .
[0028] Furthermore, according to one embodiment of the present invention, from the hash value Extracting plaintext data Equal-length hash value , , and XOR generates ciphertext data. ,include: if , , They are different; if , , They are the same; if , Truncate the hash value and plaintext to the same length Perform an XOR operation to generate ciphertext data. .
[0029] Furthermore, according to one embodiment of the present invention, a hash function is run to obtain a hash value. From hash value Extracting plaintext data Equal-length hash value , , and , XOR generates ciphertext data. ,include: if Run the hash function to get the hash value. ; if Perform parallel hash operations to obtain a hash value sequence. , , ..., , Truncate the hash value and plaintext to the same length Perform an XOR operation to generate ciphertext data. .
[0030] Furthermore, according to one embodiment of the present invention, a hash function is run to obtain a hash value. From hash value Extracting plaintext data Equal-length hash value , and , XOR generates ciphertext data. ,include: if Run the hash function to get the hash value. ; if Perform parallel hash operations to obtain a hash value sequence. , , ..., , Truncate the hash value and plaintext to the same length Perform an XOR operation to generate ciphertext data. .
[0031] Furthermore, according to one embodiment of the present invention, a hash function is run to obtain a hash value. From hash value Extracting plaintext data Equal-length hash value , and , XOR generates ciphertext data. ,include: if Run the hash function to get the hash value. ; if Perform parallel hash operations to obtain a hash value sequence. , , ..., , Truncate the hash value and plaintext to the same length Perform an XOR operation to generate ciphertext data. .
[0032] Furthermore, according to one embodiment of the present invention, the encrypted text is... , key data The initial vector IV is used as input to the hash function, which is then run to obtain the initial hash value. ,include: if When the hash function is a hash function, the key data is... The initial vector IV is used as input to the hash function, which is then run to obtain the initial hash value. ; if When the hash function is t hash functions, the key data is... Divide the initial vector IV into t equal parts, and input them sequentially into t hash functions to obtain... .
[0033] Furthermore, according to one embodiment of the present invention, from the hash value Intercepting and ciphertext data Equal-length hash value , , and XOR generates plaintext data. ,include: if , , They are different; if , , They are the same; if , Truncate the hash value and plaintext to the same length Perform an XOR operation to generate plaintext data. .
[0034] Furthermore, according to one embodiment of the present invention, a hash function is run to obtain a hash value. From hash value Intercepting and ciphertext data Equal-length hash value , , and , XOR generates plaintext data. ,include: if Run the hash function to get the hash value. ; if Perform parallel hash operations to obtain a hash value sequence. , , ..., , Extract equal-length hash values and ciphertext Perform an XOR operation to generate plaintext data. .
[0035] Furthermore, according to one embodiment of the present invention, a hash function is run to obtain a hash value. From hash value Intercepting and ciphertext data Equal-length hash value , and , XOR generates plaintext data. ,include: if Run the hash function to get the hash value. ; if Perform parallel hash operations to obtain a hash value sequence. , , ..., , Extract equal-length hash values and ciphertext Perform an XOR operation to generate plaintext data. .
[0036] Furthermore, according to one embodiment of the present invention, a hash function is run to obtain a hash value. From hash value Intercepting and ciphertext data Equal-length hash value , and , XOR generates plaintext data. ,include: if Run the hash function to get the hash value. ; if Perform parallel hash operations to obtain a hash value sequence. , , ..., , Truncate the hash value and plaintext to the same length Perform an XOR operation to generate plaintext data. .
[0037] According to the above-described scheme of the present invention, the cryptographic design method based on hash functions and Feitel structures allows users to set the plaintext block length according to the communication rate of the application scenario, thus adapting the speed. For example, setting the plaintext block length to 64 bits, 128 bits, 160 bits, 256 bits, or 512 bits significantly improves the adaptability and flexibility of the cryptographic algorithm. By setting the plaintext block length, the algorithm speed can be adjusted according to the needs of the application scenario, expanding the applicability of the cryptographic algorithm.
[0038] Users can set the key length according to the password security strength requirements of the application scenario. For example, setting the key length to 128 bits, 160 bits, 192 bits, 256 bits, etc. can improve the flexibility of the password algorithm's security strength and meet the needs of different security levels without having to change the algorithm itself, thereby saving development costs.
[0039] This invention enables the implementation of key-related hash message authentication code (HMAC) functionality, effectively solving the authentication problem. Through hash operations and Feitel structure design, it ensures the integrity and correctness of data transmission, effectively addressing the lack of message integrity verification functionality in existing block cipher algorithms.
[0040] The encryption and decryption algorithms of the cryptographic design method of the present invention are consistent. In the scenario of serial processing of plaintext, there is no need to design a decryption algorithm. During decryption, the ciphertext can be input into the encryption algorithm.
[0041] The encryption authentication method of the present invention can directly call SM3 during implementation, which saves the time cost of algorithm implementation and is very suitable for domestic platforms.
[0042] The method of this invention is similar to stream cipher, so it has low error propagation and can be widely applied to wireless communication environments such as satellite internet and the Internet of Things.
[0043] Furthermore, to achieve the above objectives, the present invention also provides an encryption authentication system based on hash functions and Feistel structures, comprising: Encryption authentication module: Obtain the plaintext block length L and the key length, select the hash function as the round function of the Feitel structure, and let the hash value length be M; Set plaintext as , key data The initial vector IV is used as input to the hash function, which is then run to obtain the initial hash value. ; From hash value Extracting plaintext data Equal-length hash value , , and XOR generates ciphertext data. ; Run the hash function to get the hash value. From hash value Extracting plaintext data Equal-length hash value , , and , XOR generates ciphertext data. ; Run the hash function to get the hash value. From hash value Extracting plaintext data Equal-length hash value , and , XOR generates ciphertext data. ; This process continues until the hash function is executed and the hash value is obtained. From hash value Extracting plaintext data Equal-length hash value , and , XOR generates ciphertext data. Simultaneously output the hash value. As a verification code; Decryption and verification module: Obtain the plaintext block length L and the key length, select the hash function as the round function of the Feitel structure, and let the hash value length be M; The ciphertext is , key data The initial vector IV is used as input to the hash function, which is then run to obtain the initial hash value. ; From hash value Intercepting and ciphertext data Equal-length hash value , , and XOR generates plaintext data. ; Run the hash function to get the hash value. From hash value Intercepting and ciphertext data Equal-length hash value , , and , XOR generates plaintext data. ; Run the hash function to get the hash value. From hash value Intercepting and ciphertext data Equal-length hash value , and , XOR generates plaintext data. ; This process continues until the hash function is executed and the hash value is obtained. From hash value Intercepting and ciphertext data Equal-length hash value , and , XOR generates plaintext data. Simultaneously output the hash value. Verify received and Check if they are equal. If they are equal, the integrity check passes; otherwise, the integrity check fails.
[0044] The encryption authentication system based on hash functions and Feistel structure according to the present invention can implement the encryption authentication method based on hash functions and Feistel structure. The specific process steps are as described above and will not be repeated here.
[0045] Furthermore, to achieve the above objectives, the present invention also provides an electronic device, including a processor, a memory, and a computer program stored in the memory and executable on the processor. When the computer program is executed by the processor, it implements the encryption authentication method based on hash functions and Feistel structures as described above.
[0046] Furthermore, to achieve the above objectives, the present invention also provides a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the encryption and authentication method based on hash functions and Feistel structures as described above.
[0047] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely one preferred embodiment of the invention and are only used to explain the invention. They do not limit the scope of protection of the invention. All other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this invention.
[0048] Example 1 This embodiment provides an encryption authentication method based on hash functions and Feistel structures, including: Encryption authentication algorithm: Step 1: The sender selects the international hash function standard SHA3_512 as the hash function, with an output length of 512 bits and a plaintext block length of 128 bits. The key... 128 bits in length, assuming there are three plaintext blocks. , ; Step 2: Calculate the hash value ; Step 3, from the hash value Starting from the highest bit, two 128-bit segments are extracted sequentially, denoted as . , , and XOR yields ciphertext ; Step 4: Run the hash function to obtain the hash value. From hash value Extracting hash values from the middle , , and , XOR generates ciphertext data. ; Step 5: Run the hash function to obtain the hash value. From hash value Extracting hash values from the middle , and , XOR generates ciphertext data. ; and Decryption verification algorithm: Step 1: The receiver selects SHA3_512 as the hash function, the ciphertext block length is 128 bits, and the key... 128 bits in length, assuming there are three ciphertext blocks. , ; Step 2: Calculate the hash value ; Step 3, from the hash value Starting from the highest bit, two 128-bit segments are extracted sequentially, denoted as . , , and XOR yields plaintext ; Step 4: Run the hash function to obtain the hash value. From hash value Extracting hash values from the middle , , and , XOR generates plaintext data. ; Step 5: Run the hash function to obtain the hash value. From hash value Extracting hash values from the middle , and , XOR generates plaintext data. ; Recipient comparison and Check if they are equal. If they are equal, it means that the complete message has been received, confirming that the sender has the same key as you.
[0049] Those skilled in the art will recognize that the modules and algorithm steps described in conjunction with the embodiments disclosed herein can be implemented using electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementations should not be considered beyond the scope of this invention.
[0050] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working process of the above-described apparatus and equipment can be referred to the corresponding process in the foregoing method implementation, and will not be repeated here.
[0051] In the embodiments provided in this application, it should be understood that the disclosed apparatus and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of modules is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple modules or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between apparatuses or modules may be electrical, mechanical, or other forms.
[0052] The modules described as separate components may or may not be physically separate. The components shown as modules may or may not be physical modules; that is, they may be located in one place or distributed across multiple network modules. Some or all of the modules can be selected to achieve the objectives of the embodiments of the present invention, depending on actual needs.
[0053] In addition, the functional modules in the embodiments of the present invention can be integrated into one processing module, or each module can exist physically separately, or two or more modules can be integrated into one module.
[0054] If the aforementioned functions are implemented as software functional modules and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this invention, essentially, or the part that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the sending / receiving methods of various embodiments of this invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, ROM, RAM, magnetic disks, or optical disks.
[0055] The above description is merely a preferred embodiment of this application and an explanation of the technical principles employed. Those skilled in the art should understand that the scope of the invention involved in this application is not limited to technical solutions formed by specific combinations of the above-described technical features, but should also cover other technical solutions formed by arbitrary combinations of the above-described technical features or their equivalents without departing from the inventive concept. For example, technical solutions formed by substituting the above-described features with (but not limited to) technical features with similar functions disclosed in this application.
[0056] It should be understood that the sequence number of each step in the invention and its embodiments does not absolutely imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present invention.
Claims
1. An encryption and authentication method based on hash functions and Feistel structures, characterized in that, include: Encryption authentication: Obtain the plaintext block length L and the key length, select the hash function as the round function of the Feitel structure, and let the hash value length be M; Set plaintext as , key data The initial vector IV is used as input to the hash function, which is then run to obtain the initial hash value. ; From hash value Extracting plaintext data Equal-length hash value , , and XOR generates ciphertext data. ; Run the hash function to get the hash value. From the hash value Extracting plaintext data Equal-length hash value , , and , XOR generates ciphertext data. ; Run the hash function to get the hash value. From the hash value Extracting plaintext data Equal-length hash value , and , XOR generates ciphertext data. ; This process continues until the hash function is executed and the hash value is obtained. From the hash value Extracting plaintext data Equal-length hash value , and , XOR generates ciphertext data. Simultaneously output the hash value. As a verification code; Decryption verification: Obtain the plaintext block length L and the key length, select the hash function as the round function of the Feitel structure, and let the hash value length be M; The ciphertext is , key data The initial vector IV is used as input to the hash function, which is then run to obtain the initial hash value. ; From hash value Intercepting and ciphertext data Equal-length hash value , , and XOR generates plaintext data. ; Run the hash function to get the hash value. From the hash value Intercepting and ciphertext data Equal-length hash value , , and , XOR generates plaintext data. ; Run the hash function to get the hash value. From the hash value Intercepting and ciphertext data Equal-length hash value , and , XOR generates plaintext data. ; This process continues until the hash function is executed and the hash value is obtained. From the hash value Intercepting and ciphertext data Equal-length hash value , and , XOR generates plaintext data. Simultaneously output the hash value. Verify received and Check if they are equal. If they are equal, the integrity check passes; otherwise, the integrity check fails.
2. The encryption and authentication method based on hash functions and Feistel structures according to claim 1, characterized in that, if The hash function is a hash function; if The hash function consists of t hash functions.
3. The encryption and authentication method based on hash functions and Feistel structures according to claim 1, characterized in that, The specified plaintext is , key data The initial vector IV is used as input to the hash function, which is then run to obtain the initial hash value. ,include: if When the hash function is a hash function, the key data is... The initial vector IV is used as input to the hash function, which is then run to obtain the initial hash value. ; if When there are t hash functions, the t hash functions are used in parallel. The key data K and the initialization vector IV are divided into t equal parts, and then input into the t hash functions sequentially to obtain the result. .
4. The encryption and authentication method based on hash functions and Feistel structure according to claim 1, characterized in that, The from the hash value Extracting plaintext data Equal-length hash value , , and XOR generates ciphertext data. ,include: if , , They are different; if , , They are the same; if , Truncate the hash value and plaintext to the same length Perform an XOR operation to generate ciphertext data. .
5. The encryption and authentication method based on hash functions and Feistel structures according to claim 1, characterized in that, The hash function is run to obtain the hash value. From the hash value Extracting plaintext data Equal-length hash value , and , XOR generates ciphertext data. ,include: if Run the hash function to get the hash value. ; if Perform parallel hash operations to obtain a hash value sequence. , , ..., , Truncate the hash value and plaintext to the same length Perform an XOR operation to generate ciphertext data. .
6. The encryption and authentication method based on hash functions and Feistel structures according to claim 1, characterized in that, The ciphertext is , key data The initial vector IV is used as input to the hash function, which is then run to obtain the initial hash value. ,include: if When the hash function is a hash function, the key data is... The initial vector IV is used as input to the hash function, which is then run to obtain the initial hash value. ; if When the hash function is t hash functions, the key data is... Divide the initial vector IV into t equal parts, and input them sequentially into t hash functions to obtain... .
7. The encryption and authentication method based on hash functions and Feistel structures according to claim 1, characterized in that, The from the hash value Intercepting and ciphertext data Equal-length hash value , , and XOR generates plaintext data. ,include: if , , They are different; if , , They are the same; if , Truncate the hash value and plaintext to the same length Perform an XOR operation to generate plaintext data. .
8. The encryption and authentication method based on hash functions and Feistel structures according to claim 1, characterized in that, The hash function is run to obtain the hash value. From the hash value Intercepting and ciphertext data Equal-length hash value , and , XOR generates plaintext data. ,include: if Run the hash function to get the hash value. ; if Perform parallel hash operations to obtain a hash value sequence. , , ..., , Truncate the hash value and plaintext to the same length Perform an XOR operation to generate plaintext data. .
9. An encryption authentication system based on hash functions and Feistel structures, characterized in that, include: Encryption authentication module: Obtain the plaintext block length L and the key length, select the hash function as the round function of the Feitel structure, and let the hash value length be M; Set plaintext as , key data The initial vector IV is used as input to the hash function, which is then run to obtain the initial hash value. ; From hash value Extracting plaintext data Equal-length hash value , , and XOR generates ciphertext data. ; Run the hash function to get the hash value. From the hash value Extracting plaintext data Equal-length hash value , , and , XOR generates ciphertext data. ; Run the hash function to get the hash value. From the hash value Extracting plaintext data Equal-length hash value , and , XOR generates ciphertext data. ; This process continues until the hash function is executed and the hash value is obtained. From the hash value Extracting plaintext data Equal-length hash value , and , XOR generates ciphertext data. Simultaneously output the hash value. As a verification code; Decryption and verification module: Obtain the plaintext block length L and the key length, select the hash function as the round function of the Feitel structure, and let the hash value length be M; The ciphertext is , key data The initial vector IV is used as input to the hash function, which is then run to obtain the initial hash value. ; From hash value Intercepting and ciphertext data Equal-length hash value , , and XOR generates plaintext data. ; Run the hash function to get the hash value. From the hash value Intercepting and ciphertext data Equal-length hash value , , and , XOR generates plaintext data. ; Run the hash function to get the hash value. From the hash value Intercepting and ciphertext data Equal-length hash value , and , XOR generates plaintext data. ; This process continues until the hash function is executed and the hash value is obtained. From the hash value Intercepting and ciphertext data Equal-length hash value , and , XOR generates plaintext data. Simultaneously output the hash value. Verify received and Check if they are equal. If they are equal, the integrity check passes; otherwise, the integrity check fails.
10. An electronic device, characterized in that, It includes a processor, a memory, and a computer program stored in the memory and executable on the processor, wherein the computer program, when executed by the processor, implements the encryption authentication method based on a hash function and a Feistel structure as described in any one of claims 1-8.
11. A computer-readable storage medium, characterized in that, A computer program is stored on the computer-readable storage medium, which, when executed by a processor, implements the encryption and authentication method based on a hash function and a Feistel structure as described in any one of claims 1-7.