A ciphertext cracking method and device, a storage medium and an electronic device

By progressively extracting and predicting the encoding and contextual features of block cipher ciphers using a pre-trained cracking model, the problem of needing to retrain the model for each algorithm in existing technologies is solved, thus achieving efficient and accurate cracking of various block cipher cipher ciphers.

CN116827507BActive Publication Date: 2026-05-29ZHEJIANG LAB

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
ZHEJIANG LAB
Filing Date
2023-03-29
Publication Date
2026-05-29

AI Technical Summary

Technical Problem

Existing technologies require building specialized neural network models for each algorithm when cracking ciphertext generated by block ciphers. This results in technologies that are not universally applicable and are costly, making it difficult to efficiently crack various complex block ciphers.

Method used

A pre-trained cracking model is used to extract the encoded features of the ciphertext through the encoding subnet. Combined with the context layer and prediction layer of the decoding subnet, the plaintext is predicted step by step until the complete ciphertext is cracked. The idea of ​​natural language processing is used to perform multiple rounds of prediction to improve accuracy.

Benefits of technology

It achieves efficient cracking of various block cipher ciphers, improves the accuracy of cracking, and reduces the cost of model training and adapting to new algorithms.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116827507B_ABST
    Figure CN116827507B_ABST
Patent Text Reader

Abstract

The specification discloses a ciphertext cracking method and device, a storage medium and an electronic equipment. In the ciphertext cracking method provided in the specification, a ciphertext to be cracked is obtained; the ciphertext to be cracked is input into a pre-trained cracking model, and coding features are extracted through a coding subnetwork; predicted content and non-predicted content in the ciphertext to be cracked are determined, and a predicted plaintext corresponding to the predicted content is determined; the predicted plaintext is input into the cracking model, and context features are extracted through a context layer of a decoding subnetwork; the coding features and the context features are input into a prediction layer in the decoding subnetwork, so that prediction features are output through the prediction layer; the prediction features are input into an output subnetwork in the cracking model, so that a plaintext corresponding to at least part of the non-predicted content is obtained through the output subnetwork; the predicted plaintext is re-determined according to the predicted plaintext, and the non-predicted content in the ciphertext to be cracked is continuously predicted until all the content of the ciphertext to be cracked is predicted.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This specification relates to the field of computer technology, and in particular to a method, apparatus, storage medium, and electronic device for cracking encrypted messages. Background Technology

[0002] Block ciphers are a common data encryption method today. There are many implementations of block ciphers, such as the Advanced Encryption Standard (AES) algorithm, the Data Encryption Standard (DES) algorithm, and Speck codes. Current techniques for cracking cipher-generated ciphertext typically employ a neural network model specifically designed for and trained on the structure of a particular block cipher algorithm.

[0003] As research into block ciphers continues, new algorithms will emerge and their structures will become increasingly complex. Existing technologies cannot be universally applied to all block ciphers, necessitating the continuous research and training of new neural network models to cope with these new block ciphers. This process is time-consuming, labor-intensive, and costly.

[0004] Therefore, finding a universally applicable method to more easily and efficiently crack ciphertext generated by block ciphers is an urgent problem to be solved. Summary of the Invention

[0005] This specification provides a method, apparatus, storage medium, and electronic device for cracking encrypted messages, to at least partially solve the aforementioned problems existing in the prior art.

[0006] The following technical solution is adopted in this specification:

[0007] This manual provides a method for cracking encrypted messages, including:

[0008] Obtain the ciphertext to be cracked;

[0009] The ciphertext to be cracked is input into a pre-trained cracking model to extract the encoded features of the ciphertext through the encoded subnet in the cracking model;

[0010] Determine the predicted and unpredicted content in the ciphertext to be cracked, and determine the predicted plaintext corresponding to the predicted content;

[0011] The predicted plaintext is input into the cracking model to extract the context features of the predicted plaintext through the context layer of the decoding subnet in the cracking model;

[0012] The encoded features and the context features are input into the prediction layer in the decoding subnet, so that the prediction layer outputs the prediction features;

[0013] The predicted features are input into the output subnet of the cracking model so that the plaintext corresponding to at least a portion of the unpredicted content can be obtained through the output subnet.

[0014] Based on the plaintext corresponding to at least a portion of the predicted unpredicted content, the predicted plaintext is re-determined, and the prediction of unpredicted content in the ciphertext to be cracked continues until all content of the ciphertext to be cracked is predicted.

[0015] Optionally, in the method, both the ciphertext and plaintext are binary strings.

[0016] Optionally, before inputting the ciphertext to be cracked into a pre-trained cracking model, the method further includes:

[0017] When the length of the ciphertext to be cracked is less than the specified length of a single block of ciphertext corresponding to the block cipher, the ciphertext to be cracked is padded to the specified length using a filler character.

[0018] Optionally, the cracking model further includes extracting subnets;

[0019] The ciphertext to be cracked is input into a pre-trained cracking model to extract the encoded features of the ciphertext through the encoded subnet in the cracking model, specifically including:

[0020] The ciphertext to be cracked is input into the extraction subnet of a pre-trained cracking model to extract the first text features of the ciphertext to be cracked through the extraction subnet;

[0021] The first text feature is input into the encoding subnet of the cracking model, so that the encoding subnet outputs the encoding feature of the ciphertext to be cracked based on the first text feature;

[0022] The predicted plaintext is input into the cracking model to extract contextual features of the predicted plaintext through the context layer of the decoding subnet in the cracking model, specifically including:

[0023] The extraction subnet of the cracking model of the predicted plaintext is used to extract the second text features of the predicted plaintext.

[0024] The second text feature is input into the encoding subnet of the cracking model, so that the context layer in the encoding subnet outputs the context feature of the predicted plaintext based on the second text feature.

[0025] Optionally, the plaintext corresponding to at least a portion of the unpredicted content is obtained through the output subnet, specifically including:

[0026] The plaintext corresponding to the first binary character in the unpredicted content is obtained through the output subnet.

[0027] Optionally, the predicted plaintext is re-determined based on the plaintext corresponding to at least a portion of the predicted unpredicted content, specifically including:

