Machine Learning-Based Cryptanalysis
A machine learning-based approach automates the decryption of public key cryptography algorithms by training program synthesizers on input-output pairs, addressing the inefficiencies of manual cryptanalysis and enabling effective decryption of encrypted messages.
Patent Information
- Application Number
- JP2024514386
- Authority / Receiving Office
- JP · JP
- Patent Type
- Patents
- Current Assignee / Owner
- Priority Date
- 2021-09-23
- Filing Date
- 2022-09-21
- Publication Date
- 2025-11-12
- Estimated Expiration
- 2042-09-21
AI Technical Summary
Traditional cryptanalysis of public key cryptography algorithms is manual, labor-intensive, and requires esoteric mathematical skills, making it difficult to efficiently decrypt encrypted messages without the encryption key.
Implementing a machine learning-based approach using program synthesizers to automate the decryption process by training on input-output pairs and generating mathematical formulas to decrypt or partially decrypt encoded messages or secret keys, leveraging syntax-guided program synthesis to systematically utilize oracles within cryptographic algorithms.
Automates the decryption of public key cryptography algorithms, enabling efficient decryption of entire messages or partial information about secret keys, even when oracles are unavailable, by systematically using oracles to derive hidden information.
Smart Images

Figure 0007767707000003 
Figure 0007767707000004 
Figure 0007767707000005
Abstract
Description
[Technical Field]
[0001] One embodiment relates generally to cryptanalysis, and more particularly to the use of machine learning-based cryptanalysis. [Background technology]
[0002] Cryptanalysis is the study of analyzing information systems to investigate hidden aspects of the system. Cryptanalysis is used to break cryptographic security systems and gain access to the contents of encrypted messages, even when the encryption key is unknown.
[0003] Traditionally, cryptanalysis of public key cryptography algorithms is often performed manually by researchers with esoteric skills in mathematics and computer science. Cryptanalysts review the mathematical structure of cryptographic algorithms to identify weaknesses in the design. Cryptanalysts manually construct mathematical formulas that help reveal secret data (e.g., keys, messages) from public data parameters that are part of the cryptosystem, thereby decrypting the encoded message. Summary of the Invention
[0004] Embodiments decrypt or partially decrypt an encoded message or private key encoded by a public key cryptography algorithm. Embodiments encode the public key cryptography algorithm using a program synthesizer language and construct a grammar for the program synthesizer. Embodiments train the program synthesizer with training data having input-output pairs and run the trained program synthesizer to generate mathematical formulas. Embodiments validate the generated mathematical formulas and then perform decryption using the trained and validated program synthesizer. [Brief explanation of the drawings]
[0005] Further embodiments, details, advantages and modifications will become apparent from the following detailed description of the embodiments, which is to be read in conjunction with the accompanying drawings. [Figure 1]1 illustrates a general encryption algorithm according to an embodiment. [Figure 2] FIG. 1 is a block diagram of a computer server / system according to one embodiment of the present invention that can be used to implement any of the functionality disclosed herein. [Figure 3] 3 is a flow diagram of the functionality of the decryption module of FIG. 2 for performing decryption, according to one embodiment. DETAILED DESCRIPTION OF THE INVENTION
[0006] One embodiment trains a program synthesizer on input-output pairs of the encrypted communication to decrypt or partially decrypt the encoded message or secret key, and uses the trained program synthesizer to further decrypt the encrypted communication.
[0007] Embodiments implement a computer-aided decryption process for public key cryptography algorithms, such as RSA, Rabin, and Diffie-Hellman key exchange. Embodiments integrate automated program synthesis with public key cryptography to perform the decryption. Embodiments transform the public key decryption problem into a program synthesis problem to automate the decryption task.
[0008] In general, automated program synthesis generates programs that conform to a high-level formal specification. The specification can range from a complete formal behavioral specification to input-output examples (as in test cases) or a combination of partial specifications and input-output examples. Embodiments use a syntax-guided program synthesis ("SyGuS") approach by guiding a search space of possible programs to reason about using a given grammar consisting of primitive components that are typical elements of public-key cryptography algorithms (e.g., modular addition, exponentiation, etc.).
[0009] Reference will now be made in detail to the embodiments of the present disclosure, examples of which are illustrated in the accompanying drawings. In the following detailed description, numerous specific details are set forth to provide a thorough understanding of the present disclosure. However, it will be apparent to those skilled in the art that the present disclosure may be practiced without these specific details. Additionally, well-known methods, procedures, components, and circuits have not been described in detail so as not to unnecessarily obscure aspects of the embodiments. Wherever possible, like reference numerals will be used to refer to like elements.
[0010] 1 illustrates a general encryption algorithm 110 according to an embodiment. The encryption algorithm 110 includes a receiver 103 that receives a message from a sender 101 to be encrypted. The encryption algorithm 110 further includes an "oracle" 104 that receives a message from an attacker 102.
[0011] Generally, in public key cryptography, some encryption algorithms contain hard-core bits, or "oracles," of the secret message, meaning that if a cryptanalyst has access to an algorithm that predicts those hard-core bits, they can recover the entire encrypted message by repeatedly applying the exact same algorithm to different inputs. The concept of an "oracle attack" is that by selecting plaintext or ciphertext inputs to the encryptor or decryptor, respectively, and analyzing the output related to the selected inputs, it is often possible to deduce valuable information about the algorithm or a secret item of information, such as one of the keys used in the algorithm.
[0012] Such vulnerabilities in cryptographic systems are called "oracles" because, like a visit to the ancient Greek oracle at Delphi, every input or question receives an output or answer, and it is up to the observer to determine whether the answer is meaningful. A cryptographic oracle attack is successful when the oracle's output in response to multiple inputs reveals a hidden truth. Cipher constructions and / or implementations often have such oracles in connection with timing information, message padding issues, error handling, or other information leaks. Specifically, an oracle 104 can answer a specific question, such as "What are the least significant bits of an encrypted message?" However, developing an algorithm that uses the oracle 104 intelligently to decrypt the entire message is generally a difficult cryptanalysis task.
[0013] In contrast, embodiments apply program synthesis for the decryption task: they synthesize an algorithm that systematically uses oracles 104 to decrypt the entire secret.
[0014] 2 is a block diagram of a computer server / system 10 according to one embodiment of the present invention, which may be used to implement any of the functionality disclosed herein. Although shown as a single system, the functionality of system 10 may be implemented as a distributed system. Also, the functionality disclosed herein may be performed on separate servers or devices that may be coupled to each other via a network. Also, one or more components of system 10 may not be included.
[0015] System 10 includes a bus 12 or other communication mechanism for communicating information and a processor 22 coupled to bus 12 for processing information. Processor 22 may be any type of general-purpose or special-purpose processor. System 10 also includes memory 14 for storing information and instructions executed by processor 22. Memory 14 may be comprised of any combination of random access memory (“RAM”), read-only memory (“ROM”), static storage such as a magnetic or optical disk, or any other type of computer-readable medium. System 10 also includes a communication device 20, such as a network interface card, to provide access to a network. Thus, a user may interface with system 10 directly, remotely over a network, or in some other manner.
[0016] Computer-readable media may be any available media that can be accessed by processor 22 and includes both volatile and nonvolatile media, removable and non-removable media, and communication media. Communication media may include computer-readable instructions, data structures, program modules, or other data in a modulated data signal, such as a carrier wave or other transport mechanism, and includes any information delivery media.
[0017] Processor 22 is further coupled via bus 12 to a display 24, such as a liquid crystal display (“LCD”). A keyboard 26 and a cursor control device 28, such as a computer mouse, are further coupled to bus 12 to allow a user to interface with system 10.
[0018] In one embodiment, memory 14 stores software modules that provide functionality when executed by processor 22. These modules include operating system 15, which provides the operating system functionality of system 10. These modules also include decryption module 16, which performs decryption to decrypt or partially decrypt an encoded message or secret key, and all other functionality disclosed herein. System 10 can be part of a larger system. Thus, system 10 can include one or more additional functional modules 18 to include further functionality that can utilize the encryption / decryption functionality. A file storage device or database 17 is coupled to bus 12 to provide centralized storage for modules 16 and 18, including decrypted keys, constraints, and program synthesis grammars. In one embodiment, database 17 is a relational database management system (“RDBMS”) capable of managing stored data using structured query language (“SQL”).
[0019] In one embodiment, database 17 is implemented as an in-memory database (“IMDB”), especially when there are many distributed files on a single device. An IMDB is a database management system that relies primarily on main memory for computer data storage. This is in contrast to database management systems that employ disk storage mechanisms. Main memory databases are faster than disk-optimized databases because disk access is slower than memory access, and internal optimization algorithms are simpler and execute fewer CPU instructions. Accessing data in memory eliminates seek time when querying data, providing faster and more predictable performance than disk.
[0020] In one embodiment, when implemented as an IMDB, database 17 is implemented based on a distributed data grid. A distributed data grid is a system in which a collection of computer servers work together in one or more clusters to manage information and related operations, such as computation, in a distributed or clustered environment. Distributed data grids can be used to manage application objects and data shared among servers. Distributed data grids provide low response times, high throughput, predictable scalability, continuous availability, and information reliability. In a particular example, a distributed data grid, such as Oracle Corporation's "Oracle Coherence" data grid, stores information in-memory to achieve higher performance and uses redundancy to keep copies of that information synchronized across multiple servers, ensuring continuous availability of data and system resilience in the event of a server failure.
[0021] In one embodiment, system 10 is a computing / data processing system that includes an application or collection of distributed applications for an enterprise organization, and may also implement logistics, manufacturing, and inventory management functions. Application and computing system 10 may be configured to operate with or implemented as a cloud-based networking system, a software-as-a-service (“SaaS”) architecture, or other type of computing solution.
[0022] As disclosed, embodiments use machine learning to construct mathematical expressions based on public data associated with cryptographic algorithms. For example, in the case of the Diffie-Hellman algorithm, embodiments use a machine learning machine in the form of a program synthesizer to uncover the least significant bits (“LSBs”) of a private key from a corresponding public key. Similarly, one embodiment uses a machine learning machine to construct a mathematical expression that reveals a portion of a private key given access to an LSB oracle for the RSA algorithm.
[0023] In general, embodiments train a machine learning algorithm on input-output pairs and have the machine learning machine (i.e., program synthesizer) automatically perform cryptanalysis to decrypt or partially decrypt an encoded message or secret key.
[0024] Figure 3 is a flow diagram of the functionality of decryption module 16 of Figure 2 for performing decryption, according to one embodiment. In one embodiment, the functionality of the flow diagram of Figure 3 is implemented by software stored in memory or other computer-readable or tangible medium and executed by a processor. In other embodiments, the functionality may be performed by hardware (e.g., through the use of an application specific integrated circuit ("ASIC"), a programmable gate array ("PGA"), a field programmable gate array ("FPGA"), etc.), or some combination of hardware and software.
[0025] At 302, an embodiment encodes a public key encryption algorithm using a language supported by a program synthesizer. One embodiment uses syntax-guided program composition, although other encoding techniques may be used, such as enumerative search, constraint solving, stochastic search, and deductive-based programming, by way of example. An embodiment using syntax-guided composition allows the cryptanalyst to define a grammar that constrains the search space.
[0026] At 304, embodiments construct a grammar for the program synthesizer. The building blocks of the grammar are primitives, such as modular addition, multiplication, reciprocal, and any oracles, if available. Typically, these primitives are often used in the context of public key cryptography. The grammar can be iteratively evolved by adding more primitives as needed.
[0027] At 306, embodiments train a program synthesizer with input-output pairs (i.e., training data). For example, if the goal is to build a formula that uses the first least significant bit ("LSB") to predict the second LSB, embodiments train the synthesizer with a set of examples. For example, in the DH protocol example disclosed below, the training data refers to pairs consisting of the public key and the LSB of the private key. This is the training set.
[0028] At 308, embodiments run a synthesizer to generate a formula and validate the learned formula to check whether the formula is general to all input-output pairs, rather than just valid for the training examples. Traditional proof techniques or a theorem prover may be used to validate the learned formula. In embodiments, program composition is used to validate the learned formula by varying parameter values of the underlying cryptographic algorithm. If a formula is learned for a particular training set, embodiments modify the training set to verify whether the formula is generalizable, and then retrain the machine learning model based on the output. For example, in a DH protocol, embodiments can modify the group generator and verify whether the learned formula is valid. Mathematical axioms may be used to prove whether the machine-learned formula is correct for all possible scenarios.
[0029] If the learned formula is not validated at 308, then at 310, embodiments use the data (i.e., input-output pairs) from 308 to extend the trained input-output pairs and restart the function at 308 to retrain the program synthesizer. Otherwise, decryption is complete.
[0030] As a result of the functionality of Figure 3, embodiments can either decrypt the entire message (or key) or learn partial information about it (i.e., partial decryption) using a trained and validated program synthesizer. As described below, in the DH example, embodiments learn partial information about the private key, while in the RSA example, embodiments learn the entire message using an oracle that leaks only the LSBs of the encrypted message. The generated mathematical formula takes only public data (e.g., public key, ciphertext) and returns private information. Because public and private data are generally mathematically related, embodiments use machine learning to learn the underlying relationship.
[0031] Automatic program synthesis example Embodiments use program synthesis to automate cryptanalysis. One embodiment implements CVC4 as the program synthesizer. CVC4 is an efficient, open-source automated theorem prover for satisfiability modulo theories ("SMT") problems. It can be used to prove the validity (or, dually, satisfiability) of linear formulas in many embedded logic theories and their combinations. In other embodiments, alternative program synthesizers may be used.
[0032] In one example of automatic program synthesis, assume it is desired to synthesize a program that finds the second largest number among three different numbers. In an embodiment, the program synthesizer language is also SMT, so functions and types are specified using SMT language syntax, which is described below.
[0033] The bool2Int function converts a boolean value b to an int. It returns 1 if b is true, 0 otherwise. In SMT, "it" stands for if-then-else: (define-fun bool2Int ((b Bool)) Int (ite (= b true) 1 0) )
[0034] The max and min functions return the maximum and minimum of two numbers x and y, respectively: (define-fun max((x Int)(y Int)) Int (-x(*(-xy)(bool2Int( <x y))))) (define-fun min((x Int)(y Int)) Int (-x(*(-xy)(bool2Int( <y x)))))
[0035] To compose using SyGus, we need to specify a grammar containing the allowed list of variables (e.g., x, y, z) and components (e.g., max, min): min): (synth-fun second_max((x Int) (y Int) (z Int)) Int ((Start Int( xyz (max Start Start) (min Start Start) )) ) )
[0036] The specification is given using a set of input-output pairs. For example, the statement (constraint(=(second_max 1, 2, 3) 2)) means that the second_max function should return 2 when called with arguments (1, 2, 3). The second_max code is composed using the components mentioned in the grammar (e.g. max, min). The composed function (in this example) is not optimal in terms of the number of comparisons, but it shows how algorithms can be composed from components. (constraint(=(second_max 1 2 3) 2)) (constraint(=(second_max 3 2 1) 2)) (constraint(=(second_max 1 3 2) 2)) (constraint(=(second_max 3 1 2) 2)) (constraint(=(second_max 2 3 1) 2)) (constraint(=(second_max 2 1 3) 2))
[0037] The check-synth command asks the SyGus synthesis tool to synthesize a function that satisfies the above constraints: (check-synth)
[0038] After executing the following SyGus command using the CVC4 utility, the synthesized code will be printed by it. . / cvc4-2020-05-29-x86_64-linux-opt --lang=sygus1 max_second.sygus (define-fun second_max((x Int) (y Int) (z Int)) Int (min(max xy) (max z (min xy))))
[0039] As shown, syntax-guided program synthesis attempts to derive a program using components mentioned in a given grammar to match a given specification.
[0040] RSA cryptanalysis using program synthesis examples. Rivest-Shamir-Adleman ("RSA") is a widely used public-key cryptosystem for secure data transmission. With RSA, a sender encrypts a message with the receiver's public key. Only the receiver can decrypt the message with the corresponding private key.
[0041] In RSA, the key generation phase is as follows: Let b represent the key size in bits. Two random secret primes p and q are generated, and the public key n is formed by multiplying p and q, so n = pq, where p and q are both secret primes, each roughly b / 2 bits in size. Then e and d are chosen such that e*d = 1(mod phi(n)), where phi(n) = (p-1)(q-1).
[0042] In practice, the public e is a fixed constant. If a matching private d cannot be selected, new primes p and q are chosen until a suitable d is found. The public key is<n,e> and the private key is<n,e,d,p,q> RSA is considered difficult to break because it is difficult to efficiently find (1) p and q from n, or (2) phi(n) from n.
[0043] In RSA, the encryption function is: Let x be a message, also called plaintext. In RSA, the message must be encoded as an integer in [0,n). The sender must know the receiver's public key.<n,e> encrypts the message x by calling the encryption function enc defined below: enc(x)=x e (mod n)=y y is the ciphertext corresponding to the plaintext x. Because the encryption function enc is deterministic, to avoid attacks, randomness is added to the plaintext before enc is applied. Since there are no known efficient algorithms that can exchange the e-th root in a compound modulo arithmetic context, it is widely believed that finding x given y is difficult.
[0044] In RSA, the decryption function is as follows: the recipient decrypts the incoming ciphertext y using their private key exponent d to recover the plaintext x: dec(y)=y d (mod n)=x The last equation is due to a number-theoretic result of Euler and Fermat.
[0045] The embodiment then applies the program synthesizer to the RSA as follows:<n,e> Assume there exists an oracle lsbOra(y, e, n) that takes x and returns the least significant bit (LSB) of the plaintext x. Embodiments use program composition to automatically use this lsbOra to decrypt the entire message bit by bit.
[0046] Embodiments utilize a program synthesizer to exploit a grammar that enumerates an allowed list of primitives that can be invoked to learn an expression that matches an input-output pair (i.e., a training dataset). The list of primitives consists of basic mathematical functions used in public key cryptography. For example, functions such as mod, power, and inverse are often part of the catalog that the synthesizer is allowed to use. If an oracle function exists, embodiments also include it as part of the allowed list of primitives. This capability is exploited for RSA cryptanalysis.
[0047] The RSA encryption function "enc" and decryption function "dec" are formalized below (corresponding to 302 in Figure 3 when encoding the encryption and decryption functions in the SMT language). "pow" is the exponential function: (define-fun enc((x Int) (e Int) (n Int)) Int (mod(pow(mod xn) e) n) ) (define-fun dec((y Int) (d Int) (n Int)) Int (mod(pow(mod yn) d) n) )
[0048] The embodiment then uses the SMT language to specify an oracle (which corresponds to 302 and partially to 304 in Figure 3, since the oracle is part of the grammar). The least significant bit oracle lsbOra is given below. Note that the oracle knows the private key (3 in the example below). However, the combiner simply uses lsbOra as a black box. In other words, the combiner is not given the private key value. lsbOra is allowed to call the RSA decryption function: (define-fun lsbOra((y Int) (n Int)) Int (lsb(dec(mod yn) 3 n)) )
[0049] The embodiment then defines a grammar (corresponding to 304 in FIG. 3). The grammar is given as follows: (synth-fun half_pred((y Int) (e Int) (n Int)) Int ((Start Int( yen 1 2 (modAdd Start Start n) (modMul Start Start n) (lsbOra Start n) (enc Start Start n) )) ) ) This grammar allows the program synthesizer to use commonly occurring modulo operations, oracles (lsbOra), and cryptographic functions. The synthesizer is also trained on a set of examples that specify the behavior to be synthesized (corresponding to 306 in Figure 3).
[0050] In one example, RSA is applied to a small composite number n=15. Therefore, p=5, q=3, and phi(n)=8. Also, e*d=1(mod phi(n)), so e=3 and d=3.
[0051] The RSA encryption table is given below, and for all possible plaintexts x, the corresponding ciphertexts are calculated. [Table 1]
[0052] The following example defines input-output pairs for the ring of integers Z15.
[0053] The embodiment then interprets the input-output specification (constraint(=(half_pred 1 3 15)0)). half_pred means predicting whether the unknown plaintext x is < n / 2. The cryptanalyst does not know the plaintext x but knows the corresponding ciphertext y. Because it is clearly sent, and thus y is public. In (half_pred 1 3 15), y is 1, e is 3, and n is 15. (constraint(=(half_pred 1 3 15) 0)) means that the value of x is < n / 2 and is represented by 0. On the other hand, (constraint(=(half_pred 9 3 15) 1)) means that the value of x is > n / 2 and is represented by 1. The cryptographer can easily construct such a specification using examples. (constraint(=(half_pred 1 3 15) 0)) (constraint(=(half_pred 8 3 15) 0)) (constraint(=(half_pred 12 3 15) 0)) (constraint(=(half_pred 4 3 15) 0)) (constraint(=(half_pred 5 3 15) 0)) (constraint(=(half_pred 6 3 15) 0)) (constraint(=(half_pred 13 3 15) 0)) (constraint(=(half_pred 2 3 15) 1)) (constraint(=(half_pred 9 3 15) 1)) (constraint(=(half_pred 10 3 15) 1)) (constraint(=(half_pred 11 3 15) 1)) (constraint(=(half_pred 3 3 15) 1)) (constraint(=(half_pred 7 3 15) 1)) (constraint(=(half_pred 14 3 15) 1))
[0054] The embodiment then has the synthesizer generate / suggest an attack algorithm by executing the following command (corresponding to 308 in FIG. 3): As shown below, in this example, the synthesizer automatically inferred the attack algorithm using the input-output example and the grammar. This demonstrates the use of program synthesis for cryptanalysis of public key cryptography. $ . / cvc4-2020-05-29-x86_64-linux-opt --lang=sygus1 rsa_half.sygus (define-fun half_pred((y Int) (e Int) (n Int)) Int (lsbOra(modMul y (enc 2 en) n) n))
[0055] The synthesized function took as input the ciphertext y and the public parameters e and n, and inferred an algorithm that could predict the most significant bit of the secret message. The program synthesizer successfully inferred the function by using the LSB oracle lsbOra, modulo multiplication modMul, and the public encryption function enc.
[0056] The above example shows that the composed function predicts the most significant bit from this LSB oracle for all possible e and n, not just the configuration of the training examples. By repeatedly applying half_pred, a cryptanalyst can easily learn all the bits of the secret message x.
[0057] DH cryptanalysis using program synthesis examples. The above examples using RSA cryptanalysis leveraged an oracle. However, embodiments are also applicable to cryptanalysis even when it is assumed that no such oracle exists. In particular, there may be mathematical weaknesses within an algorithm that can be exposed using program synthesis. For example, using a general-purpose program synthesis algorithm, embodiments can predict the least significant bits of a public key from a private key in a basic version of the Diffie-Hellman ("DH") key exchange algorithm. Using the specification of the DH key exchange algorithm and example input-output pairs, in embodiments, a program synthesizer can generate an algorithm that successfully and automatically predicts the least significant bits of a private key.
[0058] With DH, for two parties to communicate securely, they must agree on a common key k that can be used for encryption and decryption. The DH key exchange algorithm solves this fundamental key agreement problem in that both parties can arrive at the common key k using a public channel without any prior arrangement (e.g., a courier service).
[0059] The DH algorithm is defined using a one-way function formalized as follows: Let p be a prime number, and Z * Let p={1,2,3,…,p-1}. One of the fundamental results in number theory is that Z * p contains a special element called a generator g. For example, p=11;Z * Let p={1,2,3,4,5,6,7,8,9,10}. Z *In 11, 2 is a generator because Z * All elements of 11 are 2 mod p for some integer i. i This is because it can be expressed as: Z * Since p contains a generator, Z * p is a cyclic group. The DH key exchange algorithm is, for example, Z * It is defined in cyclic groups such as p.
[0060] An example of a DH key exchange algorithm is as follows: Let Alice and Bob be two parties who wish to agree on a common key k. "Alice" and "Bob" can be thought of as two computer applications connected by a computer network. The goal of DH is to establish a shared secret key that can be used by them to encrypt and decrypt messages. Both parties must publicly agree on p and g. In an embodiment, p and g may be defined by the National Institute of Standards and Technology ("NIST") or by another source. The following steps describe the DH key exchange algorithm: Step 1: Alice randomly chooses a private key x, an integer in (1, p). Similarly, Bob randomly chooses a private key y, an integer in (1, p). Step 2: Alice finds that A=g x Send (mod p) to Bob. Step 3: Bob checks if B=g y Send (mod p) to Alice. Step 4: Alice is B x Calculate and Bob gets A y Calculate B x =A y =g xy Therefore, both have the same key k=g xy It has.
[0061] The security of the DH key exchange algorithm is determined by (1) the public value g x , g y Given g xyor (2) it is difficult to find a public value g x (or g y ), it is difficult to find x (or y), and this problem is called the discrete logarithm problem.
[0062] An embodiment performs decryption of the DH function using program composition as follows: Let g be a generator and the function dh:Z * p→Z * p = dh(x) = g x Define it as (mod p)=h. This function dh is widely considered to be one-way, meaning that it is computationally intractable to find x given dh(x). However, this definition does not mean that partial information about the input x cannot be inferred from dh(x). To that end, embodiments apply program synthesis to show how to derive partial information about a secret x from dh(x). For example, the following example shows how program synthesis can infer the least significant bits (“LSBs”) of a secret input x from dh(x):
[0063] The embodiment uses SMT language syntax to formalize the above DH functions. (define-fun dh((g Int) (x Int) (p Int)) Int (mod(pow g(mod x (-p 1))) p) )
[0064] An embodiment then constructs the grammar as follows: (synth-fun lsb_pred((g Int) (p Int) (h Int)) Int ((Start Int ( gph (Constant Start) (div Start Start) (dh Start Start p) )) ) ) The above grammar includes components such as the integer division (div) operator, the dh function, and allows the use of constant integers.
[0065] The embodiment then trains the program synthesizer on the input-output pairs. An example of an input-output is Z * p, where p=11 and g=2 are Z * This is the generator of p. (declare-const p Int) (assert(= p 11)) (declare-const g Int) (assert(= g 2))
[0066] The embodiment declares the following constraints using dh(x) for all integers x in {circumflex over (x)}: [Table 2] (constraint(=(lsb_pred gp 2) (lsb 1))) (constraint(=(lsb_pred gp 4) (lsb 2))) (constraint(=(lsb_pred gp 8) (lsb 3))) (constraint(=(lsb_pred gp 5) (lsb 4))) (constraint(=(lsb_pred gp 10)(lsb 5))) (constraint(=(lsb_pred gp 9) (lsb 6))) (constraint(=(lsb_pred gp 7) (lsb 7))) (constraint(=(lsb_pred gp 3) (lsb 8))) (constraint(=(lsb_pred gp 6) (lsb 9))) (constraint(=(lsb_pred gp 1) (lsb 10)))
[0067] The synthesizer using the cvc4 tool is run as follows: $cvc4-2020-05-29-x86_64-linux-opt --lang=sygus1 dh_lsb.sygus The following output is obtained: (define-fun lsb_pred((g Int) (p Int) (h Int)) Int(dh p (dh h (div p 2) p) p)) h=g x Then, lsb_pred(g,p,h) shown above can predict the least significant bit (LSB) of x. This example shows that program synthesis can analyze the one-way function of the DH key exchange algorithm and perform the cryptanalysis task automatically. Note that the inferred function lsb_pred is true not only for the training examples, but also for all possible p and g.
[0068] Embodiments can also be used to evaluate how difficult it is to break a cryptosystem given an oracle. For example, in contrast to RSA, it is believed that the LSB oracle of the DH algorithm cannot be used to efficiently recover all other bits of the private key. By having a program synthesizer explore the space of different possible ways to query the LSB oracle, a cryptanalyst can gain new insights, such as whether the oracle is high-risk or whether there is no obvious way to apply the oracle.
[0069] As disclosed, embodiments relate to computer-assisted processes for the cryptanalysis of public key cryptographic algorithms, such as RSA. Embodiments automatically analyze such algorithms and automatically generate attacks.
[0070] As disclosed, in public key cryptography, there are generally hardcore bits of a secret message, meaning that if a cryptanalyst has access to an algorithm that predicts those hardcore bits, they can recover the entire message by repeatedly applying the exact same algorithm to different inputs. As an example, there exist oracles that can answer the specific question: What are the least significant bits of an encrypted message? In general, finding an algorithm that cleverly uses such an oracle to decrypt the entire message is a nontrivial cryptanalysis task. To that end, embodiments apply program synthesis to the cryptanalysis task. Embodiments synthesize an algorithm that systematically uses oracles to decrypt the entire secret.
[0071] The features, structures, or features of the present disclosure described throughout this specification may be combined in any suitable manner in one or more embodiments. For example, the use of the terms "one embodiment," "some embodiments," "one particular embodiment," "particular embodiments," or other similar terms throughout this specification indicates that a particular feature, structure, or feature described in connection with that embodiment may be included in at least one embodiment of the present disclosure. Thus, the appearances of the phrases "one embodiment," "some embodiments," "one particular embodiment," "particular embodiments," or other similar terms throughout this specification do not necessarily all refer to the same group of embodiments, and the described features, structures, or features may be combined in any suitable manner in one or more embodiments.
[0072] Those skilled in the art will readily appreciate that the above-described embodiments can be practiced with steps in a different order and / or with elements in a different configuration than that disclosed. Accordingly, while this disclosure discusses embodiments outlined, it will be apparent to those skilled in the art that certain modifications, variations, and alternative constructions will become apparent while remaining within the spirit and scope of this disclosure. Accordingly, reference should be made to the appended claims to determine the metes and bounds of this disclosure.
Claims
1. A method for decrypting or partially decrypting an encoded message or private key, wherein the encoded message or private key is encoded using a public key cryptography algorithm, comprising: encoding said public key encryption algorithm using a program synthesizer language; constructing a grammar for said program synthesizer; training said program synthesizer with training data having input-output pairs; Executing the trained program synthesizer to generate a synthesized mathematical formula; Verify the validity of the generated synthesized formula; performing a decryption using the validated synthesized mathematical formula; How to have that.
2. if the correctness of the generated synthesized formula is not confirmed, repeating the execution of the trained program synthesizer to generate the synthesized formula. The method of claim 1 further comprising:
3. The method of claim 1 , wherein the program synthesizer comprises a satisfiability modulo theory (SMT) solver.
4. The method of claim 1 , wherein encoding the public key cryptography algorithm comprises using syntax-guided program synthesis.
5. 2. The method of claim 1, wherein the public key cryptographic algorithm has an oracle, and encoding the public key cryptographic algorithm specifies the oracle.
6. 2. The method of claim 1, wherein the public key cryptographic algorithm comprises a Rivest-Shamir-Adleman (RSA) algorithm having a least significant bit oracle, and the method further comprises decrypting an entire RSA-encrypted message using the validated combined mathematical formula and the least significant bit oracle.
7. 2. The method of claim 1, wherein the public key cryptography algorithm comprises a Diffie-Hellman (DH) algorithm, and the method further comprises determining least significant bits of a private key from a DH public key using the validated combined formula.
8. 1. A computer-readable medium having stored thereon instructions that, when executed by one or more processors, cause the processors to decrypt or partially decrypt an encoded message or private key, the encoded message or private key being encoded using a public key cryptography algorithm, the decryption comprising: encoding said public key encryption algorithm using a program synthesizer language; constructing a grammar for said program synthesizer; training said program synthesizer with training data having input-output pairs; Executing the trained program synthesizer to generate a synthesized mathematical formula; Verify the validity of the generated synthesized formula; performing a decryption using the validated synthesized mathematical formula; 10. A computer-readable medium having:
9. The decryption further comprises: if the correctness of the generated synthesized formula is not confirmed, repeating the execution of the trained program synthesizer to generate the synthesized formula. The computer readable medium of claim 8 , comprising:
10. 9. The computer-readable medium of claim 8, wherein the program synthesizer comprises a satisfiability modulo theory (SMT) solver.
11. 10. The computer-readable medium of claim 8, wherein encoding the public key cryptography algorithm comprises using syntax-guided program synthesis.
12. 9. The computer-readable medium of claim 8, wherein the public key cryptographic algorithm has an oracle, and encoding the public key cryptographic algorithm specifies the oracle.
13. 9. The computer-readable medium of claim 8, wherein the public key cryptographic algorithm comprises a Rivest-Shamir-Adleman (RSA) algorithm having a least significant bit oracle, and wherein the decryption further comprises decrypting the entire RSA-encrypted message using the validated combined mathematical formula and the least significant bit oracle.
14. 9. The computer-readable medium of claim 8, wherein the public key encryption algorithm comprises a Diffie-Hellman (DH) algorithm, and the decryption further comprises determining least significant bits of a private key from a DH public key using the validated combined mathematical formula.
15. 1. A decryption system having one or more processors, comprising: The one or more processors: receiving an encoded message or a private key, the encoded message or the private key being encoded using a public key cryptographic algorithm; encoding said public key encryption algorithm using a program synthesizer language; constructing a grammar for said program synthesizer; training said program synthesizer with training data having input-output pairs; Executing the trained program synthesizer to generate a synthesized mathematical formula; Verify the validity of the generated synthesized formula; performing a decryption using the validated synthesized mathematical formula; It is adapted to system.
16. if the correctness of the generated synthesized formula is not confirmed, repeating the execution of the trained program synthesizer to generate the synthesized formula.
16. The system of claim 15, further comprising:
17. 16. The system of claim 15, wherein the program synthesizer comprises a satisfiability modulo theory (SMT) solver.
18. 16. The system of claim 15, wherein encoding the public key cryptography algorithm comprises using syntax-guided program synthesis.
19. 16. The system of claim 15, wherein the public key cryptography algorithm comprises a Rivest-Shamir-Adleman (RSA) algorithm having a least significant bit oracle, and further comprising decrypting an entire RSA-encrypted message using the validated combined mathematical formula and the least significant bit oracle.
20. 16. The system of claim 15, wherein the public key cryptography algorithm comprises a Diffie-Hellman (DH) algorithm, and further comprising determining least significant bits of a private key from a DH public key using the validated combined formula.
Citation Information
Patent Citations
Information processor, encryption algorithm evaluation method, and program
JP2010039274A