Chinese character encryption and decryption method and device based on nine-square grid pinyin
By using a Chinese character encryption method based on the nine-grid pinyin, and generating ciphertext by combining separators and placeholders, the problem of high learning cost and low cracking difficulty of existing Chinese character encryption methods is solved, achieving a low-cost encryption effect with high cracking difficulty.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- 毛鹏
- Filing Date
- 2022-12-23
- Publication Date
- 2026-05-29
AI Technical Summary
Existing Chinese character encryption methods are costly to learn, difficult to memorize, and easy to crack, failing to meet the needs of civilian and commercial use.
A Chinese character encryption method based on the nine-grid pinyin is adopted. By setting the separator and character positions of the nine-grid pinyin keyboard, the encryption symbols are matched one-to-one with the separator and character positions to generate ciphertext arranged in sequence. Encryption and decryption are performed in combination with the Chinese pinyin input habits.
It lowers the learning difficulty, increases the cracking difficulty, meets the usage needs, has strong applicability, and has promotional value.
Smart Images

Figure CN116015599B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of information security technology, and in particular to a method and device for encrypting and decrypting Chinese characters based on a nine-grid pinyin system. Background Technology
[0002] Encryption technology is the foundation of information security and an important means of ensuring communication security. Encryption technology has developed to a relatively advanced level with many algorithms, but there are still few methods for encrypting Chinese characters, especially those suitable for civilian and commercial use that cannot meet the needs of users.
[0003] For example, the invention patent with application number 202210527072.6, entitled "A Method and Device for Private Key Input, Sending and Receiving," provides a method to input each Chinese character's pinyin by using numbers on a conventional nine-key pinyin keyboard. Thus, during decryption, it is only necessary to know the letter on the keyboard corresponding to each number and the number of times that number appears to determine the letter at the corresponding position on the keyboard. The encryption method is simple, but the input is cumbersome, the encryption difficulty is low, and it is easy to crack, which cannot meet the needs of actual use.
[0004] Another encryption method, called "Nine-Square Twelve-Segment," has been disclosed. It uses a nine-square grid to match the numbers 1-9. By connecting multiple squares in the nine-square grid, numbers 1-26 are formed, thus representing the letters a-z. Alternatively, multiple squares can be connected sequentially to form the letters A-Z, also representing the letters a-z. It's a one-to-one encoding conversion encryption. However, this encryption method has a high learning curve, is difficult to memorize, and is easily cracked, thus failing to meet practical needs.
[0005] The above technology is mainly used for one-to-one replacement encryption of letters. It achieves the encryption and decryption of Chinese characters by encrypting the unique pinyin and then decrypting it to get the corresponding pinyin. It is easy to crack and therefore not conducive to widespread use. Summary of the Invention
[0006] To address the shortcomings of existing Chinese character encryption methods, the purpose of this invention is to provide a Chinese character encryption and decryption method and device based on a nine-grid pinyin system, thereby encrypting Chinese characters, reducing the learning difficulty, and increasing the difficulty of cracking.
[0007] The solution of the present invention to the above-mentioned technical problems is as follows:
[0008] A Chinese character encryption method based on a nine-grid pinyin system, characterized by the following steps:
[0009] A Chinese character encryption method based on a nine-grid pinyin system, characterized by the following steps:
[0010] S1. Set the nine-key Pinyin keyboard as the public key. The nine-key Pinyin keyboard includes one separator and eight placeholders. The letters required for Pinyin are set in the eight placeholders respectively.
[0011] S2. Each encryption symbol is assigned to a separate bit and one of the eight placeholder bits. The encryption symbol is the private key and all encryption symbols are different.
[0012] S3. Obtain the order in which the user inputs each Chinese character's pinyin in the sentence to be sent on the nine-key pinyin keyboard, and obtain the order in which the user clicks the corresponding character position and the order in which the user clicks the separator position. The encryption symbol corresponding to the separator position is located between the encryption symbols corresponding to adjacent Chinese character pinyin, between the encryption symbols corresponding to adjacent word pinyin, and / or between the encryption symbols corresponding to adjacent Chinese character pinyin and word pinyin.
[0013] S4. Obtain the corresponding ciphertext according to the order in which the user clicks the corresponding placeholder and the order in which the user clicks the separator. The ciphertext includes multiple encrypted symbols generated sequentially.
[0014] Further specifying, step S1 includes the following steps:
[0015] S11. Set up a nine-square grid, using one square as a separator and the remaining eight squares as character positions;
[0016] S12. Place the letters a to z in their corresponding placeholders, such that each placeholder has at least one letter and no letter in any placeholder is repeated from any other placeholder.
[0017] S13. Use the separator and the placeholders with letters a to z as a nine-key Pinyin keyboard to obtain the public key.
[0018] Further specifying, step S11 specifically includes:
[0019] Set up a nine-square grid, with the grid on the upper left as the separator and the remaining eight grids as the character positions;
[0020] Step S12 specifically involves:
[0021] Place the letters a-c in the top center position of the 3x3 grid, the letters d-f in the top right position, the letters g-i in the middle left position, the letters j-l in the middle center position, the letters m-o in the middle right position, the letters p-s in the bottom left position, the letters t-v in the bottom center position, and the letters w-z in the bottom right position.
[0022] Further specifying, the encryption symbols include nine different identifiers, patterns, numbers, letters, Chinese characters, radicals, and / or color blocks.
[0023] Further specifying, step S3 includes the following steps:
[0024] S31. The user sequentially spells the pinyin of each Chinese character in the sentence to be sent on the nine-key pinyin keyboard. After the user has finished inputting the pinyin of each Chinese character and / or each word in the sentence, the user clicks the separator. At the same time, the user does not click the separator after the pinyin of the last Chinese character in the sentence has been input.
[0025] S32. Obtain the position of the corresponding character space and the position of the separator when the user clicks the Pinyin input. At the same time, obtain the order in which the user clicks the separator and the order of each character space when the user inputs the Pinyin.
[0026] Further specifying, step S4 includes the following steps:
[0027] S41. Based on the position of the corresponding character space and the position of the separator when the user clicks the corresponding character space and the position of the separator when inputting Pinyin, obtain the encrypted symbol corresponding to the character space and the encrypted symbol corresponding to the separator.
[0028] S42. Based on the order in which the user clicks the separator and the order of each character position when inputting Pinyin, the encrypted symbols are obtained in sequence, and the encrypted symbols obtained in sequence are used as ciphertext.
[0029] A method for decrypting Chinese characters based on a nine-grid pinyin system, characterized by the following steps:
[0030] S1. Obtain the ciphertext and private key, and match the placeholder positions corresponding to the encrypted symbols in the ciphertext according to the private key, the order in which the placeholder positions are clicked, and the order in which the separator positions are clicked.
[0031] S2. Select any letter in the placeholder position and arrange the letters in the order in which the placeholder position was clicked, and separate adjacent letters according to the position of the separator.
[0032] S3. Determine whether the letters corresponding to all the occupying positions on both sides of each separator form the pinyin of a single Chinese character and / or a single word. If yes, retain the letters corresponding to the occupying positions; otherwise, reselect any letter in any occupying position and execute step S3.
[0033] S4. Determine whether the sequentially arranged individual Chinese characters and / or individual word groups form a sentence. If so, match the corresponding Chinese characters according to the pinyin to complete the decryption. If not, reselect any letter in the character position and execute steps S3 and S4 until the sequentially arranged individual Chinese characters and / or individual word groups form a sentence.
[0034] A Chinese character encryption device based on a nine-grid pinyin system, characterized in that it comprises:
[0035] The public key setting unit is used to use the nine-grid Pinyin keyboard as the public key; one grid is set as a separator, eight grids are set as placeholders, and the letters required for Pinyin are set in the eight placeholders respectively;
[0036] The private key setting unit is used to map nine distinct encryption symbols to separator bits and eight placeholder bits one by one.
[0037] The public key input recording unit is used to record the order in which the user inputs the pinyin of each Chinese character in the sentence to be sent on the nine-key pinyin keyboard, and to obtain the order in which the user clicks the separator and the order in which the user clicks the corresponding character position; wherein the encryption symbol corresponding to the separator is located between the encryption symbols corresponding to adjacent Chinese character pinyin, between the encryption symbols corresponding to adjacent word pinyin, and / or between the encryption symbols corresponding to adjacent Chinese character pinyin and word pinyin;
[0038] The private key generation and sending unit is used to obtain ciphertext consisting of multiple encrypted symbols arranged in sequence according to the order in which the user clicks the separator and the corresponding placeholder, and then sends the obtained ciphertext.
[0039] A Chinese character decryption device based on a nine-grid pinyin system, characterized in that it includes:
[0040] The ciphertext receiving and reading unit is used to obtain the ciphertext and the private key, and to match the placeholder positions corresponding to the encrypted symbols in the ciphertext according to the private key, the order in which the placeholder positions are clicked, and the order in which the separator positions are clicked.
[0041] The ciphertext matching unit is used to select any letter in the placeholder and arrange the letters in the order in which the corresponding placeholder was clicked, and separate two adjacent letters according to the position of the separator.
[0042] The encrypted word determination unit is used to determine whether the letters corresponding to all the occupied positions on both sides of each separator position form the pinyin of a single Chinese character and / or a single word phrase. If so, the letters corresponding to the occupied positions are retained; if not, the letters on any occupied position are reselected until the letters corresponding to all the occupied positions on both sides of each separator position form the pinyin of a single Chinese character and / or a single word phrase.
[0043] The ciphertext statement determination unit is used to determine whether the sequentially arranged individual Chinese characters and / or individual word groups form a statement. If so, the corresponding Chinese characters are matched according to the pinyin to complete the decryption. If not, any letter in the ciphertext position is reselected, and the ciphertext word determination unit and the ciphertext statement determination unit are executed in sequence.
[0044] A computer program product, characterized in that the computer program product includes a computer program, which, when executed by a processor, implements the above-described method.
[0045] The beneficial effects of this invention are as follows:
[0046] 1. This invention utilizes the nine-grid Pinyin input method, which also maps the 26 letters to 8 of the 8 designated spaces, reducing the learning cost. An additional separator prevents confusion between two independent Pinyin syllables, lowering the decryption difficulty while maintaining the cracking difficulty. The encrypted symbols are then mapped one-to-one to the nine grids. When a sentence is sent by spelling Pinyin on the nine-grid Pinyin keyboard, the output is the position and order of each press on the corresponding grid. The encrypted symbols on the corresponding grids are matched according to their position and order to form ciphertext. The ciphertext consists of multiple sequentially ordered encrypted symbols. When both the sender and receiver know the private key, they can match the letters in the corresponding spaces based on the different encrypted symbols. The order of pressing the separator separates the Pinyin of the sentence into individual characters and phrases. Combining the meaning of the phrases or the sentence itself, the corresponding Pinyin and sentence content are determined, further reducing the decryption difficulty while increasing the cracking difficulty. This requires sufficient basic Chinese expression skills to decrypt the ciphertext, meeting the usage requirements.
[0047] 2. To reduce the learning difficulty, the existing nine-grid Pinyin keyboard can be used, with the letters a to z arranged in eight positions. At the same time, the grids without letters can be used as separators to make full use of the nine-grid keyboard, while retaining the existing Pinyin input habits and meeting the needs of users.
[0048] 3. The encryption symbols used are of many types, which can be frequently changed to increase the difficulty of cracking. At the same time, it can increase the fun of decryption in daily use, increase people's interest in learning, and reduce the learning difficulty. Attached Figure Description
[0049] Figure 1 This is a schematic diagram of the Chinese character encryption process based on the nine-grid pinyin in Embodiment 1 of the present invention;
[0050] Figure 2 This is a schematic diagram of the nine-grid Pinyin keyboard in Embodiment 1 of the present invention;
[0051] Figure 3 This is a schematic diagram showing the position of the encrypted symbols on the nine-key Pinyin keyboard in Embodiment 1 of the present invention;
[0052] Figure 4 This is a schematic diagram illustrating the Chinese character decryption principle based on the nine-grid pinyin in Embodiment 2 of the present invention;
[0053] Figure 5This is a block diagram of the Chinese character encryption system based on the nine-grid pinyin in Embodiment 3 of the present invention;
[0054] Figure 6 This is a block diagram of the Chinese character decryption system based on the nine-grid pinyin in Embodiment 4 of the present invention. Detailed Implementation
[0055] Example 1
[0056] refer to Figure 1 This embodiment provides a Chinese character encryption method based on nine-grid pinyin, including the following steps:
[0057] S1. Set the nine-key Pinyin keyboard as the public key. The nine-key Pinyin keyboard includes one separator and eight placeholders. The letters required for Pinyin are set in the eight placeholders respectively.
[0058] The nine-key pinyin keyboard is used as a public key, which makes it easy for users to determine the position of the separator and the placeholder when inputting pinyin, and also to determine the corresponding letter in the placeholder, making input easier.
[0059] S2. Each encryption symbol is assigned to a separate bit and one of the eight placeholder bits. The encryption symbol is the private key and all encryption symbols are different.
[0060] In this method, the encryption symbols are used as private keys, and each encryption symbol corresponds one-to-one with a grid of nine, so that each encryption symbol corresponds to a unique placeholder or separator, thus avoiding confusion during decryption and preventing decryption failure.
[0061] S3. Obtain the order in which the user inputs the pinyin of each Chinese character in the sentence to be sent on the nine-key pinyin keyboard, and obtain the order in which the user clicks the corresponding character position and the order in which the user clicks the separator position. The encryption symbol corresponding to the separator position is located between the encryption symbols corresponding to adjacent Chinese character pinyin, between the encryption symbols corresponding to adjacent word pinyin, and / or between the encryption symbols corresponding to adjacent Chinese character pinyin and word pinyin.
[0062] In this system, whether users use a physical or virtual 9-key keyboard, they will click on the placeholder to input the corresponding letter when inputting Pinyin. After inputting the Pinyin of a single Chinese character or a single word, they will click on the separator to separate the Pinyin of the message to be sent, which makes decryption simpler and the message to be sent is plaintext.
[0063] S4. Obtain the corresponding ciphertext according to the order in which the user clicks the corresponding placeholder and the order in which the user clicks the separator. The ciphertext includes multiple encrypted symbols generated sequentially.
[0064] In this process, the ciphertext is generated by sequentially generating corresponding encryption symbols based on the position and order of the clicked placeholders and the order of the separators. Since there is only one separator, its position in the public key is fixed and unique. Therefore, it is not necessary to obtain the position of the separator separately when clicking it. There are eight placeholders, and the letters on the placeholders are different in different positions. Clicking the placeholders in different orders will result in different pinyin results. Therefore, it is necessary to determine the corresponding encryption symbols based on the position and order of the placeholders to obtain the ciphertext. The encryption method is simple and has a low input learning cost.
[0065] refer to Figure 2 To further explain, step S1 includes the following steps:
[0066] S11. Set up a nine-square grid, using one square as a separator and the remaining eight squares as character positions;
[0067] Step S11 is as follows:
[0068] Set up a nine-square grid, with the grid on the upper left as the separator and the remaining eight grids as the character positions;
[0069] S12. Place the letters a to z in their corresponding placeholders, such that each placeholder has at least one letter and no letter in any placeholder is repeated from any other placeholder.
[0070] Step S12 is as follows:
[0071] The letters a-c are placed in the middle position of the top layer of the nine-square grid, the letters d-f are placed in the right position of the top layer, the letters g-i are placed in the left position of the middle layer, the letters j-l are placed in the middle position of the middle layer, the letters m-o are placed in the right position of the middle layer, the letters p-s are placed in the left position of the bottom layer, the letters t-v are placed in the middle position of the bottom layer, and the letters w-z are placed in the right position of the bottom layer. That is, the letters a-z are placed in their corresponding positions according to the existing nine-square grid pinyin rules.
[0072] S13. Use the separator and the placeholders with letters a to z as a nine-key Pinyin keyboard to obtain the public key.
[0073] The encryption symbols in step S2 include nine arbitrary and distinct identifiers, patterns, numbers, letters, Chinese characters, radicals, and / or color blocks. For example, 9 non-repeating punctuation marks, 9 different animal head patterns, 9 different numbers, 9 different traffic signs, 9 characters in English or other languages, 9 different Chinese characters, 9 different Chinese character radicals, or 9 different color blocks. The expression methods are diverse, and different types of expression methods can also be used during use. For example, 3 different animal patterns, 3 different numbers, and 3 different Chinese characters can be used as encryption symbols, thereby increasing the cracking difficulty. Refer to Figure 3 , the encryption symbols will be described by taking 9 different numbers as an example.
[0074] Step S3 includes the following steps:
[0075] S31. The user sequentially spells the pinyin of each Chinese character in the sentence to be sent based on Chinese pinyin on the nine-grid pinyin keyboard. After the user finishes inputting the pinyin of a single Chinese character and / or the pinyin of a single phrase in the sentence, the user clicks the separator position. At the same time, after the pinyin of the last Chinese character in the sentence is input, the user does not click the separator position;
[0076] Specifically, for example, if the sentence to be sent by the user is "I am Chinese and I love my motherland", then when the user sends this sentence, the user needs to sequentially input the pinyin of each Chinese character in the sentence. At this time, the corresponding character positions will be clicked in sequence. In daily Chinese expressions, the sentence is usually separated according to "I", "am", "Chinese", "I", "love", "my", "motherland" respectively. Therefore, after clicking the character positions where the letters w and o are located, the separator position is clicked to complete the separation between the pinyin of the character "I" and the pinyin of the character "am".
[0077] S32. Obtain the positions of the corresponding character positions and the separator position clicked by the user when inputting pinyin, and at the same time obtain the order of clicking the separator position and the order of each character position by the user when inputting pinyin;
[0078] When the user clicks on the nine-grid pinyin keyboard, since the position of the character position and the letter on the character position are fixed, it is necessary to record the position of each click on the character position, and at the same time, it is also necessary to record the order of each click on the character position. For example, when inputting the two Chinese characters "I am", record the clicks on the nine-grid pinyin keyboard as: the lower right character position, the middle right character position, the separator position, the lower left character position, the middle left character position, the middle left character position, and the separator position; since the appearance of the separator position at the end of the sentence will cause the same confidential symbol to appear at the end of the ciphertext using the same private key, it is usually selected not to click the separator position at the end of the sentence.
[0079] Furthermore, the separators can be separated according to Chinese expression habits or reading habits, or they can be separated in a way that is understandable to both the sender and the receiver. For example, the plaintext "I am Chinese, I love my motherland" can be separated into "I am", "Chinese", "I love", and "my motherland", or separated into "I am", "Chinese", "I love my", and "motherland", etc.
[0080] Step S4 includes the following steps:
[0081] S41. Based on the position of the corresponding character space and the position of the separator when the user clicks the Pinyin input, obtain the encrypted symbol corresponding to the character space and the encrypted symbol corresponding to the separator.
[0082] Specifically, according to step S32 above, the clicks of the nine-grid pinyin keyboard are: lower right side character position, middle right side character position, separator position, lower left side character position, middle left side character position, middle left side character position, and separator position. At this time, we can obtain the encryption symbol corresponding to the lower right side character position as 3, the encryption symbol corresponding to the middle right side character position as 7, the encryption symbol corresponding to the separator position as 1, the encryption symbol corresponding to the lower left side character position as 8, the encryption symbol corresponding to the middle left side character position as 5, and so on, to determine the encryption symbol corresponding to each character position and separator position.
[0083] S42. Based on the order in which the user clicks the separator and the order of each character position when inputting Pinyin, the encrypted symbols are obtained in sequence, and the encrypted symbols obtained in sequence are used as ciphertext.
[0084] Specifically, following the order of clicking the text on the nine-key Pinyin keyboard according to the sentence separation method recorded in step S31, the resulting ciphertext is: 37185513577556789713714513799136567.
[0085] The encryption of the message to be sent is completed using a simple encryption method with a low learning curve, but it is difficult to crack.
[0086] Example 2
[0087] refer to Figure 4 Based on the Chinese character encryption method based on the nine-grid pinyin provided in Embodiment 1, this embodiment provides a Chinese character decryption method based on the nine-grid pinyin, including the following steps:
[0088] S1. Obtain the ciphertext and private key, and match the placeholder positions corresponding to the encrypted symbols in the ciphertext according to the private key, the order in which the placeholder positions are clicked, and the order in which the separator positions are clicked.
[0089] After obtaining the ciphertext, the process involves identifying the placeholder or separator for each encrypted symbol. This is equivalent to determining the order in which the placeholders or separators are pressed and their corresponding positions. For example, based on the ciphertext 3718551, we can determine the user's pressing sequence on the nine-key Pinyin keyboard: lower right placeholder, middle right placeholder, separator, lower left placeholder, middle left placeholder, middle left placeholder, and separator.
[0090] S2. Select any letter in the placeholder position and arrange the letters in the order in which the placeholder position was clicked, and separate adjacent letters according to the position of the separator.
[0091] The letters corresponding to the right-side positions in the lower layer are w, x, y, and z, while the letters corresponding to the right-side positions in the middle layer are m, n, and o. Since there is a separator after the right-side position in the middle layer, the letters corresponding to the right-side positions in the lower layer and the middle-side positions can be combined to form the pinyin of a Chinese character and thus the pinyin of a word. Similarly, the letters corresponding to the left-side positions in the lower layer are p, q, r, and s, while the letters corresponding to the left-side positions in the middle layer are g, h, and i. This process is repeated to determine the letters corresponding to each position.
[0092] Then select any letter in the placeholder position. For example, select w and m before the first separator, and p, g, g before the second separator to get the corresponding pinyin wm and pgg.
[0093] S3. Determine whether the letters corresponding to all the occupying positions on both sides of each separator form the pinyin of a single Chinese character and / or a single word. If yes, retain the letters corresponding to the occupying positions; otherwise, reselect any letter in the occupying position and execute steps S2 and S3.
[0094] Specifically, after selecting the letter corresponding to each character position, it is determined whether the pinyin before and after each separator position can form a correct and complete word. If so, the letter in the character position is retained. If not, it indicates that the letter selection in the character position is inaccurate and the letter corresponding to the character position needs to be re-determined. This process is repeated until all the pinyin on both sides of each separator position can form a complete Chinese character pinyin and / or word pinyin.
[0095] For example, "wm" cannot form a complete Chinese character pinyin and / or phrase pinyin. Therefore, it is necessary to replace the letter in any of the character positions. At this time, the letter selected for the left middle character position is replaced with "n". After judgment, "wn" still cannot form a complete Chinese character pinyin and / or phrase pinyin. At this time, the letter selected for the left middle character position can be replaced with "o". At this time, "wo" can form the pinyin of the single Chinese character "我 (wǒ)". Then, retain the letter corresponding to the character position, and the pinyin before the first separator is "wo". Since the letter selection in the character position is random, when the first selected letter is "y", the finally obtained "yo" can also form a complete Chinese character pinyin and can be retained. Select the letters corresponding to the numbers after the ciphertext by analogy.
[0096] To reduce the judgment of single Chinese character and / or phrase pinyin at this time, for example, refer to the 406 kinds of pinyins recorded in the "New Compiled Student Dictionary" (hereinafter referred to as the dictionary) published by the People's Education Press in 2012. If the letters selected for the character positions on both sides of a separator do not belong to the pinyin of any Chinese character in the dictionary or the combination of any two Chinese character pinyins or the combination of any three Chinese character pinyins, then directly exclude this letter combination. For example, the combinations such as "pgg", "pgh", "pgi", "phg", etc. corresponding to the ciphertext 855 do not belong to the pinyins recorded in the dictionary, so directly exclude the possibility of this combination, and the final obtained is the combination of the letters "shi", and it is unique.
[0097] Repeat this process to obtain the ciphertext 35775567897. Since this ciphertext contains 11 letters, it can be determined as a single phrase, containing only two Chinese characters. Since 35, 357, and 3577 are not complete pinyins, 35775 is used as the pinyin of a Chinese character, corresponding to the pinyins "xiong" and "zhong". Similarly, 56 cannot be used as a single pinyin, so 567 is used as the pinyin of a Chinese character, corresponding to the pinyins "gun", "guo", "hun", and "huo". Finally, 89 can correspond to the pinyins "re" and "se", and 7 is used as the pinyin of "o"; or 897 is a group corresponding to the pinyins "pen", "ren", and "sen". At this time, the pinyins formed by the character positions adjacent to each separator are obtained.
[0098] S4. Judge whether the sequentially arranged single Chinese characters and / or single phrases form a sentence. If so, match the corresponding Chinese characters according to the pinyin to complete the decryption; if not, reselect the letter in any of the character positions, and execute steps S3 and S4 until the sequentially arranged single Chinese characters and / or single phrases form a sentence.
[0099] Specifically, according to the decryption of the ciphertext in step S3, there are multiple pinyins obtained on both sides of each delimiter, resulting in multiple meanings for the sentences corresponding to the ciphertext. Therefore, in view of the common sense of Chinese usage, it is necessary to judge whether each existing combination conforms to the Chinese expression sentence. For example, xiong, gun, re, and o cannot form a complete sentence, so this combination of pinyins is excluded. Subsequently, the new combination xiong, gun, se, and o is also unable to form a complete sentence, so this combination of pinyins is excluded as well. By analogy, the final results are xiong, guo, ren, or zhong, guo, ren. Since "Xiong Guoren" is not a commonly used term, this pinyin expression is discarded. Finally, the pinyin combination of "Chinese people" is selected, and the previous text of the ciphertext is wo, shi, zhong, guo, ren, corresponding to the text "I am Chinese". The later text of the ciphertext is decrypted in the same way, and the final obtained pinyin is wo, ai, wo, de, zu, guo, and the corresponding text can be inferred as "I love my motherland".
[0100] Since this method is based on the conventional expression of Chinese sentences, it is not applicable to new words and specific Chinese characters of personal names in sentence transmission. At the same time, when using it, in order to avoid confusion of homophonic and different-sense word groups, it is usually necessary to convey word groups in combination with sentences. For example, the pinyin corresponding to the ciphertext 3547855 is xianshi, and when reading, it may be the pinyin of "display" or the pinyin of "Xi'an City". Therefore, only by combining xianshi in a specific sentence can the corresponding meaning be judged. For example, the xianshi in wozaixianshi, xianshiweiheise, and wozaixianshipingshangzuohua respectively corresponds to Xi'an City, display, and display, and the corresponding sentence characters are "I am in Xi'an City", "The display is black", and "I am drawing on the display screen". The same encryption symbol corresponds to different Chinese characters and meanings, which also reflects the profoundness and complexity of Chinese characters. This uncertainty increases the difficulty of deciphering, but in the process of use, the difficulty of accurately decrypting in combination with the meaning of Chinese sentences is not great.
[0101] In summary, this method has a low decryption difficulty, but a high cracking difficulty. At the same time, it has strong applicability, a low learning difficulty, can be temporarily enabled, has a wide application range, and has the value of popularization.
[0102] Embodiment 3
[0103] Reference Figure 5 , referring to the Chinese character encryption method based on nine-grid pinyin described in Embodiment 1, this embodiment provides a Chinese character encryption device based on nine-grid pinyin, including:
[0104] The public key setting unit is used to use the nine-grid Pinyin keyboard as the public key; one grid is set as a separator, eight grids are set as placeholders, and the letters required for Pinyin are set in the eight placeholders respectively;
[0105] The private key setting unit is used to map nine distinct encryption symbols to separator bits and eight placeholder bits one by one.
[0106] The public key input recording unit is used to record the order in which the user inputs the pinyin of each Chinese character in the sentence to be sent on the nine-key pinyin keyboard, and to obtain the order in which the user clicks the separator and the order in which the user clicks the corresponding character position; wherein the encryption symbol corresponding to the separator is located between the encryption symbols corresponding to adjacent Chinese character pinyin, between the encryption symbols corresponding to adjacent word pinyin, and / or between the encryption symbols corresponding to adjacent Chinese character pinyin and word pinyin;
[0107] The private key generation and sending unit is used to obtain ciphertext consisting of multiple encrypted symbols arranged in sequence according to the order in which the user clicks the separator and the corresponding placeholder, and then sends the obtained ciphertext.
[0108] Example 4
[0109] refer to Figure 6 Referring to the Chinese character encryption method based on nine-grid pinyin described in Embodiment 2, this embodiment provides a Chinese character decryption device based on nine-grid pinyin, including:
[0110] The ciphertext receiving and reading unit is used to obtain the ciphertext and the private key, and to match the placeholder positions corresponding to the encrypted symbols in the ciphertext according to the private key, the order in which the placeholder positions are clicked, and the order in which the separator positions are clicked.
[0111] The ciphertext matching unit is used to select any letter in the placeholder and arrange the letters in the order in which the corresponding placeholder was clicked, and separate two adjacent letters according to the position of the separator.
[0112] The encrypted word determination unit is used to determine whether the letters corresponding to all the occupied positions on both sides of each separator position form the pinyin of a single Chinese character and / or a single word phrase. If so, the letters corresponding to the occupied positions are retained; if not, the letters on any occupied position are reselected until the letters corresponding to all the occupied positions on both sides of each separator position form the pinyin of a single Chinese character and / or a single word phrase.
[0113] The ciphertext statement determination unit is used to determine whether the sequentially arranged individual Chinese characters and / or individual word groups form a statement. If so, the corresponding Chinese characters are matched according to the pinyin to complete the decryption. If not, any letter in the ciphertext position is reselected, and the ciphertext word determination unit and the ciphertext statement determination unit are executed in sequence.
[0114] Referring to Embodiments 1 and 2, this embodiment of the invention also provides a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it implements the above-described method for encrypting and / or decrypting Chinese characters based on the nine-grid pinyin.
[0115] This invention also provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the above-described method for encrypting and / or decrypting Chinese characters based on the nine-grid pinyin.
[0116] This invention also provides a computer program product, which includes a computer program that, when executed by a processor, implements the above-described method for encrypting and / or decrypting Chinese characters based on the nine-grid pinyin.
[0117] Those skilled in the art will understand that embodiments of the present invention can be provided as methods, systems, or computer program products. Therefore, the present invention can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention can take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0118] This invention is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart illustrations and / or block diagrams. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0119] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0120] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0121] The specific embodiments described above further illustrate the purpose, technical solution, and beneficial effects of the present invention. It should be understood that the above descriptions are merely specific embodiments of the present invention and are not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.
Claims
1. A method for encrypting and decrypting Chinese characters based on a nine-grid pinyin system, characterized in that, This includes methods for encrypting and decrypting Chinese characters; The Chinese character encryption method includes the following steps: S1. Set the nine-key Pinyin keyboard as the public key. The nine-key Pinyin keyboard includes one separator and eight placeholders. The letters required for Pinyin are set in the eight placeholders respectively. S2. Each encryption symbol is assigned to a separate bit and one of the eight placeholder bits. The encryption symbol is the private key and all encryption symbols are different. S3. Obtain the order in which the user inputs each Chinese character's pinyin in the sentence to be sent on the nine-key pinyin keyboard, and obtain the order in which the user clicks the corresponding character position and the order in which the user clicks the separator position. The encryption symbol corresponding to the separator position is located between the encryption symbols corresponding to adjacent Chinese character pinyin, between the encryption symbols corresponding to adjacent word pinyin, and / or between the encryption symbols corresponding to adjacent Chinese character pinyin and word pinyin. Step S3 includes the following steps: S31. The user sequentially spells the pinyin of each Chinese character in the sentence to be sent on the nine-key pinyin keyboard. After the user has finished inputting the pinyin of each Chinese character and / or each word in the sentence, the user clicks the separator. At the same time, the user does not click the separator after the pinyin of the last Chinese character in the sentence has been input. S32. Obtain the position of the corresponding character space and the position of the separator when the user clicks the Pinyin input; at the same time, obtain the order in which the user clicks the separator and the order of each character space when the user inputs the Pinyin. S4. Obtain the corresponding ciphertext according to the order in which the user clicks the corresponding placeholder and the order in which the user clicks the separator. The ciphertext includes multiple encrypted symbols generated sequentially. Step S4 includes the following steps: S41. Based on the position of the corresponding character space and the position of the separator when the user clicks the corresponding character space and the position of the separator when inputting Pinyin, obtain the encrypted symbol corresponding to the character space and the encrypted symbol corresponding to the separator. S42. Based on the order in which the user clicks the separator and the order of each character position when inputting Pinyin, the encrypted symbols are obtained in sequence, and the encrypted symbols obtained in sequence are used as ciphertext. The Chinese character decryption method includes the following steps: S1. Obtain the ciphertext and private key, and match the placeholder positions corresponding to the encrypted symbols in the ciphertext according to the private key, the order in which the placeholder positions are clicked, and the order in which the separator positions are clicked. S2. Select any letter in the placeholder position and arrange the letters in the order in which the placeholder position was clicked, and separate adjacent letters according to the position of the separator. S3. Determine whether the letters corresponding to all the occupying positions on both sides of each separator form the pinyin of a single Chinese character and / or a single word. If yes, retain the letters corresponding to the occupying positions; otherwise, reselect any letter in the occupying position and execute steps S2 and S3. S4. Determine whether the sequentially arranged individual Chinese characters and / or individual word groups form a sentence. If so, match the corresponding Chinese characters according to the pinyin to complete the decryption. If not, reselect any letter in the character position and execute steps S3 and S4 until the sequentially arranged individual Chinese characters and / or individual word groups form a sentence.
2. The method for encrypting and decrypting Chinese characters based on nine-grid pinyin according to claim 1, characterized in that, Step S1 includes the following steps: S11. Set up a nine-square grid, using any one square as a separator and the remaining eight squares as character positions; S12. Place the letters a~z in their corresponding placeholders, such that there is at least one letter in any placeholder and that no letter in any placeholder is repeated from any other placeholder. S13. Use the separator and the placeholders with letters a~z as a nine-key Pinyin keyboard to obtain the public key.
3. The method for encrypting and decrypting Chinese characters based on nine-grid pinyin according to claim 2, characterized in that, Step S11 specifically involves: Set up a nine-square grid, with the grid on the upper left as the separator and the remaining eight grids as the character positions; Step S12 specifically involves: Place the letters a~c in the top center position of the 3x3 grid, the letters d~f in the top right position, the letters g~i in the middle left position, the letters j~l in the middle position, the letters m~o in the middle right position, the letters p~s in the bottom left position, the letters t~v in the bottom center position, and the letters w~z in the bottom right position.
4. The method for encrypting and decrypting Chinese characters based on nine-grid pinyin according to claim 1, characterized in that, The encryption symbols include nine different identifiers, patterns, numbers, letters, Chinese characters, radicals, and / or color blocks.
5. A Chinese character encryption and decryption device based on a nine-grid pinyin system, characterized in that, Includes Chinese character encryption devices and Chinese character decryption devices; The Chinese character encryption device includes: The public key setting unit is used to use the nine-grid Pinyin keyboard as the public key; one grid is set as a separator, eight grids are set as placeholders, and the letters required for Pinyin are set in the eight placeholders respectively; A private key setting unit is used to correspond nine distinct encryption symbols to separators and eight placeholders, wherein the encryption symbols are the private key and all encryption symbols are distinct. The public key input recording unit is used to record the order in which the user inputs the pinyin of each Chinese character in the sentence to be sent on the nine-key pinyin keyboard, and to obtain the order in which the user clicks the separator and the order in which the user clicks the corresponding character position; wherein the encryption symbol corresponding to the separator is located between the encryption symbols corresponding to adjacent Chinese character pinyin, between the encryption symbols corresponding to adjacent word pinyin, and / or between the encryption symbols corresponding to adjacent Chinese character pinyin and word pinyin; the public key input recording unit specifically works as follows: the user sequentially spells the pinyin of each Chinese character in the sentence to be sent on the nine-key pinyin keyboard based on Chinese pinyin, and clicks the separator after the user has finished inputting the pinyin of each individual Chinese character and / or each individual word in the sentence, while not clicking the separator after the pinyin corresponding to the last Chinese character in the sentence has been input; the position of the corresponding character position and the position of the separator are obtained when the user clicks the pinyin, and the order in which the user clicks the separator and the order of each character position are also obtained; The private key generation and sending unit is used to obtain ciphertext consisting of multiple encrypted symbols arranged sequentially according to the order in which the user clicks the separator and the corresponding placeholder, and to send the obtained ciphertext. Specifically, the private key generation and sending unit obtains the encrypted symbols corresponding to the placeholder and the separator according to the position of the placeholder and the position of the separator when the user clicks the pinyin; it obtains the sequentially arranged encrypted symbols according to the order in which the user clicks the separator and the order of each placeholder when the user inputs pinyin, and uses the sequentially arranged encrypted symbols as the ciphertext. The Chinese character decryption device includes: The ciphertext receiving and reading unit is used to obtain the ciphertext and the private key, and to match the placeholder positions corresponding to the encrypted symbols in the ciphertext according to the private key, the order in which the placeholder positions are clicked, and the order in which the separator positions are clicked. The ciphertext matching unit is used to select any letter in the placeholder and arrange the letters in the order in which the corresponding placeholder was clicked, and separate two adjacent letters according to the position of the separator. The encrypted word determination unit is used to determine whether the letters corresponding to all the occupied positions on both sides of each separator position form the pinyin of a single Chinese character and / or a single word phrase. If so, the letters corresponding to the occupied positions are retained; if not, the letters on any occupied position are reselected until the letters corresponding to all the occupied positions on both sides of each separator position form the pinyin of a single Chinese character and / or a single word phrase. The ciphertext statement determination unit is used to determine whether the sequentially arranged individual Chinese characters and / or individual word groups form a statement. If so, the corresponding Chinese characters are matched according to the pinyin to complete the decryption. If not, any letter in the ciphertext position is reselected, and the ciphertext word determination unit and the ciphertext statement determination unit are executed in sequence.
6. A computer program product, characterized in that, The computer program product includes a computer program that, when executed by a processor, implements the method of any one of claims 1 to 4.