[0028] Based on the predicted plaintext corresponding to the predicted content and the plaintext corresponding to the first binary character in the unpredicted content, the predicted plaintext is re-determined, wherein the number of valid characters in the re-determined predicted plaintext is one more than the number of valid characters in the original predicted plaintext.

[0029] Optionally, a cracking model is pre-trained, specifically including:

[0030] Obtain the ciphertext of the sample and the plaintext annotation corresponding to the ciphertext of the sample;

[0031] The ciphertext of the sample is input into the cracking model to be trained, so as to extract the coding features of the ciphertext to be optimized through the coding subnet in the cracking model;

[0032] Determine the predicted and unpredicted contents of the sample ciphertext, and determine the predicted plaintext to be optimized corresponding to the predicted contents of the sample.

[0033] The predicted plaintext to be optimized is input into the cracking model so that the context features to be optimized of the predicted plaintext to be optimized can be extracted through the context layer of the decoding subnet in the cracking model.

[0034] The encoding features to be optimized and the context features to be optimized are input into the prediction layer in the decoding subnet so that the prediction features to be optimized can be extracted through the prediction layer.

[0035] The predicted features to be optimized are input into the output subnet of the cracking model so that the plaintext corresponding to at least a portion of the unpredicted content of the sample can be obtained through the output subnet.

[0036] Based on the plaintext corresponding to at least a portion of the unpredicted content in the sample, the predicted plaintext to be optimized is re-determined, and the unpredicted content in the sample ciphertext is predicted again until all the content of the sample ciphertext is predicted, thus obtaining the target plaintext to be optimized from the sample ciphertext.

[0037] The cracking model is trained with the goal of minimizing the difference between the target plaintext and the labeled plaintext.

[0038] This specification provides an ciphertext cracking device, the device comprising:

[0039] The acquisition module is used to acquire the ciphertext to be cracked;

[0040] The ciphertext input module is used to input the ciphertext to be cracked into a pre-trained cracking model, so as to extract the coding features of the ciphertext to be cracked through the coding subnet in the cracking model;

[0041] The determination module is used to determine the predicted and unpredicted content in the ciphertext to be cracked, and to determine the predicted plaintext corresponding to the predicted content;

[0042] A plaintext input module is used to input the predicted plaintext into the cracking model so as to extract the context features of the predicted plaintext through the context layer of the decoding subnet in the cracking model;

[0043] The prediction module is used to input the encoded features and the context features into the prediction layer in the decoding subnet, so as to output the prediction features through the prediction layer;

[0044] The output module is used to input the predicted features into the output subnet of the cracking model, so as to obtain the plaintext corresponding to at least a portion of the unpredicted content through the output subnet;

[0045] The loop module is used to re-determine the predicted plaintext based on the plaintext corresponding to at least a portion of the predicted unpredicted content, and continue to predict the unpredicted content in the ciphertext to be cracked until all the content of the ciphertext to be cracked is predicted.

[0046] Optionally, both the ciphertext and plaintext can be binary strings.

[0047] Optionally, the device further includes a padding module, specifically used to pad the ciphertext to be cracked to the specified length using a padding character when the length of the ciphertext to be cracked is less than the specified length of a single block of ciphertext corresponding to the block cipher.

[0048] Optionally, the cracking model further includes extracting subnets;

[0049] The ciphertext input module is specifically used to input the ciphertext to be cracked into the extraction subnet of the pre-trained cracking model, so as to extract the first text feature of the ciphertext to be cracked through the extraction subnet; and input the first text feature into the encoding subnet of the cracking model, so as to output the encoding feature of the ciphertext to be cracked based on the first text feature through the encoding subnet.

[0050] The plaintext input module is specifically used to extract the second text features of the predicted plaintext from the extraction subnet of the cracking model; and to input the second text features into the encoding subnet of the cracking model, so that the context layer in the encoding subnet outputs the context features of the predicted plaintext based on the second text features.

[0051] Optionally, the output module is specifically used to obtain the plaintext corresponding to the first binary character in the unpredicted content through the output subnet.

[0052] Optionally, the loop module is specifically used to redetermine the predicted plaintext based on the predicted plaintext corresponding to the predicted content and the plaintext corresponding to the first binary character in the unpredicted content, wherein the number of valid characters in the redetermined predicted plaintext is one more than the number of valid characters in the original predicted plaintext.

[0053] Optionally, the device further includes a training module, specifically configured to: acquire sample ciphertext and the labeled plaintext corresponding to the sample ciphertext; input the sample ciphertext into a cracking model to be trained, so as to extract the coding features to be optimized of the sample ciphertext through the coding subnet in the cracking model; determine the predicted and unpredicted content of the samples in the sample ciphertext, and determine the predicted plaintext to be optimized corresponding to the predicted content of the samples; input the predicted plaintext to be optimized into the cracking model, so as to extract the context features to be optimized of the predicted plaintext through the context layer of the decoding subnet in the cracking model; input the coding features to be optimized and the context features to be optimized into the training module. The prediction layer in the decoding subnet is used to extract prediction features to be optimized; the prediction features to be optimized are input into the output subnet of the cracking model to obtain the plaintext corresponding to at least a portion of the unpredicted content of the sample; based on the plaintext corresponding to at least a portion of the unpredicted content of the sample, the predicted plaintext to be optimized is re-determined, and the unpredicted content of the sample ciphertext is predicted again until all the content of the sample ciphertext is predicted, thus obtaining the target plaintext to be optimized of the sample ciphertext; the cracking model is trained with the minimum difference between the target plaintext to be optimized and the labeled plaintext as the optimization objective.

[0054] This specification provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the above-described ciphertext cracking method.

[0055] This specification provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the above-described ciphertext cracking method.

[0056] The above-mentioned technical solutions adopted in this specification can achieve the following beneficial effects:

