CN115348018B - Data processing method, device and storage medium - Google Patents

Data processing method, device and storage medium Download PDF

Info

Publication number
CN115348018B
CN115348018B CN202210881193.0A CN202210881193A CN115348018B CN 115348018 B CN115348018 B CN 115348018B CN 202210881193 A CN202210881193 A CN 202210881193A CN 115348018 B CN115348018 B CN 115348018B
Authority
CN
China
Prior art keywords
subkey
polynomial
encryption
crc8
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.)
Active
Application number
CN202210881193.0A
Other languages
Chinese (zh)
Other versions
CN115348018A (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.)
Shaanxi Zhoudun Software Technology Co ltd
Original Assignee
Shaanxi Zhoudun Software 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 Shaanxi Zhoudun Software Technology Co ltd filed Critical Shaanxi Zhoudun Software Technology Co ltd
Priority to CN202210881193.0A priority Critical patent/CN115348018B/en
Publication of CN115348018A publication Critical patent/CN115348018A/en
Application granted granted Critical
Publication of CN115348018B publication Critical patent/CN115348018B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

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/14Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols using a plurality of keys or algorithms
    • 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/0643Hash functions, e.g. MD5, SHA, HMAC or f9 MAC
    • 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/065Encryption by serially and continuously modifying data stream elements, e.g. stream cipher systems, RC4, SEAL or A5/3
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L2209/00Additional information or applications relating to cryptographic mechanisms or cryptographic arrangements for secret or secure communication H04L9/00
    • H04L2209/12Details relating to cryptographic hardware or logic circuitry

Abstract

The invention discloses a data transmission method, which is based on an encryption algorithm of CRC8 polynomials, has reversible hash and is unique in a Galois field, and provides a method for applying CRC8 as a hash function to stream encryption in the field of symmetric encryption. The invention adopts a main key hash to generate a polynomial form, takes a subkey as a byte (stream) encryption method of an index lookup table, and adopts a position counter parameter to solve the subkey collision problem; third, the invention solves the technical problem that the encryption and decryption speed is in direct proportion to the length of the master key, when the master key is 128x2 n When n is a non-negative integer, n is more than or equal to 0 and less than or equal to 4), the encryption and decryption speed is increased along with the increase of n.

Description

