CN117201120A - Information encryption method, device, computer equipment and storage medium - Google Patents

Information encryption method, device, computer equipment and storage medium Download PDF

Info

Publication number
CN117201120A
CN117201120A CN202311160493.0A CN202311160493A CN117201120A CN 117201120 A CN117201120 A CN 117201120A CN 202311160493 A CN202311160493 A CN 202311160493A CN 117201120 A CN117201120 A CN 117201120A
Authority
CN
China
Prior art keywords
encryption
encrypted
information
encryption option
option
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
Application number
CN202311160493.0A
Other languages
Chinese (zh)
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.)
Shandong Yunhai Guochuang Cloud Computing Equipment Industry Innovation Center Co Ltd
Original Assignee
Shandong Yunhai Guochuang Cloud Computing Equipment Industry Innovation Center 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 Shandong Yunhai Guochuang Cloud Computing Equipment Industry Innovation Center Co Ltd filed Critical Shandong Yunhai Guochuang Cloud Computing Equipment Industry Innovation Center Co Ltd
Priority to CN202311160493.0A priority Critical patent/CN117201120A/en
Publication of CN117201120A publication Critical patent/CN117201120A/en
Pending legal-status Critical Current

Links

Abstract

The invention relates to the technical field of Internet and discloses an information encryption method, a device, computer equipment and a storage medium, wherein the method comprises the steps of selecting a corresponding number of encryption option serial numbers from a key storage module based on digital parameters to generate an encryption option sequence by responding to input information to be encrypted and the digital parameters, wherein the key storage module stores a plurality of encryption option serial numbers corresponding to different encryption types and corresponding different encryption parameters; the encryption method comprises the steps of segmenting information to be encrypted one by one based on the key length corresponding to the encryption option sequence number in the encryption option sequence, sequentially encrypting the segmented information to be encrypted based on the encryption option sequence number corresponding to the segmented information to be encrypted and the encryption parameter corresponding to the encryption option sequence number, and segmenting the encryption information by adopting various encryption modes and encryption parameters, so that the cracking difficulty of the encryption information is greatly improved, the safety of the encryption information is ensured, and the privacy safety of users is improved.

Description