[0057] In the ciphertext cracking method provided in this specification, the following steps are taken: First, the ciphertext to be cracked is obtained. Second, the ciphertext to be cracked is input into a pre-trained cracking model to extract the encoded features of the ciphertext through an encoding subnet. Third, the predicted and unpredicted content in the ciphertext to be cracked is determined, and the predicted plaintext corresponding to the predicted content is determined. Fourth, the predicted plaintext is input into the cracking model to extract the context features of the predicted plaintext through the context layer of the decoding subnet. Fifth, the encoded features and context features are input into the prediction layer of the decoding subnet to output predicted features. Sixth, the predicted features are input into the output subnet of the cracking model to obtain the plaintext corresponding to at least a portion of the unpredicted content through the output subnet. Seventh, based on the plaintext corresponding to at least a portion of the predicted unpredicted content, the predicted plaintext is re-determined, and the unpredicted content in the ciphertext to be cracked continues to be predicted until all the content of the ciphertext to be cracked is predicted.

[0058] When using the ciphertext decryption method provided in this manual to predict the plaintext corresponding to the ciphertext, a natural language processing approach can be adopted. This involves combining the characteristics of the ciphertext to be decrypted with the characteristics of the predicted plaintext to jointly predict the plaintext corresponding to the unpredicted portion of the ciphertext to be decrypted. The predicted plaintext is then updated based on the predicted plaintext, and the prediction process continues until all plaintext is predicted. This method emphasizes predicting plaintext based on the relationships between the contents of the ciphertext itself, and by combining the predicted plaintext with multiple rounds of prediction, the results are made more accurate. While ensuring the method's versatility, it improves the accuracy of the predicted plaintext. Attached Figure Description

[0059] The accompanying drawings, which are included to provide a further understanding of this specification and form part of this specification, illustrate exemplary embodiments and are used to explain this specification, but do not constitute an undue limitation thereof. In the drawings:

[0060] Figure 1 This is a flowchart illustrating one of the ciphertext decryption methods described in this manual;

[0061] Figure 2 This is a schematic diagram of the structure of one of the cracking models in this specification;

[0062] Figure 3 This is a schematic diagram of a ciphertext cracking device provided in this specification;

[0063] Figure 4 The corresponding information provided in this specification Figure 1 A schematic diagram of an electronic device. Detailed Implementation

[0064] Today, users are increasingly concerned about data security, and when handling private or important data, they often use encryption to ensure that the data is not leaked. Among these methods, block ciphers are popular due to their speed, ease of implementation, and ease of standardization, making them one of the most commonly used encryption techniques across various fields.

[0065] Correspondingly, cracking encrypted data is also a very important technology. On the one hand, ciphertext cracking methods can help users recover data when necessary; on the other hand, mature ciphertext cracking technology can guide the generation of ciphertext, improving encryption security.

[0066] Traditional ciphertext cracking methods, when breaking ciphertext generated by block ciphers, involve studying the structure of a given encryption algorithm and building and training a neural network model specifically for cracking that encryption. However, most block cipher algorithms are inherently complex, resulting in high learning costs. Furthermore, new block cipher algorithms are constantly being developed, leading to increasingly complex structures. It's easy to see that traditional ciphertext cracking methods, requiring adjustments to the neural network model based on the encryption algorithm's structure, lack universal applicability and necessitate continuous learning of new algorithm structures and development of new neural network models, which obviously incurs enormous costs.

[0067] To address the aforementioned technical problems, this specification provides a universally applicable and easier-to-implement method for cracking encrypted messages.

[0068] To make the objectives, technical solutions, and advantages of this specification clearer, the technical solutions of this specification will be clearly and completely described below in conjunction with specific embodiments and corresponding drawings. Obviously, the described embodiments are only a part of the embodiments of this specification, and not all of them. All other embodiments obtained by those skilled in the art based on the embodiments in this specification without creative effort are within the scope of protection of this application.

[0069] The technical solutions provided in the various embodiments of this specification are described in detail below with reference to the accompanying drawings.

[0070] Figure 1 This is a flowchart illustrating one method for cracking encrypted text as described in this specification, which specifically includes the following steps:

[0071] S100: Obtain the ciphertext to be cracked.

[0072] All steps in the encrypted decryption method provided in this manual can be implemented by any electronic device with computing capabilities, such as a terminal or server.

[0073] The ciphertext cracking method provided in this manual is mainly based on the idea of ​​natural language processing to crack ciphertext encrypted by block ciphers. The algorithm and structure of the block cipher can be arbitrary, and this manual does not impose any specific restrictions on them.

[0074] In this step, the ciphertext to be cracked can be obtained first, and then used in subsequent steps.

[0075] S102: Input the ciphertext to be cracked into a pre-trained cracking model to extract the coding features of the ciphertext to be cracked through the coding subnet in the cracking model.

[0076] In this step, the ciphertext to be cracked obtained in step S100 can be input into a pre-trained cracking model. The cracking model used in this specification functions to output the predicted unencrypted plaintext based on the input ciphertext. Figure 2 This document demonstrates the structure of the cracking model used in this specification, such as... Figure 2 As shown, the cracking model can include an encoding subnet, a decoding subnet, and an output subnet.

[0077] After the ciphertext to be cracked is input into the cracking model, the encoded features of the ciphertext can be extracted through the encoding subnet in the cracking model. The encoding features are used to characterize the meaning of each character in the ciphertext within the entire ciphertext. The encoding subnet can be an encoder, and its structure can be set according to requirements. For example, the encoding subnet may include multi-head attention layers, fully connected layers, etc. This specification does not impose specific restrictions on this.

[0078] Additionally, in the ciphertext cracking method provided in this manual, to unify input and output and improve cracking results, all plaintext and ciphertext can be represented in binary string form. The conversion relationship between original characters and binary characters in plaintext and ciphertext can take many forms; this manual does not impose specific restrictions, as long as the same form is used for all conversions between original characters and binary characters. For example, each Chinese character can be represented by three 8-bit binary strings, and each English letter can be represented by two 8-bit binary strings, and so on.

[0079] In block ciphers, the encrypted ciphertext is divided into several blocks, each of the same size (i.e., containing the same number of characters). Commonly, a block can contain 32, 64, or 128 characters. Correspondingly, cracking models typically match the size of each block in the block cipher, setting the input and output to the corresponding lengths. However, in some cases, the length of the ciphertext may not be sufficient to fill a single block. Therefore, padding can be considered before inputting the ciphertext to be cracked into the cracking model. Specifically, when the length of the ciphertext to be cracked is less than the specified length of a single block of ciphertext corresponding to the block cipher, padding characters can be used to fill the ciphertext to the specified length.