Data processing method, device and storage medium
Technical Field
The invention belongs to the technical field of data processing, and particularly relates to a data processing method, a data processing device and a storage medium.
Background
For an end-to-end and point-to-point data transmission application scene, a data processing request sent by a client is received, and the technical problem of data leakage can be solved. If the data security processing is involved, the data is in an unprotected state, even delay occurs, and the real-time requirement is not met.
According to the theory of the galois field: a finite field, also known as a galois field, is a field containing only a limited number of elements. Like other domains, a finite domain is a set of rules that define all the operations of addition, subtraction, multiplication, and division and satisfy a particular rule. Where the addition and multiplication must satisfy the rules of swapping, combining and assigning. Addition and multiplication have a closure, i.e. the addition and multiplication result is still an element in the domain.
The existing stream encryption algorithm obtains a pseudo-random key byte stream in a pre-preparation stage, and encryption or decryption only needs exclusive OR calculation. Meanwhile, the existing stream encryption algorithm generates a multi-byte random byte stream through kernel function calculation, then is spliced into a final pseudo-random byte stream, and performs exclusive-or operation with plaintext or ciphertext to complete encryption and decryption, and the ways of static encryption and decryption tables, linear compression tables, nonlinear replacement, a double-key mechanism, dynamic index table lookup and the like are not used.
The "perfect confidentiality" according to shannon theory requires that the key length is not smaller than the plaintext length, which may be any length. Thus, the prior art typically implements a keystream length that is not less than the plaintext length by a pseudo-random keystream generator. In reality, however, the pseudo-random key stream formed by the pseudo-random key stream generator may be periodically changed, thereby creating a hidden danger for data security of the key stream.
Disclosure of Invention
Aiming at the problems of the existing stream encryption algorithm, the invention provides a data processing method, a data processing device, computer equipment and a storage medium. The method comprises the steps that a data processing request sent by a client is received, ciphertext data is carried in the data processing request, and the ciphertext data is generated after the target data is encrypted by the client by using a polynomial encryption algorithm; responding to the data processing request, and calling polynomial encryption flow operation according to a preset secret key to obtain ciphertext feature data; and sending the ciphertext feature data to a server, wherein the server is used for calling a polynomial decryption algorithm with the client according to a preset key to process the ciphertext feature data to obtain plaintext feature data, and vice versa. The invention provides a new implementation way, which can process the ciphertext of the data under the condition that the input is plaintext data, can effectively protect the data privacy and can save bandwidth resources.
The invention provides a data transmission method, which is based on an encryption algorithm of CRC8 polynomials, has reversible hash and is unique in a Galois field, and provides a method for applying CRC8 as a hash function to stream encryption in the field of symmetric encryption. Secondly, in order to improve encryption and decryption speed, the invention adopts a main key hash to generate a polynomial form, a subkey is used as a byte (stream) encryption method of an index lookup table, and a position counter parameter is adopted to solve the problem of subkey collision, thereby realizing the pseudo-random of ciphertext stream; third, the invention solves the technical problem that the encryption and decryption speed is in direct proportion to the length of the master key, when the master key is 128x2 n When n is a non-negative integer, n is more than or equal to 0 and less than or equal to 4), the encryption and decryption speed is increased along with the increase of n.
In order to realize the technical task, the invention adopts the following technical scheme:
a data transmission method, the method comprising the steps of:
step 1: generating a corresponding static polynomial form by the master key according to the encryption or decryption flow;
step 2: the subkey is continuously rotated into a new subkey in the encryption or decryption process;
step 3: and carrying out index table lookup on the new subkey in the main key static polynomial table for a plurality of times to finish the byte encryption or decryption task.
Further, the step 1: the master key generates a corresponding static polynomial table through a kernel function CRC8 according to an encryption or decryption process.
Step 1: the master key generates a static polynomial form through kernel CRC8 hashing in an encryption process, the master key generates a static polynomial form through kernel CRC8 inverse hashing in a decryption process, and the static polynomial forms generated by the hashing and the inverse hashing are reciprocal and unique in a Galois field.
Step 1: the master key generates a static polynomial table through kernel function CRC8 hashing in the encryption process, and specifically comprises the following steps:
1) Hashing any type of master key to 128x2 via kernel CRC8 n (n is a non-negative integer, n is 0.ltoreq.4) bits of the master key;
2) For 16x2 n (n is a non-negative integer, 0.ltoreq.n.ltoreq.4) independent master key bytes, comprising 16x2 n (n is a non-negative integer, 0.ltoreq.n.ltoreq.4) polynomials of the kernel function CRC8, wherein 2m (m is a positive integer, 2.ltoreq.m.ltoreq.8x2 n ) Byte, performing 2m degree CRC8 polynomial hash;
3) For the pass through 2m (m is a positive integer, and m is more than or equal to 2 and less than or equal to 8x 2) n ) After linear S-box replacement is carried out on the data hashed by the secondary CRC8 polynomial, 2m (m is a positive integer, and m is more than or equal to 2 and less than or equal to 8x 2) n ) The CRC 8-th order polynomial hash is performed at every two 2m (m is a positive integer, and 2.ltoreq.m.ltoreq.8x2 n ) Intermediate interval linear S-box permutation of the sub-CRC 8 polynomial until traversing the master key byte, generating 2 n+4 x256 (n is a non-negative integer, 0.ltoreq.n.ltoreq.4).
Further, step 1: the master key generates a static polynomial table through the kernel function CRC8 inverse hash in the decryption process, and specifically comprises the following steps:
1) The master key of any type is hashed back to 128x2 via a kernel function CRC8 n (n is a non-negative integer, n is 0.ltoreq.4) bits of the master key;
2) For 16x2 n (n is a non-negative integer, 0.ltoreq.n.ltoreq.4) independent master key bytes, comprising 16x2 n (n is a non-negative integer, 0.ltoreq.n.ltoreq.4) polynomials of the kernel function CRC8, wherein 2m (m is a positive integer, 2.ltoreq.m.ltoreq.8x2 n ) Byte, performing 2m degree CRC8 polynomial inverse hash;
3) For the pass through 2m (m is a positive integer, and m is more than or equal to 2 and less than or equal to 8x 2) n ) After linear S-box replacement is carried out on the data of the sub CRC8 polynomial inverse hash, 2m (m is a positive integer, and m is more than or equal to 2 and less than or equal to 8x 2) n ) The sub-CRC 8 polynomial is inversely hashed, namely, every two 2m (m is a positive integer, and 2.ltoreq.m.ltoreq.8x2 n ) Intermediate interval linear S-box permutation of the sub-CRC 8 polynomial until traversing the master key byte, generating 2 n +4 x256 (n is a non-negative integer, 0.ltoreq.n.ltoreq.4).
Step 2: the subkey is continuously rotated into a new subkey in the encryption or decryption process, and specifically comprises the following steps:
1) Generating a subkey according to the master key;
2) Performing exclusive OR operation on the sub-keys of 4 bytes generated according to the main key and a position counter of a plaintext byte which is input at the beginning to obtain a new sub-key;
3) The new 4-byte subkey is divided into subkey 1, subkey 2, subkey 3, subkey 4 in bytes.
And step 3: performing index table lookup on the new subkey in the main key static polynomial table for a plurality of times to complete the byte encryption or decryption task, wherein the completion of the byte encryption task specifically comprises:
1) Performing exclusive OR operation on the input plaintext data and the subkey 1;
2) Inputting the result of the exclusive-or operation into a static polynomial table generated by the main key in the encryption process, carrying out table indexing through the subkey 2, carrying out exclusive-or operation with the index table lookup result, and simultaneously carrying out nonlinear S-box replacement on the exclusive-or operation result;
3) Performing exclusive-or operation on the result after the nonlinear S-box replacement and the subkey 3, inputting the result into a static polynomial table generated by the main key in an encryption process, performing table indexing through the subkey 3, and performing exclusive-or operation on the result and the subkey 4 of the index lookup table;
4) Outputting encrypted ciphertext data;
5) And calling continuous rotation to generate a new subkey, and repeating the steps 1) -4) until the encryption task is finished.
Step 3: and carrying out index table lookup on the new subkey in the main key static polynomial table for a plurality of times to complete the byte encryption or decryption task, wherein the completion of the byte decryption task specifically comprises the following steps:
1) Performing exclusive OR operation on the input ciphertext data and the subkey 4;
2) Inputting the result of the exclusive-or operation into a static polynomial table generated by the main key in the decryption process, carrying out table indexing through the subkey 3, carrying out exclusive-or operation with the index table lookup result, and simultaneously carrying out nonlinear S-box replacement on the exclusive-or operation result;
3) Performing exclusive-or operation on the result after the nonlinear S-box replacement and the subkey 2, inputting the result into a static polynomial table generated by the main key in a decryption process, performing table indexing through the subkey 2, and performing exclusive-or operation on the result of the index lookup table and the subkey 1;
4) Outputting decrypted plaintext data;
5) And calling continuous rotation to generate a new subkey, and repeating the steps 1) -4) until the decryption task is finished.
The method of the present invention further comprises, prior to step 1, hashing the initial key given by the user to obtain a master key of fixed length. The initial key given by the user is hashed to 128x2 via a kernel function CRCn (n=128, 256, 512, 1024, 2048) n (n is a non-negative integer, 0.ltoreq.n.ltoreq.4) bits.
The subkey to which the present invention relates is 32 bits.
The invention also provides a data transmission device, which comprises a processor and a memory;
the memory is used for storing;
the processor is used for executing the data transmission method of the invention through calling.
A computer program product comprising a computer program and/or instructions which, when executed by a processor, implement the data transmission method of the invention.
Compared with the prior art, the invention has the following technical characteristics and beneficial effects:
1) The invention hashes the main key through the kernel function CRC8 polynomial to generate a static polynomial table, dynamically indexes the table lookup of the subkeys, and takes the plaintext byte or the ciphertext byte as a unit sequence to encrypt the byte stream or decrypt the byte stream.
2) The invention effectively reduces the storage space and improves the use efficiency while improving the security intensity during encryption and decryption, and the maximum compression ratio can reach the lossless compression of 32:1, thereby being more suitable for the embedded development with limited resources.
3) The stream encryption algorithm has a double-key mechanism, and the main key generates a static encryption and decryption polynomial form through the polynomial hash of a reversible kernel function CRC8 before encryption and decryption, so that the encryption and decryption tabulation process is completed. The hash generation static encryption and decryption polynomial forms are unique, and the problem of key collision does not exist. The subkey is continually rotated to a new subkey during encryption or decryption.
4) The encryption algorithm master key hash generation polynomial table making mode uses the subkeys as index table look-up, and adopts the position counter to solve the subkey collision problem, so as to improve the pseudo-randomness of the ciphertext flow of the encryption method and increase the security intensity.
5) The encryption algorithm realizes the direct proportion between the encryption and decryption speed and the length of the master key, and when the length of the master key is increased, the encryption and decryption speed is also increased.
Drawings
FIG. 1 is a static polynomial form generation flow for encryption and decryption of the present invention;
FIG. 2 is a dynamic table look-up and subkey rotation update flow for encryption and decryption in accordance with the present invention.
Fig. 3 shows the same key as in the prior art, and the encryption effect is compared with that of the present invention. FIG. 3a shows that no position counter is used, and ciphertext data is periodically collided; fig. 3b shows that the ciphertext data is not collided and has no periodicity by using the position calculator.
Detailed Description
The present invention will be described in further detail with reference to the drawings and detailed description.
The invention relates to a data transmission method, which integrally comprises the following steps:
step 1: generating a static polynomial form by the master key according to the encryption or decryption flow;
step 2: the subkey is continuously rotated into a new subkey in the encryption or decryption process;
step 3: and carrying out index table lookup on the new subkey in the main key static polynomial table for a plurality of times to finish the byte encryption or decryption task.
Wherein, step 1: the master key generates a static polynomial table through a reversible kernel function CRC8 according to an encryption or decryption procedure, respectively.
Specifically, an initial key given by a user is first hashed to 128x2 via a kernel function CRCn (n=128, 256, 512, 1024, 2048) n (n is a non-negative integer, 0.ltoreq.n.ltoreq.4) bits. Then the master key is hashed by the kernel function CRC8 in the encryption process to generate a static polynomial table, the master key is hashed by the kernel function CRC8 in the decryption process to generate the static polynomial table, and the hashed generated static polynomial table are reciprocal and unique in the Galois field.
Referring to fig. 1, the process of generating a static polynomial table by hashing or inverse hashing the master key by the kernel CRC8 in the encryption or decryption process is as follows:
1) The initial key given by the user is hashed to obtain 128x2 n (n is a non-negative integer, 0.ltoreq.n.ltoreq.4) bits.
2) For 16x2 n (n is a non-negative integer, n is more than or equal to 0 and less than or equal to 4) independent master key bytes to form a master key containingWith 16x2 n (n is a non-negative integer, 0.ltoreq.n.ltoreq.4) polynomials of the kernel function CRC8, wherein 2m (m is a positive integer, 2.ltoreq.m.ltoreq.8x2 n ) And (3) performing 2 m-degree CRC8 polynomial hashing or inverse hashing on bytes.
3) For the pass through 2m (m is a positive integer, and m is more than or equal to 2 and less than or equal to 8x 2) n ) After linear S-box replacement is carried out on the data subjected to secondary CRC8 polynomial hash or inverse hash, 2m (m is a positive integer, and m is more than or equal to 2 and less than or equal to 8x 2) n ) The sub-CRC 8 polynomial hash or inverse hash, i.e., at every two 2m (m is a positive integer, 2.ltoreq.mltoreq.8x2 n ) Intermediate interval linear S-box permutation of the sub-CRC 8 polynomial until traversing the master key byte, 16x2 is generated n x256 (n is a non-negative integer, 0.ltoreq.n.ltoreq.4).
For example: the master key is divided into 4 independent master key bytes to form 1 group of polynomials containing 4 kernel functions CRC8, and 4 times CRC8 polynomial hashes are respectively carried out on the input data 0x 00-0 xFF. 4-degree CRC8 polynomial hash is performed on the input data 0x 00-0 xFF respectively, 1 degree CRC8 polynomial linear permutation is added in the middle, 1 group of 4x256 data tables are output until the bytes of the master key are used, and 2 are generated n+4 x256 (n is a non-negative integer, 0.ltoreq.n.ltoreq.4). For 128x2 n (n is a non-negative integer, n is more than or equal to 0 and less than or equal to 4), and the like, so that 16x256, 32x256, 64x256, 128x256 and 256x256 static polynomial tables can be obtained. In the process of generating the polynomial table, 4 times of kernel function CRC8 polynomial hash computation are shared, and 1 time of linear S-box substitution is mixed in every 2 times of computation. The linear S-box permutation nature is the hash value generated by hashing the CRC8 polynomial of 256x 256. In other words, a linear S-box permutation can be considered to be a hash calculation with a kernel function CRC8 polynomial on the 1 st order and input bytes on the abscissa. It follows that the generator polynomial table shares 5 th order kernel function CRC8 polynomial hash calculations. For any byte in 0x 00-0 xFF, hash bytes in 0x 00-0 xFF are generated through polynomial hashing of a kernel function CRC 8; conversely, for any hashed byte in 0x 00-0 xFF, the bytes in 0x 00-0 xFF are generated via the polynomial inverse hash of the kernel CRC 8. Moreover, both the hash and the reverse hash are unique, and there is no collision. For the followingThe bytes in 0x 00-0 xFF are hashed by polynomials of the kernel function CRC8 to generate hashed bytes to form a row of polynomial table corresponding to the kernel function CRC 8. Then, the polynomial hashes of the plurality of different kernel functions CRC8 may form a multi-row polynomial table, i.e. the different kernel functions CRC8 are on the ordinate and the bytes in 0x 00-0 xFF are on the abscissa, so as to form a two-dimensional polynomial table, and the index value of the ordinate is the hashed byte.
The encryption static polynomial table is generated through kernel function CRC8 polynomial hash, the decryption static polynomial table is generated through kernel function CRC8 polynomial inverse hash, and the encryption static polynomial table and the decryption static polynomial table are mutually reversible processes, so that a reversible mechanism of a stream encryption algorithm core of the invention is formed together.
When the master key generates a static polynomial table through kernel CRC8 hashing or inverse hashing in an encryption flow or a decryption flow, 8 bytes which are not repeated are arbitrarily selected from 0x 00-0 xFF, and each byte can be decomposed into the sum of 8 bytes. The decomposed 8 bytes hashed by the polynomial of the kernel function CRC8 into a sub-table of a polynomial table of 8 elements, and according to the method, a polynomial sub-table of any other 7 bytes is produced, and a polynomial table of one row of CRC8 is synthesized in the Galois field. Because the number of row elements of the sub-table of the polynomial table is 8, the number of row elements of the whole table of the polynomial table is 256, and obviously, the whole table can be decomposed into sub-tables, and the sub-tables can be synthesized into the whole table, and the maximum compression ratio is 32:1. It follows that for any one byte from 0x00 to 0xFF, a linear representation of 8 bytes in the galois field can be used that is not repeated. Then 256 bytes of 0x 00-0 xFF can be obtained by this non-repeated 8 byte linear calculation, i.e. a compression ratio of 256:8=32:1 is obtained.
For the polynomial table sub-table generated by the polynomial hash of the kernel function CRC8, for encryption and decryption, the whole table synthesized into the polynomial table in the memory is only provided when indexing the table look-up, so that the security intensity of the encryption method is improved and the use efficiency of the storage space is also improved.
The master key of the invention is 128x2 n (n is a non-negative integer, 0.ltoreq.n.ltoreq.4) bits, for encryption and decryption processes, as n increases,the corresponding shifting times are sequentially 4-n (n is a non-negative integer, and n is more than or equal to 0 and less than or equal to 4). With the increase of n, the difference of algorithm implementation is only that the shift times are reduced, so that the algorithm implementation speed is equivalent to the improvement speed, namely the encryption and decryption speed is proportional to the length of the master key, and when the length of the master key is increased, the encryption and decryption speed is also increased.
Step 2 of the invention: the subkey is continuously rotated into a new subkey in the encryption or decryption process, and the specific process comprises the following steps:
1) Generating a subkey according to the master key; where the subkey is 32 bits, i.e. 4 bytes.
2) Performing exclusive OR operation on the arbitrarily generated sub-keys with 4 bytes and a position counter of a plaintext byte which is input at the beginning to obtain a new sub-key; the purpose of this position calculator parameter is to make the subkey 0-2 in order to eliminate the subkey collision of the 32-bit pseudo random stream key generator in the data range of 4G 32 No regularity in the variation range of-1 can be followed to enhance the randomness.
3) The new subkey is divided into subkey 1, subkey 2, subkey 3, subkey 4 in bytes.
Referring to fig. 2, in step 3 of the present invention, a new subkey is subjected to multiple index lookup in the static polynomial table of the master key to complete the byte encryption or decryption task.
The byte encryption task completion specifically comprises:
1) Performing exclusive OR operation on the input plaintext data and the subkey 1;
2) Inputting the result of the exclusive-or operation into a static polynomial table generated by the main key in the encryption process, carrying out table indexing through the subkey 2, carrying out exclusive-or operation with the index table lookup result, and simultaneously carrying out nonlinear S-box replacement on the exclusive-or operation result;
3) Performing exclusive-or operation on the result after the nonlinear S-box replacement and the subkey 3, inputting the result into a static polynomial table generated by the main key in an encryption process, performing table indexing through the subkey 3, and performing exclusive-or operation on the result and the subkey 4 of the index lookup table;
4) Outputting encrypted ciphertext data;
5) Calling continuous rotation to generate a new subkey, and repeating the steps 1) -4) until the encryption task is finished.
The specific completion byte decryption tasks include:
1) Performing exclusive OR operation on the input ciphertext data and the subkey 4;
2) Inputting the result of the exclusive-or operation into a static polynomial table generated by the main key in the decryption process, carrying out table indexing through the subkey 3, carrying out exclusive-or operation with the index table lookup result, and simultaneously carrying out nonlinear S-box replacement on the exclusive-or operation result;
3) Performing exclusive-or operation on the result after the nonlinear S-box replacement and the subkey 2, inputting the result into a static polynomial table generated by the main key in a decryption process, performing table indexing through the subkey 2, and performing exclusive-or operation on the result of the index lookup table and the subkey 1;
4) Outputting decrypted plaintext data;
5) And calling continuous rotation to generate a new subkey, and repeating the steps 1) -4) until the decryption task is finished.
The invention also provides a data processing device, which comprises a processor and a memory;
the memory is used for storing;
the processor configured to execute the method according to any one of the above embodiments by calling.
The invention also provides a computer program product comprising a computer program and/or instructions which, when executed by a processor, implement the steps of the method according to any of the above embodiments.
It will be apparent to those skilled in the art that embodiments of the present invention may be provided as a method, apparatus, or computer program product. Accordingly, the present invention may take the form of an entirely software embodiment, an entirely hardware embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention is in the form of a computer program product that can be embodied on one or more computer-usable storage media including computer-usable program code. And the computer-usable storage medium includes, but is not limited to: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a random access Memory (Random Access Memory, RAM), a magnetic disk Memory, a Read-Only optical disk (Compact Disc Read-Only Memory, CD-ROM), an optical Memory, and other various media capable of storing program codes.
The present invention is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus and computer program products according to the invention. It will be understood that each flow and/or block of the flowchart illustrations and/or block diagrams, and combinations of flows and/or blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create a system for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks. While preferred embodiments of the present invention have been described, additional variations and modifications in those embodiments may occur to those skilled in the art once they learn of the basic inventive concepts.
It will be apparent to those skilled in the art that various modifications and variations can be made to the present invention without departing from the spirit or scope of the invention. Thus, if such modifications and variations of the present invention fall within the scope of the present invention and the equivalent techniques thereof, the present invention is also intended to include such modifications and variations.
Referring to fig. 3, a verification diagram of the technical effect of the present invention is shown. The invention adopts the same secret key as the prior art, and the encryption effect is compared. FIG. 3a shows that no position counter is used, and ciphertext data is periodically collided; fig. 3b shows that the ciphertext data is not collided and has no periodicity by using the position calculator.
The invention relates to a method for generating a polynomial table by hashing a master key in a data transmission method, which uses a subkey as an index table to look up, and adopts a position counter to solve the problem of subkey collision so as to improve the randomness of the encryption method and increase the security intensity.
Compared with the prior art, the present stream encryption algorithm only needs to do exclusive OR for 1 time for encrypting and decrypting one byte. The multi-byte random byte stream is generated through kernel function calculation, and then spliced into a final pseudo-random byte stream, and exclusive-or operation is carried out on the final pseudo-random byte stream and plaintext or ciphertext to complete encryption and decryption.
In contrast, the stream encryption algorithm of the present invention needs to perform 3 table look-up and 4 exclusive OR operations for each byte encryption and decryption, and it merges the ways of using static encryption and decryption tables, linear compression tables, nonlinear substitution, double key mechanism, dynamic index table look-up, etc. to complete the encryption and decryption processes. Meanwhile, the encryption algorithm of the present invention is stream encryption alone, and the parallel use is packet encryption.
The stream encryption algorithm of the invention provides a brand new encryption realization way. The stream encryption algorithm of the invention, the transformation mainly comprises four parts, namely horizontal displacement, exclusive or, linear replacement and nonlinear replacement, and does not need the transformation in the vertical direction. And, the randomness of the collision-enhancement algorithm is eliminated by using a position calculator. Compared with block encryption, the invention has obvious speed performance advantage because no vertical conversion is needed, and realizes encryption and decryption of plaintext and ciphertext according to single byte.

