A method and device for encrypting and decrypting mail
By embedding the ciphertext pattern and carbon copy person information in the email, the problem of insufficient security and camouflage of email encryption in the existing technology is solved, and an efficient and safe email encryption method is realized.
Patent Information
- Application Number
- CN202111256524.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-10-27
- Publication Date
- 2024-08-27
- Estimated Expiration
- 2041-10-27
AI Technical Summary
Existing email encryption methods have deficiencies in security and camouflage. There are security risks when email ciphertext is hosted on the server. Conventional encryption algorithms are highly complex and easy to detect, and the encoding length of the encrypted email content is reversible.
The preset compression algorithm is used to convert the email ciphertext into an encoding sequence, and the style configuration and carbon copy information are generated based on the encryption comparison table and the plain text. The steganography is sent in the plain text, and the receiver recovers the cipher text through the decompression algorithm to avoid the server Escrow keys for increased security and disguise.
No server is required to host the key, which improves the security and camouflage of email encryption, simplifies the encryption and decryption algorithm, reduces the difficulty of deciphering, and realizes a convenient, fast and secure encryption method.
Smart Images

Figure CN116032509B
Abstract
Description
Technical Field
[0001] The present application relates to the field of email encryption technology, and specifically to an email encryption and decryption method, device, electronic device and computer program product. Background Art
[0002] With the rapid development of electronic information technology in society, the use of e-mails is increasing day by day. Therefore, the demand for confidentiality of information is also increasing. There are usually two solutions for sending secret emails: 1. The email platform provides encryption technology, the sender sets a string of passwords to open the email, and the recipient enters the password to obtain the email information. 2. The sender encrypts the email using a conventional encryption algorithm, and the recipient implements a decryption algorithm to obtain the email content information after receiving the email.
[0003] If the encryption technology provided by the mail platform is used, there will be problems such as: the ciphertext information in the mail will still be stored in the mail platform, and the encryption and decryption are performed on the server side. Once the mail platform has security problems (such as the mail server is attacked, the mail account information is leaked, etc.), the ciphertext in the mail will be stolen. For example, the identity-based cryptographic technology is used to encrypt emails. The principle is to use the user's public identity information (such as e-mail address, IP address, name, etc.) as the user's public key, and the user's private key is generated by a trusted center called the private key generator. However, under this mechanism, the user's key is hosted on the server side, and the user's information security also depends on the security of the server itself and the commitment of the service provider.
[0004] If you use a conventional text encryption algorithm to send emails, the security of the email ciphertext depends on the encryption algorithm. For example, symmetric encryption algorithms use hash functions such as MD5, SHA1, and SHA25 for encryption. As modern computers become more and more powerful, the cost of collision tests is getting lower and lower, so the security is gradually reduced; and the use of asymmetric encryption algorithms such as RSA, Elgamal, backpack algorithm, Rabin, etc., often faces problems such as complex algorithms, high complexity of calculating public and private keys, and long calculation time. Moreover, the encrypted email ciphertext usually looks like a bunch of codes, the encryption behavior is easy to detect, and the disguise is insufficient. Once the email is stolen by a third party, the third party can reverse the algorithm used by the encoding length and rules of the encrypted email content, so there is still a risk of decryption. Summary of the invention
[0005] The embodiments of the present application provide an email encryption and decryption method, device, electronic device and computer program product to solve the technical problems of insufficient disguise and insufficient security of existing email encryption methods.
[0006] In a first aspect, an embodiment of the present application provides an email encryption method, comprising:
[0007] Use a preset compression algorithm to convert the email ciphertext into a coding sequence;
[0008] Based on the preset encryption comparison table and the encoding sequence, the email plaintext is styled and the carbon copy recipient information is generated;
[0009] The email is sent in plain text to the email recipient according to the carbon copy information.
[0010] In one embodiment, the encryption comparison table includes a font style comparison table, a carbon copy address character table, and a carbon copy domain name comparison table; the configuration of the email plain text style and the generation of carbon copy information based on the preset encryption comparison table and the encoding sequence include:
[0011] Extracting a first coding sequence from the coding sequence, and performing style configuration on the email plain text based on the font style comparison table and the first coding sequence;
[0012] The sequence other than the first coding sequence in the coding sequence is used as a second coding sequence, and the cc information is generated based on the cc address character table, the cc domain name comparison table and the second coding sequence.
[0013] In one embodiment, the step of using a sequence other than the first coding sequence in the coding sequence as a second coding sequence, and generating the cc information based on the cc address character table, the cc domain name comparison table, and the second coding sequence includes:
[0014] The second coding sequence is converted into a comparison parameter according to a preset conversion algorithm, characters are extracted from the cc address character table to form a cc prefix according to the comparison parameter, and a cc domain name is extracted from the cc domain name comparison table, and the cc information is generated according to the cc prefix and the cc domain name.
[0015] In one embodiment, the converting the second coding sequence into a comparison parameter according to a preset conversion algorithm, extracting characters from the cc address character table to form a cc prefix according to the comparison parameter, extracting a cc domain name from the cc domain name comparison table, and generating the cc information according to the cc prefix and the cc domain name, includes:
[0016] Using the character length of the plain text of the email as the division length, dividing the second encoding sequence into a plurality of groups of encoding subsequences;
[0017] Dividing each group of the coding subsequences into a front subsequence and a rear subsequence, converting the front subsequence into a first control parameter according to a preset conversion algorithm, and converting the rear subsequence into a second control parameter according to the conversion algorithm;
[0018] According to the first comparison parameter, characters are extracted from the cc address character table to form a cc prefix, and according to the second comparison parameter, a cc domain name is extracted from the cc domain name comparison table, and then the cc information is generated according to the cc prefix and the cc domain name.
[0019] In a second aspect, an embodiment of the present application provides an email decryption method, comprising:
[0020] Based on the pre-stored encryption comparison table, the cc information of the email and the text style information of the email plaintext are parsed to obtain the encoding sequence;
[0021] The encoding sequence is converted according to a pre-stored decompression algorithm to obtain the email ciphertext.
[0022] In one embodiment, the encryption comparison table includes a font style comparison table, a cc address character table, and a cc domain name comparison table. Based on the pre-stored encryption comparison table, the cc information of the email and the text style information of the email plaintext are parsed to obtain a coding sequence, including:
[0023] Based on the font style comparison table, the text style information of the email plaintext is parsed to obtain a first encoding sequence;
[0024] Based on the cc address character table and the cc domain name comparison table, the cc information of the email is parsed to obtain a second coding sequence;
[0025] The first coding sequence and the second coding sequence are combined to obtain the coding sequence.
[0026] In a third aspect, an embodiment of the present application provides an email encryption device, comprising:
[0027] A code generation module, used to convert the email ciphertext into a code sequence using a preset compression algorithm;
[0028] An email steganography module, used to configure the email plaintext style and generate the CC information based on a preset encryption comparison table and the encoding sequence;
[0029] The mail sending module is used to send the mail in plain text to the mail recipient according to the carbon copy information.
[0030] In a fourth aspect, an embodiment of the present application provides an email decryption device, comprising:
[0031] The encoding parsing module is used to parse the Cc information of the email and the text style information of the email plaintext to obtain the encoding sequence based on the pre-stored encryption comparison table;
[0032] The mail decryption module is used to convert the encoding sequence according to a pre-stored decompression algorithm to obtain the mail ciphertext.
[0033] In a fifth aspect, an embodiment of the present application provides an electronic device, comprising a processor and a memory storing a computer program, wherein when the processor executes the program, the steps of the email encryption method described in the first aspect or the steps of the email decryption method described in the second aspect are implemented.
[0034] In a sixth aspect, an embodiment of the present application provides a computer program product, including a computer program, which, when executed by a processor, implements the steps of the email encryption method described in the first aspect or the steps of the email decryption method described in the second aspect.
[0035] The email encryption and decryption method, device, electronic device and computer program product provided in the embodiments of the present application use plain text style information and the email's carbon copy information to steganographically write the email ciphertext, without the need to host the secret key information through a server, thereby effectively improving the security of the encrypted email. At the same time, since the corresponding plain text is retained in the email, the encryption behavior of the email is not easy to be detected, thereby effectively improving the disguise of the encrypted email. BRIEF DESCRIPTION OF THE DRAWINGS
[0036] In order to more clearly illustrate the technical solutions in the present application or the prior art, a brief introduction will be given below to the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0037] Figure 1 This is one of the flowcharts of the email encryption method provided in the embodiment of the present application;
[0038] Figure 2 This is one of the flowcharts of the email decryption method provided in the embodiment of the present application;
[0039] Figure 3 This is the second flowchart of the email encryption method provided in the embodiment of the present application;
[0040] Figure 4 This is the second flow chart of the email decryption method provided in the embodiment of the present application;
[0041] Figure 5 It is a structural diagram of the email encryption device provided in an embodiment of the present application;
[0042] Figure 6 It is a structural diagram of the mail decryption device provided in an embodiment of the present application;
[0043] Figure 7 It is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0044] In order to make the purpose, technical solutions and advantages of this application clearer, the technical solutions in this application will be clearly and completely described below in conjunction with the drawings in the embodiments of this application. Obviously, the described embodiments are part of the embodiments of this application, not all of them. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0045] Figure 1 A flowchart of the email encryption method provided in the embodiment of the present application. Figure 1 , the embodiment of the present application provides an email encryption method, which may include:
[0046] S1. Use a preset compression algorithm to convert the email ciphertext into a coding sequence;
[0047] S2. Based on the preset encryption comparison table and encoding sequence, the email plain text is styled and the carbon copy information is generated;
[0048] S3. Send the plain text of the email to the email recipient according to the CC information.
[0049] In the embodiment of the present application, a preset compression algorithm is first used to convert the email ciphertext into a coding sequence, for example, it can be converted into a binary sequence.
[0050] According to the preset encryption comparison table, the plain text text style information and the Cc information of the email can be used to steganographically write the email ciphertext. For example, the coding sequence is compared with the encryption comparison table to set the font format of the plain text, and the information of the coding sequence is steganographically written in the plain text (text format information); in addition, the coding sequence is compared with the encryption comparison table to generate the Cc information, and the information of the coding sequence is steganographically written in the Cc information. In a specific embodiment, the styles of each font of the plain text can use similar fonts and colors to further improve the disguise of the email encryption behavior. For example, the font can use "Songti" and "Xin Songti", and the font color RGB used is similar to (0,0,0) and (1,1,1) and other styles.
[0051] After the ciphertext is stegographed to complete the encryption of the email, the plaintext with a specific style is used as the email content, and then the encrypted email is sent to the email recipient. It can be understood that even if the email is intercepted by the attacker, only the plaintext part of the email is intercepted, and the actual ciphertext information will not be known, and the encrypted email is effectively protected; and due to the existence of the plaintext, the attacker will not be aware that the email has been encrypted and steganographic, which greatly improves the disguise of the encryption behavior. In addition, it should be noted that the recipient address of the email is still in accordance with the address actually filled in by the sender, and the cc information is only used as the ciphertext information to be sent to the recipient, so that the email recipient can parse the received plaintext (text style information) and the cc information based on its pre-stored encryption comparison table (consistent with the sender's encryption comparison table) to obtain the ciphertext encoding sequence, and then calculate the encoding sequence according to its pre-stored decompression algorithm (corresponding to the sender's compression algorithm, which can be understood as an inverse operation) to obtain the email ciphertext information.
[0052] The email encryption method provided in the embodiment of the present application uses plain text style information and the email's carbon copy information to steganographically write the email ciphertext, without the need to host key information through a server, which effectively improves the security of the encrypted email. At the same time, since the corresponding plain text is retained in the email, the encryption behavior of the email is not easy to be detected, which effectively improves the disguise of the encrypted email. In addition, the encryption and decryption algorithm of the embodiment of the present application is simple, the algorithm complexity is low, the cost is low, and it is difficult to decipher. It is a convenient, fast and safe encryption method.
[0053] In one embodiment, the encryption comparison table includes a font style comparison table, a cc address character table, and a cc domain name comparison table; further, step S2 may include:
[0054] S21, extracting a first coding sequence from the coding sequence, and configuring the style of the email plaintext based on the font style comparison table and the first coding sequence;
[0055] S22: Use the sequence other than the first coding sequence in the coding sequence as the second coding sequence, and generate the cc information based on the cc address character table, the cc domain name comparison table and the second coding sequence.
[0056] It should be noted that the encryption comparison table may include a font style comparison table, a cc address character table, and a cc domain name comparison table. Then the coding sequence of the ciphertext may be divided into two parts, one part is used to compare with the font style comparison table to select the corresponding font style to set the style of the plaintext, and the other part is used to compare with the cc address character table and the cc domain name comparison table to extract the corresponding cc address information. Among them, the coding sequence of the first part may be a coding sequence with the same number of characters as the plaintext, so that each bit of the coding is used to set the font style of each character. In other embodiments, a coding sequence with an indefinite number of bits may also be used to set the font style of the plaintext, for example, every two codes are used for the style setting of a plaintext font, etc.
[0057] It is understandable that the first coding sequence can be intercepted from any position of the coding sequence. In order to simplify the encryption process, the corresponding first coding sequence can be intercepted from the head of the coding sequence. However, it should be noted that no matter which part of the coding sequence is intercepted as the first coding sequence, the second coding sequence must be the remaining coding sequence except the first coding sequence, so that all coding sequences can participate in the steganography of the ciphertext without repeated participation, so that the encryption and decryption processes can be aligned more neatly and avoid errors in ciphertext translation.
[0058] The email encryption method provided in the embodiment of the present application can effectively improve the efficiency and accuracy of the email encryption process by dividing the encryption comparison table into a font style comparison table, a cc address character table and a cc domain name comparison table, further dividing the coding sequence into a first coding sequence and a second coding sequence, and performing steganographic ciphertext information on the first coding sequence and the second coding sequence respectively.
[0059] In one embodiment, further, S22 may include:
[0060] S221. Convert the second coding sequence into a comparison parameter according to a preset conversion algorithm, extract characters from a cc address character table to form a cc prefix according to the comparison parameter, extract a cc domain name from a cc domain name comparison table, and generate cc information according to the cc prefix and the cc domain name.
[0061] It should be noted that the second coding sequence may be relatively lengthy and complex to obtain, and the corresponding steganographic information cannot be easily and uniquely obtained from the encryption comparison table. Therefore, the second coding sequence can be simplified by using a preset conversion algorithm. For example, the second coding sequence is divided into several groups, and the code of each group is obtained by using an algorithm such as division rounding or remainder calculation, and then these obtained numbers are compared with the encryption comparison table to obtain the corresponding content as the cc information.
[0062] The email encryption method provided in the embodiment of the present application converts the second coding sequence into a reference parameter by adopting a conversion algorithm, and then uses the reference parameter to generate the carbon copy information from a preset encryption reference table, thereby simplifying the complexity of the encryption reference table and further improving the encryption efficiency.
[0063] In one embodiment, further, S221 may include:
[0064] S2211, dividing the second coding sequence into a plurality of coding subsequences using the character length of the email plain text as the division length;
[0065] S2212, dividing each group of coding subsequences into a front subsequence and a rear subsequence, converting the front subsequence into a first comparison parameter according to a preset conversion algorithm, and converting the rear subsequence into a second comparison parameter according to the conversion algorithm;
[0066] S2213. Extract characters to form a cc prefix from the cc address character table according to the first comparison parameter, extract the cc domain name from the cc domain name comparison table according to the second comparison parameter, and then generate cc information according to the cc prefix and the cc domain name.
[0067] It should be noted that when the second coding sequence is grouped, the length of each group of codes can be used as the character length of the plain text. Each group of coding subsequences corresponds to a cc information, wherein each group of coding subsequences can be divided into a front subsequence and a rear subsequence, the front subsequence is used to compare with the cc address character table to extract the characters to form the cc prefix, and the rear subsequence is used to compare with the cc domain name comparison table and extract the cc domain name, and then the cc prefix and the cc domain name are combined to generate the cc information of the group of coding subsequences.
[0068] The email encryption method provided in the embodiment of the present application groups the second coding sequence and divides each group of coding subsequences into a front subsequence and a rear subsequence, and then obtains the cc prefix and the cc domain name by comparison respectively, thereby further simplifying the complexity of the encryption comparison table and further improving the efficiency of email encryption.
[0069] Figure 2 A flowchart of the email decryption method provided in the embodiment of the present application. Figure 2 , the embodiment of the present application provides an email decryption method, comprising:
[0070] S1. Based on the pre-stored encryption comparison table, the cc information of the email and the text style information of the email plaintext are parsed to obtain a coding sequence;
[0071] S2. Convert the encoded sequence according to the pre-stored decompression algorithm to obtain the email ciphertext.
[0072] It should be noted that the decryption process of the embodiment of the present application and the email encryption process of the above embodiment can be understood as inverse operations. First, based on the pre-stored encryption comparison table, the cc information of the email and the text style information of the email plaintext are parsed to obtain the ciphertext encoding sequence. Among them, the encryption comparison table is consistent with the encryption comparison table used by the sender for email encryption. Then, the pre-stored decompression algorithm (corresponding to the compression algorithm of the sender, which can be understood as inverse operations) is used to calculate the parsed ciphertext encoding sequence to obtain the email ciphertext information.
[0073] The email decryption method provided in the embodiment of the present application uses a pre-stored encryption comparison table to parse the CC information of the email and the text style information of the email plaintext to obtain the encoding sequence of the ciphertext, and then uses a pre-stored decompression algorithm to parse the ciphertext information of the email. There is no need to host the secret key information through the server, which effectively improves the security of the encrypted email. At the same time, since the corresponding plaintext is retained in the email, the encryption behavior of the email is not easy to be detected, which effectively improves the disguise of the encrypted email.
[0074] In one embodiment, the encryption comparison table includes a font style comparison table, a cc address character table, and a cc domain name comparison table. Step S1 may include:
[0075] S11. Based on the font style comparison table, parse the text style information of the email plaintext to obtain a first encoding sequence;
[0076] S12, based on the cc address character table and the cc domain name comparison table, parse the cc information of the email to obtain a second coding sequence;
[0077] S13. Combine the first coding sequence and the second coding sequence to obtain a coding sequence.
[0078] In an embodiment of the present application, the email recipient compares the obtained text style information of the email plaintext with the font style comparison table and parses out the corresponding first coding sequence; and compares the email's cc information with the cc address character table and the cc domain name comparison table to parse out the corresponding second coding sequence, and combines them according to the decryption strategy corresponding to the sender's encryption strategy to obtain a complete ciphertext coding sequence.
[0079] The email decryption method provided in the embodiment of the present application divides the encryption comparison table into a font style comparison table, a cc address character table and a cc domain name comparison table, and parses the text style information of the email plaintext and the cc information of the email to obtain a first coding sequence and a second coding sequence respectively, and then splices and combines them to obtain an overall ciphertext coding sequence, thereby effectively improving the efficiency and accuracy of the email decryption process.
[0080] In one embodiment, further, step S12 may include:
[0081] S121. Decompose the Cc information of the email into a Cc prefix and a Cc domain name, compare and parse the Cc prefix with a Cc address character table to obtain a first comparison parameter, and compare and parse the Cc domain name with a Cc domain name comparison table to obtain a second comparison parameter, and reversely calculate the second coding sequence based on the first comparison parameter and the second comparison parameter.
[0082] The email decryption method provided in the embodiment of the present application divides the cc information into the cc prefix and the cc domain name, and parses out the first comparison parameter and the second parameter respectively, and then reversely calculates the second encoding sequence based on the first comparison parameter and the second comparison parameter, thereby simplifying the complexity of the encryption comparison table (cc address character table, cc domain name comparison table) and further improving the decryption efficiency.
[0083] See also Figure 3 to Figure 4 Based on the above scheme, in order to better understand the email encryption method and email decryption method provided by the present invention, the following specific examples are given for detailed description:
[0084] 1. The sender and receiver of the email need to obtain a common encryption comparison table, including a font style comparison table, a CC address character table, and a CC domain name comparison table. This step can be achieved by pre-setting the relevant menu of the APP or plug-in gadget;
[0085] 2. The encryption program of the email sender compresses the ciphertext to be sent through a compression algorithm to obtain a binary sequence;
[0086] 3. The sender of the email encrypts the plain text written by the program in the ciphertext carrier. The plain text can be a piece of text automatically generated by the program that conforms to the language logic, such as a news release or a chapter of a novel, or some sentences and paragraphs defined by the user. These can also be achieved by setting up an APP or plug-in gadget;
[0087] 4. Obtain the binary code according to the compression algorithm and apply it to the comparison table to set the style of the plain text;
[0088] 5. Obtain the Cc information according to a specific conversion algorithm. The Cc information of this implementation is determined by four parameters x, y, z1, and z2, where x and y are the corresponding characters found in the comparison table and concatenated as the Cc address; z1 and z2 values are the corresponding email domain addresses found in the comparison table. According to this proposed algorithm, if z2 has a value z1, it is invalid, so x, y, z1 (or x, y, z2) is finally concatenated to xy@z1 (or xy@z2), which is the Cc address domain name.
[0089] 6. The decryption program of the email recipient reversely calculates the ciphertext information based on the text style information and CC information in the received email.
[0090] Please continue to see Figure 3 to Figure 4 , the specific implementation is as follows:
[0091] 1. Both the sender and the receiver of the email need to have a common encryption comparison table. The specific comparison tables are: font style comparison table, CC address character table, CC domain name comparison table. The following comparison table is for example only and is not limited. Assuming that the font style comparison table uses two colors and two fonts, the key values 0 and 1 in the reference table correspond to multiple styles. The specific usage of the comparison table can be as follows: When a key value appears for the first time, use the style with the smallest serial number i. When the key value appears again, use the style with serial number i+1. If i+1 is greater than the maximum serial number corresponding to the key value, use the style with the smallest serial number, and repeat this process. For example, "10110". The first character is "1". "1" appears for the first time, so the style of the smallest serial number 3 corresponding to "1" is used; the second character is "0". "0" appears for the first time, so the style of the smallest serial number 1 corresponding to serial number "0" is used; the third number is "1". This time "1" does not appear for the first time, and the style of serial number 3 was used last time, so this time the style of serial number 3+1, i.e., serial number 4, is used; the fourth number is "1". This time "1" does not appear for the first time, and because serial number 4+1, i.e., serial number 5, is greater than the largest serial number corresponding to "1", the cycle returns to the style of the smallest serial number 3 corresponding to "1"; the fifth number is "0". This time "0" does not appear for the first time, so the style of serial number 1+1, i.e., serial number 2, is used.
[0092] The embodiment of the present application adopts the following font style, color RGB (0,0,0) and color RGB (1,1,1) are two very similar black colors, and Songti and Xin Songti are two very similar fonts.
[0093] Font style comparison table (the number of fonts and colors can be adjusted):
[0094] Serial number Key value style 1 0 Songti+color RGB(0,0,0) 2 0 Songti+color RGB(1,1,1) 3 1 New Songti+color RGB(0,0,0) 4 1 New Songti+color RGB(1,1,1)
[0095] Cc address character table x (the specific content can be adjusted according to actual needs):
[0096]
[0097]
[0098] Cc address character table y (the specific content can be adjusted according to actual needs, and the table here uses the same table as the Cc address character table x):
[0099]
[0100]
[0101] Cc domain name comparison table z1:
[0102]
[0103]
[0104] Cc domain name comparison table z2 (specific content can be adjusted as needed):
[0105] Serial number (z2 value) Domain name collection 0 whut.edu 1 hzut.edu 2 whu.edu 3 hne.edu 4 wqus.edu 5 cqu.edu 6 shhu.edu 7 bjju.edu 8 bjds.edu 9 qweu.edu 10 ytw.edu 11 clsu.edu
[0106] 2. The encryption program of the email sender compresses the ciphertext to be sent to obtain a binary sequence;
[0107] In step 2, a compression algorithm is used to obtain a binary sequence after the ciphertext is compressed. Here, it is assumed that the ciphertext to be transmitted is "I don't want to go out today", and its corresponding code after compression is 01010110010011110100010101000110010100110101010110100100101001001001001.
[0108] 3. The encryption program of the email sender uses the plain text input by the user (or generated by the system), such as: "It's a nice day today, I want to go shopping."
[0109] 4. Obtain the binary code according to the compression algorithm, and compare it with the font style comparison table, and set the plain text style accordingly, as follows:
[0110] 4-1. Get the length of the plaintext characters in step 3. Here we get the length of the plaintext to be 12.
[0111] 4-2. Extract the binary code of the same length as the plain text character from the code in step 2. The character extracted here is 010101100100.
[0112] 4-3. Based on the binary code intercepted above, compare the font style comparison table according to the comparison method introduced in step 1, and set the font color style of the plain text.
[0113] 5. Obtain the values of parameters x, y, z1, and z2 according to the preset conversion algorithm. Find the corresponding characters from the 26-character alphabet based on x and y and concatenate them as the cc address. Find the corresponding email domain name address from the comparison table based on the values of z1 and z2. The algorithm is as follows:
[0114] 5-1. Take the remaining binary codes in step 2 and divide them into groups of 12 bits each. Add zeros to the right side of the last group that is less than 12 bits, and use the added bits as the value of z2. Therefore, the remaining binary codes are grouped. The last group has only 9 bits, so 3 zeros are added to make it 12 bits, so the value of z2 is 3. The code grouping value table is as follows:
[0115] Serial number Numeric 1 111101000101 2 010001100101 3 001101001101 4 010110100100 5 101001001000
[0116] 5-2. Divide each set of binary codes into the first 9 bits W1 and the last 3 bits W2. The code division value table is as follows:
[0117] Serial number Numeric W1 W2 1 111101000101 111101000 101 2 010001100101 010001100 101 3 001101001101 001101001 101 4 010110100100 010110100 100 5 101001001000 101001001 000
[0118] 5-3 According to x=W1 / 26 (rounding), y=W1%26 (remainder), z1=W2, obtain the values of x, y, z1. The reference parameter table is as follows:
[0119]
[0120]
[0121] 5-4 According to the values of x and y, find the letter in the corresponding position in the CC address character table as the CC prefix of the email, and calculate the CC address according to the values of z1 and z2. The CC information table is as follows:
[0122] Serial number x y z1 z2 Cc address 1 18 20 5 \ su@qq.com 2 5 10 5 \ fk@qq.com 3 4 1 5 \ eb@qq.com 4 6 24 4 \ gy@gmail.com 5 12 17 \ 3 mr@hne.edu
[0123] At this point, the encryption of the email is completed, and the sender sends the email. If the email is intercepted by an attacker, the intercepted information is also the plaintext part, and the ciphertext information will not be intercepted.
[0124] 6. The decryption program of the email receiver calculates the ciphertext information in reverse based on the plain text style information and the CC information of the email. Please refer to the decryption process Figure 4 .
[0125] 6-1 The email receiver reversely calculates the values of x, y, z1, and z2 based on the CC information in the received email. The corresponding table between the CC information and the comparison parameters is as follows:
[0126] Serial number x y z1 z2 Cc address 1 18 20 5 \ su@qq.com 2 5 10 5 \ fk@qq.com 3 4 1 5 \ eb@qq.com 4 6 24 4 \ gy@gmail.com 5 12 17 \ 3 mr@hne.edu
[0127] 6-2 Calculate the binary code through x, y, z1, z2. The conversion table between the parameters and the code is as follows:
[0128]
[0129]
[0130] Among them, W1=x*26+y, W2=z1.
[0131] 6-3 Based on the font style of the plaintext information, the binary code 010101100100 is calculated.
[0132] 6-4 Concatenate the above codes together to get the overall binary code 01010110010011110100010101000110010100110100110101010110100100101001001001001.
[0133] 6-5 Finally, the encrypted message "I don't want to go out today" is obtained through the decompression algorithm.
[0134] It is understandable that implicit encryption refers to secretly encrypting the information to be expressed, so that it still looks like plain text, but not the original text. Its advantage is that the encryption behavior is not easy to be discovered, which makes it easier to confuse secret spies. The email encryption method of the embodiment of the present application uses the font, color and cc information of the email text to steganographically write the ciphertext, especially using similar fonts and colors to make it difficult for secret spies to detect. For example, the fonts used in the plain text are "Songti" and "New Songti", and the RGB colors used are (0,0,0) and (1,1,1). The plain text seems to be no different from ordinary text, but the actual meaning may be "I don't want to go out today."
[0135] It should be noted that for the same terminal, only an encryption program (as the sender of the email) or only a decryption program (as the receiver of the email) can be deployed, or both the encryption program and the decryption program can be deployed at the same time. In addition, in specific applications, the above-mentioned encryption program or decryption program can be implemented through a mobile phone APP or a plug-in gadget. When the user sends and receives emails, the mobile phone can encrypt and decrypt the email ciphertext through the APP, and the PC can encrypt and decrypt the email ciphertext through the plug-in gadget. It can be understood that the method of the present invention is suitable for application scenarios such as sending and receiving emails within the military, government, and enterprises. The method of the present invention can realize the encryption and steganography of internal emails of enterprises or government agencies, and even if an external attacker obtains email information through illegal means, it is impossible to know the ciphertext content of the email. The email encryption and decryption method of the present invention, under the premise of simple encryption and decryption algorithms, low cost, and difficult decryption, more secretly improves the confidentiality of emails.
[0136] It should be noted that, for the above method or process embodiments, for the sake of simplicity of description, they are all expressed as a series of action combinations, but those skilled in the art should be aware that the embodiments of the present application are not limited by the described action sequence, because according to the embodiments of the present application, certain steps can be performed in other sequences or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all optional embodiments, and the actions involved are not necessarily required by the embodiments of the present application.
[0137] The following is a description of an email encryption device provided in an embodiment of the present application. The email encryption device described below and the email encryption method described above can be referenced to each other.
[0138] See also Figure 5 , the embodiment of the present application provides an email encryption device, comprising:
[0139] The code generation module 1 is used to convert the email ciphertext into a code sequence using a preset compression algorithm;
[0140] The email steganography module 2 is used to configure the email plaintext style and generate the CC information based on the preset encryption comparison table and the encoding sequence;
[0141] The mail sending module 3 is used to send the mail in plain text to the mail recipient according to the carbon copy information.
[0142] Furthermore, the encryption comparison table includes a font style comparison table, a cc address character table and a cc domain name comparison table; the email steganography module 2 is specifically used for:
[0143] Extracting a first coding sequence from the coding sequence, and performing style configuration on the email plain text based on the font style comparison table and the first coding sequence;
[0144] The sequence other than the first coding sequence in the coding sequence is used as a second coding sequence, and the cc information is generated based on the cc address character table, the cc domain name comparison table and the second coding sequence.
[0145] Further, the step of using a sequence other than the first coding sequence in the coding sequence as a second coding sequence, and generating the cc information based on the cc address character table, the cc domain name comparison table and the second coding sequence includes:
[0146] The second coding sequence is converted into a comparison parameter according to a preset conversion algorithm, characters are extracted from the cc address character table to form a cc prefix according to the comparison parameter, and a cc domain name is extracted from the cc domain name comparison table, and the cc information is generated according to the cc prefix and the cc domain name.
[0147] Further, the converting the second coding sequence into a comparison parameter according to a preset conversion algorithm, extracting characters from the cc address character table to form a cc prefix according to the comparison parameter, extracting a cc domain name from the cc domain name comparison table, and generating the cc information according to the cc prefix and the cc domain name, includes:
[0148] Using the character length of the plain text of the email as the division length, dividing the second encoding sequence into a plurality of groups of encoding subsequences;
[0149] Dividing each group of the coding subsequences into a front subsequence and a rear subsequence, converting the front subsequence into a first control parameter according to a preset conversion algorithm, and converting the rear subsequence into a second control parameter according to the conversion algorithm;
[0150] According to the first comparison parameter, characters are extracted from the cc address character table to form a cc prefix, and according to the second comparison parameter, a cc domain name is extracted from the cc domain name comparison table, and then the cc information is generated according to the cc prefix and the cc domain name.
[0151] It can be understood that the above-mentioned device item embodiment corresponds to the method item embodiment of the present invention. The email encryption device provided by the embodiment of the present application can implement the email encryption method provided by any method item embodiment of the present invention.
[0152] The following is a description of an email decryption device provided in an embodiment of the present application. The email decryption device described below and the email decryption method described above can be referenced to each other.
[0153] See also Figure 6, the embodiment of the present application provides an email decryption device, comprising:
[0154] The encoding parsing module 1 is used to parse the Cc information of the email and the text style information of the email plaintext to obtain the encoding sequence based on the pre-stored encryption comparison table;
[0155] The email decryption module 2 is used to convert the encoding sequence according to a pre-stored decompression algorithm to obtain the email ciphertext.
[0156] The encryption comparison table includes a font style comparison table, a cc address character table and a cc domain name comparison table. The encoding parsing module 1 is specifically used for:
[0157] Based on the font style comparison table, the text style information of the email plaintext is parsed to obtain a first encoding sequence;
[0158] Based on the cc address character table and the cc domain name comparison table, the cc information of the email is parsed to obtain a second coding sequence;
[0159] The first coding sequence and the second coding sequence are combined to obtain the coding sequence.
[0160] It can be understood that the above-mentioned device item embodiment corresponds to the method item embodiment of the present invention. The email decryption device provided by the embodiment of the present application can implement the email decryption method provided by any method item embodiment of the present invention.
[0161] Figure 7 An example of a physical structure diagram of an electronic device is shown in FIG. Figure 7 As shown, the electronic device may include: a processor 710, a communication interface 720, a memory 730 and a communication bus 740, wherein the processor 710, the communication interface 720 and the memory 730 communicate with each other through the communication bus 740. The processor 710 may call the computer program in the memory 730 to execute the steps of any one of the mail encryption methods or any one of the mail decryption methods provided in the above embodiments, for example, including:
[0162] Convert the email ciphertext into a coding sequence using a preset compression algorithm; configure the email plaintext style and generate the carbon copy information based on a preset encryption comparison table and the coding sequence; send the email plaintext to the email recipient according to the carbon copy information; or:
[0163] Based on the pre-stored encryption comparison table, the Cc information of the email and the text style information of the email plain text are parsed to obtain a coding sequence; and the coding sequence is converted according to the pre-stored decompression algorithm to obtain the email ciphertext.
[0164] In addition, the logic instructions in the above-mentioned memory 730 can be implemented in the form of a software functional unit and can be stored in a computer-readable storage medium when it is sold or used as an independent product. Based on this understanding, the technical solution of the present application can be essentially or partly embodied in the form of a software product that contributes to the prior art, and the computer software product is stored in a storage medium, including several instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a disk or an optical disk.
[0165] On the other hand, an embodiment of the present application further provides a computer program product, the computer program product including a computer program, the computer program can be stored on a non-transitory computer-readable storage medium, and when the computer program is executed by a processor, the computer can perform the steps of any one of the email encryption methods or any one of the email decryption methods provided in the above embodiments, for example, including:
[0166] Convert the email ciphertext into a coding sequence using a preset compression algorithm; configure the email plaintext style and generate the carbon copy information based on a preset encryption comparison table and the coding sequence; send the email plaintext to the email recipient according to the carbon copy information; or:
[0167] Based on the pre-stored encryption comparison table, the Cc information of the email and the text style information of the email plain text are parsed to obtain a coding sequence; and the coding sequence is converted according to the pre-stored decompression algorithm to obtain the email ciphertext.
[0168] On the other hand, an embodiment of the present application further provides a processor-readable storage medium, wherein the processor-readable storage medium stores a computer program, wherein the computer program is used to enable a processor to execute the steps of any one of the email encryption methods or any one of the email decryption methods provided in the above embodiments, for example, including:
[0169] Convert the email ciphertext into a coding sequence using a preset compression algorithm; configure the email plaintext style and generate the carbon copy information based on a preset encryption comparison table and the coding sequence; send the email plaintext to the email recipient according to the carbon copy information; or:
[0170] Based on the pre-stored encryption comparison table, the Cc information of the email and the text style information of the email plain text are parsed to obtain a coding sequence; and the coding sequence is converted according to the pre-stored decompression algorithm to obtain the email ciphertext.
[0171] The processor-readable storage medium can be any available medium or data storage device that can be accessed by the processor, including but not limited to magnetic storage (such as floppy disks, hard disks, magnetic tapes, magneto-optical disks (MO), etc.), optical storage (such as CD, DVD, BD, HVD, etc.), and semiconductor storage (such as ROM, EPROM, EEPROM, non-volatile memory (NANDFLASH), solid-state drive (SSD)), etc.
[0172] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative labor.
[0173] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.
[0174] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit it. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application.
Claims
1. A mail encryption method, characterized in that: include: Use a preset compression algorithm to convert the email ciphertext into a coding sequence; Based on the preset encryption comparison table and the encoding sequence, the email plaintext is styled and the carbon copy recipient information is generated; Sending the email in plain text to the email recipient according to the CC information; The encryption comparison table includes a font style comparison table, a cc address character table, and a cc domain name comparison table; the configuration of the email plaintext style and the generation of cc information based on the preset encryption comparison table and the encoding sequence include: Extracting a first coding sequence from the coding sequence, and configuring the style of the email plain text based on the font style comparison table and the first coding sequence; The sequence other than the first coding sequence in the coding sequence is used as a second coding sequence, and the cc information is generated based on the cc address character table, the cc domain name comparison table and the second coding sequence.
2. The email encryption method according to claim 1, characterized in that: The step of using a sequence other than the first coding sequence in the coding sequence as a second coding sequence, and generating the cc information based on the cc address character table, the cc domain name comparison table and the second coding sequence includes: The second coding sequence is converted into a comparison parameter according to a preset conversion algorithm, characters are extracted from the cc address character table to form a cc prefix according to the comparison parameter, and a cc domain name is extracted from the cc domain name comparison table, and the cc information is generated according to the cc prefix and the cc domain name.
3. The email encryption method according to claim 2, characterized in that: The step of converting the second coding sequence into a comparison parameter according to a preset conversion algorithm, extracting characters from the cc address character table to form a cc prefix according to the comparison parameter, extracting the cc domain name from the cc domain name comparison table, and generating the cc information according to the cc prefix and the cc domain name, includes: Using the character length of the plain text of the email as the division length, dividing the second encoding sequence into a plurality of groups of encoding subsequences; Dividing each group of the coding subsequences into a front subsequence and a rear subsequence, converting the front subsequence into a first control parameter according to a preset conversion algorithm, and converting the rear subsequence into a second control parameter according to the conversion algorithm; According to the first comparison parameter, characters are extracted from the cc address character table to form a cc prefix, and according to the second comparison parameter, a cc domain name is extracted from the cc domain name comparison table, and then the cc information is generated according to the cc prefix and the cc domain name.
4. A method for decrypting mail, characterized in that: include: Based on the pre-stored encryption comparison table, the cc information of the email and the text style information of the email plaintext are parsed to obtain the encoding sequence; Converting the encoded sequence according to a pre-stored decompression algorithm to obtain a mail ciphertext; The encryption comparison table includes a font style comparison table, a cc address character table, and a cc domain name comparison table. Based on the pre-stored encryption comparison table, the cc information of the email and the text style information of the email plaintext are parsed to obtain a coding sequence, including: Based on the font style comparison table, the text style information of the email plaintext is parsed to obtain a first encoding sequence; Based on the cc address character table and the cc domain name comparison table, the cc information of the email is parsed to obtain a second coding sequence; The first coding sequence and the second coding sequence are combined to obtain the coding sequence.
5. An email encryption device, characterized in that: include: A code generation module, used to convert the email ciphertext into a code sequence using a preset compression algorithm; The email steganography module is used to configure the style of the email plain text and generate the carbon copy information based on the preset encryption comparison table and the coding sequence, including: extracting a first coding sequence from the coding sequence, and configuring the style of the email plain text based on the font style comparison table and the first coding sequence; using the sequence other than the first coding sequence in the coding sequence as a second coding sequence, and generating the carbon copy information based on the carbon copy address character table, the carbon copy domain name comparison table and the second coding sequence; The mail sending module is used to send the mail in plain text to the mail recipient according to the carbon copy information.
6. A mail decryption device, characterized in that: include: The encoding parsing module is used to parse the Cc information of the email and the text style information of the email plaintext to obtain the encoding sequence based on the pre-stored encryption comparison table; The encryption comparison table includes a font style comparison table, a carbon copy address character table, and a carbon copy domain name comparison table. The method of parsing the carbon copy information of the email and the text style information of the email plain text to obtain a coding sequence based on the pre-stored encryption comparison table includes: parsing the text style information of the email plain text to obtain a first coding sequence based on the font style comparison table; parsing the carbon copy information of the email based on the carbon copy address character table and the carbon copy domain name comparison table to obtain a second coding sequence; and combining the first coding sequence and the second coding sequence to obtain the coding sequence; The mail decryption module is used to convert the encoding sequence according to a pre-stored decompression algorithm to obtain the mail ciphertext.
7. An electronic device comprising a processor and a memory storing a computer program, characterized in that: When the processor executes the computer program, the processor implements the steps of the mail encryption method according to any one of claims 1 to 3, or implements the steps of the mail decryption method according to claim 4.
8. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the email encryption method according to any one of claims 1 to 3 are implemented, or the steps of the email decryption method according to claim 4 are implemented.