Information encryption method, device, computer equipment and storage medium
Technical Field
The present invention relates to the field of internet technologies, and in particular, to an information encryption method, an information encryption device, a computer device, and a storage medium.
Background
The high-speed development of internet technology makes the network environment increasingly complex, a large amount of important private information faces the threat of illegal access, and the encryption technology can greatly reduce the threat and ensure the security of the private information.
However, with the continuous improvement of the computing power of the computer, the privacy information is encrypted by adopting a single encryption mode in the prior art, so that the privacy information can be cracked by violence, further the privacy information is illegally obtained, and the privacy security of the user is influenced.
Disclosure of Invention
In view of the above, the present invention provides an information encryption method, apparatus, computer device and storage medium, so as to solve the problem that a single encryption method in the prior art may be cracked, and affect the privacy security of a user.
In a first aspect, the present invention provides an information encryption method, the method including: responding to received information to be encrypted and digital parameters input from the outside, selecting the encryption option serial numbers corresponding to the corresponding number of encryption types from a key storage module based on the digital parameters, generating an encryption option sequence, wherein the key storage module stores a plurality of encryption option serial numbers corresponding to different encryption types and corresponding to different encryption parameters, and the digital parameters represent the number of the selected encryption option serial numbers; segmenting the information to be encrypted one by one based on the key length corresponding to the encryption option sequence number in the encryption option sequence, wherein the encryption parameters comprise the key length corresponding to the encryption option sequence number; and sequentially encrypting the segmented information to be encrypted based on the encryption option sequence numbers corresponding to the segmented information to be encrypted and the encryption parameters corresponding to the encryption option sequence numbers to obtain encrypted data.
According to the information encryption method provided by the invention, the encryption option sequence is generated by responding to the received information to be encrypted and the digital parameters which are input from the outside and selecting the encryption option sequence corresponding to the corresponding number of encryption types from the key storage module based on the digital parameters, and the key storage module stores a plurality of encryption option sequence corresponding to different encryption types and corresponding different encryption parameters; segmenting the information to be encrypted one by one based on the key length corresponding to the encryption option sequence number in the encryption option sequence, wherein the encryption parameters comprise the key length corresponding to the encryption option sequence number; the segmented information to be encrypted is sequentially encrypted based on the encryption option sequence numbers corresponding to the segmented information to be encrypted and the encryption parameters corresponding to the encryption option sequence numbers, and the encryption information is segmented and encrypted by adopting various encryption modes and encryption parameters, so that the cracking difficulty of the encryption information is greatly improved, the safety of the encryption information is ensured, and the privacy safety of users is improved.
In an optional implementation manner, the segmenting the information to be encrypted based on the key length corresponding to the encryption option serial number in the encryption option sequence one by one includes: acquiring the length of the information to be encrypted and the sum of key lengths corresponding to all encryption option serial numbers in the encryption option sequence; judging the size relation between the length of the information to be encrypted and the sum of the key lengths corresponding to all the encryption option serial numbers in the encryption option sequence; if the length of the information to be encrypted is not greater than the sum of the key lengths corresponding to all the encryption option serial numbers in the encryption option sequence, segmenting the information to be encrypted according to the key length corresponding to the encryption option serial numbers in the encryption option sequence in sequence; if the length of the information to be encrypted is greater than the sum of the key lengths corresponding to all the encryption option serial numbers in the encryption option sequence, circularly adopting the key length corresponding to the encryption option serial numbers in the encryption option sequence to segment the information to be encrypted; and when the length of the last section of the information to be encrypted is smaller than the key length of the corresponding encryption option sequence number, byte filling is carried out on the information to be encrypted of the last section until the length of the information to be encrypted of the last section is consistent with the key length of the corresponding encryption option sequence number.
According to the method, the size relation between the length of the information to be encrypted and the sum of the key lengths corresponding to all the encryption option serial numbers is judged, if the length of the information to be encrypted is larger than the sum of the key lengths corresponding to all the encryption option serial numbers in the encryption option sequence, the key lengths corresponding to the encryption option serial numbers in the encryption option sequence are adopted circularly to segment the information to be encrypted, when the length of the last segment of the information to be encrypted is smaller than the key length corresponding to the encryption option serial numbers, byte filling is carried out on the information to be encrypted of the last segment until the length of the information to be encrypted of the last segment is consistent with the key length corresponding to the encryption option serial numbers, and corresponding processing is carried out under any condition possibly occurring when the information to be encrypted is segmented, so that all the information to be encrypted can be encrypted in different encryption modes, and the privacy safety of the information is improved.
In an optional implementation manner, the segmenting the information to be encrypted based on the key length corresponding to the encryption option serial number in the encryption option sequence one by one further includes: and adding byte stuffing identification to the segmented information to be encrypted.
The invention can intuitively extract the actual information of the current segment by adding the byte filling identification to the segmented information to be encrypted in the subsequent encryption or decryption.
In an alternative embodiment, the adding the byte pad identifier to the segmented information to be encrypted includes: adding a first identifier to the segmented information to be encrypted for byte stuffing, wherein the first identifier characterizes the corresponding byte stuffing number; and adding a second identifier to the segmented information to be encrypted which is not subjected to byte stuffing, wherein the second identifier indicates that the segmented information to be encrypted is not subjected to byte stuffing.
The invention adds the corresponding identification of the byte filling number to the information to be encrypted which is filled with bytes, adds the identification which indicates that the information to be encrypted which is not filled with bytes, can distinguish whether the information to be encrypted is filled with bytes or not, and can rapidly extract the actual information to be decrypted when the information to be encrypted is encrypted and decrypted subsequently.
In an optional implementation manner, the encrypting the segmented information to be encrypted sequentially based on the encryption option sequence number corresponding to the segmented information to be encrypted and the encryption parameter corresponding to the encryption option sequence number to obtain encrypted data includes: encrypting the information to be encrypted of the current segment based on an encryption parameter corresponding to an encryption option sequence number corresponding to the information to be encrypted of the current segment; forming a corresponding encrypted frame based on the encrypted information of the current segment, and an encryption option sequence number and a byte filling identifier corresponding to the encrypted information of the current segment, wherein the encrypted frame at least comprises the encryption option sequence number, the byte filling identifier and the encrypted information of the current segment; and splicing the encrypted frames corresponding to all the segmented information to be encrypted according to the encryption sequence to obtain encrypted data.
The invention encrypts the encrypted data based on the encrypted option sequence number corresponding to the segmented information to be encrypted and the corresponding encryption parameters, forms the corresponding encrypted frame based on the encrypted information to be encrypted, splices the encrypted frames corresponding to all the segmented information to be encrypted according to the encryption sequence to obtain the encrypted data, and finally can obtain the encrypted data corresponding to a plurality of encryption modes.
In an alternative embodiment, the method further comprises: extracting an encryption option sequence number corresponding to each encryption frame in the encryption data in response to receiving the encryption data; and sequentially decrypting the encrypted frames in the encrypted data based on the encrypted option sequence numbers corresponding to each encrypted frame in the encrypted data and the encrypted parameters corresponding to the encrypted option sequence numbers to obtain decryption information, wherein the encrypted parameters at least comprise decryption keys.
In an optional implementation manner, the encrypting data is decrypted based on the encrypting option serial number corresponding to the encrypting data and the encrypting parameter corresponding to the encrypting option serial number to obtain decrypting information, which comprises extracting byte stuffing identification corresponding to a current encrypting frame in the encrypting data; extracting actual information to be decrypted corresponding to the current encrypted frame based on the byte stuffing identification; decrypting the current encrypted frame based on the encryption parameters corresponding to the encryption option serial numbers corresponding to the current encrypted frame to obtain decryption information corresponding to the current encrypted frame; and splicing the decryption information corresponding to all the encryption frames in the encryption data to obtain decryption data corresponding to the encryption data.
According to the invention, the encryption option serial numbers corresponding to each encryption frame in the encryption data are based, the actual information to be decrypted corresponding to the current encryption frame is extracted based on the byte filling identification, each encryption frame in the encryption data is decrypted to obtain decryption information, the decryption information corresponding to all the encryption frames in the encryption data is spliced to obtain decryption data corresponding to the encryption data, the encryption data is decrypted based on different decryption keys, the complexity of the decryption process is ensured, and the encryption data is prevented from being decrypted by violence.
In a second aspect, the present invention provides an information encryption apparatus, comprising: the encryption option serial number selection module is used for responding to received information to be encrypted and digital parameters input from the outside, selecting the encryption option serial numbers corresponding to the corresponding number of encryption types from the key storage module based on the digital parameters, generating an encryption option sequence, wherein the key storage module stores a plurality of encryption option serial numbers corresponding to different encryption types and corresponding to different encryption parameters, and the digital parameters represent the number of the selected encryption option serial numbers; the encryption information segmentation module is used for segmenting the information to be encrypted one by one based on the key length corresponding to the encryption option sequence number in the encryption option sequence, and the encryption parameters comprise the key length corresponding to the encryption option sequence number; the information encryption module is used for sequentially encrypting the segmented information to be encrypted based on the encryption option sequence numbers corresponding to the segmented information to be encrypted and the encryption parameters corresponding to the encryption option sequence numbers to obtain encrypted data.
In a third aspect, the present invention provides a computer device comprising: the information encryption method comprises the steps of storing computer instructions in a memory and a processor, wherein the memory and the processor are in communication connection, and the processor executes the computer instructions, so that the information encryption method of the first aspect or any implementation mode corresponding to the first aspect is executed.
In a fourth aspect, the present invention provides a computer-readable storage medium having stored thereon computer instructions for causing a computer to execute the information encryption method of the first aspect or any one of its corresponding embodiments.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings that are needed in the description of the embodiments or the prior art will be briefly described, and it is obvious that the drawings in the description below are some embodiments of the present invention, and other drawings can be obtained according to the drawings without inventive effort for a person skilled in the art.
Fig. 1 is a flow chart of an information encryption method according to an embodiment of the present invention;
FIG. 2 is a flow chart of another information encryption method according to an embodiment of the present invention;
FIG. 3 is a flow chart of yet another information encryption method according to an embodiment of the present invention;
fig. 4 is a block diagram of a structure in which an information encryption method according to an embodiment of the present invention is applied to an information encryption system;
fig. 5 is a block diagram of a structure of an information encryption apparatus according to an embodiment of the present invention;
FIG. 6 is a schematic diagram of a hardware structure of a computer device according to an embodiment of the invention
Detailed Description
For the purpose of making the objects, technical solutions and advantages of the embodiments of the present invention more apparent, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention, and it is apparent that the described embodiments are some embodiments of the present invention, but not all embodiments of the present invention. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
According to an embodiment of the present invention, there is provided an information encryption method embodiment, it being noted that the steps shown in the flowcharts of the drawings may be performed in a computer system such as a set of computer executable instructions, and that although a logical order is shown in the flowcharts, in some cases the steps shown or described may be performed in an order different from that herein.
In this embodiment, an information encryption method is provided, which may be used in the above-mentioned computer device, and fig. 1 is a flowchart of an information encryption method according to an embodiment of the present application, as shown in fig. 1, where the flowchart includes the following steps:
step S101, in response to receiving the information to be encrypted and the digital parameters input from the outside, selecting the encryption option serial numbers corresponding to the corresponding number of encryption types from the key storage module based on the digital parameters, generating an encryption option sequence, wherein the key storage module stores a plurality of encryption option serial numbers corresponding to different encryption types and the corresponding different encryption parameters, and the digital parameters represent the number of the selected encryption option serial numbers.
The key storage module according to the embodiment of the present application may include a plurality of key storage units, where each key storage unit stores a content including an encryption option sequence number and an encryption parameter corresponding to each encryption option sequence number, where the encryption option sequence number may be used to identify and distinguish information in the key storage unit, each encryption option sequence number corresponds to one encryption parameter, and the encryption parameters corresponding to each encryption option sequence number may be different, where the encryption parameters may include encryption types, such as DES (Data Encryption Standard ), AES (Advanced Encryption Standard, advanced encryption standard), RSA (Rivest-Shamir-Adleman, asymmetric encryption algorithm), ECC (Elliptic Curve Cryptography, elliptic encryption algorithm), etc., and the encryption key, the decryption key, and other encryption parameters, are merely examples, and the key in the key storage module may be updated.
In the embodiment of the application, a user can input information to be encrypted and digital parameters needed to encrypt the information to be encrypted in a segmented way in an information encryption system, after receiving the information to be encrypted and the digital parameters which are input externally, a corresponding number of encryption option serial numbers can be selected randomly in a key storage module, wherein each encryption option serial number corresponds to one encryption parameter, the encryption parameter can comprise encryption type, key length and the like, the encryption parameter can comprise the encryption type, the key length and the like, the encryption option serial numbers of the corresponding number can be selected according to the selected order to generate an encryption option sequence, and in the specific embodiment, for example, the encryption option serial number can be selected randomly from the key storage module if the digital parameters input externally are P, the encryption option serial numbers can be selected randomly for P times, and P encryption option serial numbers can be finally formed.
Step S102, the information to be encrypted is segmented one by one based on the key length corresponding to the encryption option serial number in the encryption option sequence, and the encryption parameters comprise the key length corresponding to the encryption option serial number.
In an embodiment of the present application, encryption parameters may include a key length corresponding to an encryption option sequence, after the encryption option sequence is obtained based on the steps, the encryption information to be encrypted may be sequentially segmented based on the encryption option sequence arranged according to a selected order in the encryption option sequence and the key length corresponding to each encryption option sequence until the information to be encrypted has been fully segmented according to the encryption option sequence, for example, in a specific embodiment, the 1 st option sequence corresponds to AES (Advanced Encryption Standard ) in a key storage module, the key length is 256 bits, then the information to be encrypted in the 1 st section is 256 bits from the beginning of the whole information to be encrypted, the 2 nd option sequence corresponds to RSA (Rivest-Shamir-Adleman) in a key storage module, the key length is 1024 bits, and then the information to be encrypted in the 2 nd section is 1024 bits after the 1 st section is 256 bits until the information to be encrypted is fully segmented, which is merely by way of example.
Step S103, the segmented information to be encrypted is sequentially encrypted based on the encryption option sequence numbers corresponding to the segmented information to be encrypted and the encryption parameters corresponding to the encryption option sequence numbers, and encrypted data are obtained.
According to the embodiment of the application, after the information to be encrypted is segmented based on the steps, the segmented information to be encrypted can be sequentially encrypted according to the encryption option sequence numbers corresponding to the segmented information to be encrypted and the encryption parameters corresponding to the encryption option sequence numbers, in the specific embodiment, the encryption type corresponding to the information to be encrypted of the 1 st segment is AES encryption, AES encryption calculation can be performed on the information to be encrypted of the 1 st segment, the encryption type corresponding to the information to be encrypted of the 2 nd segment is RSA encryption, RSA encryption calculation can be performed on the information to be encrypted of the 2 nd segment, and the like until all the segmented information to be encrypted is encrypted, so that encrypted data can be obtained, by way of example only.
According to the information encryption method provided by the embodiment, the encryption option sequence is generated by responding to the received information to be encrypted and the digital parameters which are input from the outside and selecting the encryption option sequence corresponding to the corresponding number of encryption types from the key storage module based on the digital parameters, and the key storage module stores a plurality of encryption option sequence corresponding to different encryption types and corresponding different encryption parameters; segmenting the information to be encrypted one by one based on the key length corresponding to the encryption option sequence number in the encryption option sequence, wherein the encryption parameters comprise the key length corresponding to the encryption option sequence number; the segmented information to be encrypted is sequentially encrypted based on the encryption option sequence numbers corresponding to the segmented information to be encrypted and the encryption parameters corresponding to the encryption option sequence numbers, and the encryption information is segmented and encrypted by adopting various encryption modes and encryption parameters, so that the cracking difficulty of the encryption information is greatly improved, the safety of the encryption information is ensured, and the privacy safety of users is improved.
In this embodiment, an information encryption method is provided, which may be used in the above-mentioned computer device, and fig. 2 is a flowchart of the information encryption method according to an embodiment of the present application, as shown in fig. 2, where the flowchart includes the following steps:
in step S201, in response to receiving the information to be encrypted and the digital parameter input from the outside, the encryption option sequence corresponding to the corresponding number of encryption types is selected from the key storage module based on the digital parameter, and the encryption option sequence is generated, where the key storage module stores a plurality of encryption option sequence numbers corresponding to different encryption types and corresponding to different encryption parameters, and the digital parameter represents the number of the selected encryption option sequence numbers. Please refer to step S101 in the embodiment shown in fig. 1 in detail, which is not described herein.
Step S202, the information to be encrypted is segmented one by one based on the key length corresponding to the encryption option sequence number in the encryption option sequence, and the encryption parameters comprise the key length corresponding to the encryption option sequence number.
Specifically, the step S202 includes:
in step S2021, the sum of the length of the information to be encrypted and the key length corresponding to all the encryption option serial numbers in the encryption option sequence is obtained.
In the embodiment of the present application, after receiving the information to be encrypted input from the outside, the length of the information to be encrypted may be obtained, and after selecting the corresponding number of encryption option numbers based on the above embodiment, the total of the key lengths corresponding to all the encryption option numbers may be calculated, for example, p=3, the key length corresponding to the 1 st encryption option number is 256 bits, the key length corresponding to the 2 nd encryption option number is 1024 bits, the key length corresponding to the 3 rd encryption option number is 256 bits, and the total length corresponding to the 3 encryption option numbers is 1536 bits, which is merely an example.
In step S2022, the size relationship between the length of the information to be encrypted and the sum of the key lengths corresponding to all the encryption option serial numbers in the encryption option sequence is determined.
In step S2023, if the length of the information to be encrypted is not greater than the sum of the key lengths corresponding to all the encryption option serial numbers in the encryption option sequence, the information to be encrypted is segmented sequentially according to the key length corresponding to the encryption option serial number in the encryption option sequence.
In step S2024, if the length of the information to be encrypted is greater than the sum of the key lengths corresponding to all the encryption option sequence numbers in the encryption option sequence, the key lengths corresponding to the encryption option sequence numbers in the encryption option sequence are circularly used to segment the information to be encrypted.
In step S2025, when the length of the last segment of the information to be encrypted is smaller than the key length of the corresponding encryption option sequence number, byte stuffing is performed on the information to be encrypted of the last segment until the length of the information to be encrypted of the last segment is consistent with the key length of the corresponding encryption option sequence number.
The embodiment of the application can judge the size relation between the length of the information to be encrypted and the sum of the key lengths corresponding to all the encryption option serial numbers in the encryption option sequence, for example, the length of the information to be encrypted is exactly equal to the sum of the key lengths, and the information to be encrypted can be segmented exactly according to the key lengths corresponding to the encryption option serial numbers in the encryption option sequence.
If the length of the information to be encrypted is smaller than the sum of the key lengths, the information to be encrypted can be segmented according to the key length corresponding to the encryption option serial number in the encryption option sequence, the length of the last segment of the information to be encrypted does not meet the key length requirement corresponding to the encryption option serial number, the last segment can be filled with bytes until the length of the last segment is just consistent with the key length of the corresponding encryption option serial number, for example, the length of the information to be encrypted is 1530, the information to be encrypted is segmented in sequence based on the 3 encryption option serial numbers, the length of the 1 st segment is 256, the length of the 2 nd segment is 1024, the 3 rd segment only remains 250 bits of the information to be encrypted at the moment, and the 3 rd segment can be filled with 6 bits of bytes, so that the information to be encrypted of the 3 rd segment is 256 bits.
If the length of the information to be encrypted is greater than the sum of the key lengths, the information to be encrypted can be segmented according to the key length corresponding to the encryption option serial number in the encryption option sequence, at this time, a part of the information to be encrypted is not segmented, the encryption option sequence can be circulated to segment the part which is not segmented again based on the key length corresponding to the encryption option serial number, if the length of the last segment of the information to be encrypted at this time does not meet the key length requirement corresponding to the corresponding encryption option serial number, the last segment can be filled with bytes until the length of the last segment is just consistent with the key length of the corresponding encryption option serial number until all the information to be encrypted is segmented.
According to the method, the size relation between the length of the information to be encrypted and the sum of the key lengths corresponding to all the encryption option serial numbers is judged, if the length of the information to be encrypted is larger than the sum of the key lengths corresponding to all the encryption option serial numbers in the encryption option sequence, the key lengths corresponding to the encryption option serial numbers in the encryption option sequence are adopted circularly to segment the information to be encrypted, when the length of the last segment of the information to be encrypted is smaller than the key length corresponding to the encryption option serial numbers, byte filling is carried out on the information to be encrypted of the last segment until the length of the information to be encrypted of the last segment is consistent with the key length corresponding to the encryption option serial numbers, and corresponding processing is carried out under any condition possibly occurring when the information to be encrypted is segmented, so that all the information to be encrypted can be encrypted in different encryption modes, and the privacy safety of the information is improved.
Step S2026 adds a byte pad identifier to the segmented information to be encrypted.
After the information to be encrypted is segmented based on the steps, the embodiment of the application can add byte stuffing identification to the information to be encrypted of each segment, for example, a 1 character is added to the information to be encrypted of the segment after byte stuffing, which indicates that the information to be encrypted of the segment is subjected to byte stuffing, a 0 character is added to the information to be encrypted of the segment without byte stuffing, which indicates that the information to be encrypted of the segment is not subjected to byte stuffing, and the embodiment of the application is only used as an example.
The application can intuitively extract the actual information of the current segment by adding the byte filling identification to the segmented information to be encrypted in the subsequent encryption or decryption.
Specifically, step S2026 includes:
and a step a1, adding a first identifier to the segmented information to be encrypted for byte stuffing, wherein the first identifier characterizes the corresponding byte stuffing number.
And a step a2, adding a second identifier to the segmented information to be encrypted which is not subjected to byte stuffing, wherein the second identifier indicates that the segmented information to be encrypted is not subjected to byte stuffing.
The embodiment of the application can add characters capable of representing the number of filled bytes to the segmented information to be encrypted for byte filling, for example, if the number of bytes of the segmented information to be encrypted is 2 bits, then '2' characters can be added to the segmented information to be encrypted, and only by way of example, character identifiers can also be added to the segmented information to be encrypted which is not filled to represent that the information to be segmented is not filled.
The application adds the corresponding identification of the byte filling number to the information to be encrypted which is filled with bytes, adds the identification which indicates that the information to be encrypted which is not filled with bytes, can distinguish whether the information to be encrypted is filled with bytes or not, and can rapidly extract the actual information to be decrypted when the information to be encrypted is encrypted and decrypted subsequently.
Step S203, the segmented information to be encrypted is sequentially encrypted based on the encryption option sequence numbers corresponding to the segmented information to be encrypted and the encryption parameters corresponding to the encryption option sequence numbers, and encrypted data is obtained.
Specifically, step S203 includes:
step S2031, encrypting the information to be encrypted of the current segment based on the encryption parameter corresponding to the encryption option sequence number corresponding to the information to be encrypted of the current segment.
Step S2032, forming a corresponding encrypted frame based on the encrypted information of the current segment and the encryption option sequence number and the byte pad identifier corresponding to the encrypted information of the current segment, where the encrypted frame at least includes the encryption option sequence number, the byte pad identifier and the encrypted information of the current segment.
Step S2033, splicing all the encrypted frames corresponding to the segmented information to be encrypted according to the encryption sequence, to obtain encrypted data.
The embodiment of the application encrypts the information to be encrypted of the current segment by utilizing other encryption parameters of the corresponding encryption calculation engine based on the encryption type, encryption key and the like in the encryption parameters corresponding to the encryption option serial numbers of the information to be encrypted of the current segment, adds the corresponding encryption option serial numbers and byte filling identifiers at the head of the information to be encrypted after encryption is completed to form an encryption frame corresponding to the information to be encrypted of the segment, and can splice all formed corresponding encryption frames according to the sequence of encryption after all segmented information to be encrypted form the encryption frame to form the encryption data corresponding to the information to be encrypted.
The invention encrypts the encrypted data based on the encrypted option sequence number corresponding to the segmented information to be encrypted and the corresponding encryption parameters, forms the corresponding encrypted frame based on the encrypted information to be encrypted, splices the encrypted frames corresponding to all the segmented information to be encrypted according to the encryption sequence to obtain the encrypted data, and finally can obtain the encrypted data corresponding to a plurality of encryption modes.
In this embodiment, an information encryption method is provided, which may be used in the above-mentioned computer device, and fig. 3 is a flowchart of the information encryption method according to an embodiment of the present invention, as shown in fig. 3, where the flowchart includes the following steps:
in step S301, in response to receiving the information to be encrypted and the digital parameter input from the outside, the encryption option sequence corresponding to the corresponding number of encryption types is selected from the key storage module based on the digital parameter, and the encryption option sequence is generated, where the key storage module stores a plurality of encryption option sequence numbers corresponding to different encryption types and corresponding to different encryption parameters, and the digital parameter represents the number of the selected encryption option sequence numbers. Please refer to step S201 in the embodiment shown in fig. 2 in detail, which is not described herein.
Step S302, the information to be encrypted is segmented one by one based on the key length corresponding to the encryption option sequence number in the encryption option sequence, and the encryption parameters comprise the key length corresponding to the encryption option sequence number. Please refer to step S202 in the embodiment shown in fig. 2, which is not described herein.
Step S303, sequentially encrypting the segmented information to be encrypted based on the encryption option sequence numbers corresponding to the segmented information to be encrypted and the encryption parameters corresponding to the encryption option sequence numbers to obtain encrypted data. Please refer to step S203 in the embodiment shown in fig. 2 in detail, which is not described herein.
Step S304, in response to receiving the encrypted data, extracting an encryption option sequence number corresponding to each encryption frame in the encrypted data; and sequentially decrypting the encrypted frames in the encrypted data based on the encrypted option sequence numbers corresponding to each encrypted frame in the encrypted data and the encrypted parameters corresponding to the encrypted option sequence numbers to obtain decryption information, wherein the encrypted parameters at least comprise decryption keys.
In the embodiment of the application, after the encrypted data input by a user is received, wherein the encrypted data is formed by splicing all the encrypted frames, the encryption option serial number corresponding to each encrypted frame in the encrypted data can be extracted, then the corresponding decryption parameters such as the decryption type, the decryption key and the like can be obtained from the key storage module based on the encryption option serial number corresponding to each encrypted frame, and finally each encrypted frame in the encrypted data is decrypted based on the corresponding decryption parameters to obtain the decryption information corresponding to the encrypted data.
Specifically, step S304 includes:
step S3041, extracting a byte stuffing identifier corresponding to the current encrypted frame in the encrypted data.
Step S3042, extracting the actual information to be decrypted corresponding to the current encrypted frame based on the byte stuffing identification.
Step S3043, decrypting the current encrypted frame based on the encryption parameters corresponding to the encryption option serial numbers corresponding to the current encrypted frame to obtain decryption information corresponding to the current encrypted frame.
And step S3044, splicing the decryption information corresponding to all the encryption frames in the encryption data to obtain decryption data corresponding to the encryption data.
The embodiment of the application can extract the byte stuffing identification corresponding to the current encrypted frame before decrypting the current encrypted frame, determine whether the information in the encrypted frame is the information to be decrypted, if the header of the current encrypted frame judges that the encrypted frame is subjected to byte stuffing, extract the actual information to be decrypted corresponding to the current encrypted frame based on the number of the byte stuffing, if the header of the current encrypted frame judges that the encrypted frame is not subjected to byte stuffing, the information in the encrypted frame is the information to be decrypted, and after the actual information to be decrypted of the current encrypted frame is extracted, decrypt the information corresponding to the current encrypted frame based on the decryption type, the decryption key and the like in the encryption parameters corresponding to the encryption option serial numbers corresponding to the current encrypted frame, and splice the decryption information corresponding to all the encrypted frames after decrypting all the encrypted frames in the encrypted data to obtain the decryption information, so as to obtain the decryption data corresponding to the encrypted data.
According to the invention, the encryption option serial numbers corresponding to each encryption frame in the encryption data are based, the actual information to be decrypted corresponding to the current encryption frame is extracted based on the byte filling identification, each encryption frame in the encryption data is decrypted to obtain decryption information, the decryption information corresponding to all the encryption frames in the encryption data is spliced to obtain decryption data corresponding to the encryption data, the encryption data is decrypted based on different decryption keys, the complexity of the decryption process is ensured, and the encryption data is prevented from being decrypted by violence.
The information encryption method provided in the above embodiment may be applied to an information encryption system, as shown in fig. 4, where the system includes: the key storage module 1 may include a plurality of key storage units, where each key storage unit stores content including an encryption option sequence number and an encryption parameter corresponding to each encryption option sequence number, and may include an encryption option sequence number 11, an encryption option sequence number 12 … …, and an encryption option sequence number 1M, where M represents a number of encryption option sequence numbers, and the corresponding encryption parameter is an encryption parameter 11, an encryption parameter 12 … …, and an encryption parameter 1M, where the encryption option sequence number may be used to identify and distinguish information in the key storage unit, each encryption option sequence number corresponds to one encryption parameter, and the encryption parameter corresponding to each encryption option sequence number may be different, and the encryption parameters may include encryption types such as DES (Data Encryption Standard ), AES (Advanced Encryption Standard, advanced encryption standard), RSA (Rivest-Shamir-Adleman, asymmetric encryption algorithm), ECC (Elliptic Curve Cryptography, elliptic encryption algorithm), and the like, and the key lengths such as 128, 512, and other encryption parameters are merely used as examples, and not limited, and the key storage module may update the key.
The information encryption system further comprises an encryption preprocessing module 2, wherein the encryption preprocessing module 2 can comprise an encryption key configuration unit 21 and an information processing unit 22 to be encrypted, the encryption key configuration unit 21 can randomly select a corresponding number of encryption option serial numbers corresponding to different encryption types from the key storage module 1 according to received digital parameters input from outside, for example, if the digital parameters input from outside are P, the encryption option serial numbers can be randomly selected from the key storage module 1, P times are selected, each time the selection is random, P encryption option serial numbers are finally formed, the encryption option serial numbers can be called as an encryption option sequence, the information processing unit 22 to be encrypted can sequentially segment the externally input information to be encrypted according to the key length corresponding to the encryption option serial numbers in the encryption option sequence, for example, P serial numbers are included in the encryption option sequence, the corresponding key length is determined according to the P serial numbers, then the segmentation information to be encrypted is sequentially segmented according to the key length, the segmentation length of the P information to be encrypted can be determined, if the length of the information to be encrypted is larger than the sum of the key length corresponding to all the encryption option serial numbers, the encryption option serial numbers can be cyclically segmented until the byte is equal to the byte-added with the byte corresponding length of the byte which can be filled with the byte corresponding to the byte of the information to be encrypted, and the byte which can be filled up to the byte corresponding to the byte of the byte which can be added, the byte stuffing information used for recording the segmented information to be encrypted can also be a character which is not subjected to byte stuffing and has the same byte stuffing, for example, the character is 0, the number of the byte stuffing is 0, and the byte stuffing information can be transmitted to the encryption module 3 for encryption calculation after 1 piece of the segmented information to be encrypted, the corresponding encryption option sequence number and the byte stuffing information are obtained through the processing of the encryption preprocessing module 2, and the encryption option sequence number and the byte stuffing information are transmitted firstly during transmission, and finally the segmented information to be encrypted is transmitted until all piece of the segmented information to be encrypted is transmitted.
The information encryption system further comprises an encryption module 3, wherein the encryption module 3 may include an information encryption unit 31 and an encryption information buffer 32, the information encryption unit 31 may include encryption calculation engines of various encryption types, the encryption calculation that can be completed covers all encryption types in the key storage module 1, after the information encryption unit 31 receives the encryption option sequence number, it is determined whether the information to be encrypted required for the encryption is transmitted completely according to the encryption parameter corresponding to the sequence number, if the transmission is completed, the corresponding encryption calculation engine is started to sequentially encrypt the segmented information to be encrypted according to the corresponding encryption parameter, such as the encryption type, the encryption key and other encryption parameters, the corresponding encryption option sequence number and byte filling information can be added to the head of each piece of the encrypted information to be completed after the encryption is completed, an encrypted frame corresponding to the information to be encrypted is formed, wherein the byte filling information is an added character, after the piece of the information to be encrypted is formed into an encrypted frame, the encrypted frame can be cached in the encryption information buffer 32, because the encryption calculation speed corresponding to each encryption type is different, in order to ensure that the output sequence of the encrypted frame is consistent with the corresponding encryption frame to the encrypted frame to be encrypted, and the corresponding data to the piece of information to be encrypted, and the encrypted frame to be encrypted according to the corresponding sequence of the encryption information to the encryption buffer 32.
The information encryption system further includes a decryption preprocessing module 4, where the decryption preprocessing module 4 may include a decryption key configuration unit 41 and a to-be-decrypted information processing unit 42, where the to-be-decrypted information processing unit 42 may extract an encryption option sequence number and byte pad information from a header of the to-be-decrypted frame after receiving an externally input to-be-decrypted frame, the decryption key configuration unit 41 may read corresponding encryption parameters from the key storage module 1 according to the encryption option sequence number corresponding to the to-be-decrypted frame, the to-be-decrypted information processing unit 42 re-extracts the segment information actually to be decrypted according to the encryption parameters, where a method of extracting the segment information actually to be decrypted may be to determine the segment information actually to be decrypted according to the byte pad information thereof, for example, if a byte pad character of the header of the decrypted frame is "0", it indicates that the decrypted frame has no byte pad, if the byte pad character of the header of the decrypted frame is byte pad number, and the remaining information may be the byte of the corresponding number from the last extracted of the segment information, and the two units jointly process all to-be-decrypted frame, and the byte pad information actually to be decrypted, and the byte pad information are transmitted to the decryption module 5, and the byte pad information to the decryption module.
The information encryption system further comprises a decryption module 5, after the decryption module 5 receives the encryption option sequence number, whether the information to be decrypted required for the decryption is transmitted completely is judged through the encryption parameter corresponding to the sequence number, if the transmission is completed, a corresponding decryption engine is started to perform decryption calculation on the segmented information to be decrypted, wherein the decryption module 5 can comprise an information decryption unit 51 and a decryption information buffer 52, the information decryption unit 51 comprises a plurality of types of decryption calculation engines, the encryption calculation which can be completed covers the encryption type corresponding to the key storage module 1, the information decryption unit 51 performs decryption calculation according to the encryption parameter extracted by the decryption preprocessing module 4 and the segmented information to be actually decrypted, and after the decryption is completed, effective information before filling can be obtained from the decrypted information according to the byte filling information extracted by the decryption preprocessing module 4 and is buffered in the decryption information buffer 52, and corresponding decryption information is output according to the decryption sequence of the frame to be decrypted.
The embodiment also provides an information encryption device, which is used for implementing the above embodiment and the preferred implementation manner, and is not described in detail. As used below, the term "module" may be a combination of software and/or hardware that implements a predetermined function. While the means described in the following embodiments are preferably implemented in software, implementation in hardware, or a combination of software and hardware, is also possible and contemplated.
The present embodiment provides an information encryption apparatus, as shown in fig. 5, including:
the encryption option sequence number selecting module 501 is configured to select, based on the digital parameter, an encryption option sequence corresponding to a corresponding number of encryption types from the key storage module in response to receiving information to be encrypted and the digital parameter input from the outside, and generate an encryption option sequence, where the key storage module stores a plurality of encryption option sequence numbers corresponding to different encryption types and corresponding to different encryption parameters, and the digital parameter indicates the number of the selected encryption option sequence numbers;
the encryption information segmentation module 502 is configured to segment the information to be encrypted one by one based on a key length corresponding to the encryption option sequence number in the encryption option sequence, where the encryption parameter includes the key length corresponding to the encryption option sequence number;
the information encrypting module 503 is configured to sequentially encrypt the segmented information to be encrypted based on the encryption option sequence number corresponding to the segmented information to be encrypted and the encryption parameter corresponding to the encryption option sequence number, so as to obtain encrypted data.
In some alternative embodiments, the encryption information segmentation module 502 includes: the information length acquisition unit is used for acquiring the length of the information to be encrypted and the sum of the key lengths corresponding to all the encryption option serial numbers in the encryption option sequence; the size comparison unit is used for judging the size relation between the length of the information to be encrypted and the sum of the key lengths corresponding to all the encryption option serial numbers in the encryption option sequence; the information segmentation unit is used for segmenting the information to be encrypted according to the key length corresponding to the encryption option serial numbers in the encryption option sequence in sequence if the length of the information to be encrypted is not greater than the sum of the key lengths corresponding to all the encryption option serial numbers in the encryption option sequence; the sequence circulation adopting unit is used for circularly adopting the key length corresponding to the encryption option serial numbers in the encryption option sequence to segment the information to be encrypted if the length of the information to be encrypted is larger than the sum of the key lengths corresponding to all the encryption option serial numbers in the encryption option sequence; and the byte filling unit is used for filling bytes of the information to be encrypted of the last section when the length of the last section of the information to be encrypted is smaller than the key length of the corresponding encryption option sequence number until the length of the information to be encrypted of the last section is consistent with the key length of the corresponding encryption option sequence number.
In some alternative embodiments, the encryption information segmentation module 502 further includes: and the identification adding unit is used for adding byte filling identification to the segmented information to be encrypted.
In some alternative embodiments, the identification adding unit includes: a first identifier adding subunit, configured to add a first identifier to the segmented information to be encrypted that is subjected to byte padding, where the first identifier characterizes a corresponding byte padding number; and the second identification adding subunit is used for adding a second identification to the segmented information to be encrypted which is not subjected to byte stuffing, wherein the second identification indicates that the segmented information to be encrypted is not subjected to byte stuffing.
In some alternative embodiments, the information encryption module 503 includes: the information encryption unit is used for encrypting the information to be encrypted of the current segment based on the encryption parameters corresponding to the encryption option sequence numbers corresponding to the information to be encrypted of the current segment; the encryption frame generation unit is used for forming a corresponding encryption frame based on the encrypted information of the current segment, which is encrypted, and the encryption option sequence number and the byte filling identifier corresponding to the encrypted information of the current segment, wherein the encryption frame at least comprises the encryption option sequence number, the byte filling identifier and the encrypted information of the current segment which is encrypted; and the encrypted frame splicing unit is used for splicing all the encrypted frames corresponding to the segmented information to be encrypted according to the encryption sequence to obtain encrypted data.
In some alternative embodiments, the information encryption apparatus includes: the encryption option sequence number extraction module is used for responding to the received encryption data and extracting an encryption option sequence number corresponding to each encryption frame in the encryption data; the encrypted frame decryption module is used for sequentially decrypting the encrypted frames in the encrypted data based on the encrypted option sequence numbers corresponding to each encrypted frame in the encrypted data and the encrypted parameters corresponding to the encrypted option sequence numbers to obtain decryption information, wherein the encrypted parameters at least comprise decryption keys.
In some alternative embodiments, the encrypted frame decryption module includes: the byte identifier extraction unit is used for extracting byte filling identifiers corresponding to the current encrypted frames in the encrypted data; extracting actual information to be decrypted corresponding to the current encrypted frame based on the byte filling identification; the decryption frame decryption unit is used for decrypting the current encryption frame based on the encryption parameters corresponding to the encryption option serial numbers corresponding to the current encryption frame to obtain decryption information corresponding to the current encryption frame; and the decryption information splicing unit is used for splicing the decryption information corresponding to all the encryption frames in the encryption data to obtain decryption data corresponding to the encryption data.
Further functional descriptions of the above respective modules and units are the same as those of the above corresponding embodiments, and are not repeated here.
The information encryption apparatus in this embodiment is presented in the form of functional units, where the units refer to ASIC (Application Specific Integrated Circuit ) circuits, processors and memories executing one or more software or fixed programs, and/or other devices that can provide the above described functions.
The embodiment of the invention also provides computer equipment, which is provided with the information encryption device shown in the figure 5.
Referring to fig. 6, fig. 6 is a schematic structural diagram of a computer device according to an alternative embodiment of the present invention, as shown in fig. 6, the computer device includes: one or more processors 10, memory 20, and interfaces for connecting the various components, including high-speed interfaces and low-speed interfaces. The various components are communicatively coupled to each other using different buses and may be mounted on a common motherboard or in other manners as desired. The processor may process instructions executing within the computer device, including instructions stored in or on memory to display graphical information of the GUI on an external input/output device, such as a display device coupled to the interface. In some alternative embodiments, multiple processors and/or multiple buses may be used, if desired, along with multiple memories and multiple memories. Also, multiple computer devices may be connected, each providing a portion of the necessary operations (e.g., as a server array, a set of blade servers, or a multiprocessor system). One processor 10 is illustrated in fig. 6.
The processor 10 may be a central processor, a network processor, or a combination thereof. The processor 10 may further include a hardware chip, among others. The hardware chip may be an application specific integrated circuit, a programmable logic device, or a combination thereof. The programmable logic device may be a complex programmable logic device, a field programmable gate array, a general-purpose array logic, or any combination thereof.
Wherein the memory 20 stores instructions executable by the at least one processor 10 to cause the at least one processor 10 to perform a method for implementing the embodiments described above.
The memory 20 may include a storage program area that may store an operating system, at least one application program required for functions, and a storage data area; the storage data area may store data created according to the use of the computer device, etc. In addition, the memory 20 may include high-speed random access memory, and may also include non-transitory memory, such as at least one magnetic disk storage device, flash memory device, or other non-transitory solid-state storage device. In some alternative embodiments, memory 20 may optionally include memory located remotely from processor 10, which may be connected to the computer device via a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
Memory 20 may include volatile memory, such as random access memory; the memory may also include non-volatile memory, such as flash memory, hard disk, or solid state disk; the memory 20 may also comprise a combination of the above types of memories.
The computer device further comprises input means 30 and output means 40. The processor 10, memory 20, input device 30, and output device 40 may be connected by a bus or other means, for example in fig. 6.
The input device 30 may receive input numeric or character information and generate signal inputs related to user settings and function control of the computer apparatus, such as a touch screen, a keypad, a mouse, a track pad, a touch pad, a pointer stick, one or more mouse buttons, a track ball, a joystick, and the like. The output means 40 may include a display device, auxiliary lighting means (e.g., LEDs), tactile feedback means (e.g., vibration motors), and the like. Such display devices include, but are not limited to, liquid crystal displays, light emitting diodes, displays and plasma displays. In some alternative implementations, the display device may be a touch screen.
The embodiments of the present invention also provide a computer readable storage medium, and the method according to the embodiments of the present invention described above may be implemented in hardware, firmware, or as a computer code which may be recorded on a storage medium, or as original stored in a remote storage medium or a non-transitory machine readable storage medium downloaded through a network and to be stored in a local storage medium, so that the method described herein may be stored on such software process on a storage medium using a general purpose computer, a special purpose processor, or programmable or special purpose hardware. The storage medium can be a magnetic disk, an optical disk, a read-only memory, a random access memory, a flash memory, a hard disk, a solid state disk or the like; further, the storage medium may also comprise a combination of memories of the kind described above. It will be appreciated that a computer, processor, microprocessor controller or programmable hardware includes a storage element that can store or receive software or computer code that, when accessed and executed by the computer, processor or hardware, implements the methods illustrated by the above embodiments.
Although embodiments of the present invention have been described in connection with the accompanying drawings, various modifications and variations may be made by those skilled in the art without departing from the spirit and scope of the invention, and such modifications and variations fall within the scope of the invention as defined by the appended claims.