[0080] S104: Determine the predicted and unpredicted content in the ciphertext to be cracked, and determine the predicted plaintext corresponding to the predicted content.

[0081] The ciphertext cracking method provided in this manual is primarily based on the principles of natural language processing. Compared to traditional methods that predict the entire plaintext at once, this method predicts the plaintext gradually, combining the already predicted parts of the plaintext each time, repeating the prediction process multiple times to obtain the complete plaintext.

[0082] Typically, the plaintext and ciphertext are of the same length, and characters in the same position in the plaintext and ciphertext can be considered to correspond to each other. Therefore, based on each predicted plaintext, the predicted and unpredicted content in the ciphertext can be determined, as well as the predicted plaintext, which is all the plaintext predicted after several repetitions.

[0083] S106: Input the predicted plaintext into the cracking model to extract the context features of the predicted plaintext through the context layer of the decoding subnet in the cracking model.

[0084] As one might expect, if the predicted plaintext corresponds to the entire content of the ciphertext, then the prediction is complete, and the prediction can be stopped and output; however, if the predicted plaintext does not contain the entire content, then the prediction needs to continue.

[0085] In this step, the predicted model determined in step S104 can be input into the decoding subnet of the cracked model. For example... Figure 2 As shown, the coding subnet of the cracking model can include a context layer and a prediction layer. The context layer is used to provide the context features of the predicted plaintext based on the input predicted plaintext and the contextual relationships within the predicted plaintext.

[0086] As mentioned in step S102, the input and output lengths of the cracking model are the same, and they typically match the length of each block of data in the block cipher's ciphertext. Therefore, even if the plaintext has not yet been predicted, its length is known, and the predicted plaintext can be directly input into the cracking model according to its known length. However, the length of the predicted plaintext itself is obviously shorter than the final plaintext length. Therefore, padding can also be used when inputting the predicted plaintext into the cracking model to ensure that its length meets the requirements.

[0087] Specifically, in the ciphertext cracking method provided in this manual, when both plaintext and ciphertext are represented as binary strings, the strings can be constructed as follows:

[0088] Four symbols are used to represent strings: "0", "1", "2", and "3". "0" represents the binary character 0; "1" represents the binary character 1; "2" is the start symbol, indicating the beginning of a string; and "3" is the padding symbol, used to fill the string to the required length. It is worth noting that "0", "1", "2", and "3" are just one specific representation of the symbols. In practical applications, other different symbols can be used, and this manual does not impose any specific restrictions on this.

[0089] Padding characters can be used to fill in either the ciphertext to be cracked or the predicted plaintext. The padding characters themselves have no meaning; they are only used to fill in placeholders, and this can be learned during the training of the cracking model.

[0090] A start character is used to indicate the beginning of a binary string. In the ciphertext cracking methods provided in this manual, the start character is typically placed before the ciphertext and plaintext. In other words, in addition to the content it should contain, the ciphertext or plaintext will also include an extra start character at the beginning position. The start character is used to identify the beginning of the string, enabling the cracking model to distinguish new strings.

[0091] In the first round of prediction of the ciphertext to be cracked by the cracking model, there is no predicted content in the ciphertext to be cracked. At this time, the predicted plaintext in the input decoding subnet contains only a start character and several fill characters for padding.

[0092] S102: Input the encoded features and the context features into the prediction layer in the decoding subnet, so as to output the prediction features through the prediction layer.

[0093] In this step, the encoding features determined in step S104 and the context features determined in step S106 can be input into the prediction layer of the encoding subnet to determine the prediction features output by the prediction layer. Specifically, the prediction layer outputs prediction features for predicting the plaintext based on the encoding features characterizing the meaning of each character in the ciphertext to be cracked and the context features characterizing the context meaning in the predicted plaintext.

[0094] In simple terms, the above process can be understood as follows: the context layer, based on the predicted plaintext, makes a preliminary judgment on the unpredicted plaintext portion, i.e., the part occupied by padding characters, and generates contextual features; the prediction layer, based on the contextual features and encoded features containing the meaning of the ciphertext to be cracked, makes a more accurate prediction of the unpredicted plaintext and outputs the prediction features. Corresponding to the idea in natural language processing, this involves first determining the part of speech of the word at the predicted position based on the context, and then determining the specific word at the predicted position based on the ciphertext information.

[0095] S110: Input the predicted features into the output subnet of the cracking model to obtain the plaintext corresponding to at least a portion of the unpredicted content through the output subnet.

[0096] In this step, the predicted features determined in step S108 can be input into the output subnet of the cracking model. The plaintext corresponding to at least a portion of the unpredicted content can be obtained through the output subnet. In this method, the entire plaintext is not predicted at once, but rather multiple times, predicting a portion of the plaintext each time.

[0097] Preferably, in the ciphertext cracking method provided in this specification, when predicting part of the plaintext based on the predictive features, the plaintext corresponding to the first binary character in the unpredicted content can be obtained through the output subnet.

[0098] In text data, characters in close proximity are generally more correlated. Therefore, when predicting plaintext corresponding to parts of unpredicted content, it's best to predict content near already predicted plaintext. Based on this idea, this method predicts plaintext sequentially from the start to the end. Furthermore, when the number of predicted plaintext characters is small each time, more rounds of prediction can be performed, resulting in more predicted plaintext characters at each prediction stage and higher accuracy. Therefore, when predicting plaintext, we can start from the first binary character after the start character, predicting one binary character at a time, moving forward one character in each round until the entire plaintext is predicted.

[0099] S112: Based on the plaintext corresponding to at least a portion of the predicted unpredicted content, re-determine the predicted plaintext, and continue to predict the unpredicted content in the ciphertext to be cracked until all the content of the ciphertext to be cracked is predicted.

