Mail processing method and device
By calculating coded value and processing the encryption matrix of the mail block, and writing layout tags of random numbers, the problem of key distribution risks in mail communication is solved, and the security hiding and verification of mail content is achieved, and the convenient mail correction is achieved. Testing process.
Patent Information
- Application Number
- CN202411099859.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-12
- Publication Date
- 2024-11-05
- Estimated Expiration
- 2044-08-12
AI Technical Summary
In existing mail communications, the key distribution process has the risk of malicious replacement or tampering, resulting in low security of mail verification.
By calculating the coded value of the email block, building an encryption matrix and writing a layout tag sequence, generating intermediate emails, and writing specific layout tags based on random numbers to generate target emails to achieve safe hiding and proofreading of email content. Test.
It improves the security of email communication, enhances the security and verification of email blocks, and prevents third parties from identifying or tampering with email content.
Smart Images

Figure CN118900263A_ABST
Abstract
Description
Technical Field
[0001] This document relates to the field of data processing technology, and in particular to a mail processing method and device. Background Art
[0002] With the continuous development of Internet technology, email has gradually become an important communication channel. In the process of information communication through email, the content of the email may be maliciously tampered with, resulting in the email recipient being unable to obtain the real email content, and the email recipient is difficult to verify the email after receiving it.
[0003] At present, in the process of information transmission through email, keys are often used to achieve the purpose of email verification. Specifically, the hash value of the email is digitally signed with a private key, and the email and the signed hash value are sent to the email recipient. The email recipient decrypts the email with a public key to obtain the hash value, and compares it with the hash value calculated based on the email to determine whether the email has been tampered with. Since there is still a risk of malicious replacement or tampering during the key distribution process, email verification achieved through keys makes email communication less secure. Summary of the invention
[0004] The purpose of one embodiment of the present specification is to provide a mail processing method and device to solve the technical problem of how to improve the communication security of mails.
[0005] To solve the above technical problems, an embodiment of this specification is implemented as follows:
[0006] In a first aspect, an embodiment of the present specification provides a mail processing method, the method comprising:
[0007] Calculate the encoding value of multiple mail blocks of the initial mail to obtain the encoding value of each mail block;
[0008] A matrix is constructed based on the code values of each mail block to obtain a code matrix, and the code matrix is encrypted according to a pre-generated random number to obtain an encryption matrix;
[0009] Determine the layout label sequence of each mail block corresponding to the encryption matrix, and write the layout label sequence into each mail block to obtain an intermediate mail;
[0010] According to the random number and the number of specific layout tags in the intermediate mail, the specific layout tag is written into the intermediate mail to obtain the target mail.
[0011] The mail processing method provided in this embodiment firstly calculates the code value of multiple mail blocks of the initial mail to obtain the code value of each mail block in the multiple mail blocks, converts the code value of each mail block into a code matrix, and encrypts the code matrix using a pre-generated random number to obtain an encryption matrix, thereby encrypting the code value of each mail block and enhancing the security of the mail block. Secondly, writes the layout label sequence of each mail block corresponding to the encryption matrix into each mail block to obtain an intermediate mail, thereby safely hiding the code value of each mail block in each mail block, further improving the security of each mail block. On this basis, according to the random number and the number of specific layout tags in the intermediate email, the specific layout tag is written into the intermediate email to obtain the target email. By writing the specific layout tag into the intermediate email, the random number can be safely hidden in the intermediate email. Through matrix encryption, secure hiding of coded values and secure hiding of random numbers, the coded values of each email block can be safely hidden from multiple dimensions, which is not easily identified or detected by a third party, thereby improving the communication security of the email, providing a security foundation for subsequent email verification, and improving the convenience of subsequent email verification.
[0012] In a second aspect, another embodiment of the present specification provides another mail processing method, the method comprising:
[0013] determining a number of specific layout labels in a target email and calculating a random number based on the number;
[0014] Identifying the layout tag sequence of each mail block in the target mail, and constructing a matrix based on the layout tag sequence of each mail block to obtain an encryption matrix;
[0015] Decrypting the encryption matrix according to the random number to obtain a decryption matrix, and converting the decryption matrix into a code value to obtain the code value of each mail block;
[0016] The coding value of each mail block after deleting the layout tag sequence is calculated, and the verification process is performed on each mail block according to the coding value and the calculated coding value.
[0017] The mail processing method provided in this embodiment calculates a random number based on the number of specific layout tags in the target mail, identifies the layout tag sequence of each mail block in the target mail, constructs a matrix based on the layout tag sequence of each mail block to obtain an encryption matrix, decrypts the encryption matrix based on the random number to obtain a decryption matrix, then converts the decryption matrix into a code value of each mail block, calculates the code value of each mail block after deleting the layout tag sequence, and verifies each mail block based on the code value of each mail block and the calculated code value, thereby restoring the random number through the specific layout tag, and then restoring the code value of each mail block through the random number, so that the real code value of each mail block can be easily restored from the target mail, and then each mail block is verified, thereby improving the validity and accuracy of the verification result of each mail block.
[0018] In a third aspect, another embodiment of the present specification provides a mail processing device, the device comprising:
[0019] A code value calculation module is used to calculate the code values of multiple mail blocks of the initial mail to obtain the code value of each mail block;
[0020] A matrix construction module, used for performing matrix construction based on the code values of each mail block to obtain a coding matrix, and encrypting the coding matrix according to a pre-generated random number to obtain an encryption matrix;
[0021] A label sequence writing module, used for determining the layout label sequence of each mail block corresponding to the encryption matrix, and writing the layout label sequence into each mail block to obtain an intermediate mail;
[0022] The label writing module is used to write the specific layout label into the intermediate mail according to the random number and the number of the specific layout labels in the intermediate mail to obtain the target mail.
[0023] In a fourth aspect, another embodiment of the present specification provides another mail processing device, the device comprising:
[0024] A random number calculation module, used to determine the number of specific layout labels in the target email and calculate a random number based on the number;
[0025] A label sequence identification module, used to identify the layout label sequence of each mail block in the target mail, and to construct a matrix based on the layout label sequence of each mail block to obtain an encryption matrix;
[0026] A decryption processing module, used for decrypting the encryption matrix according to the random number to obtain a decryption matrix, and converting the decryption matrix into a code value to obtain the code value of each mail block;
[0027] The verification processing module is used to calculate the code value of each mail block after deleting the layout tag sequence, and perform verification processing on each mail block according to the code value and the calculated code value.
[0028] In the fifth aspect, another embodiment of the present specification provides an email processing device, which includes: a memory, a processor, and computer executable instructions stored in the memory and executable on the processor, and when the computer executable instructions are executed by the processor, the steps of the email processing method described in the first aspect above are implemented.
[0029] In the sixth aspect, another embodiment of the present specification provides another mail processing device, the device comprising: a memory, a processor, and computer executable instructions stored on the memory and executable on the processor, and the computer executable instructions, when executed by the processor, implement the steps of the mail processing method as described in the second aspect above.
[0030] In a seventh aspect, another embodiment of the present specification provides a computer-readable storage medium, wherein the computer-readable storage medium is used to store computer-executable instructions, and when the computer-executable instructions are executed by a processor, the steps of the mail processing method as described in the first aspect above are implemented.
[0031] In an eighth aspect, another embodiment of the present specification provides another computer-readable storage medium, wherein the computer-readable storage medium is used to store computer-executable instructions, and when the computer-executable instructions are executed by a processor, the steps of the mail processing method described in the second aspect above are implemented.
[0032] In a ninth aspect, another embodiment of the present specification provides a computer program product, wherein the computer program product includes a mail processing program, and the mail processing program is executed by a processor to implement the steps of the mail processing method as described in the first aspect above.
[0033] In a tenth aspect, another embodiment of the present specification provides another computer program product, wherein the computer program product includes a mail processing program, and the mail processing program is executed by a processor to implement the steps of the mail processing method as described in the second aspect above. BRIEF DESCRIPTION OF THE DRAWINGS
[0034] In order to more clearly illustrate one or more embodiments of the present specification or the technical solutions in the prior art, the drawings required for use in the embodiments or the prior art descriptions are briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in the present specification. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative work.
[0035] Figure 1 A processing flow chart of a mail processing method provided in one embodiment of this specification;
[0036] Figure 2 A flowchart of an email processing method applied to an email encryption scenario provided by an embodiment of this specification;
[0037] Figure 3 A flowchart of another mail processing method provided by one embodiment of this specification;
[0038] Figure 4 A processing flow chart of an email processing method applied to an email decryption scenario provided by an embodiment of this specification;
[0039] Figure 5 A schematic diagram of a mail processing device provided in one embodiment of this specification;
[0040] Figure 6 A schematic diagram of another mail processing device provided in one embodiment of this specification;
[0041] Figure 7 A schematic diagram of the structure of a mail processing device provided in one embodiment of this specification;
[0042] Figure 8 A schematic diagram of the structure of another mail processing device provided in one embodiment of this specification. DETAILED DESCRIPTION
[0043] In order to enable those skilled in the art to better understand the technical solutions in one or more embodiments of this specification, the following will be combined with the drawings in one or more embodiments of this specification to clearly and completely describe the technical solutions in one or more embodiments of this specification. Obviously, the described embodiments are only part of the embodiments of this specification, not all of the embodiments. Based on one or more embodiments of this specification, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of this document.
[0044] An embodiment of an email processing method provided in this specification is as follows:
[0045] The email processing method provided in this embodiment can be executed by a computer device, which can be a terminal or a server. The terminal can include a mobile phone, a laptop computer, an intelligent interactive device, etc., and the server can include an independent physical server, a server cluster composed of multiple servers, or a cloud server capable of cloud computing.
[0046] Reference Figure 1The mail processing method provided in this embodiment specifically includes the following steps S102 to S108.
[0047] Step S102, calculating the coding value of multiple mail blocks of the initial mail to obtain the coding value of each mail block.
[0048] The mail in this embodiment refers to an electronic mail. The mail can specifically be the body of the mail, that is, the content of the mail body. In addition, the mail can also be the entire mail including the mail header, the mail body, and the attachments, that is, a global mail. The mail in this embodiment can be a mail containing any content. The mail can be a text mail or a rich text mail. This embodiment does not limit the specific content of the mail. The initial mail includes the initial mail body and the initial global mail. The initial mail can be obtained in the following manner: identifying the empty layout tags in the mail to be processed, and deleting the empty layout tags in the mail to be processed to obtain the initial mail.
[0049] The multiple mail blocks of the initial mail include multiple mail blocks obtained after the initial mail is divided into blocks, that is, the initial mail is divided into multiple mail parts, for example, the initial mail is divided into blocks to obtain x mail blocks; in an optional implementation manner provided in this embodiment, the multiple mail blocks of the initial mail are obtained by:
[0050] Obtaining a to-be-processed email, and identifying an empty layout tag in the to-be-processed email;
[0051] The empty layout tags in the to-be-processed email are deleted to obtain the initial email, and the initial email is processed in blocks to obtain the multiple email blocks.
[0052] The empty layout tag in the to-be-processed email may be an empty content tag or a self-closing tag. For example, an empty layout tag may be , , <hr> , <area> Etc.; by removing empty layout tags in the processed emails, the subsequent email encryption process is prevented from being disturbed, the efficiency of email encryption is improved; and by processing the initial emails in blocks, the convenience of encrypting the encoding values of multiple email blocks is achieved, thereby improving the comprehensiveness and effectiveness of email encryption.
[0053] Specifically, in the process of dividing the initial email into blocks and obtaining the multiple email blocks, the initial email may be divided into blocks according to a preset number of blocks to obtain the multiple email blocks; the preset number of blocks may be a multiple of a preset value, for example, if the preset value is 8, the preset number of blocks may be a multiple of 8. In addition, in the process of dividing the initial email into blocks and obtaining the multiple email blocks, the initial email may be divided into blocks according to a random number of blocks to obtain the multiple email blocks; the random number of blocks refers to a randomly generated number of blocks for processing.
[0054] In this embodiment, the encoding value of each mail block includes a hash value or a hash value of each mail block. The encoding value of each mail block can be a coding string, specifically a fixed-length coding string, for example, the encoding value of each mail block can be the MD (Message-Digest Algorithm) 5 value of each mail block, and the MD5 value is a 32-bit hexadecimal number. The hash value of each mail block can be obtained by inputting each mail block into a hash function to calculate the hash value.
[0055] Step S104, constructing a matrix based on the code values of each mail block to obtain a code matrix, and encrypting the code matrix according to a pre-generated random number to obtain an encryption matrix.
[0056] The above-mentioned code value calculation is performed starting from the multiple mail blocks of the initial mail to obtain the code value of each mail block in the multiple mail blocks. In this step, the code value of each mail block is converted into a code matrix, and the code matrix is encrypted using a pre-generated random number to obtain an encryption matrix, so that the code matrix constructed by the code value is encrypted by random numbers to enhance the data security of each mail block.
[0057] The coding matrix in this embodiment refers to the coding value representing each mail block in the form of a matrix; the random number includes a value randomly generated based on a preset numerical interval, and the preset numerical interval can be determined based on the number of row elements or column elements of multiple sub-matrices obtained by splitting the rotation matrix obtained by rotating the coding matrix by an angle; that is, it can be determined based on the number of row elements or column elements of each sub-matrix, and can be specifically constructed based on the full permutation number obtained by fully permuting the number of row elements or column elements of multiple sub-matrices. For example, each sub-matrix is a 4×4 matrix, then the number of row elements and the number of column elements of the sub-matrix are both 4, and 24 is obtained by fully permuting 4, then the preset numerical interval can be 0-23, and the preset numerical interval can include 0 and 23, then the random number can be randomly generated based on the preset numerical interval, that is, the random number can be any one of 0-23. The random number includes a first random number and / or a second random number, the first random number can be a column random number, and the second random number can be a row random number.
[0058] In practical applications, the code values of each email block may be relatively complex. If the code values of each email block are directly encrypted, the encryption process may be complicated, and the encryption efficiency may be low. In view of this, in order to simplify the encryption process of code value encryption and improve the encryption efficiency of code value encryption, the code values of each email block can be converted into a matrix form for representation. Specifically, in the process of obtaining a coding matrix by matrix construction based on the code values of each email block, the code values of each email block can be matrix converted to obtain a conversion matrix of each email block, and the conversion matrices of each email block can be matrix merged to obtain the coding matrix; the coding matrix can be a square matrix, that is, a matrix with the same number of rows and columns.
[0059] For example, the multiple mail blocks of the initial mail are 8 mail blocks, the encoding values of the 8 mail blocks are MD5 values, the MD5 values of the 8 mail blocks are all 32-bit hexadecimal numbers, the MD5 value of each mail block is converted into a 4×8 matrix, the 8 4×8 matrices are merged to obtain a 16×16 encoding matrix, that is, the 8 4×8 matrices are merged into a 16×16 matrix, and the encoding matrix is a square matrix.
[0060] In a specific implementation, in order to enable the code value of each email block to be encrypted and transmitted during the email transmission process, it is helpful to ensure the integrity and security of the email content; in an optional implementation provided by this embodiment, in the process of encrypting the code matrix according to the pre-generated random number to obtain the encryption matrix, the following operations are performed:
[0061] Calculating a rotation angle according to the random number, and performing angle rotation on the encoding matrix according to the rotation angle to obtain a rotation matrix;
[0062] The rotation matrix is split to obtain a plurality of sub-matrices, and matrix transformation is performed on each of the plurality of sub-matrices according to a transformation sequence corresponding to the random number to obtain a plurality of encrypted sub-matrices.
[0063] The rotation angle may be a multiple of 90 degrees, for example, the rotation angle may be 0 degrees, 90 degrees, 180 degrees, 270 degrees, etc. The transformation sequence corresponding to the random number includes a position transformation sequence corresponding to the random number, specifically, a column transformation sequence corresponding to the first random number and / or a row transformation sequence corresponding to the second random number.
[0064] Specifically, in the process of calculating the rotation angle according to a random number, the random number can be input into an angle calculation algorithm to obtain the rotation angle. Specifically, the first random number and / or the second random number can be input into the angle calculation algorithm to obtain the rotation angle. The angle calculation value can also be input into the angle calculation algorithm with the first random number and / or the second random number to obtain the rotation angle. The angle calculation value can be n, and the angle calculation value can be determined based on the number of rows or columns of the sub-matrix after the matrix is split.
[0065] For example, taking the first random number and the second random number as an example, the angle calculation algorithm includes:
[0066] C=(A+B)mod n×90°
[0067] Among them, C represents the rotation angle; A represents the first random number; B represents the second random number; n represents the number of rows or columns of each submatrix in the multiple submatrices; (A+B) mod n represents (A+B) modulo n.
[0068] It should be added that, for example, because the rotation matrix is subsequently split into multiple 4×4 sub-matrices, the number of rows and columns of these sub-matrices are both 4, so in the process of calculating the rotation angle based on the random number, n in the angle calculation algorithm is 4.
[0069] In the process of performing angle rotation on the encoding matrix according to the rotation angle to obtain the rotation matrix, the encoding matrix may be subjected to clockwise angle transformation or counterclockwise angle transformation according to the rotation angle.
[0070] For example, a first random number A is randomly generated within a preset numerical range of 0-23 as 16, and a second random number B is randomly generated within a preset numerical range of 0-23 as 21. The number of rows or columns of the submatrix after subsequent matrix splitting is 4, so the rotation angle C=(A+B)mod 4×90°=(16+21)mod 4×90°=90° is calculated according to the first random number A, the second random number B and the angle calculation value 4, and the 16×16 coding matrix is rotated 90° clockwise or counterclockwise to obtain a 16×16 rotation matrix.
[0071] In the process of splitting the rotation matrix to obtain multiple sub-matrices, the rotation matrix can be split according to the angle calculation value to obtain multiple sub-matrices; optionally, each sub-matrix in the multiple sub-matrices is a square matrix, and the number of rows or columns of each sub-matrix can be determined based on the angle calculation value, that is, the number of rows or columns of each sub-matrix can be the same as the angle calculation value; for example, if the angle calculation value is 4, the 16×16 rotation matrix is split according to the angle calculation value 4 to obtain 16 4×4 sub-matrices, and the number of rows and columns of the sub-matrices are both 4, which is the same as the angle calculation value.
[0072] On this basis, in order to further improve the privacy of the block content of each email block and improve the data security of the email content; in an optional implementation manner provided by this embodiment, in the process of performing matrix transformation on each sub-matrix of the multiple sub-matrices according to the transformation order corresponding to the random number to obtain multiple encrypted sub-matrices, each sub-matrix can be subjected to a first position transformation according to the transformation order corresponding to the first random number to obtain each intermediate sub-matrix, and each intermediate sub-matrix can be subjected to a second position transformation according to the transformation order corresponding to the second random number to obtain multiple encrypted sub-matrices. Specifically, the following operations can be performed:
[0073] Performing column transformation on each of the sub-matrices according to the column transformation order corresponding to the first random number to obtain each intermediate sub-matrix;
[0074] The plurality of encrypted sub-matrices are obtained by performing row transformation on the intermediate sub-matrices according to the row transformation sequence corresponding to the second random number.
[0075] Among them, the column transformation order corresponding to the first random number can be the order of performing elementary column transformation on each sub-matrix; the row transformation order corresponding to the second random number can be the order of performing elementary row transformation on each sub-matrix.
[0076] Specifically, elementary column transformations may be performed on each submatrix according to the column transformation order corresponding to the first random number to obtain each intermediate submatrix, and elementary row transformations may be performed on each intermediate submatrix according to the row transformation order corresponding to the second random number to obtain multiple encrypted submatrices.
[0077] Using the above example, the column transformation order corresponding to the first random number A is [3, 4, 1, 2], and the row transformation order corresponding to the second random number B is [2, 1, 4, 3]. Taking a submatrix in each submatrix as an example, the process of matrix transformation is explained; assuming that a submatrix is:
[0078] The submatrix is transformed in the column transformation order [3, 4, 1, 2] corresponding to the first random number, that is, the columns of the submatrix are rearranged to [3, 4, 1, 2] to obtain the intermediate submatrix:
[0079] Then, the rows of the intermediate submatrix are transformed according to the row transformation order [2, 1, 4, 3] corresponding to the second random number, that is, the rows of the intermediate submatrix are rearranged to [2, 1, 4, 3] to obtain the encrypted submatrix:
[0080] The process of performing column transformation and row transformation on other sub-matrices to obtain encrypted sub-matrices is similar to the processing process of a certain sub-matrix mentioned above, and will not be repeated here.
[0081] In addition, in the process of performing matrix transformation on each submatrix of the multiple submatrices according to the transformation order corresponding to the random number to obtain multiple encrypted submatrices, in order to improve the flexibility and convenience of matrix transformation, each submatrix may be subjected to column transformation according to the column transformation order corresponding to the first random number to obtain multiple encrypted submatrices, each submatrix may be subjected to row transformation according to the row transformation order corresponding to the second random number to obtain multiple encrypted submatrices, each submatrix may be subjected to row transformation according to the row transformation order corresponding to the second random number to obtain each intermediate submatrix, and each intermediate submatrix may be subjected to column transformation according to the column transformation order corresponding to the first random number to obtain multiple encrypted submatrices; that is, any one of the two modes of row transformation and column transformation may be selected for matrix transformation, or both row transformation and column transformation may be combined for matrix transformation. This embodiment does not specifically limit the execution order of row transformation and column transformation.
[0082] It should be noted that in the process of encrypting the coding matrix according to the pre-generated random number to obtain the encrypted matrix, the coding matrix can also be split to obtain multiple sub-matrices, the rotation angle is calculated according to the random number, each sub-matrix is angle-rotated according to the rotation angle to obtain multiple rotation sub-matrices, and each rotation sub-matrix in the multiple rotation sub-matrices is matrix-transformed according to the transformation order corresponding to the random number to obtain multiple encrypted sub-matrices; the process of splitting, calculating the rotation angle, performing angle rotation and matrix transformation is similar to the above and will not be repeated here.
[0083] Step S106, determining the layout tag sequence of each mail block corresponding to the encryption matrix, and writing the layout tag sequence into each mail block to obtain an intermediate mail.
[0084] The above converts the code value of each mail block into a code matrix, and encrypts the code matrix according to the pre-generated random number to obtain an encryption matrix. In this step, in order to hide the encryption matrix in each mail block, it is not easy for a third party to detect it, and it is convenient for subsequent inspection of whether the mail content of each mail block has been tampered with. By writing the layout label sequence of each mail block corresponding to the encryption matrix into each mail block, an intermediate mail is obtained, thereby realizing the safe hiding of the encryption matrix.
[0085] The layout tag sequence described in this embodiment refers to a sequence composed of one or more tags used for layout; the layout tag sequence may be an HTML (Hyper Text Markup Language) tag sequence.
[0086] In specific implementation, after encrypting the code value of each mail block to obtain the encryption matrix, in order to facilitate the subsequent verification of whether the mail content has been maliciously tampered or replaced, the encrypted code value of each mail block can be safely hidden in each mail block, so as to facilitate the subsequent comparison of the code value of each mail block to determine whether each mail block has been tampered with, thereby improving the credibility of each mail block; in an optional implementation manner provided by this embodiment, in the process of determining the layout label sequence of each mail block corresponding to the encryption matrix, the following operations are performed:
[0087] Performing code value conversion on the encryption matrix to obtain the encryption code value of each mail block;
[0088] In the label sequence mapping table, the layout label sequence of each mail block mapped with the encrypted code value is searched.
[0089] The label sequence mapping table may store encrypted code values and mapped layout label sequences. In this embodiment, the layout label sequence mapped by the code value may be adjusted according to the content size of the email and / or the level of the email. For example, if the content of the email is large and / or the level of the email is high, the layout label sequence mapped by the code value may be set to be longer and more complex.
[0090] Taking a 4-bit binary number as an example, the encrypted code value and the layout tag sequence in the tag sequence mapping table in this embodiment are explained. Assuming that the encrypted code values include 0001, 0010, 0011, 0100, and 0101, the layout tag sequence mapped by 0001 is , the layout tag sequence of 0010 mapping is , the layout tag sequence for 0011 mapping is , the layout tag sequence for 0100 mapping is , the layout tag sequence for 0101 mapping is .
[0091] It should be noted that the above-mentioned layout label sequence of the encrypted code value mapping using a 4-bit binary number as an example is merely illustrative. In practice, the number of bits of the encrypted code value may be larger, and the encrypted code value of each email block may be a 32-bit hexadecimal number. The layout label sequence of the encrypted code value mapping may be stored in the label sequence mapping label. Since each email block itself has a layout label, the encryption matrix is converted into a layout label sequence to achieve the effect of subsequently securely hiding the code value of each email block.
[0092] In addition, after the encryption matrix is converted into code values as mentioned above and the encrypted code values of each email block are obtained, in order to improve the effectiveness of the layout label sequence, the layout label sequence of each email block can also be generated in real time, that is, the layout label sequence corresponding to the encrypted code value can be generated, such as inputting the encrypted code value into the layout label model to generate the layout label and obtaining the layout label sequence corresponding to the encrypted code value.
[0093] On this basis, in order to improve the writing accuracy of the layout tag sequence of each mail block and further improve the high concealment and security of data writing; in an optional implementation manner provided by this embodiment, in the process of writing the layout tag sequence into each mail block and obtaining the intermediate mail, the writing position of the layout tag sequence of each mail block in each mail block can be determined, and the layout tag sequence of each mail block is written into each mail block according to the writing position to obtain the intermediate mail. Specifically, the following operations can be performed:
[0094] Inputting the layout tag sequence and each mail block into a position calculation model for position calculation processing to obtain writing position information of the layout tag sequence in each mail block;
[0095] The layout tag sequences of the mail blocks are written into the mail blocks according to the writing position information, and the mail blocks after writing are used as the intermediate mails.
[0096] The write position information may be a write position identifier, that is, an identifier representing a write position. The model structure of the position calculation model may be a convolutional neural network (CNN).
[0097] Specifically, the position calculation model can perform position calculation processing in the following manner: parse each email block to obtain the block length of each email block and the layout label information in each email block, and calculate the write position information of the layout label sequence of each email block in each email block based on the block length and the layout label information; wherein, the block length of each email block can be the number of characters in each email block, and the layout label information in each email block includes the layout label type, the number of labels of each layout label type and / or label nesting information; since there are layout labels in each email block itself, by converting the encryption matrix into a layout label sequence and writing the layout label sequence into each email block, the intermediate email after writing the layout label sequence is similar to an ordinary email, making it difficult for a third party to detect, thereby improving the security of the email, and by writing the layout label sequence into each email block, the intermediate email is made more secure and effective.
[0098] It should be noted that the above-mentioned position calculation model can be obtained by training in advance, that is, the position calculation model can be obtained after the model to be trained is trained. Specifically, the training can be obtained in the following manner:
[0099] Input the training data into the model to be trained for position calculation processing, and obtain the writing position information of the layout label sequence in the training data in the email block;
[0100] The loss is calculated according to the writing position information and the writing position label of the mail block, and the parameters of the model to be trained are adjusted based on the calculated loss to obtain a position calculation model.
[0101] Among them, the training data may include email blocks and corresponding layout label sequences; the email blocks can be obtained after block processing of intermediate training emails, and the intermediate training emails can be obtained after data preprocessing of training emails. The training emails can be collected from email databases, user-authorized data collection, email samples on the Internet and / or from public email data sets; the data preprocessing here may include data cleaning, such as removing invalid emails (spam), removing duplicate emails, and deleting non-standard emails, so as to ensure the consistency of the quality of email data, improve the quality of training data, and further ensure the accuracy of model training.
[0102] Step S108: According to the random number and the number of specific layout tags in the intermediate mail, the specific layout tag is written into the intermediate mail to obtain a target mail.
[0103] The above-mentioned process of writing the layout tag sequence of each mail block corresponding to the encryption matrix into each mail block to obtain the intermediate mail, in this step, in order to further improve the data security of the mail, according to the random number and the number of specific layout tags in the intermediate mail, the specific layout tag is written into the intermediate mail to obtain the target mail. The specific layout tag described in this embodiment refers to a specified layout tag, and the specific layout tag includes a first specific layout tag and / or a second specific layout tag. The first specific layout tag can be , the second specific layout tag can be .
[0104] In actual applications, after sending an email to a recipient, the recipient can obtain a coding value from the email and compare it with the coding value calculated by itself, so as to determine whether the email content has been tampered with. In order to enable the recipient to successfully obtain the coding value from the received email, the random number can be further securely hidden in the intermediate email, so that the recipient can parse the random number from the received email, and then restore the coding value based on the random number; in an optional implementation provided by this embodiment, according to the random number and the number of specific layout tags in the intermediate email, in the process of writing the specific layout tag in the intermediate email to obtain the target email, the following operations are performed:
[0105] Calculating the number of the specific layout labels in the intermediate mail, and determining the remaining number of the specific layout labels to be written according to the number and the random number;
[0106] The specific layout tag is written into the intermediate mail according to the remaining writing quantity to obtain the target mail.
[0107] The remaining writing quantity refers to the remaining quantity of specific layout tags to be written in the intermediate mail, that is, the quantity of specific layout tags that need to be written in the intermediate mail.
[0108] Specifically, in the process of determining the remaining write quantity of the specific layout label according to the quantity and the random number, the remaining write quantity of the specific layout label can be determined according to the quantity, the first random number and the second random number. When there is only one specific layout label, the remaining write quantity of the specific layout label can also be determined according to the quantity and the first random number or the second random number. The quantity and the random number can also be input into the quantity calculation algorithm to perform write quantity calculation to obtain the remaining write quantity of the specific layout label.
[0109] For example, the quantity calculation algorithm includes: Count1 mod 24 = random number A, Count2 mod 24 = random number B; and Count1 = (m1 + x1), Count2 = (m2 + x2); that is, the quantity calculation algorithm includes: (m1 + x1) mod 24 = random number A, (m2 + x2) mod 24 = random number B;
[0110] Among them, Count1 represents a specific layout tag The number of items that need to be met in the intermediate mail; Count2 represents a specific layout tag The number that needs to be met in the intermediate email; that is, the final Count1 represents the specific layout label in the target email Count2 represents the number of specific layout labels in the target email. The number of; m1 represents the specific layout label in the middle mail The number of; m2 represents the specific layout label in the middle mail The number of; x1 represents a specific layout label The remaining number of writes; x2 represents a specific layout tag The remaining number of writes.
[0111] On this basis, in an optional implementation manner provided by this embodiment, in the process of writing the specific layout label into the intermediate mail according to the remaining writing quantity to obtain the target mail, the following operations are performed:
[0112] Generate a corresponding combined tag including the specific layout tag according to the remaining write quantity;
[0113] The generated combined label is written into the intermediate mail to obtain the target mail.
[0114] The combination tag including the specific layout tag may be composed of the specific layout tag and the end tag of the specific layout tag. For example, the combination tag may be and , or and Any one of .
[0115] Specifically, a remaining number of combination tags containing specific layout tags can be generated, and the generated combination tags can be written into an intermediate email to obtain a target email. In this way, by using sufficient combination tags in the target email, the random number can be safely hidden in the intermediate email without affecting the reading effect of the email itself, so that the email recipient can easily infer the random number without being easily detected by a third party.
[0116] For example, depending on the specific layout tags in the middle email The number n1 and the first random number A determine a specific layout tag The remaining number of writes is r1, according to the specific layout tag in the intermediate mail and the second random number B determines the specific layout tag The remaining number of writes is r2, and r1 containing specific layout tags are generated according to the remaining number of writes r1 Combination tags , according to the remaining write quantity r2, generate r2 containing specific layout tags Combination tags , the generated r1 combined labels and r2 combination labels Write the intermediate email and get the target email.
[0117] Further, in order to improve the comprehensiveness of the secure hiding of the random number, the generated combined label can be written into the middle position according to the writing position to obtain the target mail; in an optional implementation manner provided by this embodiment, in the process of writing the generated combined label into the middle mail and obtaining the target mail, the following operations are performed:
[0118] Determine the writing position of the generated combined label on the intermediate mail;
[0119] The generated combined label is written into the intermediate mailpiece according to the writing position to obtain the target mailpiece.
[0120] Specifically, the generated combined label and the intermediate mail may be input into the above-mentioned position calculation model for position calculation processing to obtain the writing position information of the generated combined label in the intermediate mail, and the generated combined label may be written into the intermediate mail according to the writing position information to obtain the target mail.
[0121] It should be noted that after obtaining the target email as mentioned above, the target email can be sent and processed. In the process of sending and processing the target email, if the initial email is a global email, the target email can be sent to the email recipient; if the initial email is the email body, the target email, email header and attachments can be assembled to obtain an assembled email, and the assembled email can be sent to the email recipient.
[0122] After the mail recipient receives the target mail, the target mail here may be the target mail sent when the initial mail is a global mail, or may be an assembled mail sent when the initial mail is a mail body; after the target mail is obtained by writing the specific layout tags into the intermediate mail according to the random number and the number of specific layout tags in the intermediate mail, the target mail may be parsed to obtain the encoding value of each mail block, the layout tag sequence of each mail block in the target mail may be identified and deleted, the encoding value of each mail block after the layout tag sequence is deleted may be calculated, and each mail block may be checked according to the encoding value of each mail block and the encoding value obtained by calculation;
[0123] Specifically, after the target mail is obtained by writing the specific layout tag into the intermediate mail according to the random number and the number of the specific layout tags in the intermediate mail, the following operations may be performed:
[0124] A random number is calculated according to the number of specific layout tags in the target email, and the layout tag sequence of each email block in the target email is identified. A matrix is constructed based on the layout tag sequence of each email block to obtain an encryption matrix;
[0125] Decrypt the encryption matrix according to the random number to obtain a decryption matrix, and convert the decryption matrix into a code value to obtain the code value of each mail block;
[0126] The coding value of each mail block after deleting the layout tag sequence is calculated, and the verification process is performed on each mail block according to the coding value and the calculated coding value.
[0127] Among them, a specific layout tag refers to a specified layout tag. A specific layout tag can be and , or and Any one of .
[0128] Specifically, in the process of calculating the random number according to the number of specific layout tags in the target email, the first random number may be calculated according to the number of first specific layout tags in the target email and / or the second random number may be calculated according to the number of second specific layout tags in the target email, or the number of specific layout tags in the target email may be input into a random number calculation algorithm to perform random number calculation to obtain the random number;
[0129] For example, the random number calculation algorithm includes: random number A = Count3 mod 24, random number B = Count4 mod 24;
[0130] Among them, Count3 represents the first specific layout label in the target email Count4 represents the number of the second specific layout label in the target email The number of
[0131] In the process of constructing a matrix based on the layout label sequence of each mail block to obtain an encryption matrix, the encrypted code value mapped by the layout label sequence of each mail block can be found in the label sequence mapping table, and the encrypted code value of each mail block can be matrix-converted to obtain an encryption matrix; in the process of decrypting the encryption matrix according to the random number to obtain a decryption matrix, the encryption matrix can be split to obtain multiple encryption sub-matrices, and each of the multiple encryption sub-matrices can be matrix-inversely transformed according to the transformation order corresponding to the random number to obtain multiple rotation sub-matrices, and the multiple rotation sub-matrices can be merged to obtain a rotation matrix, and the rotation angle can be calculated according to the random number, and the rotation matrix can be rotated in the opposite direction according to the rotation angle to obtain a decryption matrix; in the process of converting the decryption matrix to obtain the code value of each mail block, the decryption matrix can be split according to the number of each mail block to obtain the code matrix of each mail block, and the code matrix of each mail block can be converted to the code value to obtain the code value of each mail block.
[0132] For example, a first random number A is calculated as 16 according to the number Count3 of the first specific layout labels in the target mail, and a second random number B is calculated as 21 according to the number Count4 of the second specific layout labels in the target mail. The layout label sequences of 8 mail blocks in the target mail are identified, and the encrypted code values mapped by the layout label sequences of the 8 mail blocks are searched in the label sequence mapping table, that is, 8 32-bit hexadecimal numbers. The 8 encrypted code values are subjected to matrix conversion to obtain an encrypted matrix. Specifically, the 8 encrypted code values can be converted into a 4×8 matrix, and the 8 4×8 matrices are combined into a 16×16 matrix, which is the encrypted matrix. The 16×16 encrypted matrix is split to obtain 16 4×4 encrypted sub-matrices. According to the transformation sequence [2, 1, 4, 3] corresponding to the second random number B, each encryption sub-matrix is subjected to a row inverse transformation to obtain each intermediate sub-matrix, and according to the transformation sequence [3, 4, 1, 2] corresponding to the first random number A, each intermediate sub-matrix is subjected to a column inverse transformation to obtain 16 rotation sub-matrices, and the 16 rotation sub-matrices are merged to obtain a 16×16 rotation matrix, and the rotation angle is calculated to be 90° according to the first random number A and the second random number B, and the rotation matrix is rotated in the reverse direction according to the rotation angle of 90° to obtain a 16×16 decryption matrix, and the decryption matrix is split according to the number of each mail block 8 to obtain the encoding matrix of 8 mail blocks, and the encoding matrix of the 8 mail blocks is converted into the encoding value to obtain the encoding value of the 8 mail blocks.
[0133] It should be supplemented that each optional implementation method in step S102 to step S108 provided in this embodiment can be executed independently as needed, or can be combined and referenced with each other. At the same time, each specific execution step in each optional implementation method can also be executed independently, and this embodiment does not make specific limitations.
[0134] In summary, the mail processing method provided in this embodiment firstly calculates the code value of multiple mail blocks of the initial mail to obtain the code value of each mail block, constructs a matrix based on the code value of each mail block to obtain a code matrix, thereby facilitating subsequent calculations by converting the code value into a code matrix; calculates a rotation angle according to a random number, and performs angle rotation on the code matrix according to the rotation angle to obtain a rotation matrix, splits the rotation matrix to obtain multiple sub-matrices, and performs matrix transformation on each of the multiple sub-matrices according to the transformation order corresponding to the random number to obtain multiple encrypted sub-matrices; secondly, performs code value conversion on the multiple encrypted sub-matrices to obtain the encrypted code value of each mail block, searches for the layout label sequence of each mail block mapped by the encrypted code value in the label sequence mapping table, inputs the layout label sequence of each mail block and each mail block into a position calculation model for position calculation processing, obtains the write position information of the layout label sequence in each mail block, and calculates the position of the layout label sequence according to the random number. The write position information writes the layout label sequence of each mail block into each mail block, and each mail block after writing is used as an intermediate mail, so as to improve the concealment of the code value in each mail block by writing the encrypted code value into each mail block in the form of a layout label sequence, and encrypt the code value and then convert the encrypted code value into a layout label sequence and write it into each mail block, and use a multi-layer nesting method to hide the code value of each mail block in each mail block, thereby improving the effectiveness and comprehensiveness of data hiding; finally, the number of specific layout labels in the intermediate mail is calculated, and the remaining write number of the specific layout label is determined according to the number and the random number, and the combined label containing the specific layout label is written into the intermediate mail according to the remaining write number to obtain the target mail, and the random number is hidden in the intermediate mail by further using the specific layout label, so that the mail recipient can easily obtain the random number without being easily detected by a third party, thereby improving the convenience and accuracy of subsequent mail recipients in mail verification.
[0135] The following combination Figure 2 , taking the application of the email processing method provided by this embodiment in the email encryption scenario as an example, the email processing method provided by this embodiment is further explained. Figure 2 ,The email processing method applied to the email encryption scenario specifically includes the following steps.
[0136] Step S202, calculating the coding value of multiple mail blocks of the initial mail to obtain the coding value of each mail block.
[0137] Step S204 , constructing a matrix based on the code value of each mail block to obtain a code matrix, and calculating a rotation angle according to the first random number and the second random number.
[0138] Step S206: Rotate the encoding matrix clockwise according to the rotation angle to obtain a rotation matrix, and split the rotation matrix to obtain multiple sub-matrices.
[0139] Here, the encoding matrix may also be rotated counterclockwise according to the rotation angle to obtain a rotation matrix.
[0140] Step S208, performing elementary column transformation on each submatrix according to the column transformation order corresponding to the first random number to obtain each intermediate submatrix, and performing elementary row transformation on each intermediate submatrix according to the row transformation order corresponding to the second random number to obtain multiple encrypted submatrices.
[0141] Here, each submatrix may be subjected to elementary row transformation according to the row transformation order corresponding to the second random number to obtain each intermediate submatrix, and each intermediate submatrix may be subjected to elementary column transformation according to the column transformation order corresponding to the first random number to obtain multiple encrypted submatrices.
[0142] Step S210 , converting the code values of the multiple encryption sub-matrices to obtain the encryption code value of each mail block, and searching the layout label sequence of each mail block mapped with the encryption code value in the label sequence mapping table.
[0143] Step S212, input the layout tag sequence and each email block into the position calculation model for position calculation processing, obtain the write position information of the layout tag sequence in each email block, and write the layout tag sequence of each email block into each email block according to the write position information, and use each email block after writing as an intermediate email.
[0144] Step S214, calculate the number of first specific layout tags and second specific layout tags in the intermediate email, and calculate the remaining write number of the first specific layout tags based on the number of first specific layout tags and the first random number, and calculate the remaining write number of the second specific layout tags based on the number of second specific layout tags and the second random number.
[0145] Step S216, write the combined label including the first specific layout label into the intermediate mail according to the remaining writing quantity of the first specific layout label, and write the combined label including the second specific layout label into the intermediate mail according to the remaining writing quantity of the second specific layout label, to obtain the target mail.
[0146] It should be noted that any one of steps S202 to S216 or any combination of multiple steps can be replaced by the corresponding technical means provided in the above steps S102 to S108 according to the needs of implementation and deployment, and will not be repeated here. It should be supplemented that the relevant contents of the mail processing method provided in the above embodiment can be executed in conjunction with the relevant contents of the mail processing method provided in the following embodiment. When reading the above embodiment, you can refer to the relevant contents of the following embodiment. Correspondingly, when reading the following embodiment, you can also refer to the relevant contents provided in the above embodiment.
[0147] Another mail processing method embodiment provided in this specification is as follows:
[0148] The email processing method provided in this embodiment can be executed by a computer device, which can be a terminal or a server. The terminal can include a mobile phone, a laptop computer, an intelligent interactive device, etc., and the server can include an independent physical server, a server cluster composed of multiple servers, or a cloud server capable of cloud computing.
[0149] Reference Figure 3 The mail processing method provided in this embodiment specifically includes the following steps S302 to S308.
[0150] Step S302, determining the number of specific layout labels in the target email, and calculating a random number based on the number.
[0151] The mail in this embodiment refers to an electronic mail, and the mail may specifically be the body of the mail, that is, the content of the mail body. In addition, the mail may also be the entire mail including the mail header, the mail body, and the attachments, that is, the global mail. The mail in this embodiment may be a mail containing any content, and may be a text mail or a rich text mail. The specific content of the mail is not limited in this embodiment.
[0152] The target email includes the target email body and the target global email; the target email may be the target email received by the recipient; the target email may include multiple email blocks, such as 8 email blocks. The specific layout tag refers to a specified layout tag, which includes a first specific layout tag and / or a second specific layout tag. The first specific layout tag may be , the second specific layout tag can be The random number may be a value randomly generated by the sender of the target email. The random number includes a value randomly generated based on a preset value interval. For example, the preset value interval may include 0 and 23. The random number may be randomly generated based on the preset value interval, that is, the random number may be any one of 0-23.
[0153] In a specific implementation, before verifying the content of the target email, the encoding value of each email block can be parsed based on the target email, and in order to parse the encoding value of each email block, it is necessary to calculate the random number hidden in the target email by the email sender; specifically, in the process of calculating the random number based on the number of specific layout tags, the first random number can be calculated according to the number of first specific layout tags in the target email and / or the second random number can be calculated according to the number of second specific layout tags in the target email, or the number of specific layout tags in the target email can be input into a random number calculation algorithm to perform random number calculation to obtain a random number;
[0154] For example, the random number calculation algorithm includes: random number A = Count3 mod 24, random number B = Count4 mod 24;
[0155] Among them, Count3 represents the first specific layout label in the target email Count4 represents the number of the second specific layout label in the target email The random number A represents the first random number, and the random number B represents the second random number; for example, the first random number A is calculated as 16 according to the number Count3 of the first specific layout tags in the target mail, and the second random number B is calculated as 21 according to the number Count4 of the second specific layout tags in the target mail.
[0156] Step S304: identifying the layout tag sequence of each mail block in the target mail, and constructing a matrix based on the layout tag sequence of each mail block to obtain an encryption matrix.
[0157] The layout tag sequence of each mail block described in this embodiment refers to a sequence composed of one or more tags used for layout; the layout tag sequence may be an HTML (Hyper Text Markup Language) tag sequence.
[0158] In actual applications, the layout tag sequence of each mail block in the target mail does not belong to the original content of each mail block, but is a layout tag sequence set for transmission in order to hide the coding value of each mail block in each mail block. To this end, the layout tag sequence of each mail block in the target mail can be identified, and a matrix can be constructed based on the layout tag sequence of each mail block to obtain an encryption matrix; in the process of constructing the matrix based on the layout tag sequence of each mail block to obtain the encryption matrix, the encrypted coding value mapped by the layout tag sequence of each mail block can be found in the tag sequence mapping table, and the encrypted coding value of each mail block can be matrix-converted to obtain the encryption matrix; in the process of performing matrix conversion on the encrypted coding value of each mail block to obtain the encryption matrix, the encrypted coding value of each mail block can be matrix-converted to obtain the conversion matrix of each mail block, and the conversion matrix of each mail block can be matrix-merged to obtain the encryption matrix.
[0159] The encrypted code value of each mail block refers to the code value of each mail block after encryption, and the code value includes the hash value or hash value of each mail block. The code value can be a code string, and specifically can be a code string of fixed length, for example, the code value can be MD (Message-Digest Algorithm, message digest algorithm) 5 value, and the MD5 value is a 32-bit hexadecimal number. The hash value of each mail block can be obtained by inputting each mail block into a hash function to calculate the hash value.
[0160] Using the above example, the layout label sequences of the 8 mail blocks in the target mail are identified, and the encrypted code values mapped by the layout label sequences of the 8 mail blocks are searched in the label sequence mapping table, that is, 8 32-bit hexadecimal numbers. The 8 encrypted code values are matrix-converted to obtain an encryption matrix. Specifically, each of the 8 encrypted code values can be converted into a 4×8 conversion matrix, and the 8 4×8 conversion matrices are matrix-merged to obtain a 16×16 encryption matrix.
[0161] Step S306, decrypting the encryption matrix according to the random number to obtain a decryption matrix, and converting the decryption matrix into a code value to obtain the code value of each mail block.
[0162] The encoding value of each email block described in this embodiment includes the hash value or hash value of each email block. The encoding value of each email block can be an encoding string, specifically an encoding string of fixed length. For example, the encoding value of each email block can be the MD (Message-Digest Algorithm) 5 value of each email block, and the MD5 value is a 32-bit hexadecimal number.
[0163] After the random number is obtained by the above calculation, in order to parse the code value of each email block from the encryption matrix; in the process of decrypting the encryption matrix according to the random number to obtain the decryption matrix, the encryption matrix can be split to obtain multiple encryption sub-matrices, and each of the multiple encryption sub-matrices is subjected to matrix inverse transformation according to the transformation order corresponding to the random number to obtain multiple rotation sub-matrices, and the multiple rotation sub-matrices are merged to obtain a rotation matrix, and the rotation angle is calculated according to the random number, and the rotation matrix is rotated in the reverse direction according to the rotation angle to obtain the decryption matrix.
[0164] Specifically, in the process of performing matrix inverse transformation on each encryption submatrix in the plurality of encryption submatrices according to the transformation order corresponding to the random number to obtain the plurality of rotation submatrices, the primary inverse transformation can be performed on each encryption submatrix according to the transformation order corresponding to the random number to obtain the plurality of rotation submatrices. Specifically, the row inverse transformation can be performed on each encryption submatrix according to the transformation order corresponding to the second random number to obtain each intermediate submatrix, and then the column inverse transformation can be performed on each intermediate submatrix according to the transformation order corresponding to the first random number to obtain the plurality of rotation submatrices.
[0165] In addition, if the above embodiment performs matrix transformation on each submatrix in the plurality of submatrices according to the transformation order corresponding to the random number, and in the process of obtaining the plurality of encrypted submatrices, performs column transformation on each submatrix according to the column transformation order corresponding to the first random number to obtain the plurality of encrypted submatrices, then the present embodiment performs matrix inverse transformation on each encrypted submatrix in the plurality of encrypted submatrices according to the transformation order corresponding to the random number, and in the process of obtaining the plurality of rotation submatrices, performs column inverse transformation on each encrypted submatrix according to the column transformation order corresponding to the first random number to obtain the plurality of rotation submatrices; if the above embodiment performs row transformation on each submatrix according to the row transformation order corresponding to the second random number to obtain the plurality of encrypted submatrices, then here the row inverse transformation on each encrypted submatrix can be performed according to the row transformation order corresponding to the second random number to obtain the plurality of rotation submatrices; if the above embodiment performs row transformation on each submatrix according to the column transformation order corresponding to the first random number to obtain the plurality of encrypted submatrices The matrix is transformed into columns to obtain each intermediate sub-matrix, and each intermediate sub-matrix is transformed into a row according to the row transformation order corresponding to the second random number to obtain the multiple encrypted sub-matrices. Here, each encrypted sub-matrix can be inversely transformed into a row according to the row transformation order corresponding to the second random number to obtain each intermediate sub-matrix, and then each intermediate sub-matrix is inversely transformed into a column according to the column transformation order corresponding to the first random number to obtain a plurality of rotated sub-matrices; if the above embodiment transforms each sub-matrix into a row according to the row transformation order corresponding to the second random number to obtain each intermediate sub-matrix, and transforms each intermediate sub-matrix into a column according to the column transformation order corresponding to the first random number to obtain the multiple encrypted sub-matrixes, then here, each encrypted sub-matrix can be inversely transformed into a column according to the column transformation order corresponding to the first random number to obtain each intermediate sub-matrix, and then each intermediate sub-matrix is inversely transformed into a row according to the row transformation order corresponding to the second random number to obtain a plurality of encrypted sub-matrices.
[0166] Still taking the example of performing row inverse transformation on each encrypted submatrix according to the row transformation order corresponding to the second random number to obtain each intermediate submatrix, and then performing column inverse transformation on each intermediate submatrix according to the column transformation order corresponding to the first random number to obtain multiple rotation submatrices as follows:
[0167] The 16×16 encryption matrix is split to obtain 16 4×4 encryption sub-matrices, and each encryption sub-matrix is subjected to a row inverse transformation according to the transformation order [2, 1, 4, 3] corresponding to the second random number B to obtain each intermediate sub-matrix, and each intermediate sub-matrix is subjected to a column inverse transformation according to the transformation order [3, 4, 1, 2] corresponding to the first random number A to obtain 16 rotation sub-matrices, and the 16 rotation sub-matrices are merged to obtain a 16×16 rotation matrix.
[0168] Taking one of the 16 4×4 encryption sub-matrices as an example, the process of inverse transformation of the encryption sub-matrix according to random numbers is described. For example, assuming that the encryption sub-matrix is:
[0169] According to the transformation order [2, 1, 4, 3] corresponding to the second random number B, the encrypted submatrix is subjected to a row inverse transformation, that is, the row arrangement order of the encrypted submatrix is restored to [2, 1, 4, 3], and the intermediate submatrix is obtained:
[0170] According to the transformation order [3, 4, 1, 2] corresponding to the first random number A, the intermediate submatrix is subjected to column inverse transformation, that is, the column arrangement order of the intermediate submatrix is restored to [3, 4, 1, 2], and the rotation submatrix is obtained:
[0171] The process of inversely transforming other encrypted sub-matrices to obtain the rotation sub-matrix is similar to the processing process of the above-mentioned encrypted sub-matrix, which will not be repeated here.
[0172] In the process of calculating the rotation angle according to the random number and rotating the rotation matrix in the reverse direction according to the rotation angle to obtain the decryption matrix, the rotation angle can be calculated according to the first random number and / or the second random number, and the rotation matrix can be rotated in the reverse direction according to the rotation angle to obtain the decryption matrix; wherein the rotation angle can be a multiple of 90 degrees, for example, the rotation angle can be 0 degrees, 90 degrees, 180 degrees, 270 degrees, etc.
[0173] In the process of calculating the rotation angle according to the random number, the random number can be input into the angle calculation algorithm to obtain the rotation angle. Specifically, the first random number and / or the second random number can be input into the angle calculation algorithm to obtain the rotation angle. The angle calculation value can also be input into the angle calculation algorithm with the first random number and / or the second random number to obtain the rotation angle. The angle calculation value can be n, which can be determined based on the number of rows or columns of each encrypted sub-matrix in the multiple encrypted sub-matrices obtained by splitting the encryption matrix as mentioned above. The specific angle calculation value can be the same as the number of rows or columns.
[0174] For example, taking the first random number and the second random number as an example, the angle calculation algorithm includes:
[0175] C=(A+B)mod n×90°
[0176] Among them, C represents the rotation angle; A represents the first random number; B represents the second random number; n represents the number of rows or columns of each encryption submatrix in the multiple encryption submatrices; (A+B) mod n represents (A+B) modulo n.
[0177] It should be added that, for example, the number of rows or columns of each encryption submatrix in the multiple encryption submatrices is 4, so n in the angle calculation algorithm here can be 4.
[0178] It should be noted that if the above embodiment rotates the encoding matrix according to the rotation angle, and in the process of obtaining the rotation matrix, the encoding matrix is transformed clockwise according to the rotation angle to obtain the rotation matrix, then in this embodiment, the rotation matrix is rotated in the reverse direction according to the rotation angle to obtain the decryption matrix, and the rotation matrix can be transformed counterclockwise according to the rotation angle to obtain the decryption matrix. If the above embodiment transforms the encoding matrix counterclockwise according to the rotation angle to obtain the rotation matrix, then the rotation matrix can be transformed clockwise according to the rotation angle to obtain the decryption matrix. For example, the rotation angle is calculated to be 90° based on the first random number A and the second random number B, and the rotation matrix is rotated in the reverse direction according to the rotation angle of 90° to obtain a 16×16 decryption matrix.
[0179] In the process of converting the decryption matrix into code values to obtain the code values of the mail blocks, the decryption matrix may be split according to the number of mail blocks to obtain the code matrices of the mail blocks, and the code matrices of the mail blocks may be converted into code values to obtain the code values of the mail blocks; for example, the decryption matrix may be split according to the number of mail blocks 8 to obtain the code matrices of 8 mail blocks, and the code matrices of the 8 mail blocks may be converted into code values to obtain the code values of 8 mail blocks.
[0180] Step S308, calculating the coding value of each mail block after deleting the layout tag sequence, and performing verification processing on each mail block according to the coding value and the calculated coding value.
[0181] The operation of deleting the layout tag sequence in each mail block here can be performed at any time after the layout tag sequence of each mail block in the target mail is identified.
[0182] In specific implementation, in the process of calculating the code value of each mail block after deleting the layout tag sequence, each mail block after deleting the layout tag sequence can be input into the hash value function to calculate the hash value; in the process of verifying each mail block according to the code value and the calculated code value, it can be detected whether the hash value of each mail block and the calculated hash value of each mail block match; it is determined that the abnormality detection of the first mail block whose hash value in each mail block matches the calculated hash value passes, indicating that the first mail block has not been tampered with; it is determined that the abnormality detection of the second mail block whose hash value in each mail block does not match the calculated hash value fails, indicating that the second mail block has been tampered with, and the second mail block that fails the abnormality detection can be marked in the target mail.
[0183] The following combination Figure 4 , taking the application of the email processing method provided by this embodiment in the email decryption scenario as an example, the email processing method provided by this embodiment is further explained. Figure 4 ,The email processing method applied to the email decryption scenario specifically includes the following steps.
[0184] Step S402, determining the number of first specific layout tags and the number of second specific layout tags in the target email, calculating a first random number based on the number of first specific layout tags, and calculating a second random number based on the number of second specific layout tags.
[0185] Step S404, identifying the layout tag sequence of each mail block in the target mail, and searching the encrypted code value mapped by the layout tag sequence of each mail block in the tag sequence mapping table, performing matrix conversion on the encrypted code value of each mail block to obtain an encryption matrix.
[0186] Step S406, split the encryption matrix to obtain multiple encryption sub-matrices, perform elementary row inverse transformation on each encryption sub-matrix according to the row transformation order corresponding to the second random number to obtain each intermediate sub-matrix, perform elementary column inverse transformation on each intermediate sub-matrix according to the column transformation order corresponding to the first random number to obtain multiple rotation sub-matrices.
[0187] Here, each encrypted submatrix can also be subjected to elementary column inverse transformation according to the column transformation order corresponding to the first random number to obtain each intermediate submatrix, and then each encrypted submatrix can be subjected to elementary row inverse transformation according to the row transformation order corresponding to the second random number to obtain multiple rotation submatrices.
[0188] Step S408: merge the multiple rotation sub-matrices to obtain a rotation matrix, and calculate the rotation angle according to the first random number and the second random number.
[0189] Step S410, counterclockwise rotating the rotation matrix according to the rotation angle to obtain a decryption matrix, performing code value conversion on the decryption matrix to obtain the code value of each mail block.
[0190] Here, the rotation matrix can also be rotated clockwise according to the rotation angle to obtain the decryption matrix.
[0191] Step S412, calculating the coding value of each mail block after deleting the layout tag sequence, and comparing the coding value of each mail block with the calculated coding value.
[0192] Step S414, determining the abnormality detection result of each email block according to the comparison processing result.
[0193] Figure 5 A schematic diagram of a mail processing device provided by an embodiment of the present invention is shown in FIG. Figure 5 As shown, the device comprises:
[0194] The code value calculation module 502 is used to calculate the code value of multiple mail blocks of the initial mail to obtain the code value of each mail block;
[0195] A matrix construction module 504 is used to construct a matrix based on the code values of each mail block to obtain a coding matrix, and encrypt the coding matrix according to a pre-generated random number to obtain an encryption matrix;
[0196] The label sequence writing module 506 is used to determine the layout label sequence of each mail block corresponding to the encryption matrix, and write the layout label sequence into each mail block to obtain the intermediate mail;
[0197] The label writing module 508 is used to write the specific layout label into the intermediate mail according to the random number and the number of the specific layout labels in the intermediate mail to obtain the target mail.
[0198] The mail processing device provided in this embodiment firstly calculates the code values of multiple mail blocks of the initial mail by running the code value calculation module 502 to obtain the code values of each mail block, runs the matrix construction module 504 to construct a matrix based on the code values of each mail block to obtain a code matrix, and encrypts the code matrix according to a pre-generated random number to obtain an encryption matrix, then runs the label sequence writing module 506 to determine the layout label sequence of each mail block corresponding to the encryption matrix, and writes the layout label sequence into each mail block to obtain an intermediate mail, and finally runs the label writing module 508 to write the specific layout label into the intermediate mail according to the random number and the number of specific layout labels in the intermediate mail to obtain a target mail, so as to improve the communication security of the mail.
[0199] An email processing device provided in an embodiment of this specification can implement each process in the aforementioned method embodiment and achieve the same functions and effects, which will not be repeated here.
[0200] Figure 6 A schematic diagram of another mail processing device provided by an embodiment of the present invention, such as Figure 6 As shown, the device comprises:
[0201] A random number calculation module 602, used to determine the number of specific layout labels in the target email and calculate a random number based on the number;
[0202] The label sequence identification module 604 is used to identify the layout label sequence of each email block in the target email, and to construct a matrix based on the layout label sequence of each email block to obtain an encryption matrix;
[0203] The decryption processing module 606 is used to perform a decryption process on the encryption matrix according to the random number to obtain a decryption matrix, and perform a code value conversion on the decryption matrix to obtain the code value of each mail block;
[0204] The verification processing module 608 is used to calculate the code value of each mail block after deleting the layout tag sequence, and perform verification processing on each mail block according to the code value and the calculated code value.
[0205] The mail processing device provided in this embodiment first determines the number of specific layout labels in the target mail by running the random number calculation module 602, and calculates a random number based on the number, runs the label sequence identification module 604, identifies the layout label sequence of each mail block in the target mail, and performs matrix construction based on the layout label sequence of each mail block to obtain an encryption matrix, then runs the decryption processing module 606, decrypts the encryption matrix according to the random number to obtain a decryption matrix, and converts the decryption matrix into a code value to obtain the code value of each mail block, and finally runs the verification processing module 608, calculates the code value of each mail block after deleting the layout label sequence, and verifies each mail block according to the code value and the calculated code value, so as to improve the convenience and effectiveness of mail verification.
[0206] Another mail processing device provided in an embodiment of this specification can implement each process in the aforementioned another method embodiment and achieve the same functions and effects, which will not be repeated here.
[0207] Furthermore, an embodiment of the present specification also provides a mail processing device, Figure 7 A schematic diagram of a mail processing device provided in an embodiment of this specification is shown in FIG. Figure 7 As shown, the device includes: a memory 701, a processor 702, a bus 703 and a communication interface 704. The memory 701, the processor 702 and the communication interface 704 communicate through the bus 703, and the communication interface 704 may include an input and output interface, which includes but is not limited to a keyboard, a mouse, a display, a microphone, a loudspeaker, etc.
[0208] Figure 7 In the embodiment, the memory 701 stores computer executable instructions that can be run on the processor 702, and when the computer executable instructions are executed by the processor 702, the following process is implemented:
[0209] Calculate the encoding value of multiple mail blocks of the initial mail to obtain the encoding value of each mail block;
[0210] A matrix is constructed based on the code values of each mail block to obtain a code matrix, and the code matrix is encrypted according to a pre-generated random number to obtain an encryption matrix;
[0211] Determine the layout label sequence of each mail block corresponding to the encryption matrix, and write the layout label sequence into each mail block to obtain an intermediate mail;
[0212] According to the random number and the number of specific layout tags in the intermediate mail, the specific layout tag is written into the intermediate mail to obtain the target mail.
[0213] The mail processing device provided in this embodiment calculates the coding values of multiple mail blocks of the initial mail through the cooperation of the memory 701, the processor 702, the bus 703 and the communication interface 704, obtains the coding value of each mail block in the multiple mail blocks, converts the coding value of each mail block into a coding matrix, encrypts the coding matrix using a pre-generated random number to obtain an encryption matrix, and then writes the layout label sequence of each mail block corresponding to the encryption matrix into each mail block to obtain an intermediate mail, and performs a writing process of the specific layout label on the intermediate mail according to the random number and the number of specific layout labels in the intermediate mail to obtain the target mail, so as to improve the communication security of the mail.
[0214] A mail processing device provided in an embodiment of this specification can implement each process in the aforementioned method embodiment and achieve the same functions and effects, which will not be repeated here.
[0215] An embodiment of the present specification also provides another mail processing device, Figure 8 A schematic diagram of a mail processing device provided in an embodiment of this specification is shown in FIG. Figure 8 As shown, the device includes: a memory 801, a processor 802, a bus 803 and a communication interface 804. The memory 801, the processor 802 and the communication interface 804 communicate through the bus 803, and the communication interface 804 may include an input and output interface, which includes but is not limited to a keyboard, a mouse, a display, a microphone, a loudspeaker, etc.
[0216] Figure 8 In the embodiment, the memory 801 stores computer executable instructions that can be run on the processor 802, and when the computer executable instructions are executed by the processor 802, the following process is implemented:
[0217] determining a number of specific layout labels in a target email and calculating a random number based on the number;
[0218] Identifying the layout tag sequence of each mail block in the target mail, and constructing a matrix based on the layout tag sequence of each mail block to obtain an encryption matrix;
[0219] Decrypting the encryption matrix according to the random number to obtain a decryption matrix, and converting the decryption matrix into a code value to obtain the code value of each mail block;
[0220] The coding value of each mail block after deleting the layout tag sequence is calculated, and the verification process is performed on each mail block according to the coding value and the calculated coding value.
[0221] The mail processing device provided in this embodiment calculates a random number based on the number of specific layout labels in the target mail through the cooperation of the memory 801, the processor 802, the bus 803 and the communication interface 804, identifies the layout label sequence of each mail block in the target mail, constructs a matrix based on the layout label sequence of each mail block to obtain an encryption matrix, decrypts the encryption matrix according to the random number to obtain a decryption matrix, then converts the decryption matrix into the code value of each mail block, calculates the code value of each mail block after deleting the layout label sequence, and verifies each mail block according to the code value of each mail block and the calculated code value, thereby improving the convenience and effectiveness of mail verification.
[0222] Another mail processing device provided in an embodiment of this specification can implement each process in the aforementioned another method embodiment and achieve the same functions and effects, which will not be repeated here.
[0223] Furthermore, another embodiment of the present specification provides a computer-readable storage medium, wherein the computer-readable storage medium is used to store computer-executable instructions, and when the computer-executable instructions are executed by a processor, the following process is implemented:
[0224] Calculate the encoding value of multiple mail blocks of the initial mail to obtain the encoding value of each mail block;
[0225] A matrix is constructed based on the code values of each mail block to obtain a code matrix, and the code matrix is encrypted according to a pre-generated random number to obtain an encryption matrix;
[0226] Determine the layout label sequence of each mail block corresponding to the encryption matrix, and write the layout label sequence into each mail block to obtain an intermediate mail;
[0227] According to the random number and the number of specific layout tags in the intermediate mail, the specific layout tag is written into the intermediate mail to obtain the target mail.
[0228] The computer-readable storage medium provided in this embodiment calculates the coding value of multiple mail blocks of an initial mail, obtains the coding value of each mail block in the multiple mail blocks, converts the coding value of each mail block into a coding matrix, encrypts the coding matrix using a pre-generated random number to obtain an encryption matrix, and then writes the layout label sequence of each mail block corresponding to the encryption matrix into each mail block to obtain an intermediate mail, and performs a writing process of a specific layout label on the intermediate mail according to the random number and the number of specific layout labels in the intermediate mail to obtain a target mail, so as to improve the communication security of the mail.
[0229] The computer-readable storage medium includes a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, etc.
[0230] The computer-readable storage medium provided in one embodiment of this specification can implement each process in the aforementioned method embodiment and achieve the same functions and effects, which will not be repeated here.
[0231] Another embodiment of the present specification also provides another computer-readable storage medium, wherein the computer-readable storage medium is used to store computer-executable instructions, and when the computer-executable instructions are executed by a processor, the following process is implemented:
[0232] determining a number of specific layout labels in a target email and calculating a random number based on the number;
[0233] Identifying the layout tag sequence of each mail block in the target mail, and constructing a matrix based on the layout tag sequence of each mail block to obtain an encryption matrix;
[0234] Decrypting the encryption matrix according to the random number to obtain a decryption matrix, and converting the decryption matrix into a code value to obtain the code value of each mail block;
[0235] The coding value of each mail block after deleting the layout tag sequence is calculated, and the verification process is performed on each mail block according to the coding value and the calculated coding value.
[0236] The computer-readable storage medium provided in this embodiment calculates a random number based on the number of specific layout tags in the target email, identifies the layout tag sequence of each email block in the target email, constructs a matrix based on the layout tag sequence of each email block to obtain an encryption matrix, decrypts the encryption matrix according to the random number to obtain a decryption matrix, then converts the decryption matrix into a coding value of each email block, calculates the coding value of each email block after deleting the layout tag sequence, and verifies each email block according to the coding value of each email block and the calculated coding value, thereby improving the convenience and effectiveness of email verification.
[0237] The computer-readable storage medium includes a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, etc.
[0238] Another computer-readable storage medium provided in an embodiment of this specification can implement each process in the aforementioned another method embodiment and achieve the same functions and effects, which will not be repeated here.
[0239] Furthermore, another embodiment of the present specification also provides a computer program product, which implements the following process when executed by a processor:
[0240] Calculate the encoding value of multiple mail blocks of the initial mail to obtain the encoding value of each mail block;
[0241] A matrix is constructed based on the code values of each mail block to obtain a code matrix, and the code matrix is encrypted according to a pre-generated random number to obtain an encryption matrix;
[0242] Determine the layout label sequence of each mail block corresponding to the encryption matrix, and write the layout label sequence into each mail block to obtain an intermediate mail;
[0243] According to the random number and the number of specific layout tags in the intermediate mail, the specific layout tag is written into the intermediate mail to obtain the target mail.
[0244] The computer program product provided in this embodiment calculates the coding value of multiple mail blocks of an initial mail, obtains the coding value of each mail block in the multiple mail blocks, converts the coding value of each mail block into a coding matrix, encrypts the coding matrix using a pre-generated random number to obtain an encryption matrix, and then writes the layout label sequence of each mail block corresponding to the encryption matrix into each mail block to obtain an intermediate mail, and performs a writing process of the specific layout label on the intermediate mail according to the random number and the number of specific layout labels in the intermediate mail to obtain a target mail, so as to improve the communication security of the mail.
[0245] A computer program product provided in one embodiment of this specification can implement each process in the aforementioned method embodiment and achieve the same functions and effects, which will not be repeated here.
[0246] Another embodiment of the present specification also provides another computer program product, which implements the following process when executed by a processor:
[0247] determining a number of specific layout labels in a target email and calculating a random number based on the number;
[0248] Identifying the layout tag sequence of each mail block in the target mail, and constructing a matrix based on the layout tag sequence of each mail block to obtain an encryption matrix;
[0249] Decrypting the encryption matrix according to the random number to obtain a decryption matrix, and converting the decryption matrix into a code value to obtain the code value of each mail block;
[0250] The coding value of each mail block after deleting the layout tag sequence is calculated, and the verification process is performed on each mail block according to the coding value and the calculated coding value.
[0251] The computer program product provided in this embodiment calculates a random number based on the number of specific layout labels in a target email, identifies the layout label sequence of each email block in the target email, constructs a matrix based on the layout label sequence of each email block to obtain an encryption matrix, decrypts the encryption matrix based on the random number to obtain a decryption matrix, then converts the decryption matrix into a coding value of each email block, calculates the coding value of each email block after deleting the layout label sequence, and verifies each email block based on the coding value of each email block and the calculated coding value, thereby improving the convenience and effectiveness of email verification.
[0252] Another computer program product provided in one embodiment of this specification can implement each process in the aforementioned another method embodiment and achieve the same functions and effects, which will not be repeated here.
[0253] Those skilled in the art will appreciate that embodiments of the present invention may be provided as methods, systems, or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present invention may take the form of a computer program product implemented on one or more computer-readable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0254] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0255] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0256] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0257] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.
[0258] Memory may include non-permanent storage in a computer-readable storage medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. Memory is an example of a computer-readable storage medium.
[0259] Computer-readable storage media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer-readable instructions, data structures, program modules or other data. Examples of computer-readable storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer-readable storage media does not include temporary computer-readable media (transitory media), such as modulated data signals and carrier waves.
[0260] It should also be noted that the term "includes", "comprising" or any other variation thereof is intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of further restrictions, an element defined by the sentence "comprising a ..." does not exclude the existence of other identical elements in the process, method, commodity or device including the element.
[0261] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that contain computer-usable program code.
[0262] The above is only an embodiment of the present application and is not intended to limit the present application. For those skilled in the art, the present application may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included in the scope of the claims of the present application.
Claims
1. A mail processing method, characterized in that: The method comprises: Calculate the encoding value of multiple mail blocks of the initial mail to obtain the encoding value of each mail block; A matrix is constructed based on the code values of each mail block to obtain a code matrix, and the code matrix is encrypted according to a pre-generated random number to obtain an encryption matrix; Determine the layout label sequence of each mail block corresponding to the encryption matrix, and write the layout label sequence into each mail block to obtain an intermediate mail; According to the random number and the number of specific layout tags in the intermediate mail, the specific layout tag is written into the intermediate mail to obtain the target mail.
2. The mail processing method according to claim 1, characterized in that: The step of encrypting the encoding matrix according to the pre-generated random number to obtain the encrypted matrix includes: Calculating a rotation angle according to the random number, and performing angle rotation on the encoding matrix according to the rotation angle to obtain a rotation matrix; The rotation matrix is split to obtain a plurality of sub-matrices, and matrix transformation is performed on each of the plurality of sub-matrices according to a transformation sequence corresponding to the random number to obtain a plurality of encrypted sub-matrices.
3. The mail processing method according to claim 2, characterized in that: The performing matrix transformation on each submatrix of the plurality of submatrices according to the transformation order corresponding to the random number to obtain a plurality of encrypted submatrices comprises: Performing column transformation on each of the sub-matrices according to the column transformation order corresponding to the first random number to obtain each intermediate sub-matrix; The plurality of encrypted sub-matrices are obtained by performing row transformation on the intermediate sub-matrices according to the row transformation sequence corresponding to the second random number.
4. The mail processing method according to claim 1, characterized in that: The step of determining the layout tag sequence of each mail block corresponding to the encryption matrix includes: Performing code value conversion on the encryption matrix to obtain the encryption code value of each mail block; In the label sequence mapping table, the layout label sequence of each mail block mapped with the encrypted code value is searched.
5. The mail processing method according to claim 4, characterized in that: The step of writing the layout tag sequence into each mail block to obtain the intermediate mail comprises: Inputting the layout tag sequence and each mail block into a position calculation model for position calculation processing to obtain writing position information of the layout tag sequence in each mail block; The layout tag sequences of the mail blocks are written into the mail blocks according to the writing position information, and the mail blocks after writing are used as the intermediate mails.
6. The mail processing method according to claim 1, characterized in that: The step of writing the specific layout tag into the intermediate mail according to the random number and the number of the specific layout tags in the intermediate mail to obtain the target mail includes: Calculating the number of the specific layout labels in the intermediate mail, and determining the remaining number of the specific layout labels to be written according to the number and the random number; The specific layout tag is written into the intermediate mail according to the remaining writing quantity to obtain the target mail.
7. The mail processing method according to claim 6, characterized in that: The step of performing a writing process on the specific layout label on the intermediate mail according to the remaining writing quantity to obtain the target mail comprises: Generate a corresponding combined tag including the specific layout tag according to the remaining write quantity; The generated combined label is written into the intermediate mail to obtain the target mail.
8. The mail processing method according to claim 7, characterized in that: Writing the generated combined label into the intermediate mail to obtain the target mail comprises: Determine the writing position of the generated combined label on the intermediate mail; The generated combined label is written into the intermediate mailpiece according to the writing position to obtain the target mailpiece.
9. The mail processing method according to claim 1, characterized in that: The multiple mail blocks of the initial mail are obtained in the following manner: Obtaining a to-be-processed email, and identifying an empty layout tag in the to-be-processed email; The empty layout tags in the to-be-processed email are deleted to obtain the initial email, and the initial email is processed in blocks to obtain the multiple email blocks.
10. A mail processing method, characterized in that: The method comprises: determining a number of specific layout labels in a target email and calculating a random number based on the number; Identifying the layout tag sequence of each mail block in the target mail, and constructing a matrix based on the layout tag sequence of each mail block to obtain an encryption matrix; Decrypting the encryption matrix according to the random number to obtain a decryption matrix, and converting the decryption matrix into a code value to obtain the code value of each mail block; The coding value of each mail block after deleting the layout tag sequence is calculated, and the verification process is performed on each mail block according to the coding value and the calculated coding value.
Citation Information
Patent Citations
Secure E-mail authentication method based on PKI (Public Key Infrastructure)
CN113709158A
Trusted e-mail evidence storage and collection system and method based on block chain
CN116155479A
Identity-encrypted secure E-mail transmission method and system
CN117155670A
Tag generation apparatus, tag verification apparatus, communication system, tag generation method, tag verification method, and recording medium
US20120057702A1
E-mail sending method, apparatus and device, and computer-readable storage medium
WO2021093673A1