Claims (10)

1. An information encryption method, characterized in that the method comprises:
responding to received information to be encrypted and digital parameters input from the outside, selecting the encryption option serial numbers corresponding to the corresponding number of encryption types from a key storage module based on the digital parameters, generating an encryption option sequence, wherein the key storage module stores a plurality of encryption option serial numbers corresponding to different encryption types and corresponding to different encryption parameters, and the digital parameters represent the number of the selected encryption option serial numbers;
segmenting the information to be encrypted one by one based on the key length corresponding to the encryption option sequence number in the encryption option sequence, wherein the encryption parameters comprise the key length corresponding to the encryption option sequence number;
and sequentially encrypting the segmented information to be encrypted based on the encryption option sequence numbers corresponding to the segmented information to be encrypted and the encryption parameters corresponding to the encryption option sequence numbers to obtain encrypted data.
2. The method of claim 1, wherein the segmenting the information to be encrypted based on the key length corresponding to the encryption option sequence number in the encryption option sequence one by one comprises:
acquiring the length of the information to be encrypted and the sum of key lengths corresponding to all encryption option serial numbers in the encryption option sequence;
judging the size relation between the length of the information to be encrypted and the sum of the key lengths corresponding to all the encryption option serial numbers in the encryption option sequence;
if the length of the information to be encrypted is not greater than the sum of the key lengths corresponding to all the encryption option serial numbers in the encryption option sequence, segmenting the information to be encrypted according to the key length corresponding to the encryption option serial numbers in the encryption option sequence in sequence;
if the length of the information to be encrypted is greater than the sum of the key lengths corresponding to all the encryption option serial numbers in the encryption option sequence, circularly adopting the key length corresponding to the encryption option serial numbers in the encryption option sequence to segment the information to be encrypted;
and when the length of the last section of the information to be encrypted is smaller than the key length of the corresponding encryption option sequence number, byte filling is carried out on the information to be encrypted of the last section until the length of the information to be encrypted of the last section is consistent with the key length of the corresponding encryption option sequence number.
3. The method of claim 2, wherein the segmenting the information to be encrypted based on the key length corresponding to the encryption option sequence number in the encryption option sequence one by one further comprises:
and adding byte stuffing identification to the segmented information to be encrypted.
4. A method according to claim 3, wherein said adding a byte pad identifier to the segmented information to be encrypted comprises:
adding a first identifier to the segmented information to be encrypted for byte stuffing, wherein the first identifier characterizes the corresponding byte stuffing number;
and adding a second identifier to the segmented information to be encrypted which is not subjected to byte stuffing, wherein the second identifier indicates that the segmented information to be encrypted is not subjected to byte stuffing.
5. The method according to claim 3, wherein sequentially encrypting the segmented information to be encrypted based on the encryption option sequence number corresponding to the segmented information to be encrypted and the encryption parameter corresponding to the encryption option sequence number to obtain encrypted data, includes:
encrypting the information to be encrypted of the current segment based on an encryption parameter corresponding to an encryption option sequence number corresponding to the information to be encrypted of the current segment;
Forming a corresponding encrypted frame based on the encrypted information of the current segment, and an encryption option sequence number and a byte filling identifier corresponding to the encrypted information of the current segment, wherein the encrypted frame at least comprises the encryption option sequence number, the byte filling identifier and the encrypted information of the current segment;
and splicing the encrypted frames corresponding to all the segmented information to be encrypted according to the encryption sequence to obtain encrypted data.
6. A method according to claim 3, characterized in that the method further comprises:
extracting an encryption option sequence number corresponding to each encryption frame in the encryption data in response to receiving the encryption data;
and sequentially decrypting the encrypted frames in the encrypted data based on the encrypted option sequence numbers corresponding to each encrypted frame in the encrypted data and the encrypted parameters corresponding to the encrypted option sequence numbers to obtain decryption information, wherein the encrypted parameters at least comprise decryption keys.
7. The method according to claim 6, wherein decrypting the encrypted data based on the encrypted option sequence number corresponding to the encrypted data and the encrypted parameter corresponding to the encrypted option sequence number to obtain the decrypted information includes:
Extracting byte filling identification corresponding to a current encrypted frame in the encrypted data;
extracting actual information to be decrypted corresponding to the current encrypted frame based on the byte stuffing identification;
decrypting the current encrypted frame based on the encryption parameters corresponding to the encryption option serial numbers corresponding to the current encrypted frame to obtain decryption information corresponding to the current encrypted frame;
and splicing the decryption information corresponding to all the encryption frames in the encryption data to obtain decryption data corresponding to the encryption data.
8. An information encryption apparatus, characterized in that the apparatus comprises:
the encryption option serial number selection module is used for responding to received information to be encrypted and digital parameters input from the outside, selecting the encryption option serial numbers corresponding to the corresponding number of encryption types from the key storage module based on the digital parameters, generating an encryption option sequence, wherein the key storage module stores a plurality of encryption option serial numbers corresponding to different encryption types and corresponding to different encryption parameters, and the digital parameters represent the number of the selected encryption option serial numbers;
the encryption information segmentation module is used for segmenting the information to be encrypted one by one based on the key length corresponding to the encryption option sequence number in the encryption option sequence, and the encryption parameters comprise the key length corresponding to the encryption option sequence number;
The information encryption module is used for sequentially encrypting the segmented information to be encrypted based on the encryption option sequence numbers corresponding to the segmented information to be encrypted and the encryption parameters corresponding to the encryption option sequence numbers to obtain encrypted data.
9. A computer device, comprising:
a memory and a processor, the memory and the processor being communicatively connected to each other, the memory having stored therein computer instructions, the processor executing the computer instructions to perform the information encryption method of any one of claims 1 to 7.
10. A computer-readable storage medium having stored thereon computer instructions for causing a computer to execute the information encryption method according to any one of claims 1 to 7.
CN202311160493.0A 2023-09-08 2023-09-08 Information encryption method, device, computer equipment and storage medium Pending CN117201120A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311160493.0A CN117201120A (en) 2023-09-08 2023-09-08 Information encryption method, device, computer equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311160493.0A CN117201120A (en) 2023-09-08 2023-09-08 Information encryption method, device, computer equipment and storage medium