[0100] In this step, the predicted plaintext can be re-determined based on the plaintext corresponding to at least a portion of the unpredicted content identified in step S110. If the re-determined predicted plaintext cannot correspond to all content in the ciphertext to be cracked, other predicted content can be re-predicted based on the predicted plaintext, i.e., steps S106 to S112 in this method are repeated; when the re-determined predicted plaintext can correspond to all content in the ciphertext to be cracked, it indicates that all plaintext has been predicted, the current prediction can be ended, and all predicted plaintext can be output.

[0101] When using the ciphertext decryption method provided in this manual to predict the plaintext corresponding to the ciphertext, a natural language processing approach can be adopted. This involves combining the characteristics of the ciphertext to be decrypted with the characteristics of the predicted plaintext to jointly predict the plaintext corresponding to the unpredicted portion of the ciphertext to be decrypted. The predicted plaintext is then updated based on the predicted plaintext, and the prediction process continues until all plaintext is predicted. This method emphasizes predicting plaintext based on the relationships between the contents of the ciphertext itself, and by combining the predicted plaintext with multiple rounds of prediction, the results are made more accurate. While ensuring the method's versatility, it improves the accuracy of the predicted plaintext.

[0102] Furthermore, when the predicted plaintext in each round corresponds to the plaintext of the first binary character in the unpredicted content, specifically, the predicted plaintext can be re-determined based on the predicted plaintext corresponding to the predicted content and the plaintext corresponding to the first binary character in the unpredicted content. The re-determined predicted plaintext contains one more bit of valid characters than the original predicted plaintext. Valid characters are "0" or "1" in binary, and the corresponding padding character is an invalid character. In other words, the predicted plaintext content is used to replace the corresponding padding character in the original predicted plaintext to obtain the re-determined predicted plaintext.

[0103] Additional, such as Figure 2As shown, the cracking model used in this method may further include an extraction subnet for extracting textual features of the input plaintext / ciphertext, that is, converting the input string into a feature vector representing the meaning of the text. Specifically, when extracting encoded features, the ciphertext to be cracked can be input into the extraction subnet of the pre-trained cracking model to extract the first textual features of the ciphertext to be cracked; the first textual features are then input into the encoding subnet of the cracking model to output the encoded features of the ciphertext to be cracked based on the first textual features. When extracting contextual features, the predicted plaintext can be extracted into the extraction subnet of the cracking model to extract the second textual features of the predicted plaintext; the second textual features are then input into the encoding subnet of the cracking model to output the contextual features of the predicted plaintext based on the second textual features through the context layer in the encoding subnet.

[0104] Furthermore, the cracking model used in this specification can be pre-trained. Specifically, sample ciphertext and the corresponding labeled plaintext can be obtained; the sample ciphertext is input into the cracking model to be trained, so as to extract the coding features to be optimized of the sample ciphertext through the coding subnet in the cracking model; the predicted and unpredicted contents of the sample ciphertext are determined, and the predicted plaintext to be optimized corresponding to the predicted contents is determined; the predicted plaintext to be optimized is input into the cracking model, so as to extract the context features to be optimized of the predicted plaintext through the context layer of the decoding subnet in the cracking model; the coding features to be optimized and the context features to be optimized are input into the decoding subnet. A prediction layer is used to extract prediction features to be optimized. These features are then input into the output subnet of the cracking model to obtain plaintext corresponding to at least a portion of the unpredicted content in the sample. Based on the predicted plaintext corresponding to at least a portion of the unpredicted content, the predicted plaintext to be optimized is redefined, and the unpredicted content in the ciphertext continues to be predicted until all content of the ciphertext is predicted, thus obtaining the target plaintext to be optimized. The cracking model is trained with the minimum difference between the target plaintext and the labeled plaintext as the optimization objective.

[0105] In the cracking model, both the context layer and the prediction layer in the decoding subnet can be implemented using attention layers. Similarly, attention layers can also be implemented in the encoding subnet. The implementation methods of attention layers can include, but are not limited to, self-attention mechanisms, multi-head attention mechanisms, etc., and this specification does not impose specific limitations on them. Of course, each subnet can also include other common network layers, such as pooling layers, fully connected layers, normalization layers, etc., and this specification does not impose specific limitations on them either.

[0106] The cracking model is trained using sample ciphertext and corresponding labeled plaintext. Since the labeled plaintext corresponding to the sample ciphertext is known, it can be directly masked and used as the initial predicted plaintext input into the cracking model. The masking operation can still be implemented using padding characters, replacing all content in the original plaintext with padding characters. It is important to note that the start character should remain unchanged throughout the process.

[0107] Additionally, both during training and in practical applications, the cracking model can contain several identical encoding subnets and several identical decoding subnets. The number can be set according to requirements, and this manual does not impose specific limitations. Reusing multiple encoding and / or decoding subnets can improve model performance, but too many subnets may lead to overfitting and other problems.

[0108] In one specific embodiment, for a DES encryption system with an unknown key and a length of 64 bits per group, this method obtains 32,768 sets of sample ciphertext and labeled plaintext, divides them into 2,048 training batches, each consisting of 16 sets of plaintext-ciphertext pairs for training data, and performs a total of 5,000 iterations. The cracking model uses a 3-layer encoding subnet and a 3-layer decoding subnet. The extracted feature length is 128, the fully connected layer dimension is 512, the number of self-attention mechanisms is 4, and the Adam optimization method is used. Model training uses 8 Nvidia Tesla V100 GPUs and takes 2 days. After completion, the plaintext accuracy for the input ciphertext is above 60%, significantly higher than 50%.

[0109] It is clear that the ciphertext cracking method provided in this manual does not design its model structure according to the traditional approach of targeting encryption algorithms, but rather designs the cracking model based on the ciphertext content itself. Therefore, unlike traditional methods that are specifically designed to crack ciphertext for a particular encryption algorithm, the ciphertext cracking algorithm provided in this manual can be applied to crack ciphertext for various different encryption algorithms. When encountering a new encryption algorithm, it is only necessary to use the plaintext-ciphertext pairs obtained using the corresponding encryption algorithm as samples for training to obtain a cracking model capable of cracking the ciphertext for that encryption algorithm, without needing to redesign the model structure.