Claims (10)

1. A method of data processing, characterized by: the method comprises the following steps:
step 1: generating a corresponding static polynomial form by the master key according to the encryption or decryption flow;
the master key generates a static polynomial table through kernel function CRC8 hashing in the encryption process, and specifically comprises the following steps:
1) Hashing any type of master key to 128x2 via kernel CRC8 n A master key for the bits;
2) For 16×2 n Individual master key bytes comprising 16x2 components n A polynomial of a kernel function CRC8, wherein 2m bytes are arbitrarily selected, and 2m times of CRC8 polynomial hashing is performed;
3) After performing linear S-box replacement on the data subjected to 2m times of CRC8 polynomial hash, performing 2m times of CRC8 polynomial hash again, namely performing linear S-box replacement at intervals of every two 2m times of CRC8 polynomials until traversing the master key byte to generate 2 n+4 A static polynomial table of x 256;
the master key generates a static polynomial table through the kernel function CRC8 inverse hash in the decryption process, and specifically comprises the following steps:
1) The master key of any type is hashed back to 128x2 via a kernel function CRC8 n A master key for the bits;
2) For 16x2 n Individual master key bytes comprising 16x2 components n A polynomial of a kernel function CRC8, wherein 2m bytes are arbitrarily selected, and 2m times of inverse hashing of the CRC8 polynomial is performed;
3) After performing linear S-box replacement on the data subjected to 2 m-degree CRC8 polynomial inverse hash, performing 2 m-degree CRC8 polynomial inverse hash again, namely performing linear S-box replacement at intervals of every two 2 m-degree CRC8 polynomials until traversing the master key byte to generate 2 n+4 A static polynomial table of x 256; n is a non-negative integer, n is more than or equal to 0 and less than or equal to 4, m is a positive integer, and m is more than or equal to 2 and less than or equal to 8x2 n
Step 2: generating a sub-key according to the main key, wherein the sub-key continuously rotates to be a new sub-key in the encryption or decryption process;
step 3: and carrying out index table lookup on the new subkey in the main key static polynomial table for a plurality of times to finish the byte encryption or decryption task.
2. A data processing method as claimed in claim 1, characterized in that: the static polynomial table generated by the hash and the inverse hash in the step 1 is reciprocal and unique in the Galois field.
3. A data processing method as claimed in claim 1, characterized in that: step 2: generating a subkey according to the main key, wherein the subkey continuously rotates to be a new subkey in the encryption or decryption process, and the method specifically comprises the following steps:
1) Performing exclusive OR operation on the sub-keys of 4 bytes generated according to the main key and a position counter of a plaintext byte which is input at the beginning to obtain a new sub-key;
2) The new subkey is divided into subkey 1, subkey 2, subkey 3, and subkey 4 in bytes.
4. A data processing method as claimed in claim 3, characterized in that: and step 3: performing index table lookup on the new subkey in the main key static polynomial table for a plurality of times to complete the byte encryption or decryption task, wherein the completion of the byte encryption task specifically comprises:
1) Performing exclusive OR operation on the input plaintext data and the subkey 1;
2) Inputting the result of the exclusive-or operation into a static polynomial table generated by the main key in an encryption process, carrying out table indexing through the subkey 2, carrying out exclusive-or operation on the result of the exclusive-or operation of the input plaintext data and the subkey 1 and the index table lookup result, and simultaneously carrying out nonlinear S-box replacement on the obtained exclusive-or operation result;
3) Performing exclusive-or operation on the result after the nonlinear S-box replacement and the subkey 3, inputting the result into a static polynomial table generated by the main key in an encryption process, performing table indexing through the subkey 3, and performing exclusive-or operation on the index table lookup result and the subkey 4;
4) Outputting encrypted ciphertext data;
5) Calling continuous rotation to generate a new subkey, and repeating the steps 1) -4) until the encryption task is finished.
5. A data processing method as claimed in claim 3, characterized in that: and step 3: and carrying out index table lookup on the new subkey in the main key static polynomial table for a plurality of times to complete the byte encryption or decryption task, wherein the completion of the byte decryption task specifically comprises the following steps:
1) Performing exclusive OR operation on the input ciphertext data and the subkey 4;
2) Inputting the result of the exclusive-or operation into a static polynomial table generated by the main key in a decryption process, carrying out table indexing through the subkey 3, carrying out exclusive-or operation on the input ciphertext data and the result of the exclusive-or operation of the subkey 4 and the index table lookup result, and simultaneously carrying out nonlinear S-box replacement on the obtained exclusive-or operation result;
3) Performing exclusive-or operation on the result after the nonlinear S-box replacement and the subkey 2, inputting the result into a static polynomial table generated by the main key in a decryption process, performing table indexing through the subkey 2, and performing exclusive-or operation on the index table lookup result and the subkey 1;
4) Outputting decrypted plaintext data;
5) Calling continuous rotation to generate a new subkey, and repeating the steps 1) -4) until the decryption task is finished.
6. A data processing method as claimed in claim 1, characterized in that: the method further comprises, prior to step 1, hashing an initial key given by the user to obtain a master key of fixed length.
7. The data processing method of claim 6, wherein: said user-given initial key being subjected to a kernel function CRC 128 Or CRC (cyclic redundancy check) 256 Or CRC (cyclic redundancy check) 512 Or CRC (cyclic redundancy check) 1024 Or CRC (cyclic redundancy check) 2048 Hashed to 128x2 n Master key of bits.
8. A data processing method as claimed in claim 1, 3, 6 or 7, characterized in that: the subkey is 32 bits.
9. A data processing apparatus comprising a processor and a memory;
the memory is used for storing computer programs and/or instructions;
the processor being adapted to perform the data processing method of any of claims 1-8 by invoking computer programs and/or instructions.
10. A computer storage medium comprising a computer program and/or instructions which, when executed by a processor, implement the data processing method of any of claims 1-8.
CN202210881193.0A 2022-07-26 2022-07-26 Data processing method, device and storage medium Active CN115348018B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210881193.0A CN115348018B (en) 2022-07-26 2022-07-26 Data processing method, device and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210881193.0A CN115348018B (en) 2022-07-26 2022-07-26 Data processing method, device and storage medium

