Let's give a warm welcome to Alan. Thank you. Good afternoon. My name is Alan. I'm now working for Q360 in Beijing. And today I'm so glad to be here to present a quick talk about cryptographic battle in OpenSSL. And I'll show you how to build a battle in OpenSSL. So before the presentation, I'd like to introduce ourselves briefly. The idea of this presentation was conceived by two people, Slay and me. And Slay is the main implementer of this idea. He's not only my colleague who is a keeper of mathematics, but also a vulnerability hunter in the Intel CPU architecture. Colonel in OpenSSL, and now he has found about ten OpenSSL vulnerabilities, including the SSL Death Alerts. And this is a picture of our team's office. So without further ado, let's look at the outline of this topic. In the first part, I'll introduce the cryptographic battle. And something about the architecture of the OpenSSL source code. In the second part, I'll show you how to build a new method of cryptographic battle in OpenSSL. And then I'll show you two demos. In the first part, we think this kind of battle can be used in supply chain attack scenarios. So firstly, as we all know, the most common example of a cryptographic battle is using weak random, such as dual EC, DRBG, and super random number generator. However, it's rarely to notice that there's another kind of battle, which is called the battle of mathematics. And security, you're really looking for vulnerabilities in cryptographic implementation. Instead of paying more attention to mathematics. Maybe because finding mathematics needs a high level mathematics skill. In fact, general developers do not have the same level of mathematics skills as the deniers of mathematics. So it is hard to detect the mathematics that is well designed, well structured, and logical. Who else can discover it? So for the open source code, You know, OpenSSL is the webiemf their first .. for TS and SSL codes. So let's do a little digging to the architecture of open source code. The open source code is called. Open source code! . Open source code! made in Crypto Engine SSL3 directories. And the application layout in the IPOS directory. The most important things are Crypto and SSL. The directory of Crypto includes ASN1 code interface, random number generator, engine mechanism, EVP cipher algorithm interface of a unified cryptographic algorithm, large number operation interface, private key information syntax, asymmetric cryptographic algorithm, etc. On the other hand, the directory of SSL is the implementation of SSL TR protocol. And technically, this is the most important thing. Today, I will build a back dog in RSA algorithm, cause RSA algorithm is quite clear. I first read, select two prime numbers P and Q and computing and after that we can get a public key and a private key. The second step is the encryption. We can get a ciphertext C. And finally, after the decryption, we can get a private text M. So, I see a simple back dog in RSA algorithm. In the key generation algorithm of RSA, it's easy to learn from cybersecurity papers that the difference between two prime numbers in RSA should not be too small. Otherwise, you'll be unsafe. But this definition is too vague. In particular, general developers could hardly know how more it will be in security as well as how much in security is there for a given difference. Therefore, we can think of the security as a reason of adding check patch to the key generation function as a generator key in the open SSL. And for it to give a unsaved prime time, more or less it's even possible to set the time complexity during which we can crack a private key as we wish. So let's see the patch. In this patch, by limiting the range of generated prime difference, we can crack the private key as we in one time complexity. The picture is look too small. So let's see what we can do. Let's take the example, too small, and I will upload this example to the Github in the later. So let's look at another compressed example. Imagine that we can patch a faster prime generating algorithm in order to generate primes with special defects under specific mathematics principles. we are able to control it difficultly for cracking the private key through for generating primes that are not strong enough, such as generating a prime number of a particular family, a prime prime that generates a special range difference. Even if the difference is large enough, indeed the prime prime doesn't seem to have any problem at all, but will be unsafe after certain transformation. So now it is our small conclusion. As far as I'm concerned, the problem comes from the lack of our understanding for the security principle of RSA optimum. Its safety has not been proven mathematically yet. The question is what is the RSA optimum? kinds of primes are safer and how to evaluate them. So, we have now come up with a strict mathematical judgment for this situation. And let's see the demos. I will show two demos. In the first demo, I will show the mandatory inspection patch is added. So that the difference between the two prime numbers output by the generator is the security boundary, which allows us to set time complexity to achieve a quality cracking. So, first we will generate a keypad. And then we will get a public key. After that, we kill the private key and then we will try to crack the private key. Yeah, we can print the information of the private key. And then we crack it. That is quite faster. So, let's look at a second demo. In the second demo, it allows the generator faction to output the two primes that appear to be okay. But it will become insecure after some transformation. In our case, we can require one prime number p after 1826 range of transformation. Let's say as the last one, we generate a keypad. Yeah, we can crack it after a transformation. Yeah, it's quite fast and easy. It can be controlled. So, as I said, we think this kind of battle can be used in supply chain attack. Imagine that many of us may have used the public key generator in the SSL, in the SSL private key management, such as Excel. If the attacker starts attacking the compiler environment of the target software company, they can modify the generation algorithm of the keypad, which is harder to detect. So, this is what the industry needs to reveal. And at last, as John said, the biggest problem with the network defense is that the defender is thinking this and attack is thinking graphics. As long as this is true, attacks won. And that's there because it's a lot of attack methods related to the cryptographic battles. So, it's necessary for us to pay more attention to this. So, I will go back to the source code security and the cryptographic security. And I'll upload the code to GitHub after this meeting. So, thanks for your listening.