[0110] The above are the methods for cracking ciphertext provided in this manual. Based on the same approach, this manual also provides corresponding ciphertext cracking devices, such as... Figure 3 As shown.

[0111] Figure 3 This specification provides a schematic diagram of a ciphertext cracking device, which specifically includes:

[0112] Module 200 is used to obtain the ciphertext to be cracked;

[0113] The ciphertext input module 202 is used to input the ciphertext to be cracked into a pre-trained cracking model, so as to extract the coding features of the ciphertext to be cracked through the coding subnet in the cracking model;

[0114] The determining module 204 is used to determine the predicted and unpredicted content in the ciphertext to be cracked, and to determine the predicted plaintext corresponding to the predicted content;

[0115] Plaintext input module 206 is used to input the predicted plaintext into the cracking model so as to extract the context features of the predicted plaintext through the context layer of the decoding subnet in the cracking model;

[0116] Prediction module 208 is used to input the encoded features and the context features into the prediction layer in the decoding subnet, so as to output prediction features through the prediction layer;

[0117] Output module 210 is used to input the predicted features into the output subnet of the cracking model, so as to obtain the plaintext corresponding to at least part of the unpredicted content through the output subnet;

[0118] The loop module 212 is used to re-determine the predicted plaintext based on the plaintext corresponding to at least a portion of the predicted unpredicted content, and continue to predict the unpredicted content in the ciphertext to be cracked until all the content of the ciphertext to be cracked is predicted.

[0119] Optionally, in the method, both the ciphertext and plaintext are binary strings.

[0120] Optionally, the device further includes a filling module 214, specifically used to fill the ciphertext to be cracked to the specified length using a filler character when the length of the ciphertext to be cracked is less than the specified length of a single block of ciphertext corresponding to the block cipher.

[0121] Optionally, the cracking model further includes extracting subnets;

[0122] The ciphertext input module 202 is specifically used to input the ciphertext to be cracked into the extraction subnet of the pre-trained cracking model, so as to extract the first text feature of the ciphertext to be cracked through the extraction subnet; and input the first text feature into the encoding subnet of the cracking model, so as to output the encoding feature of the ciphertext to be cracked based on the first text feature through the encoding subnet.

[0123] The plaintext input module 206 is specifically used to extract the second text features of the predicted plaintext from the extraction subnet of the cracking model; and to input the second text features into the encoding subnet of the cracking model, so that the context layer in the encoding subnet outputs the context features of the predicted plaintext based on the second text features.

[0124] Optionally, the output module 210 is specifically used to obtain the plaintext corresponding to the first binary character in the unpredicted content through the output subnet.

[0125] Optionally, the loop module 212 is specifically used to redetermine the predicted plaintext based on the predicted plaintext corresponding to the predicted content and the plaintext corresponding to the first binary character in the unpredicted content, wherein the number of valid characters in the redetermined predicted plaintext is one more than the number of valid characters in the original predicted plaintext.

[0126] Optionally, the device further includes a training module 216, specifically configured to: acquire sample ciphertext and the labeled plaintext corresponding to the sample ciphertext; input the sample ciphertext into a cracking model to be trained, so as to extract the coding features to be optimized of the sample ciphertext through the coding subnet in the cracking model; determine the predicted and unpredicted content of the samples in the sample ciphertext, and determine the predicted plaintext to be optimized corresponding to the predicted content of the samples; input the predicted plaintext to be optimized into the cracking model, so as to extract the context features to be optimized of the predicted plaintext through the context layer of the decoding subnet in the cracking model; and input the coding features to be optimized and the context features to be optimized into the training module 216. The prediction layer in the decoding subnet is used to extract the prediction features to be optimized; the prediction features to be optimized are input into the output subnet in the cracking model to obtain the plaintext corresponding to at least a portion of the unpredicted content of the sample; based on the plaintext corresponding to at least a portion of the unpredicted content of the sample, the predicted plaintext to be optimized is re-determined, and the unpredicted content of the sample ciphertext continues to be predicted until all the content of the sample ciphertext is predicted, thus obtaining the target plaintext to be optimized of the sample ciphertext; the cracking model is trained with the minimum difference between the target plaintext to be optimized and the labeled plaintext as the optimization objective.

[0127] This specification also provides a computer-readable storage medium storing a computer program that can be used to execute the above-described... Figure 1 The provided method for cracking encrypted messages.

[0128] This instruction manual also provides Figure 4 The diagram shows a schematic structural representation of the electronic device. Figure 4 At the hardware level, the electronic device includes a processor, internal bus, network interface, memory, and non-volatile memory, and may also include other hardware required for the business operations. The processor reads the corresponding computer program from the non-volatile memory into memory and then runs it to achieve the above-mentioned functions. Figure 1 The ciphertext cracking method described above. Of course, in addition to software implementation, this specification does not exclude other implementation methods, such as logic devices or a combination of hardware and software, etc. In other words, the execution subject of the following processing flow is not limited to individual logic units, but can also be hardware or logic devices.

[0129] Improvements in a technology can be clearly distinguished as either hardware improvements (e.g., improvements to the circuit structure of diodes, transistors, switches, etc.) or software improvements (improvements to the methodology). However, with technological advancements, many improvements to the methodology can now be considered direct improvements to the hardware circuit structure. Designers almost always obtain the corresponding hardware circuit structure by programming the improved methodology into the hardware circuit. Therefore, it cannot be said that an improvement in methodology cannot be implemented using hardware physical modules. For example, a Programmable Logic Device (PLD) (such as a Field Programmable Gate Array (FPGA)) is such an integrated circuit whose logic function is determined by the user programming the device. Designers can program and "integrate" a digital system onto a PLD themselves, without needing chip manufacturers to design and manufacture dedicated integrated circuit chips. Furthermore, nowadays, instead of manually manufacturing integrated circuit chips, this programming is mostly implemented using "logic compiler" software. Similar to the software compiler used in program development, the original code before compilation must be written in a specific programming language, called a Hardware Description Language (HDL). There are many HDLs, such as ABEL (Advanced Boolean Expression Language), AHDL (Altera Hardware Description Language), Confluence, CUPL (Cornell University Programming Language), HDCal, JHDL (Java Hardware Description Language), Lava, Lola, MyHDL, PALASM, and RHDL (Ruby Hardware Description Language). Currently, VHDL (Very-High-Speed ​​Integrated Circuit Hardware Description Language) and Verilog are the most commonly used. Those skilled in the art should understand that by simply performing some logic programming on the method flow using one of these hardware description languages ​​and programming it into an integrated circuit, the hardware circuit implementing the logical method flow can be easily obtained.