Publications (2)

Publication Number Publication Date
CN115348018A CN115348018A (en) 2022-11-15
CN115348018B true CN115348018B (en) 2023-05-16

Family

ID=83950365

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210881193.0A Active CN115348018B (en) 2022-07-26 2022-07-26 Data processing method, device and storage medium

Country Status (1)

Country Link
CN (1) CN115348018B (en)

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5398284A (en) * 1993-11-05 1995-03-14 United Technologies Automotive, Inc. Cryptographic encoding process
CN101262334A (en) * 2008-04-17 2008-09-10 中国人民解放军海军工程大学 Encryption method for Bluetooth data transmission
CN109274485B (en) * 2017-07-17 2021-06-15 科大国盾量子技术股份有限公司 Data encryption method, data authentication method, related equipment and system
CN112311527A (en) * 2020-09-17 2021-02-02 裴文耀 Encryption method for converting master key into polynomial table lattice key lookup

Also Published As

Publication number Publication date
CN115348018A (en) 2022-11-15

Similar Documents

Publication Publication Date Title
JP3901909B2 (en) ENCRYPTION DEVICE AND RECORDING MEDIUM CONTAINING PROGRAM
CA2546211C (en) Key masking for cryptographic processes
KR100917073B1 (en) Method and apparatus for increasing the speed of cryptographic processing
US7899190B2 (en) Security countermeasures for power analysis attacks
US7945049B2 (en) Stream cipher using multiplication over a finite field of even characteristic
US11546135B2 (en) Key sequence generation for cryptographic operations
WO2006012363A1 (en) Stream cipher combining system and method
CN107147487B (en) Symmetric key random block cipher
CN109417468B (en) Method and device for realizing safe and efficient block cipher algorithm
CA2723319A1 (en) A closed galois field cryptographic system
US7499542B2 (en) Device and method for encrypting and decrypting a block of data
Launchbury et al. Application-scale secure multiparty computation
KR101095386B1 (en) A Cryptosystem with a Discretized Chaotic Map
JPH10240500A (en) Random number generator and method, enciphering device and method, decoder and method and stream cipher system
KR20190020988A (en) Computer-executable lightweight white-box cryptographic method and apparatus thereof
Andreeva et al. AES-COPA v.
CN115348018B (en) Data processing method, device and storage medium
CN106921486A (en) The method and apparatus of data encryption
Mihalkovich et al. MPF based symmetric cipher performance comparison to AES and TDES
Ledda et al. Enhancing IDEA algorithm using circular shift and middle square method
Singh et al. Study & analysis of cryptography algorithms: RSA, AES, DES, T-DES, blowfish
RU2738321C1 (en) Cryptographic transformation method and device for its implementation
Faragallah et al. Improved RC6 block cipher based on data dependent rotations
Abubaker et al. DAFA-A Lightweight DES Augmented Finite Automaton Cryptosystem
JPS6281145A (en) Data ciphering system

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
GR01 Patent grant