Publications (1)

Publication Number Publication Date
CN117201120A true CN117201120A (en) 2023-12-08

Family

ID=88988246

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311160493.0A Pending CN117201120A (en) 2023-09-08 2023-09-08 Information encryption method, device, computer equipment and storage medium

Country Status (1)

Country Link
CN (1) CN117201120A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117499023A (en) * 2024-01-02 2024-02-02 深圳市玩视科技股份有限公司 Hardware security method, device and storage medium based on AES algorithm

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117499023A (en) * 2024-01-02 2024-02-02 深圳市玩视科技股份有限公司 Hardware security method, device and storage medium based on AES algorithm
CN117499023B (en) * 2024-01-02 2024-04-09 深圳市玩视科技股份有限公司 Hardware security method, device and storage medium based on AES algorithm

Similar Documents

Publication Publication Date Title
CN109933995B (en) User sensitive data protection and system based on cloud service and block chain
CN108345806B (en) Hardware encryption card and encryption method
CN112751852B (en) Data transmission method and related equipment
TW202009778A (en) Firmware upgrade method and device
CN110062014B (en) Encryption and decryption method and system of network model
CN105468940B (en) Method for protecting software and device
CN110933109B (en) Dynamic small program authentication method and device
CN113225297B (en) Data hybrid encryption method, device and equipment
CN108431819B (en) Method and system for protecting client access to service of DRM agent of video player
CN111538479B (en) Random parameter generation method and device in bidding process
CN111049897B (en) Method, device, equipment and medium for encrypted uploading and decrypted deployment of small program package
CN117201120A (en) Information encryption method, device, computer equipment and storage medium
CN115442032A (en) Data processing method, system on chip and readable storage medium
CN117240625B (en) Tamper-resistant data processing method and device and electronic equipment
CN110798433B (en) Verification code verification method and device
US10223249B2 (en) Test methodology for detection of unwanted cryptographic key destruction
CN105184119B (en) A kind of method for security protection of software
US11042610B1 (en) Enabling integrity and authenticity of design data
CN110932853B (en) Key management device and key management method based on trusted module
CN113704818A (en) Key management method and device for encrypted data storage system and terminal equipment
CN112199730A (en) Method and device for processing application data on terminal and electronic equipment
CN105939192A (en) Data encryption method and device
CN103516722A (en) Subscriber stage file automatic encryption and decryption method and device
CN107391970B (en) Function access control method and device in Flash application program
CN114091041A (en) Data transmission method, device, equipment and medium based on embedded equipment

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