[0130] The controller can be implemented in any suitable manner. For example, it can take the form of a microprocessor or processor and a computer-readable medium storing computer-readable program code (e.g., software or firmware) executable by the (micro)processor, logic gates, switches, application-specific integrated circuits (ASICs), programmable logic controllers, and embedded microcontrollers. Examples of controllers include, but are not limited to, the following microcontrollers: ARC 625D, Atmel AT91SAM, Microchip PIC18F26K20, and Silicon Labs C8051F320. A memory controller can also be implemented as part of the control logic of the memory. Those skilled in the art will also recognize that, in addition to implementing the controller in purely computer-readable program code form, the same functionality can be achieved by logically programming the method steps to make the controller take the form of logic gates, switches, application-specific integrated circuits, programmable logic controllers, and embedded microcontrollers. Therefore, such a controller can be considered a hardware component, and the means included therein for implementing various functions can also be considered as structures within the hardware component. Alternatively, the means for implementing various functions can be considered as both software modules implementing the method and structures within the hardware component.

[0131] The systems, devices, modules, or units described in the above embodiments can be implemented by computer chips or entities, or by products with certain functions. A typical implementation device is a computer. Specifically, a computer can be, for example, a personal computer, laptop computer, cellular phone, camera phone, smartphone, personal digital assistant, media player, navigation device, email device, game console, tablet computer, wearable device, or any combination of these devices.

[0132] For ease of description, the above devices are described in terms of function, divided into various units. Of course, in implementing this specification, the functions of each unit can be implemented in one or more software and / or hardware components.

[0133] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application 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.

[0134] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this application. 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... Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.

[0135] 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.

[0136] 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.

[0137] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.

[0138] Memory may include non-persistent storage in computer-readable media, such as random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM. Memory is an example of computer-readable media.

[0139] Computer-readable media includes both permanent and non-permanent, removable and non-removable media that can store information using any method or technology. Information can be computer-readable instructions, data structures, modules of programs, or other data. Examples of computer storage media include, but are not limited to, phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, CD-ROM, digital versatile optical disc (DVD) or other optical storage, magnetic tape, magnetic magnetic disk storage or other magnetic storage devices, or any other non-transferable medium that can be used to store information accessible by a computing device. As defined herein, computer-readable media does not include transient computer-readable media, such as modulated data signals and carrier waves.

[0140] It should also be noted that the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.

[0141] Those skilled in the art will understand that the embodiments of this specification can be provided as methods, systems, or computer program products. Therefore, this specification may take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this specification may 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.

[0142] This specification can be described in the general context of computer-executable instructions that are executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc., that perform a specific task or implement a specific abstract data type. This specification can also be practiced in distributed computing environments, where tasks are performed by remote processing devices connected via a communication network. In distributed computing environments, program modules can reside in local and remote computer storage media, including storage devices.

[0143] The various embodiments in this specification are described in a progressive manner. Similar or identical parts between embodiments can be referred to interchangeably. Each embodiment focuses on describing the differences from other embodiments. In particular, the system embodiments are basically similar to the method embodiments, so the description is relatively simple; relevant parts can be referred to the descriptions in the method embodiments.

[0144] The above description is merely an embodiment of this specification and is not intended to limit this specification. Various modifications and variations can be made to this specification by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this specification should be included within the scope of the claims of this application.

Claims

1. A method for cracking encrypted text, characterized in that, include: Obtain the ciphertext to be cracked; The ciphertext to be cracked is input into a pre-trained cracking model to extract the encoded features of the ciphertext through the encoded subnet in the cracking model; Determine the predicted and unpredicted content in the ciphertext to be cracked, and determine the predicted plaintext corresponding to the predicted content; The predicted plaintext is input into the cracking model to extract the context features of the predicted plaintext through the context layer of the decoding subnet in the cracking model; The encoded features and the context features are input into the prediction layer in the decoding subnet, so that the prediction layer outputs the prediction features; The predicted features are input into the output subnet of the cracking model so that the plaintext corresponding to at least a portion of the unpredicted content can be obtained through the output subnet. Based on the plaintext corresponding to at least a portion of the predicted unpredicted content, the predicted plaintext is re-determined, and the prediction of unpredicted content in the ciphertext to be cracked continues until all content of the ciphertext to be cracked is predicted.

2. The method as described in claim 1, characterized in that, In the method described, both the ciphertext and plaintext are binary strings.

3. The method as described in claim 2, characterized in that, Before inputting the ciphertext to be cracked into a pre-trained cracking model, the method further includes: When the length of the ciphertext to be cracked is less than the specified length of a single block of ciphertext corresponding to the block cipher, the ciphertext to be cracked is padded to the specified length using a filler character.

4. The method as described in claim 1, characterized in that, The cracking model also includes extracting subnets; The ciphertext to be cracked is input into a pre-trained cracking model to extract the encoded features of the ciphertext through the encoded subnet in the cracking model, specifically including: The ciphertext to be cracked is input into the extraction subnet of a pre-trained cracking model to extract the first text features of the ciphertext to be cracked through the extraction subnet; The first text feature is input into the encoding subnet of the cracking model, so that the encoding subnet outputs the encoding feature of the ciphertext to be cracked based on the first text feature; The predicted plaintext is input into the cracking model to extract contextual features of the predicted plaintext through the context layer of the decoding subnet in the cracking model, specifically including: The extraction subnet of the cracking model of the predicted plaintext is used to extract the second text features of the predicted plaintext. The second text feature is input into the encoding subnet of the cracking model, so that the context layer in the encoding subnet outputs the context feature of the predicted plaintext based on the second text feature.

5. The method as described in claim 2, characterized in that, The plaintext corresponding to at least a portion of the unpredicted content is obtained through the output subnet, specifically including: The plaintext corresponding to the first binary character in the unpredicted content is obtained through the output subnet.

6. The method as described in claim 5, characterized in that, Based on the plaintext corresponding to at least a portion of the predicted unpredicted content, the predicted plaintext is re-determined, specifically including: Based on the predicted plaintext corresponding to the predicted content and the plaintext corresponding to the first binary character in the unpredicted content, the predicted plaintext is re-determined, wherein the number of valid characters in the re-determined predicted plaintext is one more than the number of valid characters in the original predicted plaintext.

7. The method as described in claim 1, characterized in that, Pre-training the cracking model specifically includes: Obtain the ciphertext of the sample and the plaintext annotation corresponding to the ciphertext of the sample; The ciphertext of the sample is input into the cracking model to be trained, so as to extract the coding features of the ciphertext to be optimized through the coding subnet in the cracking model; Determine the predicted and unpredicted contents of the sample ciphertext, and determine the predicted plaintext to be optimized corresponding to the predicted contents of the sample. The predicted plaintext to be optimized is input into the cracking model so that the context features to be optimized of the predicted plaintext to be optimized can be extracted through the context layer of the decoding subnet in the cracking model. The encoding features to be optimized and the context features to be optimized are input into the prediction layer in the decoding subnet so that the prediction features to be optimized can be extracted through the prediction layer. The predicted features to be optimized are input into the output subnet of the cracking model so that the plaintext corresponding to at least a portion of the unpredicted content of the sample can be obtained through the output subnet. Based on the plaintext corresponding to at least a portion of the unpredicted content in the sample, the predicted plaintext to be optimized is re-determined, and the unpredicted content in the sample ciphertext is predicted again until all the content of the sample ciphertext is predicted, thus obtaining the target plaintext to be optimized from the sample ciphertext. The cracking model is trained with the goal of minimizing the difference between the target plaintext and the labeled plaintext.

8. A ciphertext cracking device, characterized in that, include: The acquisition module is used to acquire the ciphertext to be cracked; The ciphertext input module is used to input the ciphertext to be cracked into a pre-trained cracking model, so as to extract the coding features of the ciphertext to be cracked through the coding subnet in the cracking model; The determination module is used to determine the predicted and unpredicted content in the ciphertext to be cracked, and to determine the predicted plaintext corresponding to the predicted content; A plaintext input module is used to input the predicted plaintext into the cracking model so as to extract the context features of the predicted plaintext through the context layer of the decoding subnet in the cracking model; The prediction module is used to input the encoded features and the context features into the prediction layer in the decoding subnet, so as to output the prediction features through the prediction layer; The output module is used to input the predicted features into the output subnet of the cracking model, so as to obtain the plaintext corresponding to at least a portion of the unpredicted content through the output subnet; The loop module is used to re-determine the predicted plaintext based on the plaintext corresponding to at least a portion of the predicted unpredicted content, and continue to predict the unpredicted content in the ciphertext to be cracked until all the content of the ciphertext to be cracked is predicted.

9. The apparatus as claimed in claim 8, characterized in that, Both the ciphertext and plaintext are binary strings.

10. The apparatus as claimed in claim 9, characterized in that, The device further includes a padding module, specifically used to pad the ciphertext to be cracked to the specified length using a padding character when the length of the ciphertext to be cracked is less than the specified length of a single block of ciphertext corresponding to the block cipher.

11. The apparatus as claimed in claim 8, characterized in that, The cracking model also includes extracting subnets; The ciphertext input module is specifically used to input the ciphertext to be cracked into the extraction subnet of a pre-trained cracking model, so as to extract the first text feature of the ciphertext to be cracked through the extraction subnet. The first text feature is input into the encoding subnet of the cracking model, so that the encoding subnet outputs the encoding feature of the ciphertext to be cracked based on the first text feature; The plaintext input module is specifically used to extract the second text features of the predicted plaintext from the extraction subnet of the cracking model. The second text feature is input into the encoding subnet of the cracking model, so that the context layer in the encoding subnet outputs the context feature of the predicted plaintext based on the second text feature.

12. The apparatus as claimed in claim 9, characterized in that, The output module is specifically used to obtain the plaintext corresponding to the first binary character in the unpredicted content through the output subnet.

13. The apparatus as claimed in claim 12, characterized in that, The loop module is specifically used to redetermine the predicted plaintext based on the predicted plaintext corresponding to the predicted content and the plaintext corresponding to the first binary character in the unpredicted content, wherein the number of valid characters in the redetermined predicted plaintext is one more than the number of valid characters in the original predicted plaintext.

14. The apparatus as claimed in claim 8, characterized in that, The device further includes a training module, specifically used to acquire sample ciphertext and the labeled plaintext corresponding to the sample ciphertext; input the sample ciphertext into the cracking model to be trained, so as to extract the coding features to be optimized of the sample ciphertext through the coding subnet in the cracking model; The predicted and unpredicted contents of the sample ciphertext are determined, and the predicted plaintext to be optimized corresponding to the predicted contents is determined; the predicted plaintext to be optimized is input into the cracking model, so as to extract the context features to be optimized of the predicted plaintext to be optimized through the context layer of the decoding subnet in the cracking model. The encoding features to be optimized and the context features to be optimized are input into the prediction layer in the decoding subnet so that the prediction features to be optimized can be extracted through the prediction layer. The predicted features to be optimized are input into the output subnet of the cracking model so that the plaintext corresponding to at least a portion of the unpredicted content of the sample can be obtained through the output subnet. Based on the plaintext corresponding to at least a portion of the unpredicted content in the sample, the predicted plaintext to be optimized is re-determined, and the unpredicted content in the sample ciphertext is predicted again until all the content of the sample ciphertext is predicted, thus obtaining the target plaintext to be optimized from the sample ciphertext. The cracking model is trained with the goal of minimizing the difference between the target plaintext and the labeled plaintext.

15. A computer-readable storage medium, characterized in that, The storage medium stores a computer program, which, when executed by a processor, implements the method described in any one of claims 1 to 7.

16. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the program, it implements the method described in any one of claims 1 to 7.